LDMX Software
Public Member Functions | Private Attributes | List of all members
dqm::HCalRawDigi Class Reference

Public Member Functions

 HCalRawDigi (const std::string &name, framework::Process &process)
 Constructor.
 
 ~HCalRawDigi ()
 Destructor.
 
void configure (framework::config::Parameters &parameters) override
 Configure the processor using the given user specified parameters.
 
void onProcessStart () override
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
void analyze (const framework::Event &event) override
 Process the event and make histograms ro summaries.
 
- Public Member Functions inherited from framework::Analyzer
 Analyzer (const std::string &name, Process &process)
 Class constructor.
 
- 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 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_
 
std::string input_pass_
 

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::Analyzer
static const int CLASSTYPE {2}
 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.
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger theLog_
 The logger for this EventProcessor.
 

Detailed Description

Definition at line 24 of file HCalRawDigi.h.

Constructor & Destructor Documentation

◆ HCalRawDigi()

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

Constructor.

Definition at line 27 of file HCalRawDigi.h.

28 : framework::Analyzer(name, process) {}
Base class for a module which does not produce a data product.

◆ ~HCalRawDigi()

dqm::HCalRawDigi::~HCalRawDigi ( )
inline

Destructor.

Definition at line 31 of file HCalRawDigi.h.

31{}

Member Function Documentation

◆ analyze()

void dqm::HCalRawDigi::analyze ( const framework::Event event)
overridevirtual

Process the event and make histograms ro summaries.

Parameters
eventThe event to analyze.

we can do this incrementing of channel indices because the decoder uses a map which sorts by electronic ID and then adds the digis in sequence, so the order from event to event is the same without zero supp

Implements framework::Analyzer.

Definition at line 25 of file HCalRawDigi.cxx.

25 {
26 auto digis{
27 event.getObject<ldmx::HgcrocDigiCollection>(input_name_, input_pass_)};
33 unsigned int i_digi{1};
34 for (auto const& digi : digis) {
35 for (unsigned int i_sample{0}; i_sample < digis.getNumSamplesPerDigi();
36 i_sample++) {
37 histograms_.fill("adc_by_channel_sample" + std::to_string(i_sample),
38 i_digi, digi.at(i_sample).adc_t());
39 }
40 i_digi++;
41 }
42}
HistogramHelper histograms_
Interface class for making and filling histograms.
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
Represents a collection of the digi hits readout by an HGCROC.

References framework::HistogramHelper::fill(), and framework::EventProcessor::histograms_.

◆ configure()

void dqm::HCalRawDigi::configure ( framework::config::Parameters parameters)
overridevirtual

Configure the processor using the given user specified parameters.

Parameters
parametersSet of parameters used to configure this processor.

Reimplemented from framework::EventProcessor.

Definition at line 9 of file HCalRawDigi.cxx.

9 {
10 input_name_ = ps.getParameter<std::string>("input_name");
11 input_pass_ = ps.getParameter<std::string>("input_pass");
12}

References framework::config::Parameters::getParameter().

◆ onProcessStart()

void dqm::HCalRawDigi::onProcessStart ( )
overridevirtual

Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.

Reimplemented from framework::EventProcessor.

Definition at line 14 of file HCalRawDigi.cxx.

14 {
16 for (unsigned int i_sample{0}; i_sample < 4; i_sample++) {
17 histograms_.create("adc_by_channel_sample" + std::to_string(i_sample),
18 "Arbitrary Channel Index", 250, 0, 250,
19 "ADC Counts in Sample " + std::to_string(i_sample), 200,
20 0, 200);
21 // histograms_.get("adc_by_channel_sample"+std::to_string(i_sample))->SetCanExtend(TH1::kAllAxes);
22 }
23}
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
void create(const std::string &name, const std::string &xLabel, const double &bins, const double &xmin, const double &xmax)
Create a ROOT 1D histogram of type TH1F and pool it for later use.

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

Member Data Documentation

◆ input_name_

std::string dqm::HCalRawDigi::input_name_
private

Definition at line 50 of file HCalRawDigi.h.

◆ input_pass_

std::string dqm::HCalRawDigi::input_pass_
private

Definition at line 51 of file HCalRawDigi.h.


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