LDMX Software
dqm::TrigScintClusterDQM Class Reference

Public Member Functions

 TrigScintClusterDQM (const std::string &name, framework::Process &process)
 Constructor.
 
 ~TrigScintClusterDQM ()=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 cluster_collection_name_ {"TriggerPadUpClusters"}
 Name of trigger pad cluster collection.
 
std::string pad_name_ {"_up"}
 
std::string pass_name_ {""}
 

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 19 of file TrigScintClusterDQM.h.

Constructor & Destructor Documentation

◆ TrigScintClusterDQM()

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

Constructor.

Definition at line 5 of file TrigScintClusterDQM.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::TrigScintClusterDQM::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 41 of file TrigScintClusterDQM.cxx.

41 {
42 if (not event.exists(cluster_collection_name_, pass_name_)) return;
43 // Get the collection of TrigScintCluster digitized clusters if the exists
44 const std::vector<ldmx::TrigScintCluster> trig_scint_clusters =
46 pass_name_);
47
48 double total_pe{0};
49 // Loop through all TrigScint clusters in the event
50 for (const ldmx::TrigScintCluster &cluster : trig_scint_clusters) {
51 histograms_.fill("pe", cluster.getPE());
52 histograms_.fill("energy", cluster.getEnergy());
53 histograms_.fill("cluster_time", cluster.getTime());
54 histograms_.fill("centroid", cluster.getCentroid());
55 histograms_.fill("n_hits", cluster.getNHits());
56 histograms_.fill("seed", cluster.getSeed());
57 histograms_.fill("beamEfrac", cluster.getBeamEfrac());
58
59 histograms_.fill("x", cluster.getCentroidX());
60 histograms_.fill("y", cluster.getCentroidY());
61 histograms_.fill("z", cluster.getCentroidZ());
62
63 total_pe += cluster.getPE();
64 }
65
66 histograms_.fill("n_clusters", trig_scint_clusters.size());
67 histograms_.fill("total_pe", total_pe);
68}
std::string cluster_collection_name_
Name of trigger pad cluster collection.
HistogramPool histograms_
helper object for making and filling histograms
bool exists(const std::string &name, const std::string &passName, bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Definition Event.cxx:92
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Stores cluster information from the trigger scintillator pads.

References cluster_collection_name_, framework::Event::exists(), framework::HistogramPool::fill(), and framework::EventProcessor::histograms_.

◆ configure()

void dqm::TrigScintClusterDQM::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 32 of file TrigScintClusterDQM.cxx.

32 {
33 cluster_collection_name_ = ps.get<std::string>("cluster_collection");
34 pad_name_ = ps.get<std::string>("pad").c_str();
35 pass_name_ = ps.get<std::string>("passName").c_str();
36
37 ldmx_log(debug) << "Collection name = " << cluster_collection_name_
38 << ", pad = " << pad_name_ << ", pass = " << pass_name_;
39}

References cluster_collection_name_, and framework::config::Parameters::get().

◆ onProcessStart()

void dqm::TrigScintClusterDQM::onProcessStart ( )
virtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 9 of file TrigScintClusterDQM.cxx.

9 {
11
12 histograms_.create("centroid", "Cluster channel centroid", 500, 0, 100);
13 histograms_.create("total_pe", "Total cluster PEs in the pad/event", 500, 0,
14 2000);
15 histograms_.create("n_clusters", "Clusters in the pad/event", 25, 0, 25);
16 histograms_.create("n_hits", "n_{hits} forming the clusters", 4, 0, 4);
17 histograms_.create("seed", "Cluster seed hit channel ID", 100, 0, 100);
18 histograms_.create("beamEfrac", "Cluster edep fraction from beam electron",
19 101, 0., 1.01);
20 histograms_.create("x", "Cluster x position [mm]", 1000, -100, 100);
21 histograms_.create("y", "Cluster y position [mm]", 1000, -100, 100);
22 histograms_.create("z", "Cluster z position [mm]", 1000, -900, 100);
23
24 histograms_.create("pe", "PE in a cluster", 250, 0, 1000);
25 histograms_.create("energy", "Energy dep in a cluster [MeV]", 500, 0, 1500);
26 histograms_.create("cluster_time", "Cluster time [ns]", 600, -150, 150);
27
28 // TODO: implement getting a list of the constructed histograms, to iterate
29 // through and set overflow boolean.
30}
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

◆ cluster_collection_name_

std::string dqm::TrigScintClusterDQM::cluster_collection_name_ {"TriggerPadUpClusters"}
private

Name of trigger pad cluster collection.

Definition at line 46 of file TrigScintClusterDQM.h.

46{"TriggerPadUpClusters"};

Referenced by analyze(), and configure().

◆ pad_name_

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

Definition at line 47 of file TrigScintClusterDQM.h.

47{"_up"};

◆ pass_name_

std::string dqm::TrigScintClusterDQM::pass_name_ {""}
private

Definition at line 48 of file TrigScintClusterDQM.h.

48{""};

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