ATLAS Offline Software
ExpertMethods.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /**********************************************************************************
6  * @Project: TrigDecisionTool
7  * @Package: TrigDecisionTool
8  * @Class : DecisionAnalysis
9  *
10  * @brief access to information about the trigger decision
11  *
12  * @author Michael Begel <michael.begel@cern.ch> - Brookhaven National Laboratory
13  * @author Nicolas Berger <Nicolas.Berger@cern.ch> - LAPP Annecy
14  *
15  ***********************************************************************************/
16 
17 #include <vector>
18 #include <exception>
20 
21 #ifndef XAOD_ANALYSIS // Full athena
24 #endif
25 
27 
31 
35 
37 
38 
40  : m_cacheGlobalMemory(cgm)
41 {
42 }
43 
45 
48  ATH_MSG_VERBOSE("getting L1 item configuration details for: " << chain);
49  return cgm(true)->config_item(chain);
50 }
51 
52 const TrigConf::HLTChain*
54  ATH_MSG_VERBOSE("getting chain configuration details for: " << chain);
55  return cgm(true)->config_chain(chain);
56 }
57 
58 
59 const HLT::Chain* Trig::ExpertMethods::getChainDetails(const std::string& chain) const {
60  return cgm()->chain(chain);
61 }
62 
64  return cgm()->item(chain);
65 }
66 
67 const Trig::CacheGlobalMemory* Trig::ExpertMethods::cgm(bool onlyConfig) const {
68  if ( ! onlyConfig ) {
69  if ( !std::as_const(m_cacheGlobalMemory)->get()->assert_decision() ) {
70  ATH_MSG_WARNING("TDT has not ben able to unpack trigger decision");
71  }
72  }
73  return std::as_const(m_cacheGlobalMemory)->get();
74 }
75 
76 #ifndef XAOD_STANDALONE // AthAnalysis or full Athena
77 
78 // NOTE: Nested ifndef
79 #ifndef XAOD_ANALYSIS // Full Athena only sub-part
80 
82 {
83  return dynamic_cast<const HLT::NavigationCore*>(cgm()->navigation());
84 }
85 
86 #else // AthAnalysis only sub-part
87 
89 {
90  return dynamic_cast<const HLT::TrigNavStructure*>(cgm()->navigation());
91 }
92 
93 #endif // NOTE: End of nested ifndef
94 
95 #else // AnalysisBase
96 
98 {
99  return cgm()->navigation();
100 }
101 
102 #endif
103 
104 
106 
107  const SG::ReadHandleKey<xAOD::TrigDecision>* trigDecRH = cgm()->xAODTrigDecisionKey();
108  if (trigDecRH && !trigDecRH->empty()) {
110  if(!trigDec.isValid()) {
111  ATH_MSG_DEBUG("TDT has not been able to retrieve xTrigDecision");
112  } else {
113  return trigDec->efTruncated();
114  }
115  }
116 
117 #ifndef XAOD_ANALYSIS // Full Athena only
118  SG::ReadHandle<HLT::HLTResult> hltResult("HLTResult_HLT");
119  if(!hltResult.isValid()) {
120  ATH_MSG_WARNING("TDT has not ben able to get HLTResult_HLT");
121  return false;
122  }
123  return hltResult->isHLTResultTruncated();
124 #else // AnalysisBase or AthAnalysis
125  ATH_MSG_ERROR("isHLTTruncated only supported with a xAOD::TrigDecision ReadHandle (Runs 2,3) or in full Athena (Run 2)");
126  return false;
127 #endif
128 
129 }
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigDecision.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
Trig::CacheGlobalMemory
Definition: CacheGlobalMemory.h:67
ExpertMethods.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
HLTResult.h
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
HLT::TrigNavStructure
Definition: TrigNavStructure.h:40
TDTUtilities.h
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
HLT::NavigationCore
The NavigationCore class, adds on top of the TrigNavStructure the EDM read-only handling.
Definition: NavigationCore.h:96
Trig::ExpertMethods::getChainConfigurationDetails
const TrigConf::HLTChain * getChainConfigurationDetails(const std::string &chain) const
return TrigConf::HLTChain
Definition: ExpertMethods.cxx:53
LVL1CTP::Lvl1Item
Definition: Lvl1Item.h:37
Trig::ExpertMethods::cgm
const Trig::CacheGlobalMemory * cgm(bool onlyConfig=false) const
Definition: ExpertMethods.cxx:67
SG::SlotSpecificObj< Trig::CacheGlobalMemory >
CacheGlobalMemory.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HLT::HLTResult::isHLTResultTruncated
bool isHLTResultTruncated() const
is serialized HLTResult truncated
Definition: HLTResult.h:248
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HLTSignature.h
Logger.h
Trig::ExpertMethods::getNavigation
const HLT::NavigationCore * getNavigation() const
return HLT::NavigationCore
Definition: ExpertMethods.cxx:81
Chain.h
HLT::Chain
Definition: Chain.h:64
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trig::ExpertMethods::~ExpertMethods
virtual ~ExpertMethods()
Definition: ExpertMethods.cxx:44
ReadHandle.h
Handle class for reading from StoreGate.
Trig::ExpertMethods::getItemDetails
const LVL1CTP::Lvl1Item * getItemDetails(const std::string &chain) const
return LVL1CTP::Lvl1Item
Definition: ExpertMethods.cxx:63
HLTTriggerElement.h
xAOD::TrigDecision_v1::efTruncated
bool efTruncated() const
Is the EF result truncated?
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trig::ExpertMethods::isHLTTruncated
bool isHLTTruncated() const
Returns true if HLT result is truncated.
Definition: ExpertMethods.cxx:105
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
Trig::ExpertMethods::getItemConfigurationDetails
const TrigConf::TriggerItem * getItemConfigurationDetails(const std::string &chain) const
return TrigConf::TriggerItem
Definition: ExpertMethods.cxx:47
AccessProxy.h
Trig::ExpertMethods::getChainDetails
const HLT::Chain * getChainDetails(const std::string &chain) const
return HLT::Chain
Definition: ExpertMethods.cxx:59
Trig::ExpertMethods::ExpertMethods
ExpertMethods(SG::SlotSpecificObj< Trig::CacheGlobalMemory > *m_cacheGlobalMemory)
Definition: ExpertMethods.cxx:39
TrigConf::TriggerItem
Definition: TriggerItem.h:25