LDMX Software
|
Public Member Functions | |
EcalRawDecoder (const std::string &n, framework::Process &p) | |
Constructor. | |
virtual | ~EcalRawDecoder ()=default |
Destructor. | |
virtual void | configure (framework::config::Parameters &) |
Callback for the EventProcessor to configure itself from the given set of parameters. | |
virtual void | produce (framework::Event &event) |
Process the event and put new data products into it. | |
Public Member Functions inherited from framework::Producer | |
Producer (const std::string &name, Process &process) | |
Class constructor. | |
virtual void | beforeNewRun (ldmx::RunHeader &header) |
Handle allowing producers to modify run headers before the run begins. | |
Public Member Functions inherited from framework::EventProcessor | |
EventProcessor (const std::string &name, Process &process) | |
Class constructor. | |
virtual | ~EventProcessor () |
Class destructor. | |
virtual void | onNewRun (const ldmx::RunHeader &runHeader) |
Callback for the EventProcessor to take any necessary action when the run being processed changes. | |
virtual void | onFileOpen (EventFile &eventFile) |
Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened. | |
virtual void | onFileClose (EventFile &eventFile) |
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. | |
virtual void | onProcessEnd () |
Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities. | |
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 Attributes | |
std::string | input_name_ |
input object of encoded data | |
std::string | input_pass_ |
input pass of creating encoded data | |
std::string | output_name_ |
output object to put onto event bus | |
int | roc_version_ |
version of HGC ROC we are decoding | |
bool | translate_eid_ |
should we translate electronic IDs to detector IDs | |
Additional Inherited Members | |
Static Public Member Functions inherited from framework::EventProcessor | |
static void | declare (const std::string &classname, int classtype, EventProcessorMaker *) |
Internal function which is part of the PluginFactory machinery. | |
Static Public Attributes inherited from framework::Producer | |
static const int | CLASSTYPE {1} |
Constant used to track EventProcessor types by the PluginFactory. | |
Protected Member Functions inherited from framework::EventProcessor | |
void | abortEvent () |
Abort the event immediately. | |
Protected Attributes inherited from framework::EventProcessor | |
HistogramHelper | histograms_ |
Interface class for making and filling histograms. | |
NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
Manager for any ntuples. | |
logging::logger | theLog_ |
The logger for this EventProcessor. | |
Definition at line 14 of file EcalRawDecoder.h.
|
inline |
Constructor.
Definition at line 19 of file EcalRawDecoder.h.
|
virtual |
Callback for the EventProcessor to configure itself from the given set of parameters.
The parameters a processor has access to are the member variables of the python class in the sequence that has className equal to the EventProcessor class name.
For an example, look at MyProcessor.
parameters | Parameters for configuration. |
Reimplemented from framework::EventProcessor.
Definition at line 22 of file EcalRawDecoder.cxx.
References framework::config::Parameters::getParameter(), input_name_, input_pass_, output_name_, roc_version_, and translate_eid_.
|
virtual |
Process the event and put new data products into it.
event | The Event to process. |
Static parameters depending on ROC version
words for reading and decoding
Re-sort the data from grouped by bunch to by channel
The readout cip streams the data off of it, so it doesn't have time to re-group the signals across multiple bunches (samples) by their channel ID. We need to do that here.
are we reading a buffer from multi-sample per event?
Decode Bunch Header We have a few words of header material before the actual data. This header material is assumed to be encoded as in Table 3 of the DAQ specs.
<name> (bits)
VERSION (4) | FPGA_ID (8) | NLINKS (6) | 00 | LEN (12) BX ID (12) | RREQ (10) | OR (10) RID ok (1) | CRC ok (1) | LEN3 (6) | RID ok (1) | CRC ok (1) | LEN2 (6) | RID ok (1) | CRC ok (1) | LEN1 (6) | RID ok (1) | CRC ok (1) | LEN0 (6) ... other listing of links ...
Decode Each Link in Sequence Now we should be decoding each link serially where each link was encoded as in Table 4 of the DAQ specs
ROC_ID (16) | CRC ok (1) | 0 (7) | RO Map (8) RO Map (32)
Special "Header" Word from ROC
version 3: 0101 | BXID (12) | RREQ (6) | OR (3) | HE (3) | 0101
version 2: 10101010 | BXID (12) | WADD (9) | 1010
Common Mode Channels 10 | 0000000000 | Common Mode ADC 0 (10) | Common Mode ADC 1 (10)
DAQ Channels
Generate Packed Electronics ID Link Index i_link Channel ID channel_id ROC ID roc_id FPGA ID fpga are all available. For now, we just generate a dummy mapping using the link and channel indices.
The subfields for the electronics ID infrastructure need to start from 0 and count up. This means we need to subtract some of the fields by their lowest value before inputting them into the EID.
TODO fix hardcoded starting value
roc_id-256 is the ssame as i_link = is this a coincidence? or should we change the second input to be the link index
Translation
Now the HgcrocDigiCollection::Sample class handles the unpacking of individual samples; however, we still need to translate electronic IDs into detector IDs.
DO NOTHING skip hits where the EID aren't in the detector mapping no zero supp during test beam on the front-end, so channels that aren't connected to anything are still being readout. std::cout << "EID(" << eid.fiber() << "," << eid.elink() << "," << eid.channel() << ") "; for (auto& s : digi) std::cout << hex(s.raw()) << " "; std::cout << std::endl;
no EID translation, just add the digis to the digi collection with their raw electronic ID TODO: remove this, we shouldn't be able to get past the decoding stage without translating the EID into a detector ID to avoid confusion in recon
Implements framework::Producer.
Definition at line 30 of file EcalRawDecoder.cxx.
References ldmx::HgcrocDigiCollection::addDigi(), ecal::EcalDetectorMap::CONDITIONS_OBJECT_NAME, input_name_, input_pass_, output_name_, roc_version_, ldmx::HgcrocDigiCollection::setNumSamplesPerDigi(), ldmx::HgcrocDigiCollection::setSampleOfInterestIndex(), ldmx::HgcrocDigiCollection::setVersion(), and translate_eid_.
|
private |
input object of encoded data
Definition at line 37 of file EcalRawDecoder.h.
Referenced by configure(), and produce().
|
private |
input pass of creating encoded data
Definition at line 39 of file EcalRawDecoder.h.
Referenced by configure(), and produce().
|
private |
output object to put onto event bus
Definition at line 41 of file EcalRawDecoder.h.
Referenced by configure(), and produce().
|
private |
version of HGC ROC we are decoding
Definition at line 43 of file EcalRawDecoder.h.
Referenced by configure(), and produce().
|
private |
should we translate electronic IDs to detector IDs
Definition at line 45 of file EcalRawDecoder.h.
Referenced by configure(), and produce().