LDMX Software
dqm::TrigScintDQM Class Reference

Public Member Functions

 TrigScintDQM (const std::string &name, framework::Process &process)
 Constructor.
 
 ~TrigScintDQM ()=default
 Destructor.
 
void configure (framework::config::Parameters &pSet)
 Configure the processor using the given user specified parameters.
 
void analyze (const framework::Event &event)
 Process the event and make histograms ro summaries.
 
void onProcessStart ()
 Method executed before processing of events begins.
 
- 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 hit_collection_name_ {"TriggerPadUpSimHits"}
 Name of trigger pad hit collection.
 
std::string pad_name_ {"_up"}
 Name of Pad.
 
std::string hit_passname_
 

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
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger the_log_
 The logger for this EventProcessor.
 

Detailed Description

Definition at line 32 of file TrigScintDQM.h.

Constructor & Destructor Documentation

◆ TrigScintDQM()

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

Constructor.

Definition at line 8 of file TrigScintDQM.cxx.

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::TrigScintDQM::analyze ( const framework::Event & event)
virtual

Process the event and make histograms ro summaries.

Parameters
eventThe event to analyze.

Implements framework::Analyzer.

Definition at line 46 of file TrigScintDQM.cxx.

46 {
47 const std::vector<ldmx::SimCalorimeterHit> trig_scint_hits =
49 hit_passname_);
50
51 // Get the total hit count
52 int hit_count = trig_scint_hits.size();
53 histograms_.fill("n_hits", hit_count);
54
55 double total_energy{0};
56 for (const ldmx::SimCalorimeterHit &hit : trig_scint_hits) {
57 ldmx::TrigScintID det_id(hit.getID());
58
59 int bar = det_id.bar();
60
61 histograms_.fill("energy", hit.getEdep());
62 histograms_.fill("hit_time", hit.getTime());
63 histograms_.fill("id", bar);
64
65 std::vector<float> posvec = hit.getPosition();
66 histograms_.fill("x", posvec.at(0));
67 histograms_.fill("y", posvec.at(1));
68 histograms_.fill("z", posvec.at(2));
69
70 total_energy += hit.getEdep();
71 }
72
73 histograms_.fill("total_energy", total_energy);
74}
std::string hit_collection_name_
Name of trigger pad hit collection.
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Stores simulated calorimeter hit information.
Class that defines the detector ID of the trigger scintillator.
Definition TrigScintID.h:14

References ldmx::TrigScintID::bar(), framework::HistogramPool::fill(), framework::EventProcessor::histograms_, and hit_collection_name_.

◆ configure()

void dqm::TrigScintDQM::configure ( framework::config::Parameters & pSet)
virtual

Configure the processor using the given user specified parameters.

Parameters
pSetSet of parameters used to configure this processor.

Reimplemented from framework::EventProcessor.

Definition at line 37 of file TrigScintDQM.cxx.

37 {
38 hit_collection_name_ = ps.get<std::string>("hit_collection");
39 pad_name_ = ps.get<std::string>("pad");
40 hit_passname_ = ps.get<std::string>("hit_passname");
41
42 ldmx_log(debug) << " Collection name = " << hit_collection_name_
43 << " pad name = " << pad_name_;
44}
std::string pad_name_
Name of Pad.

References framework::config::Parameters::get(), hit_collection_name_, and pad_name_.

◆ onProcessStart()

void dqm::TrigScintDQM::onProcessStart ( )
virtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 11 of file TrigScintDQM.cxx.

11 {
12 ldmx_log(debug) << "Process starts!";
13
15
16 histograms_.create("id", "Channel ID of sim hit", 100, 0, 100);
17 histograms_.create("total_energy",
18 "Total energy deposition in the pad/event [MeV]", 1000, 0,
19 3000);
20 histograms_.create("n_hits", "Hit multiplicity in the pad/event [MeV]", 100,
21 0, 100);
22 histograms_.create("x", "Hit x position [mm]", 1000, -100, 100);
23 histograms_.create("y", "Hit y position [mm]", 1000, -100, 100);
24 histograms_.create("z", "Hit z position", 1000, -900, 100);
25
26 histograms_.create("energy", "Energy deposition in a bar", 250, 0, 1500);
27 histograms_.create("hit_time", "Hit time [ns]", 1600, -100, 1500);
28
29 histograms_.create("max_pe:time", "Max Photoelectrons in a bar", 1500, 0,
30 1500, "Max PE hit time [ns]", 1500, 0, 1500);
31
32 histograms_.create("min_time_hit_above_thresh:pe", "Photoelectrons in a bar",
33 1500, 0, 1500, "Earliest time of hit above threshold [ns]",
34 1600, -100, 1500);
35}
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

◆ hit_collection_name_

std::string dqm::TrigScintDQM::hit_collection_name_ {"TriggerPadUpSimHits"}
private

Name of trigger pad hit collection.

Definition at line 59 of file TrigScintDQM.h.

59{"TriggerPadUpSimHits"};

Referenced by analyze(), and configure().

◆ hit_passname_

std::string dqm::TrigScintDQM::hit_passname_
private

Definition at line 63 of file TrigScintDQM.h.

◆ pad_name_

std::string dqm::TrigScintDQM::pad_name_ {"_up"}
private

Name of Pad.

Definition at line 62 of file TrigScintDQM.h.

62{"_up"};

Referenced by configure().


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