LDMX Software
dqm::TrkDeDxMassEstFeatures Class Reference

Generate histograms to check tracker dE/dx mass estimate features. More...

#include <TrkDeDxMassEstFeatures.h>

Public Member Functions

 TrkDeDxMassEstFeatures (const std::string &name, framework::Process &process)
 Constructor.
 
virtual void configure (framework::config::Parameters &ps) override
 Input python configuration parameters.
 
virtual void analyze (const framework::Event &event) override
 Fills histograms.
 
void onProcessStart () override
 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 mass_estimate_name_
 Collection Name for mass estimate object.
 
std::string mass_estimate_pass_
 Pass Name for mass estimate object.
 

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

Generate histograms to check tracker dE/dx mass estimate features.

Definition at line 14 of file TrkDeDxMassEstFeatures.h.

Constructor & Destructor Documentation

◆ TrkDeDxMassEstFeatures()

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

Constructor.

Blank Analyzer constructor

Definition at line 21 of file TrkDeDxMassEstFeatures.h.

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

Member Function Documentation

◆ analyze()

void dqm::TrkDeDxMassEstFeatures::analyze ( const framework::Event & event)
overridevirtual

Fills histograms.

Implements framework::Analyzer.

Definition at line 15 of file TrkDeDxMassEstFeatures.cxx.

15 {
16 auto mass_estimates_{event.getCollection<ldmx::TrackDeDxMassEstimate>(
18
19 for (const auto &mass_est : mass_estimates_) {
20 auto momentum = mass_est.getMomentum();
21 histograms_.fill("momentum:harmonic_mean_dedx", momentum, mass_est.getIh());
22 if (momentum < 2000)
23 histograms_.fill("momentum_low:harmonic_mean_dedx", momentum,
24 mass_est.getIh());
25 histograms_.fill("harmonic_mean_dedx", mass_est.getIh());
26 histograms_.fill("mass_estimate", mass_est.getMass());
27 if (momentum < 1000)
28 histograms_.fill("mass_estimate_low_p", mass_est.getMass());
29 histograms_.fill("track_type", mass_est.getTrackType());
30 }
31
32 return;
33}
std::string mass_estimate_name_
Collection Name for mass estimate object.
std::string mass_estimate_pass_
Pass Name for mass estimate object.
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 the estimated mass of a particle using tracker dE/dx information.

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

◆ configure()

void dqm::TrkDeDxMassEstFeatures::configure ( framework::config::Parameters & ps)
overridevirtual

Input python configuration parameters.

Reimplemented from framework::EventProcessor.

Definition at line 8 of file TrkDeDxMassEstFeatures.cxx.

8 {
9 mass_estimate_name_ = ps.getParameter<std::string>("mass_estimate_name");
10 mass_estimate_pass_ = ps.getParameter<std::string>("mass_estimate_pass");
11
12 return;
13}

References mass_estimate_name_, and mass_estimate_pass_.

◆ onProcessStart()

void dqm::TrkDeDxMassEstFeatures::onProcessStart ( )
overridevirtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 35 of file TrkDeDxMassEstFeatures.cxx.

35 {
36 std::vector<std::string> labels = {"Other", // 0
37 "Tagger", // 1
38 "Recoil", // 2
39 ""};
40 TH1 *hist = histograms_.get("track_type");
41 for (int ilabel{1}; ilabel < labels.size(); ++ilabel) {
42 hist->GetXaxis()->SetBinLabel(ilabel, labels[ilabel - 1].c_str());
43 }
44}
TH1 * get(const std::string &name)
Get a pointer to a histogram by name.
Definition Histograms.h:194

References framework::HistogramHelper::get(), and framework::EventProcessor::histograms_.

Member Data Documentation

◆ mass_estimate_name_

std::string dqm::TrkDeDxMassEstFeatures::mass_estimate_name_
private

Collection Name for mass estimate object.

Definition at line 39 of file TrkDeDxMassEstFeatures.h.

Referenced by analyze(), and configure().

◆ mass_estimate_pass_

std::string dqm::TrkDeDxMassEstFeatures::mass_estimate_pass_
private

Pass Name for mass estimate object.

Definition at line 42 of file TrkDeDxMassEstFeatures.h.

Referenced by analyze(), and configure().


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