LDMX Software
dqm::HcalVetoResults Class Reference

Generate histograms to check the final decisions made in the Hcal veto. More...

#include <HcalVetoResults.h>

Public Member Functions

 HcalVetoResults (const std::string &name, framework::Process &process)
 Constructor.
 
 ~HcalVetoResults ()=default
 Destructor.
 
virtual void configure (framework::config::Parameters &ps)
 Input python configuration parameters.
 
virtual void onProcessStart ()
 Things to do only on process start.
 
virtual void analyze (const framework::Event &event)
 Fills histograms.
 
- 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 hcal_veto_name_
 Collection Name for veto object.
 
std::string hcal_veto_pass_
 Pass Name for veto 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 the final decisions made in the Hcal veto.

Definition at line 13 of file HcalVetoResults.h.

Constructor & Destructor Documentation

◆ HcalVetoResults()

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

Constructor.

Blank Analyzer constructor

Definition at line 20 of file HcalVetoResults.h.

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

◆ ~HcalVetoResults()

dqm::HcalVetoResults::~HcalVetoResults ( )
default

Destructor.

Blank Analyzer Destructor

Member Function Documentation

◆ analyze()

void dqm::HcalVetoResults::analyze ( const framework::Event & event)
virtual

Fills histograms.

Implements framework::Analyzer.

Definition at line 31 of file HcalVetoResults.cxx.

31 {
32 // Get the veto object
33 auto hcal_veto{event.getObject<ldmx::HcalVetoResult>("HcalVeto")};
34
35 // Get variables to be plotted
36 auto veto_passed = hcal_veto.passesVeto();
37 auto total_pe = hcal_veto.getTotalPE();
38 auto num_valid_hits = hcal_veto.getNumValidHits();
39 auto max_pe_hit = hcal_veto.getMaxPEHit();
40 auto max_pe = max_pe_hit.getPE();
41 auto max_section = max_pe_hit.getSection();
42 auto max_pos_z = max_pe_hit.getZPos();
43
44 // ldmx_log(info) << "max_section" << max_section;
45
46 // Fill the histograms
47 histograms_.fill("max_pe", max_pe);
48 histograms_.fill("total_pe", total_pe);
49 histograms_.fill("num_valid_hits", num_valid_hits);
50 histograms_.fill("max_section", max_section);
51 histograms_.fill("max_pos_z", max_pos_z);
52 histograms_.fill("veto_pass", veto_passed);
53}
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

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

◆ configure()

void dqm::HcalVetoResults::configure ( framework::config::Parameters & ps)
virtual

Input python configuration parameters.

Reimplemented from framework::EventProcessor.

Definition at line 7 of file HcalVetoResults.cxx.

7 {
8 hcal_veto_name_ = ps.getParameter<std::string>("hcal_veto_name");
9 hcal_veto_pass_ = ps.getParameter<std::string>("hcal_veto_pass");
10}
std::string hcal_veto_pass_
Pass Name for veto object.
std::string hcal_veto_name_
Collection Name for veto object.

References hcal_veto_name_, and hcal_veto_pass_.

◆ onProcessStart()

void dqm::HcalVetoResults::onProcessStart ( )
virtual

Things to do only on process start.

Reimplemented from framework::EventProcessor.

Definition at line 12 of file HcalVetoResults.cxx.

12 {
13 std::vector<TH1 *> hists_HCALsector = {histograms_.get("max_section")};
14
15 // enum HcalSection { BACK = 0, TOP = 1, BOTTOM = 2, RIGHT = 3, LEFT = 4 };
16 std::vector<std::string> labels_HCALsector = {"HCAL BACK", // 1
17 "HCAL TOP", // 2
18 "HCAL BOTTOM", // 3
19 "HCAL RIGHT", // 4
20 "HCAL LEFT", // 5
21 ""};
22
23 for (int ilabel{1}; ilabel < labels_HCALsector.size(); ++ilabel) {
24 for (auto &hist : hists_HCALsector) {
25 hist->GetXaxis()->SetBinLabel(ilabel,
26 labels_HCALsector[ilabel - 1].c_str());
27 }
28 }
29}
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

◆ hcal_veto_name_

std::string dqm::HcalVetoResults::hcal_veto_name_
private

Collection Name for veto object.

Definition at line 47 of file HcalVetoResults.h.

Referenced by configure().

◆ hcal_veto_pass_

std::string dqm::HcalVetoResults::hcal_veto_pass_
private

Pass Name for veto object.

Definition at line 50 of file HcalVetoResults.h.

Referenced by configure().


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