ATLAS Offline Software
TrigPrescalesAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef TRIGGER_ANALYSIS_ALGORITHMS__TRIG_PRESCALES_ALG_H
9 #define TRIGGER_ANALYSIS_ALGORITHMS__TRIG_PRESCALES_ALG_H
10 
11 #include <functional>
12 
16 
17 namespace CP
18 {
21  constexpr float invalidTriggerPrescale () {return -1;}
22 
23 
24 
26 
27  class TrigPrescalesAlg final : public EL::AnaAlgorithm
28  {
30  public:
32  StatusCode initialize () override;
33  StatusCode execute () override;
34 
35 
37  private:
38  ToolHandle<IPileupReweightingTool> m_pileupReweightingTool {this, "pileupReweightingTool", "PileupReweightingTool", "the pileup reweighting tool to be used"};
39 
41  private:
42  Gaudi::Property<std::vector<std::string>> m_trigList {this, "triggers", {}, "trigger list"};
43 
45  private:
46  Gaudi::Property<std::vector<std::string>> m_trigListAll {this, "triggersAll", {}, "all trigger list"};
47 
49  private:
50  Gaudi::Property<std::string> m_trigFormula {this, "triggersFormula", "", "produce prescale based on formula instead of per trigger, e.g. (trigA||trigB)"};
51 
53  private:
54  std::vector<std::function<float(const xAOD::EventInfo *, const std::string &)>> m_prescaleFunctions;
55 
57  private:
58  Gaudi::Property<std::string> m_prescaleDecoration {this, "prescaleDecoration", "", "decoration to store prescales"};
59 
61  private:
62  Gaudi::Property<bool> m_prescaleMC {this, "prescaleMC", false, "whether to do prescaling of MC instead of unprescaling of data"};
63 
65  private:
66  std::vector<SG::AuxElement::Decorator<float>> m_prescaleAccessors;
67  };
68 }
69 
70 #endif
PropertyWrapper.h
CP::invalidTriggerPrescale
constexpr float invalidTriggerPrescale()
the decoration value to use if there is no valid trigger prescale information
Definition: TrigPrescalesAlg.h:21
CP::TrigPrescalesAlg::m_prescaleDecoration
Gaudi::Property< std::string > m_prescaleDecoration
the decoration for trigger prescales
Definition: TrigPrescalesAlg.h:58
CP::TrigPrescalesAlg::m_prescaleAccessors
std::vector< SG::AuxElement::Decorator< float > > m_prescaleAccessors
the accessors for m_prescaleDecoration and m_trigList combination
Definition: TrigPrescalesAlg.h:66
CP::TrigPrescalesAlg::m_trigListAll
Gaudi::Property< std::vector< std::string > > m_trigListAll
list of all triggers or trigger chains
Definition: TrigPrescalesAlg.h:46
CP::TrigPrescalesAlg::m_prescaleMC
Gaudi::Property< bool > m_prescaleMC
whether to prescale MC instead of unprescale dat
Definition: TrigPrescalesAlg.h:62
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition: AnaAlgorithm.cxx:40
AnaAlgorithm.h
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
IPileupReweightingTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::TrigPrescalesAlg::m_pileupReweightingTool
ToolHandle< IPileupReweightingTool > m_pileupReweightingTool
the pile-up reweighting tool
Definition: TrigPrescalesAlg.h:38
CP::TrigPrescalesAlg::m_prescaleFunctions
std::vector< std::function< float(const xAOD::EventInfo *, const std::string &)> > m_prescaleFunctions
list of helper functions to compute the prescales
Definition: TrigPrescalesAlg.h:54
CP::TrigPrescalesAlg::initialize
StatusCode initialize() override
Definition: TrigPrescalesAlg.cxx:25
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CP::TrigPrescalesAlg::m_trigList
Gaudi::Property< std::vector< std::string > > m_trigList
list of prescaled triggers or trigger chains
Definition: TrigPrescalesAlg.h:42
CP::TrigPrescalesAlg::execute
StatusCode execute() override
Definition: TrigPrescalesAlg.cxx:97
CP::TrigPrescalesAlg
an algorithm for retrieving trigger prescales
Definition: TrigPrescalesAlg.h:28
readCCLHist.float
float
Definition: readCCLHist.py:83
CP::TrigPrescalesAlg::m_trigFormula
Gaudi::Property< std::string > m_trigFormula
list of all triggers or trigger chains
Definition: TrigPrescalesAlg.h:50