LDMX Software
dqm::EcalRecHitDQM Class Reference

Histograms of ECal rec hits that need no simulation truth, e.g. More...

#include <EcalRecHitDQM.h>

Public Member Functions

 EcalRecHitDQM (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 rec_hit_coll_
 name of the rec hit collection
 
std::string rec_hit_pass_
 pass of the rec hits
 
double mip_si_energy_
 Si energy of one MIP [MeV], converts the hit amplitude to MIPs.
 

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 ECal rec hits that need no simulation truth, e.g.

for raw data: hits per event, amplitude in MIPs, time, and the occupancy per layer and cell (checks the detector map).

Definition at line 15 of file EcalRecHitDQM.h.

Constructor & Destructor Documentation

◆ EcalRecHitDQM()

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

constructor

Definition at line 18 of file EcalRecHitDQM.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::EcalRecHitDQM::analyze ( const framework::Event & event)
overridevirtual

fill the histograms

Implements framework::Analyzer.

Definition at line 23 of file EcalRecHitDQM.cxx.

23 {
24 const auto& hits{
25 event.getCollection<ldmx::EcalHit>(rec_hit_coll_, rec_hit_pass_)};
26 histograms_.fill("n_hits", hits.size());
27 for (const auto& hit : hits) {
28 ldmx::EcalID id(hit.getID());
29 histograms_.fill("amplitude", hit.getAmplitude() / mip_si_energy_);
30 histograms_.fill("time", hit.getTime());
31 histograms_.fill("layer", id.layer());
32 histograms_.fill("cell", id.cell());
33 }
34}
double mip_si_energy_
Si energy of one MIP [MeV], converts the hit amplitude to MIPs.
std::string rec_hit_coll_
name of the rec hit collection
std::string rec_hit_pass_
pass of the rec hits
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Stores reconstructed hit information from the ECAL.
Definition EcalHit.h:19
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
Definition EcalID.h:20

References framework::HistogramPool::fill(), framework::EventProcessor::histograms_, mip_si_energy_, rec_hit_coll_, and rec_hit_pass_.

◆ configure()

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

configure the input names

Reimplemented from framework::EventProcessor.

Definition at line 8 of file EcalRecHitDQM.cxx.

8 {
9 rec_hit_coll_ = ps.get<std::string>("rec_hit_coll");
10 rec_hit_pass_ = ps.get<std::string>("rec_hit_pass");
11 mip_si_energy_ = ps.get<double>("mip_si_energy");
12}

References framework::config::Parameters::get(), mip_si_energy_, rec_hit_coll_, and rec_hit_pass_.

◆ onProcessStart()

void dqm::EcalRecHitDQM::onProcessStart ( )
overridevirtual

create the histograms

Reimplemented from framework::EventProcessor.

Definition at line 14 of file EcalRecHitDQM.cxx.

14 {
16 histograms_.create("n_hits", "Rec Hits per Event", 50, -0.5, 49.5);
17 histograms_.create("amplitude", "Amplitude [MIPs]", 100, 0, 4);
18 histograms_.create("time", "Hit Time [ns]", 100, -100, 100);
19 histograms_.create("layer", "Layer", 34, -0.5, 33.5);
20 histograms_.create("cell", "Cell", 432, -0.5, 431.5);
21}
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

◆ mip_si_energy_

double dqm::EcalRecHitDQM::mip_si_energy_
private

Si energy of one MIP [MeV], converts the hit amplitude to MIPs.

Definition at line 36 of file EcalRecHitDQM.h.

Referenced by analyze(), and configure().

◆ rec_hit_coll_

std::string dqm::EcalRecHitDQM::rec_hit_coll_
private

name of the rec hit collection

Definition at line 32 of file EcalRecHitDQM.h.

Referenced by analyze(), and configure().

◆ rec_hit_pass_

std::string dqm::EcalRecHitDQM::rec_hit_pass_
private

pass of the rec hits

Definition at line 34 of file EcalRecHitDQM.h.

Referenced by analyze(), and configure().


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