ATLAS Offline Software
Loading...
Searching...
No Matches
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
33
40
41// containers
42#include <vector>
43#include <string>
44
45namespace LVL1CTP {
46 class Lvl1Result;
47}
48
49namespace TrigDec {
50
64 {
65
66 public:
67
68 TrigDecisionMakerMT(const std::string &name, ISvcLocator *pSvcLocator);
70
71 // IAlgorithm virtual methods to implement
72 virtual StatusCode initialize() override;
73 virtual StatusCode execute( const EventContext& context ) const override;
74 virtual StatusCode finalize() override;
75
76 private:
77
78 StatusCode getL1Result (const LVL1CTP::Lvl1Result*& result, const EventContext& context) const;
79
80 Gaudi::Property<bool> m_doL1{this, "doL1", true, "Read L1 trigger information"};
81 Gaudi::Property<bool> m_doHLT{this, "doHLT", true, "Read HLT trigger information"};
82 Gaudi::Property<bool> m_useEDMxAOD{this, "UseEDMxAOD", false, "Flag whether to use xAOD::CTPResult instead of ROIB::RoIBResult for CTP result"};
83
84 // Tools & services
85 ToolHandle<HLT::ILvl1ResultAccessTool> m_lvl1Tool{this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"};
86
87 ToolHandle<ITriggerBitsMakerTool> m_bitsMakerTool{this, "BitsMakerTool", "", "Tool to create trigger bits for MC"};
88
89 // Input keys configuration
90 SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> m_bgKey{this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"};
91 SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"};
92
93 SG::ReadHandleKey<HLT::HLTResultMT> m_hltResultKeyIn {this, "HLTResultMT", "HLTResultMT", "Key of the HLTResultMT object to get bits from online bytestream" };
94 SG::ReadHandleKey<ROIB::RoIBResult> m_ROIBResultKeyIn {this, "RoIBResult", "RoIBResult", "RoIB Result Object Key"};
95 SG::ReadHandleKey<xAOD::CTPResult> m_CTPResultKeyIn{this, "CTPResult", "CTPResult", "Key to retrieve the L1 xAOD CTP result from SG" };
96 SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKeyIn {this, "EventInfo", "EventInfo", "Event Info Object Key"};
97
98 // Output configuration
99 SG::WriteHandleKey<LVL1CTP::Lvl1Result> m_l1ResultKeyOut{ this, "L1Result", "L1Result", "L1 result"};
100 SG::WriteHandleKey<xAOD::TrigDecision> m_trigDecisionKeyOut {this, "TrigDecisionKey", "xTrigDecision", "Output trigger decision object key"};
101
102 // For statistics
103 mutable std::atomic<uint32_t> m_nEvents{0}, m_l1Passed{0}, m_hltPassed{0};
104 };
105}
106
107#endif
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Gaudi::Property< bool > m_useEDMxAOD
SG::ReadHandleKey< HLT::HLTResultMT > m_hltResultKeyIn
virtual StatusCode finalize() override
std Gaudi finalize method -> print out statistics
ToolHandle< HLT::ILvl1ResultAccessTool > m_lvl1Tool
tool to ease the access to the L1 results (RoIs, items, etc)
Gaudi::Property< bool > m_doL1
SG::ReadHandleKey< xAOD::CTPResult > m_CTPResultKeyIn
virtual StatusCode execute(const EventContext &context) const override
Re-entrant execute to create the xAOD::TrigDecision.
SG::WriteHandleKey< LVL1CTP::Lvl1Result > m_l1ResultKeyOut
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
StatusCode getL1Result(const LVL1CTP::Lvl1Result *&result, const EventContext &context) const
retrieve LVL1 result (called in execute)
std::atomic< uint32_t > m_nEvents
std::atomic< uint32_t > m_hltPassed
Gaudi::Property< bool > m_doHLT
std::atomic< uint32_t > m_l1Passed
virtual StatusCode initialize() override
std Gaudi initialize method -> read-in trigger configuration
SG::ReadHandleKey< ROIB::RoIBResult > m_ROIBResultKeyIn
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKeyIn
TrigDecisionMakerMT(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
SG::WriteHandleKey< xAOD::TrigDecision > m_trigDecisionKeyOut
ToolHandle< ITriggerBitsMakerTool > m_bitsMakerTool