ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDecisionTool.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TrigDecision_TrigDecisionTool_h
8#define TrigDecision_TrigDecisionTool_h
9/**********************************************************************************
10 * @Project: TrigDecisionTool
11 * @Package: TrigDecisionTool
12 * @class : TrigDecisionTool
13 *
14 * @brief main tool
15 *
16 * @author Michael Begel <michael.begel@cern.ch> - Brookhaven National Laboratory
17 * @author Tomasz Bold <Tomasz.Bold@cern.ch> - UC Irvine - AGH Krakow
18 * @author Joerg Stelzer <Joerg.Stelzer@cern.ch> - DESY
19 *
20 ***********************************************************************************/
21
23#include "AsgTools/ToolHandle.h"
26
31
32#ifndef XAOD_STANDALONE
33#include "EventInfo/EventInfo.h"
35#include "GaudiKernel/ServiceHandle.h"
36#include "GaudiKernel/ToolHandle.h"
37
38#ifndef XAOD_ANALYSIS
40#endif // XAOD_ANALYSIS
41
42#endif // XAOD_STANDALONE
43
45
46// interface to implement for offline access (outside AtlasTrigger)
48
51
52// base classes
55
56namespace TrigConf {
57 class ITrigConfigSvc;
58}
59
60namespace Trig {
65 {
66 // constructors, destructor
69
70 public:
71 // resolve ambiguity and use Logger adaptor for all messaging
72 using Logger::msgLvl;
73 using Logger::msg;
74
75 // constructors
76 TrigDecisionTool(const std::string& name);
77
78 // initialize routine as required for an Algorithm
79 StatusCode initialize();
80
81 StatusCode beginEvent();
82
83 StatusCode beginInputFile();
84
85 StatusCode finalize();
86
87#ifndef XAOD_ANALYSIS
88 // this is called by Incident dispatcher
89 virtual void handle(const Incident& inc);
90#endif
91
98 virtual bool isPassed(const std::string& chain,
99 unsigned int condition) const;
101 virtual bool isPassed(const std::string& chain) const;
103 virtual unsigned int isPassedBits( const std::string& chain ) const;
104
107
108 const std::string& getNavigationFormat() const;
109
110 private:
111
112 std::vector<uint32_t>* getKeys();
113
114 void setForceConfigUpdate(bool b, bool forceForAllSlots = false);
116
119
120 #if !defined(XAOD_STANDALONE) && !defined(XAOD_ANALYSIS) // Athena: Do not set a Config Tool by default (this tool is not thread safe, the service should be used in Athena)
121 PublicToolHandle<TrigConf::ITrigConfigTool> m_configTool{this, "ConfigTool", ""};
122 #else // AnalysisBase: Do set a Config Tool by default for analysis convienience
123 ToolHandle<TrigConf::ITrigConfigTool> m_configTool{this, "ConfigTool", "TrigConf::xAODConfigTool/xAODConfigTool"}; // Use a public tool here in AnalysisBase, and create it first (before the TrigDecisionTool)
124 #endif
125
126 #ifndef XAOD_STANDALONE
127 ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc{this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"};
128 #endif
129
131
132 #ifndef XAOD_ANALYSIS // full Athena
133
134 Gaudi::Property<bool> m_useOldEventInfoDecisionFormat {this, "UseOldEventInfoDecisionFormat", false,
135 "For use when reading old BS with trigger decision information available in the EventInfo"};
136
137 SG::ReadHandleKey<EventInfo> m_oldEventInfoKey {this, "OldEventInfoKey", "EventInfo",
138 "Storegate key of old pre-xAOD EventInfo object"};
139
140 SG::ReadHandleKey<TrigDec::TrigDecision> m_oldDecisionKey {this, "OldTrigDecisionKey", "TrigDecision",
141 "Storegate key of old pre-xAOD Decision object"};
142
143 ToolHandle<HLT::Navigation> m_fullNavigation{this, "Navigation", "HLT::Navigation/Navigation"};
144
145 #endif
146
147 Gaudi::Property<bool> m_useOldAODDecisionInput {this, "UseAODDecision", false,
148 "For use when reading old ESD/AOD with only a TrigDec::TrigDecision and no xAOD::TrigDecision "
149 "or Run 1 / Run 2 RAW data where an initial TrigDec::TrigDecision needs to be converted via the TDT into xAOD"};
150
152
153 Gaudi::Property<bool> m_acceptMultipleInstance{this, "AcceptMultipleInstance", false,
154 "Allow multiple TrigDecisionTool instances"};
155
156 SG::ReadHandleKey<xAOD::TrigNavigation> m_navigationKey {this, "NavigationKey", "TrigNavigation",
157 "Storegate key of Run1, Run2 Trig Navigation"};
158
161 Gaudi::Property<std::string> m_navigationFormat{this, "NavigationFormat", "TriggerElement",
162 "Allowed tokens are 'TriggerElement' or 'TrigComposite'"};
163
165 "HLTNav_Summary_DAODSlimmed", "HLT summary container Key"};
166
167 SG::ReadHandleKey<xAOD::TrigDecision> m_decisionKey {this, "TrigDecisionKey", "xTrigDecision",
168 "Storegate key of Trigger Decision"};
169
170
172
173 Gaudi::Property< std::map<std::string,std::string> > m_publicChainGroups{this, "PublicChainGroups",
174 std::map<std::string,std::string>(), "Pre-created chain groups"};
175
176 };
177
178} // End of namespace
179
180
181#endif
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
#define ASG_TOOL_INTERFACE(CLASSNAME)
Dummy implementation of AthenaKernel/SlotSpecificObj.h.
Property holding a SG store/key/clid from which a ReadHandle is made.
Maintain a set of objects, one per slot.
Athena interface for all service that provide L1Topo, LVL1, and HLT menu configuration information.
Basic interface for the TrigDecisionTool.
unsigned int isPassedBits(const Trig::ChainGroup *chaingroup) const
Return expert-level information about the various trigger flags as a bit mask.
bool isPassed(const Trig::ChainGroup *chaingroup, unsigned int condition=TrigDefs::Physics) const
true if given group of chains passed
TrigDecisionTool & operator=(const TrigDecisionTool &)
SG::ReadHandleKey< xAOD::TrigDecision > m_decisionKey
Gaudi::Property< bool > m_useOldEventInfoDecisionFormat
StatusCode initialize()
Dummy implementation of the initialisation function.
StatusCode beginInputFile()
Function called when a new input file is opened.
TrigDecisionTool(const std::string &name)
SG::ReadHandleKey< EventInfo > m_oldEventInfoKey
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
trigger configuration service handle
StatusCode beginEvent()
Function called when a new events is loaded.
void setForceConfigUpdate(bool b, bool forceForAllSlots=false)
virtual bool isPassed(const std::string &chain, unsigned int condition) const
true if given chain passed
HLT::StandaloneNavigation m_standaloneNavigation
Gaudi::Property< std::map< std::string, std::string > > m_publicChainGroups
Gaudi::Property< std::string > m_navigationFormat
Note: Temporary property.
SG::SlotSpecificObj< std::atomic< bool > > m_forceConfigUpdate
Cache for registering new input files.
Gaudi::Property< bool > m_acceptMultipleInstance
const std::string & getNavigationFormat() const
Note: Temporary.
SG::SlotSpecificObj< std::vector< uint32_t > > m_configKeysCache
cache for config keys.
virtual void handle(const Incident &inc)
Function receiving incidents from IncidentSvc/TEvent.
Gaudi::Property< bool > m_useOldAODDecisionInput
SG::ReadHandleKey< xAOD::TrigNavigation > m_navigationKey
virtual unsigned int isPassedBits(const std::string &chain) const
Implementation of the ITrigDecisionTool function.
SG::ReadHandleKey< TrigDec::TrigDecision > m_oldDecisionKey
PublicToolHandle< TrigConf::ITrigConfigTool > m_configTool
std::vector< uint32_t > * getKeys()
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_HLTSummaryKeyIn
ToolHandle< HLT::Navigation > m_fullNavigation
Base class for dual-use tools that provide file metadata access.
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
The common trigger namespace for trigger analysis tools.