ATLAS Offline Software
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 
56 namespace TrigConf {
57  class ITrigConfigSvc;
58 }
59 
60 namespace Trig {
62  public asg::AsgMetadataTool,
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
80 
82 
84 
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);
115  bool getForceConfigUpdate();
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"};
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
Trig::TrigDecisionTool::beginInputFile
StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: TrigDecisionTool.cxx:224
PropertyWrapper.h
Trig::TrigDecisionTool::getForceConfigUpdate
bool getForceConfigUpdate()
Definition: TrigDecisionTool.cxx:157
Trig::TrigDecisionTool::m_configTool
PublicToolHandle< TrigConf::ITrigConfigTool > m_configTool
Definition: TrigDecisionTool.h:121
Trig::TrigDecisionTool::handle
virtual void handle(const Incident &inc)
Function receiving incidents from IncidentSvc/TEvent.
Definition: TrigDecisionTool.cxx:246
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigDecision.h
Trig::TrigDecisionTool::m_oldDecisionKey
SG::ReadHandleKey< TrigDec::TrigDecision > m_oldDecisionKey
Definition: TrigDecisionTool.h:140
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
ITrigConfigTool.h
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
Trig::ITrigDecisionTool
Basic interface for the TrigDecisionTool.
Definition: ITrigDecisionTool.h:28
ITrigConfigSvc.h
Trig::TrigDecisionTool::m_oldEventInfoKey
SG::ReadHandleKey< EventInfo > m_oldEventInfoKey
Definition: TrigDecisionTool.h:137
Trig::TrigDecisionTool::isPassedBits
virtual unsigned int isPassedBits(const std::string &chain) const
Implementation of the ITrigDecisionTool function.
Definition: TrigDecisionTool.cxx:281
Trig::TrigDecisionToolCore
Definition: TrigDecisionToolCore.h:52
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
Trig::TrigDecisionTool::m_decisionKey
SG::ReadHandleKey< xAOD::TrigDecision > m_decisionKey
Definition: TrigDecisionTool.h:167
Trig::TrigDecisionTool::m_configSvc
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
trigger configuration service handle
Definition: TrigDecisionTool.h:127
Trig::TrigDecisionTool::getNavigationFormat
const std::string & getNavigationFormat() const
Note: Temporary.
Definition: TrigDecisionTool.cxx:287
SG::ReadHandleKey< EventInfo >
Trig::TrigDecisionTool::m_navigationFormat
Gaudi::Property< std::string > m_navigationFormat
Note: Temporary property.
Definition: TrigDecisionTool.h:161
StandaloneNavigation.h
Trig::TrigDecisionTool
Definition: TrigDecisionTool.h:65
Trig::DecisionAccess::isPassed
bool isPassed(const Trig::ChainGroup *chaingroup, unsigned int condition=TrigDefs::Physics) const
true if given group of chains passed
Definition: DecisionAccess.cxx:34
Trig::Logger::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h:34
Trig::TrigDecisionTool::operator=
TrigDecisionTool & operator=(const TrigDecisionTool &)
TrigNavigation.h
Trig::TrigDecisionTool::m_configKeysCache
SG::SlotSpecificObj< std::vector< uint32_t > > m_configKeysCache
cache for config keys.
Definition: TrigDecisionTool.h:117
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigCompositeUtils.h
Trig::TrigDecisionTool::m_useOldAODDecisionInput
Gaudi::Property< bool > m_useOldAODDecisionInput
Definition: TrigDecisionTool.h:147
Trig::TrigDecisionTool::getKeys
std::vector< uint32_t > * getKeys()
Definition: TrigDecisionTool.cxx:139
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
Trig::TrigDecisionTool::m_HLTSummaryKeyIn
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_HLTSummaryKeyIn
Definition: TrigDecisionTool.h:164
SlotSpecificObj.h
Dummy implementation of AthenaKernel/SlotSpecificObj.h.
Trig::TrigDecisionTool::m_useOldEventInfoDecisionFormat
Gaudi::Property< bool > m_useOldEventInfoDecisionFormat
Definition: TrigDecisionTool.h:134
ITrigDecisionTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trig::TrigDecisionTool::setForceConfigUpdate
void setForceConfigUpdate(bool b, bool forceForAllSlots=false)
Definition: TrigDecisionTool.cxx:143
Trig::Logger::msg
MsgStream & msg() const
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h:29
Navigation.h
Logger.h
Trig::TrigDecisionTool::m_forceConfigUpdate
SG::SlotSpecificObj< std::atomic< bool > > m_forceConfigUpdate
Cache for registering new input files.
Definition: TrigDecisionTool.h:118
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
Trig::TrigDecisionTool::isPassed
virtual bool isPassed(const std::string &chain, unsigned int condition) const
true if given chain passed
Definition: TrigDecisionTool.cxx:270
Trig::TrigDecisionTool::m_acceptMultipleInstance
Gaudi::Property< bool > m_acceptMultipleInstance
Definition: TrigDecisionTool.h:153
HLT::StandaloneNavigation
Definition: StandaloneNavigation.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trig::TrigDecisionTool::m_fullNavigation
ToolHandle< HLT::Navigation > m_fullNavigation
Definition: TrigDecisionTool.h:143
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Trig::DecisionAccess::isPassedBits
unsigned int isPassedBits(const Trig::ChainGroup *chaingroup) const
Return expert-level information about the various trigger flags as a bit mask.
Definition: DecisionAccess.cxx:67
IILVL1ConfigSvc.h
TrigDecisionToolCore.h
Trig::TrigDecisionTool::m_standaloneNavigation
HLT::StandaloneNavigation m_standaloneNavigation
Definition: TrigDecisionTool.h:151
Trig::TrigDecisionTool::finalize
StatusCode finalize()
Definition: TrigDecisionTool.cxx:234
Trig::TrigDecisionTool::TrigDecisionTool
TrigDecisionTool(const std::string &name)
Definition: TrigDecisionTool.cxx:32
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
Trig::TrigDecisionTool::m_navigationKey
SG::ReadHandleKey< xAOD::TrigNavigation > m_navigationKey
Definition: TrigDecisionTool.h:156
AsgMetadataTool.h
Trig::TrigDecisionTool::beginEvent
StatusCode beginEvent()
Function called when a new events is loaded.
Definition: TrigDecisionTool.cxx:163
ToolHandle.h
Trig::TrigDecisionTool::m_publicChainGroups
Gaudi::Property< std::map< std::string, std::string > > m_publicChainGroups
Definition: TrigDecisionTool.h:173
Trig::TrigDecisionTool::initialize
StatusCode initialize()
Definition: TrigDecisionTool.cxx:45
IIHLTConfigSvc.h
ServiceHandle< TrigConf::ITrigConfigSvc >