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

Public Member Functions

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

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 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.

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

◆ ~TrigScintClusterDQM()

dqm::TrigScintClusterDQM::~TrigScintClusterDQM ( )

Destructor.

Definition at line 9 of file TrigScintClusterDQM.cxx.

9{}

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 44 of file TrigScintClusterDQM.cxx.

44 {
45 if (not event.exists(clusterCollectionName_, passName_)) return;
46 // Get the collection of TrigScintCluster digitized clusters if the exists
47 const std::vector<ldmx::TrigScintCluster> TrigScintClusters =
49 passName_);
50
51 double totalPE{0};
52 // Loop through all TrigScint clusters in the event
53 for (const ldmx::TrigScintCluster &cluster : TrigScintClusters) {
54 histograms_.fill("pe", cluster.getPE());
55 histograms_.fill("energy", cluster.getEnergy());
56 histograms_.fill("cluster_time", cluster.getTime());
57 histograms_.fill("centroid", cluster.getCentroid());
58 histograms_.fill("n_hits", cluster.getNHits());
59 histograms_.fill("seed", cluster.getSeed());
60 histograms_.fill("beamEfrac", cluster.getBeamEfrac());
61
62 histograms_.fill("x", cluster.getCentroidX());
63 histograms_.fill("y", cluster.getCentroidY());
64 histograms_.fill("z", cluster.getCentroidZ());
65
66 totalPE += cluster.getPE();
67 }
68
69 histograms_.fill("n_clusters", TrigScintClusters.size());
70 histograms_.fill("total_pe", totalPE);
71}
std::string clusterCollectionName_
Name of trigger pad cluster collection.
HistogramHelper histograms_
Interface class 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 double &val)
Fill a 1D histogram.
Definition Histograms.h:166
Stores cluster information from the trigger scintillator pads.

References clusterCollectionName_, framework::Event::exists(), framework::HistogramHelper::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 34 of file TrigScintClusterDQM.cxx.

34 {
35 clusterCollectionName_ = ps.getParameter<std::string>("cluster_collection");
36 padName_ = ps.getParameter<std::string>("pad").c_str();
37 passName_ = ps.getParameter<std::string>("passName").c_str();
38
39 ldmx_log(info) << "In TrigScintClusterDQM::configure, got parameters "
40 << clusterCollectionName_ << ", pad = " << padName_
41 << ", pass = " << passName_;
42}

References clusterCollectionName_, and framework::config::Parameters::getParameter().

◆ onProcessStart()

void dqm::TrigScintClusterDQM::onProcessStart ( )
virtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 11 of file TrigScintClusterDQM.cxx.

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

◆ clusterCollectionName_

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

Name of trigger pad cluster collection.

Definition at line 46 of file TrigScintClusterDQM.h.

46{"TriggerPadUpClusters"};

Referenced by analyze(), and configure().

◆ padName_

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

Definition at line 47 of file TrigScintClusterDQM.h.

47{"_up"};

◆ passName_

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

Definition at line 48 of file TrigScintClusterDQM.h.

48{""};

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