|
LDMX Software
|
decode event packets built by ECON-D chips More...
#include <ECONDDecoder.h>
Public Member Functions | |
| ECONDDecoder (const std::string &name, framework::Process &p) | |
| normal constructor | |
| virtual | ~ECONDDecoder ()=default |
| empty destructor | |
| void | configure (framework::config::Parameters &ps) override |
| configure the decoder | |
| void | produce (framework::Event &event) override |
| decode the raw binary data into HgcrocDigiCollection that can be used later for reconstruction or analysis | |
| void | onProcessEnd () override |
| print a summary of the decoding | |
Public Member Functions inherited from framework::Producer | |
| Producer (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual void | process (Event &event) final |
| Processing an event for a Producer is calling produce. | |
Public Member Functions inherited from framework::EventProcessor | |
| DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &) | |
| declare that we have a factory for this class | |
| EventProcessor (const std::string &name, Process &process) | |
| Class constructor. | |
| virtual | ~EventProcessor ()=default |
| Class destructor. | |
| virtual void | beforeNewRun (ldmx::RunHeader &run_header) |
| Callback for Producers to add parameters to the run header before conditions are initialized. | |
| virtual void | onNewRun (const ldmx::RunHeader &run_header) |
| Callback for the EventProcessor to take any necessary action when the run being processed changes. | |
| virtual void | onFileOpen (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened. | |
| virtual void | onFileClose (EventFile &event_file) |
| Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed. | |
| virtual void | onProcessStart () |
| Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms. | |
| template<class T > | |
| const T & | getCondition (const std::string &condition_name) |
| Access a conditions object for the current event. | |
| TDirectory * | getHistoDirectory () |
| Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples. | |
| void | setStorageHint (framework::StorageControl::Hint hint) |
| Mark the current event as having the given storage control hint from this module_. | |
| void | setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString) |
| Mark the current event as having the given storage control hint from this module and the given purpose string. | |
| int | getLogFrequency () const |
| Get the current logging frequency from the process. | |
| int | getRunNumber () const |
| Get the run number from the process. | |
| std::string | getName () const |
| Get the processor name. | |
| void | createHistograms (const std::vector< framework::config::Parameters > &histos) |
| Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create. | |
Private Member Functions | |
| unsigned int | channelID (int i_link, int i_ch) const |
| get the channel ID for the input link and channel | |
Private Attributes | |
| std::string | raw_data_name_ |
| name of event object of raw binary data | |
| std::string | raw_data_pass_ |
| name of pass to get raw binary data from | |
| std::string | digi_output_name_ |
| output name of digi collection | |
| std::string | info_output_name_ |
| output name of supporting data object | |
| bool | is_ecal_ {false} |
| which calorimeter subsystem we are decoding (true == Ecal, false == Hcal) | |
| int | n_links_ {2} |
| number of enabled eRx on the ECON-D | |
| int | fiber_ {0} |
| optical fiber index used in the electronics ID | |
| bool | translate_eid_ {false} |
| translate electronics IDs into detector IDs | |
| int | roc_version_ {3} |
| ROC version for the digi collection. | |
| std::unique_ptr< MultiSampleECONDEventPacket > | packet_ |
| decoding buffer | |
| long | n_frames_ {0} |
| number of frames seen | |
| long | n_no_frame_ {0} |
| number of events without an input frame | |
| long | n_frames_filled_ {0} |
| number of frames whose digis were filled | |
| long | n_bad_frame_size_ {0} |
| number of frames with a size that is not a multiple of 4 bytes | |
| std::array< long, MultiSampleECONDEventPacket::N_CORRUPTION > | n_frame_flags_ {} |
| number of frames with each frame-level flag | |
| long | n_packets_ {0} |
| number of packets seen | |
| long | n_packets_decoded_ {0} |
| number of packets decoded without corruption and not empty | |
| long | n_packets_empty_ {0} |
| number of empty packets (payload length 0) | |
| long | n_packets_corrupt_ {0} |
| number of corrupted packets (skipped) | |
| std::array< long, ECONDEventPacket::N_CORRUPTION > | n_packet_flags_ {} |
| number of packets with each corruption flag | |
| long | n_links_bad_stat_ {0} |
| number of decoded link sub-packets with bad Stat bits | |
| long | n_l1a_jumps_ {0} |
| number of L1A jumps between consecutive samples | |
Additional Inherited Members | |
Protected Member Functions inherited from framework::EventProcessor | |
| void | abortEvent () |
| Abort the event immediately. | |
Protected Attributes inherited from framework::EventProcessor | |
| HistogramPool | histograms_ |
| helper object for making and filling histograms | |
| NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
| Manager for any ntuples. | |
| logging::logger | the_log_ |
| The logger for this EventProcessor. | |
decode event packets built by ECON-D chips
The ECON-D chip is used to construct the event packets for both the Ecal and Hcal subsystems, so both will share this decoder.
Each event on the bus is one frame from SingleSubsystemUnpacker holding all of the samples from a single ECON-D. The channel samples are put into an HgcrocDigiCollection and the rest of the packet data into an ldmx::ECONDEventInfo. Corrupted packets are flagged and skipped, the digis are only filled if all samples in the event are good.
The input can also be the subsystem buffer from the EventBuilder. Events without the input buffer get empty outputs flagged with ldmx::ECONDEventInfo::NO_FRAME.
Definition at line 30 of file ECONDDecoder.h.
|
inline |
normal constructor
Definition at line 33 of file ECONDDecoder.h.
|
private |
get the channel ID for the input link and channel
Definition at line 60 of file ECONDDecoder.cxx.
References fiber_, is_ecal_, and ldmx::DetectorID::raw().
Referenced by produce().
|
overridevirtual |
configure the decoder
mostly focused on telling it which subsystem we are decoding (to know how to pack the ID numbers correctly), the input and output event objects.
Reimplemented from framework::EventProcessor.
Definition at line 47 of file ECONDDecoder.cxx.
References digi_output_name_, fiber_, framework::config::Parameters::get(), info_output_name_, is_ecal_, n_links_, packet_, raw_data_name_, raw_data_pass_, roc_version_, and translate_eid_.
|
overridevirtual |
print a summary of the decoding
Reimplemented from framework::EventProcessor.
Definition at line 196 of file ECONDDecoder.cxx.
References n_bad_frame_size_, n_frame_flags_, n_frames_, n_frames_filled_, n_l1a_jumps_, n_links_bad_stat_, n_no_frame_, n_packet_flags_, n_packets_, n_packets_corrupt_, n_packets_decoded_, n_packets_empty_, and raw_data_name_.
|
overridevirtual |
decode the raw binary data into HgcrocDigiCollection that can be used later for reconstruction or analysis
Implements framework::Producer.
Definition at line 67 of file ECONDDecoder.cxx.
References ldmx::HgcrocDigiCollection::addDigi(), ldmx::ECONDSampleInfo::addLink(), channelID(), ecal::EcalDetectorMap::CONDITIONS_OBJECT_NAME, hcal::HcalDetectorMap::CONDITIONS_OBJECT_NAME, digi_output_name_, framework::Event::exists(), framework::EventProcessor::getCondition(), info_output_name_, is_ecal_, n_bad_frame_size_, n_frame_flags_, n_frames_, n_frames_filled_, n_l1a_jumps_, n_links_, n_links_bad_stat_, n_no_frame_, n_packet_flags_, n_packets_, n_packets_corrupt_, n_packets_decoded_, n_packets_empty_, packet_, raw_data_name_, raw_data_pass_, roc_version_, ldmx::ECONDLinkInfo::set(), ldmx::ECONDSampleInfo::setCaptureHeader(), ldmx::ECONDSampleInfo::setCorruption(), ldmx::ECONDSampleInfo::setHeader(), ldmx::HgcrocDigiCollection::setNumSamplesPerDigi(), ldmx::HgcrocDigiCollection::setSampleOfInterestIndex(), ldmx::HgcrocDigiCollection::setVersion(), and translate_eid_.
|
private |
output name of digi collection
Definition at line 65 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
optical fiber index used in the electronics ID
Definition at line 76 of file ECONDDecoder.h.
Referenced by channelID(), and configure().
|
private |
output name of supporting data object
Definition at line 67 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
which calorimeter subsystem we are decoding (true == Ecal, false == Hcal)
Definition at line 72 of file ECONDDecoder.h.
Referenced by channelID(), configure(), and produce().
|
private |
number of frames with a size that is not a multiple of 4 bytes
Definition at line 92 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of frames with each frame-level flag
Definition at line 94 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of frames seen
Definition at line 86 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of frames whose digis were filled
Definition at line 90 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of L1A jumps between consecutive samples
Definition at line 108 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of enabled eRx on the ECON-D
Definition at line 74 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
number of decoded link sub-packets with bad Stat bits
Definition at line 106 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of events without an input frame
Definition at line 88 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of packets with each corruption flag
Definition at line 104 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of packets seen
Definition at line 96 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of corrupted packets (skipped)
Definition at line 102 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of packets decoded without corruption and not empty
Definition at line 98 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
number of empty packets (payload length 0)
Definition at line 100 of file ECONDDecoder.h.
Referenced by onProcessEnd(), and produce().
|
private |
decoding buffer
Definition at line 83 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
name of event object of raw binary data
Definition at line 61 of file ECONDDecoder.h.
Referenced by configure(), onProcessEnd(), and produce().
|
private |
name of pass to get raw binary data from
Definition at line 63 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
ROC version for the digi collection.
Definition at line 80 of file ECONDDecoder.h.
Referenced by configure(), and produce().
|
private |
translate electronics IDs into detector IDs
Definition at line 78 of file ECONDDecoder.h.
Referenced by configure(), and produce().