ATLAS Offline Software
TrigDecisionMakerMT.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 /**************************************************************************
8  **
9  ** File: TrigDecisionMakerMT.h
10  **
11  ** Description: - Re-entrant algorithm-derived class to run after the Steering
12  ** - Finds the list of defined chains at initialization
13  ** - For each event:
14  ** * Creates a xAODTriggerDecision object
15  ** * Fills it with the outcome of each defined chain
16  ** * Output to StoreGate via writehandle written to ESD/AOD
17  **
18  * @author Tim Martin <Tim.Martin@cern.ch> - University of Warwick
19  **
20  ** Created: 16 July 2018
21  **
22  **************************************************************************/
23 #ifndef TrigDecisionMaker_TrigDecisionMakerMT_H
24 #define TrigDecisionMaker_TrigDecisionMakerMT_H
25 
27 #include "GaudiKernel/ServiceHandle.h"
28 #include "GaudiKernel/ToolHandle.h"
29 
32 
38 #include "TrigConfData/HLTMenu.h"
39 
40 // containers
41 #include <vector>
42 #include <string>
43 
44 namespace LVL1CTP {
45  class Lvl1Result;
46 }
47 
48 namespace TrigDec {
49 
63  {
64 
65  public:
66 
67  TrigDecisionMakerMT(const std::string &name, ISvcLocator *pSvcLocator);
69 
70  // IAlgorithm virtual methods to implement
71  virtual StatusCode initialize() override;
72  virtual StatusCode execute( const EventContext& context ) const override;
73  virtual StatusCode finalize() override;
74 
75  private:
76 
77  StatusCode getL1Result (const LVL1CTP::Lvl1Result*& result, const EventContext& context) const;
78 
79  Gaudi::Property<bool> m_doL1{this, "doL1", true, "Read L1 trigger information"};
80  Gaudi::Property<bool> m_doHLT{this, "doHLT", true, "Read HLT trigger information"};
81 
82  // Tools & services
83  ToolHandle<HLT::ILvl1ResultAccessTool> m_lvl1Tool{this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"};
84 
85  ToolHandle<ITriggerBitsMakerTool> m_bitsMakerTool{this, "BitsMakerTool", "", "Tool to create trigger bits for MC"};
86 
87  // Input keys configuration
88  SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> m_bgKey{this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"};
89  SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"};
90 
91  SG::ReadHandleKey<HLT::HLTResultMT> m_hltResultKeyIn {this, "HLTResultMT", "HLTResultMT", "Key of the HLTResultMT object to get bits from online bytestream" };
92  SG::ReadHandleKey<ROIB::RoIBResult> m_ROIBResultKeyIn {this, "RoIBResult", "RoIBResult", "RoIB Result Object Key"};
93  SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKeyIn {this, "EventInfo", "EventInfo", "Event Info Object Key"};
94 
95  // Output configuration
96  SG::WriteHandleKey<xAOD::TrigDecision> m_trigDecisionKeyOut {this, "TrigDecisionKey", "xTrigDecision", "Output trigger decision object key"};
97 
98  // For statistics
99  mutable std::atomic<uint32_t> m_nEvents{0}, m_l1Passed{0}, m_hltPassed{0};
100  };
101 }
102 
103 #endif
TrigDec
Definition: ITrigDecisionCnvTool.h:18
TrigDec::TrigDecisionMakerMT::m_l1Passed
std::atomic< uint32_t > m_l1Passed
Definition: TrigDecisionMakerMT.h:99
TrigDec::TrigDecisionMakerMT::m_bgKey
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
Definition: TrigDecisionMakerMT.h:88
get_generator_info.result
result
Definition: get_generator_info.py:21
TrigDecision.h
ITriggerBitsMakerTool.h
TrigDec::TrigDecisionMakerMT::m_ROIBResultKeyIn
SG::ReadHandleKey< ROIB::RoIBResult > m_ROIBResultKeyIn
Definition: TrigDecisionMakerMT.h:92
TrigDec::TrigDecisionMakerMT::execute
virtual StatusCode execute(const EventContext &context) const override
Re-entrant execute to create the xAOD::TrigDecision.
Definition: TrigDecisionMakerMT.cxx:78
RoIBResult.h
TrigDec::TrigDecisionMakerMT::m_HLTMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
Definition: TrigDecisionMakerMT.h:89
SG::ReadHandleKey< TrigConf::HLTMenu >
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ILvl1ResultAccessTool.h
TrigDec::TrigDecisionMakerMT::~TrigDecisionMakerMT
~TrigDecisionMakerMT()
std deconstructor
Definition: TrigDecisionMakerMT.cxx:32
TrigDec::TrigDecisionMakerMT::finalize
virtual StatusCode finalize() override
std Gaudi finalize method -> print out statistics
Definition: TrigDecisionMakerMT.cxx:64
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
TrigDec::TrigDecisionMakerMT::m_bitsMakerTool
ToolHandle< ITriggerBitsMakerTool > m_bitsMakerTool
Definition: TrigDecisionMakerMT.h:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigDec::TrigDecisionMakerMT::getL1Result
StatusCode getL1Result(const LVL1CTP::Lvl1Result *&result, const EventContext &context) const
retrieve LVL1 result (called in execute)
Definition: TrigDecisionMakerMT.cxx:228
TrigDec::TrigDecisionMakerMT::m_doL1
Gaudi::Property< bool > m_doL1
Definition: TrigDecisionMakerMT.h:79
TrigDec::TrigDecisionMakerMT::initialize
virtual StatusCode initialize() override
std Gaudi initialize method -> read-in trigger configuration
Definition: TrigDecisionMakerMT.cxx:35
TrigDec::TrigDecisionMakerMT::m_doHLT
Gaudi::Property< bool > m_doHLT
Definition: TrigDecisionMakerMT.h:80
AthReentrantAlgorithm.h
L1BunchGroupSet.h
TrigDec::TrigDecisionMakerMT::m_lvl1Tool
ToolHandle< HLT::ILvl1ResultAccessTool > m_lvl1Tool
tool to ease the access to the L1 results (RoIs, items, etc)
Definition: TrigDecisionMakerMT.h:83
TrigDec::TrigDecisionMakerMT::m_trigDecisionKeyOut
SG::WriteHandleKey< xAOD::TrigDecision > m_trigDecisionKeyOut
Definition: TrigDecisionMakerMT.h:96
LVL1CTP::Lvl1Result
Definition: Lvl1Result.h:32
TrigDec::TrigDecisionMakerMT::m_nEvents
std::atomic< uint32_t > m_nEvents
Definition: TrigDecisionMakerMT.h:99
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EventInfo.h
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet >
TrigDec::TrigDecisionMakerMT
Definition: TrigDecisionMakerMT.h:63
HLTResultMT.h
TrigDec::TrigDecisionMakerMT::m_hltResultKeyIn
SG::ReadHandleKey< HLT::HLTResultMT > m_hltResultKeyIn
Definition: TrigDecisionMakerMT.h:91
HLTMenu.h
LVL1CTP
Definition: Lvl1ResultAccessTool.h:20
TrigDec::TrigDecisionMakerMT::m_hltPassed
std::atomic< uint32_t > m_hltPassed
Definition: TrigDecisionMakerMT.h:99
TrigDec::TrigDecisionMakerMT::TrigDecisionMakerMT
TrigDecisionMakerMT(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
Definition: TrigDecisionMakerMT.cxx:28
TrigDec::TrigDecisionMakerMT::m_EventInfoKeyIn
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKeyIn
Definition: TrigDecisionMakerMT.h:93