LDMX Software
|
Public Member Functions | |
EcalRawEncoder (const std::string &name, framework::Process &process) | |
Constructor. | |
virtual | ~EcalRawEncoder () |
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 | |
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 EcalRawEncoder.h.
ecal::EcalRawEncoder::EcalRawEncoder | ( | const std::string & | name, |
framework::Process & | process | ||
) |
Constructor.
Definition at line 15 of file EcalRawEncoder.cxx.
|
virtual |
|
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 21 of file EcalRawEncoder.cxx.
References framework::config::Parameters::getParameter(), input_name_, input_pass_, output_name_, and roc_version_.
|
virtual |
Process the event and put new data products into it.
event | The Event to process. |
Static parameters depending on ROC version
Translation
Now the HgcrocDigiCollection::Sample class handles the unpacking of individual samples; however, we still need to translate detector IDs into electronics ID and resort the data into grouped by bunch.
Encoding
Now that the samples are sorted into per-bunch groupings, we can start writing this data into the encoded data format documented in the ECal DAQ specifications. Since the class HgcrocDigiCollection::Sample handles the encoding and decoding of specific sample words, we "only" need to actually encode the header information the calculate the CRC checksums.
TODO calculate bunch ID, read request, and orbit from sample ID, event number, and run number placeholder: bunch ID = event number read request = sample ID orbit = run number
Calculate lengths of link sub-packets
Table 4 of ECal DAQ Specifications.
Each ROC link has 3 header words, a common mode channel, and a trailing CRC checksum word. The 3 header words contain a readout map of which channels are included in the DAQ packet, so we end up with.
len of link = 3 + 1 + channels.size() + 1;
The total FPGA packet includes at least 2 header words, a trailing checksum word, and a single word for each four links.
This means we add up the subpacket lengths into subpacket_total and then
n_linkwords = (nlinks/4+(nlinks%4!=0)) total_length = 2 + n_linkwords + subpacket_total + 1;
Encode 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) | 0 | LEN (12) BX ID (12) | RREQ (10) | OR (10) RID ok (1) | CDC ok (1) | LEN3 (6) | RID ok (1) | CDC ok (1) | LEN2 (6) | RID ok (1) | CDC ok (1) | LEN1 (6) | RID ok (1) | CDC ok (1) | LEN0 (6) ... other listing of links ...
Encode lengths of link subpackets
Prepare RO Map bitset
Encode 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) | 00000 | RO Map (8) RO Map (32)
TODO: Common-Mode Channel Somewhere in here is where the common-mode channel would be inserted. I'm not sure if we should expect that the common mode channel also has a sample or it will be reserved and never should have a sample
Implements framework::Producer.
Definition at line 28 of file EcalRawEncoder.cxx.
References ecal::EcalDetectorMap::CONDITIONS_OBJECT_NAME, packing::utility::CRC::get(), input_name_, input_pass_, output_name_, and ldmx::DetectorID::raw().
|
private |
input object of encoded data
Definition at line 36 of file EcalRawEncoder.h.
Referenced by configure(), and produce().
|
private |
input pass of creating encoded data
Definition at line 38 of file EcalRawEncoder.h.
Referenced by configure(), and produce().
|
private |
output object to put onto event bus
Definition at line 40 of file EcalRawEncoder.h.
Referenced by configure(), and produce().
|
private |
version of HGC ROC we are decoding
Definition at line 42 of file EcalRawEncoder.h.
Referenced by configure().