LDMX Software
ZCCMDecoder.h
1#ifndef TRIGSCINT_ZCCMDECODER_H
2#define TRIGSCINT_ZCCMDECODER_H
3
4#include <TTimeStamp.h>
5
6#include <fstream>
7#include <iostream>
8
9#include "Framework/Configure/Parameters.h" // Needed to import parameters from configuration file
10#include "Framework/Event.h"
11#include "Framework/EventProcessor.h" //Needed to declare processor
12#include "TrigScint/Event/TrigScintQIEDigis.h"
13#include "TrigScint/Event/ZCCMOutput.h"
14namespace trigscint {
15
17 public:
18 ZCCMDecoder(const std::string &name, framework::Process &process)
19 : Producer(name, process) {}
20
24 virtual ~ZCCMDecoder() = default;
25
31
32 void produce(framework::Event &event) override;
33
34 void onProcessStart() override;
35
36 void onProcessEnd() override;
37
38 private:
41 std::ifstream channel_map_file_;
42 std::map<int, int> channel_map_;
45 std::ifstream module_map_file_;
46 std::map<int, int> module_map_;
47
48 // input/output collection and pass name
49 std::string input_collection_;
50 std::string output_collection_;
51 std::string input_pass_name_;
52
53 // number of lanes in the readout message
54 int number_of_lanes_{14};
55 // number of channels served by each lane
56 // int number_of_channels_per_lane_{6}; //consider this static
57
58 // number of channels in the readout (all pads)
59 int n_channels_{number_of_lanes_ * ZCCMOutput::NUM_CHAN_PER_LANE};
60 // number of time samples making up the event
61 int n_samples_{70};
62 // configurable flag, to set the isRealData bit in the event header
63 bool is_real_data_{true};
64 // keep track of which of max 4 modules are used (get from lane/module map)
65 int modules_used_[4] = {0};
66
67}; // decoder
68
69} // namespace trigscint
70
71#endif // TRIGSCINT_ZCCMDECODER_H
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:36
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
std::string channel_map_file_name_
the channel mapping
Definition ZCCMDecoder.h:40
void produce(framework::Event &event) override
Process the event and put new data products into it.
void configure(framework::config::Parameters &ps) override
Configure our converter based off the configuration parameters decoded from the passed python script.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
virtual ~ZCCMDecoder()=default
Default destructor, closes up boost archive and input stream.
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
std::string module_map_file_name_
the module mapping
Definition ZCCMDecoder.h:44