ATLAS Offline Software
Loading...
Searching...
No Matches
TrigPrescalesAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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#include <unordered_map>
13
18
19namespace CP
20{
23 constexpr float invalidTriggerPrescale () {return -1;}
24
25
26
28
30 {
32 public:
34 StatusCode initialize () override;
35 StatusCode execute (const EventContext& ctx) override;
36
37
39 private:
40 ToolHandle<IPileupReweightingTool> m_pileupReweightingTool {this, "pileupReweightingTool", "PileupReweightingTool", "the pileup reweighting tool to be used"};
41
43 private:
44 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "eventInfo", "EventInfo", "the EventInfo to decorate"};
45
47 private:
48 Gaudi::Property<std::vector<std::string>> m_trigList {this, "triggers", {}, "trigger list"};
49
51 private:
52 Gaudi::Property<std::vector<std::string>> m_trigListAll {this, "triggersAll", {}, "all trigger list"};
53
55 private:
56 Gaudi::Property<std::string> m_trigFormula {this, "triggersFormula", "", "produce prescale based on formula instead of per trigger, e.g. (trigA||trigB)"};
57
59 private:
60 std::vector<std::function<float(const xAOD::EventInfo *, const std::string &)>> m_prescaleFunctions;
61
63 private:
64 Gaudi::Property<std::string> m_prescaleDecoration {this, "prescaleDecoration", "", "decoration to store prescales"};
65
67 private:
68 Gaudi::Property<bool> m_prescaleMC {this, "prescaleMC", false, "whether to do prescaling of MC instead of unprescaling of data"};
69
71 private:
72 std::vector<SG::Decorator<float>> m_prescaleAccessors;
73
75 private:
76 Gaudi::Property<std::string> m_selectionDecoration {this, "selectionDecoration", "", "the decoration the trigger pass status"};
77
79 private:
80 std::unordered_map<std::string, SG::ConstAccessor<bool>> m_selectionAccessors;
81 };
82}
83
84#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
an algorithm for retrieving trigger prescales
std::vector< std::function< float(const xAOD::EventInfo *, const std::string &)> > m_prescaleFunctions
list of helper functions to compute the prescales
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
the EventInfo to decorate
StatusCode initialize() override
ToolHandle< IPileupReweightingTool > m_pileupReweightingTool
the pile-up reweighting tool
Gaudi::Property< std::vector< std::string > > m_trigListAll
list of all triggers or trigger chains
Gaudi::Property< std::string > m_trigFormula
list of all triggers or trigger chains
Gaudi::Property< std::vector< std::string > > m_trigList
list of prescaled triggers or trigger chains
Gaudi::Property< bool > m_prescaleMC
whether to prescale MC instead of unprescale dat
Gaudi::Property< std::string > m_prescaleDecoration
the decoration for trigger prescales
std::vector< SG::Decorator< float > > m_prescaleAccessors
the accessors for m_prescaleDecoration and m_trigList combination
Gaudi::Property< std::string > m_selectionDecoration
the decoration for trigger selection
std::unordered_map< std::string, SG::ConstAccessor< bool > > m_selectionAccessors
the accessors for m_selectionDecoration and m_trigList combination
the (new) base class for EventLoop algorithms
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
virtual::StatusCode execute()
execute this algorithm
Property holding a SG store/key/clid from which a ReadHandle is made.
Select isolated Photons, Electrons and Muons.
constexpr float invalidTriggerPrescale()
the decoration value to use if there is no valid trigger prescale information
EventInfo_v1 EventInfo
Definition of the latest event info version.