18#include <unordered_set>
26 StatusCode TrigPrescalesAlg ::
31 ANA_MSG_ERROR (
"The prescale decoration should not be empty");
32 return StatusCode::FAILURE;
37 ANA_MSG_ERROR (
"Either a list of triggers or trigger formula need to be provided");
38 return StatusCode::FAILURE;
43 ANA_MSG_ERROR (
"Provide either only a list of triggers or only a trigger formula");
44 return StatusCode::FAILURE;
68 std::vector<std::string> formulaVector = {
m_trigFormula.value()};
70 return StatusCode::SUCCESS;
84 if (trigSet.contains(chain))
91 if (!it->second(*evtInfo))
111 return StatusCode::SUCCESS;
116 StatusCode TrigPrescalesAlg ::
117 execute (
const EventContext& ctx)
128 return StatusCode::SUCCESS;
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
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
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Select isolated Photons, Electrons and Muons.
constexpr float invalidTriggerPrescale()
the decoration value to use if there is no valid trigger prescale information
std::string sanitizeTriggerChainName(std::string chain)
convert a trigger chain name into a string usable in decoration/branch names (.
EventInfo_v1 EventInfo
Definition of the latest event info version.