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

Public Member Functions

 TrigScintTrackDQM (const std::string &name, framework::Process &process)
 Constructor.
 
 ~TrigScintTrackDQM ()
 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 trackCollectionName_ {"TriggerPadTracks"}
 Name of trigger pad track collection.
 
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 TrigScintTrackDQM.h.

Constructor & Destructor Documentation

◆ TrigScintTrackDQM()

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

Constructor.

Definition at line 5 of file TrigScintTrackDQM.cxx.

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

◆ ~TrigScintTrackDQM()

dqm::TrigScintTrackDQM::~TrigScintTrackDQM ( )

Destructor.

Definition at line 9 of file TrigScintTrackDQM.cxx.

9{}

Member Function Documentation

◆ analyze()

void dqm::TrigScintTrackDQM::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 38 of file TrigScintTrackDQM.cxx.

38 {
39 // Get the collection of TrigScintTrack digitized tracks if the exists
40 const std::vector<ldmx::TrigScintTrack> TrigScintTracks =
41 event.getCollection<ldmx::TrigScintTrack>(trackCollectionName_,
42 passName_);
43
44 // Loop through all TrigScint tracks in the event
45 for (const ldmx::TrigScintTrack &track : TrigScintTracks) {
46 histograms_.fill("centroid", track.getCentroid());
47 histograms_.fill("residual", track.getResidual());
48 histograms_.fill("n_clusters", track.getNclusters());
49 histograms_.fill("beamEfrac", track.getBeamEfrac());
50
51 histograms_.fill("x", track.getCentroidX());
52 histograms_.fill("y", track.getCentroidY());
53 histograms_.fill("z", track.getCentroidZ());
54 }
55
56 histograms_.fill("n_tracks", TrigScintTracks.size());
57}
std::string trackCollectionName_
Name of trigger pad track collection.
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 track of trigger scintillator clusters.

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

◆ configure()

void dqm::TrigScintTrackDQM::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 30 of file TrigScintTrackDQM.cxx.

30 {
31 trackCollectionName_ = ps.getParameter<std::string>("track_collection");
32 passName_ = ps.getParameter<std::string>("passName").c_str();
33
34 ldmx_log(info) << "In TrigScintTrackDQM::configure, got parameters "
35 << trackCollectionName_ << " and " << passName_;
36}

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

◆ onProcessStart()

void dqm::TrigScintTrackDQM::onProcessStart ( )
virtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 11 of file TrigScintTrackDQM.cxx.

11 {
13
14 histograms_.create("centroid", "Track channel centroid", 500, 0, 100);
16 "n_tracks", "TrigScint track multiplicity in the pad/event", 25, 0, 25);
17 histograms_.create("n_clusters", "N_{clusters} forming the track", 4, 0, 4);
18 histograms_.create("residual", "Track residual [channels]", 100, 0., 2.);
19 histograms_.create("beamEfrac",
20 "Track edep fraction associated with beam electron", 101,
21 0., 1.01);
22 histograms_.create("x", "Track x position", 1000, -100, 100);
23 histograms_.create("y", "Track y position", 1000, -100, 100);
24 histograms_.create("z", "Track z position", 1000, -900, 100);
25
26 // TODO: implement getting a list of the constructed histograms, to iterate
27 // through and set overflow boolean.
28}
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

◆ passName_

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

Definition at line 47 of file TrigScintTrackDQM.h.

47{""};

◆ trackCollectionName_

std::string dqm::TrigScintTrackDQM::trackCollectionName_ {"TriggerPadTracks"}
private

Name of trigger pad track collection.

Definition at line 46 of file TrigScintTrackDQM.h.

46{"TriggerPadTracks"};

Referenced by analyze(), and configure().


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