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 analyze (const framework::Event &event)
 Fills histograms.
 
- 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 onProcessStart ()
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
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.
 
std::string hcal_veto_passname_
 

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

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.

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.

◆ ~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 13 of file HcalVetoResults.cxx.

13 {
14 // Get the veto object
15 auto hcal_veto{
16 event.getObject<ldmx::HcalVetoResult>("HcalVeto", hcal_veto_passname_)};
17
18 // Get variables to be plotted
19 auto veto_passed = hcal_veto.passesVeto();
20 auto total_pe = hcal_veto.getTotalPE();
21 auto num_valid_hits = hcal_veto.getNumValidHits();
22 auto max_pe_hit = hcal_veto.getMaxPEHit();
23 auto max_pe = max_pe_hit.getPE();
24 auto max_section = max_pe_hit.getSection();
25 auto max_pos_z = max_pe_hit.getZPos();
26
27 // ldmx_log(info) << "max_section" << max_section;
28
29 // Fill the histograms
30 histograms_.fill("max_pe", max_pe);
31 histograms_.fill("total_pe", total_pe);
32 histograms_.fill("num_valid_hits", num_valid_hits);
33 histograms_.fill("max_section", max_section);
34 histograms_.fill("max_pos_z", max_pos_z);
35 histograms_.fill("veto_pass", veto_passed);
36}
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.

References framework::HistogramPool::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.get<std::string>("hcal_veto_name");
9 hcal_veto_pass_ = ps.get<std::string>("hcal_veto_pass");
10 hcal_veto_passname_ = ps.get<std::string>("hcal_veto_passname");
11}
std::string hcal_veto_pass_
Pass Name for veto object.
std::string hcal_veto_name_
Collection Name for veto object.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78

References framework::config::Parameters::get(), hcal_veto_name_, and hcal_veto_pass_.

Member Data Documentation

◆ hcal_veto_name_

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

Collection Name for veto object.

Definition at line 42 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 45 of file HcalVetoResults.h.

Referenced by configure().

◆ hcal_veto_passname_

std::string dqm::HcalVetoResults::hcal_veto_passname_
private

Definition at line 47 of file HcalVetoResults.h.


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