LDMX Software
dqm::ECONDDigiDQM Class Reference

Histograms of the output of packing::ECONDDecoder. More...

#include <ECONDDigiDQM.h>

Public Member Functions

 ECONDDigiDQM (const std::string &name, framework::Process &process)
 constructor
 
void configure (framework::config::Parameters &parameters) override
 configure the input names
 
void onProcessStart () override
 create the histograms
 
void analyze (const framework::Event &event) override
 fill the histograms
 
- Public Member Functions inherited from framework::Analyzer
 Analyzer (const std::string &name, Process &process)
 Class constructor.
 
virtual void process (Event &event) final
 Processing an event for an Analyzer is calling analyze.
 
virtual void beforeNewRun (ldmx::RunHeader &run_header) final
 Don't allow Analyzers to add parameters to the run header.
 
- 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 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 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 digi_name_
 name of the digi collection
 
std::string info_name_
 name of the ECONDEventInfo
 
std::string input_pass_
 pass of the decoder
 

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.
 

Detailed Description

Histograms of the output of packing::ECONDDecoder.

Fills the corruption flags and header data from the ECONDEventInfo and the channel measurements from the HgcrocDigiCollection. The measurements are taken from the sample word bits following the HGCROC convention (bit 31 = Tc, bit 30 = Tp).

Definition at line 18 of file ECONDDigiDQM.h.

Constructor & Destructor Documentation

◆ ECONDDigiDQM()

dqm::ECONDDigiDQM::ECONDDigiDQM ( const std::string & name,
framework::Process & process )
inline

constructor

Definition at line 21 of file ECONDDigiDQM.h.

Base class for a module which does not produce a data product.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.

Member Function Documentation

◆ analyze()

void dqm::ECONDDigiDQM::analyze ( const framework::Event & event)
overridevirtual

fill the histograms

Implements framework::Analyzer.

Definition at line 39 of file ECONDDigiDQM.cxx.

39 {
40 const auto& info{
42 const auto& digis{
44
45 // bin 0 is good, bit i of the mask is bin i+1
46 int frame_mask = info.getCorruption();
47 if (frame_mask == 0) histograms_.fill("frame_flags", 0);
48 for (int i{0}; i < 11; i++) {
49 if ((frame_mask >> i) & 1) histograms_.fill("frame_flags", i + 1);
50 }
51 if (info.isCorrupt(ldmx::ECONDEventInfo::NO_FRAME)) return;
52
53 histograms_.fill("n_samples", info.getSamples().size());
54 histograms_.fill("i_soi", info.getSOIIndex());
55 for (const auto& sample : info.getSamples()) {
56 int mask = sample.getCorruption();
57 if (mask == 0) {
58 histograms_.fill("packet_flags", sample.getPayloadLength() == 0 ? 1 : 0);
59 histograms_.fill("bx", sample.getBX());
60 }
61 for (int i{0}; i < 6; i++) {
62 if ((mask >> i) & 1) histograms_.fill("packet_flags", i + 2);
63 }
64 const auto& links{sample.getLinks()};
65 for (std::size_t i_link{0}; i_link < links.size(); i_link++) {
66 const auto& link{links[i_link]};
67 if (link.hasBadStat()) histograms_.fill("link_bad_stat", i_link);
68 histograms_.fill("adc_cm", link.getADCCM0());
69 histograms_.fill("adc_cm", link.getADCCM1());
70 histograms_.fill("calib_adc", (link.getCalib() >> 10) & 0x3ff);
71 }
72 }
73
74 histograms_.fill("n_digis", digis.getNumDigis());
75 for (unsigned int i_digi{0}; i_digi < digis.getNumDigis(); i_digi++) {
76 auto digi{digis.getDigi(i_digi)};
77 for (unsigned int i_sample{0}; i_sample < digi.size(); i_sample++) {
78 uint32_t w = digi.at(i_sample).raw();
79 bool tc = (w >> 31) & 1;
80 bool tp = (w >> 30) & 1;
81 histograms_.fill("flags", 2 * tc + tp);
82 histograms_.fill("toa", w & 0x3ff);
83 if (tc) {
84 histograms_.fill("tot", (w >> 10) & 0x3ff);
85 } else {
86 histograms_.fill("adc", (w >> 10) & 0x3ff);
87 histograms_.fill("adc_tm1", (w >> 20) & 0x3ff);
88 }
89 }
90 uint32_t soi = digi.soi().raw();
91 if (((soi >> 31) & 1) == 0) {
92 histograms_.fill("soi_adc_by_channel", i_digi, (soi >> 10) & 0x3ff);
93 }
94 }
95}
std::string info_name_
name of the ECONDEventInfo
std::string digi_name_
name of the digi collection
std::string input_pass_
pass of the decoder
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Supporting data for one event decoded from a single ECON-D.
Represents a collection of the digi hits readout by an HGCROC.

References digi_name_, framework::HistogramPool::fill(), framework::EventProcessor::histograms_, info_name_, and input_pass_.

◆ configure()

void dqm::ECONDDigiDQM::configure ( framework::config::Parameters & parameters)
overridevirtual

configure the input names

Reimplemented from framework::EventProcessor.

Definition at line 8 of file ECONDDigiDQM.cxx.

8 {
9 digi_name_ = ps.get<std::string>("digi_name");
10 info_name_ = ps.get<std::string>("info_name");
11 input_pass_ = ps.get<std::string>("input_pass");
12}

References digi_name_, framework::config::Parameters::get(), info_name_, and input_pass_.

◆ onProcessStart()

void dqm::ECONDDigiDQM::onProcessStart ( )
overridevirtual

create the histograms

Reimplemented from framework::EventProcessor.

Definition at line 14 of file ECONDDigiDQM.cxx.

14 {
16 histograms_.create("frame_flags", "",
17 {"good", "resync", "lost sync", "no trailer",
18 "trailer count", "ECON ID", "sample index", "truncated",
19 "extra words", "no SOI", "frame size", "no frame"});
20 histograms_.create("packet_flags", "",
21 {"good", "empty", "header marker", "length", "header CRC",
22 "CRC-32", "payload", "truncated"});
23 histograms_.create("n_samples", "Samples per Event", 33, -0.5, 32.5);
24 histograms_.create("i_soi", "Index of Sample of Interest", 33, -0.5, 32.5);
25 histograms_.create("bx", "BX", 128, 0, 4096);
26 histograms_.create("link_bad_stat", "Link Index", 12, -0.5, 11.5);
27 histograms_.create("adc_cm", "Common Mode ADC", 256, 0, 1024);
28 histograms_.create("calib_adc", "Calibration Channel ADC", 256, 0, 1024);
29 histograms_.create("n_digis", "Digis per Event", 100, 0, 500);
30 histograms_.create("flags", "Tc Tp Flags", {"00", "01", "10", "11"});
31 histograms_.create("adc", "ADC", 256, 0, 1024);
32 histograms_.create("adc_tm1", "ADC(t-1)", 256, 0, 1024);
33 histograms_.create("toa", "TOA", 256, 0, 1024);
34 histograms_.create("tot", "TOT (10-bit compressed)", 256, 0, 1024);
35 histograms_.create("soi_adc_by_channel", "Digi Index", 432, -0.5, 431.5,
36 "ADC in Sample of Interest", 128, 0, 1024);
37}
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
void create(const config::Parameters &p)
Create a histogram from the input configuration parameters.

References framework::HistogramPool::create(), framework::EventProcessor::getHistoDirectory(), and framework::EventProcessor::histograms_.

Member Data Documentation

◆ digi_name_

std::string dqm::ECONDDigiDQM::digi_name_
private

name of the digi collection

Definition at line 35 of file ECONDDigiDQM.h.

Referenced by analyze(), and configure().

◆ info_name_

std::string dqm::ECONDDigiDQM::info_name_
private

name of the ECONDEventInfo

Definition at line 37 of file ECONDDigiDQM.h.

Referenced by analyze(), and configure().

◆ input_pass_

std::string dqm::ECONDDigiDQM::input_pass_
private

pass of the decoder

Definition at line 39 of file ECONDDigiDQM.h.

Referenced by analyze(), and configure().


The documentation for this class was generated from the following files: