ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
L1DataConsistencyChecker Class Reference

Checks the consistency between CTP active items and L1 RoIs (TOBs) received from RoIB/readout. More...

#include <L1DataConsistencyChecker.h>

Inheritance diagram for L1DataConsistencyChecker:
Collaboration diagram for L1DataConsistencyChecker:

Public Member Functions

 L1DataConsistencyChecker (const std::string &type, const std::string &name, const IInterface *parent)
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

IStateful transition implementations

using MultiplicityInfo = std::unordered_map< TrigCompositeUtils::DecisionID, unsigned int >
 
SG::ReadHandleKey< TrigConf::HLTMenum_hltMenuKey
 
SG::ReadHandleKey< TrigConf::L1Menum_l1MenuKey
 
ToolHandle< GenericMonitoringToolm_monTool
 
Gaudi::Property< bool > m_errorOnMissingTOB
 
Gaudi::Property< std::map< std::string, std::string > > m_thresholdToDecisionMap
 
Gaudi::Property< std::vector< std::string > > m_excludedThresholdTypes
 
std::unordered_map< TrigCompositeUtils::DecisionID, MultiplicityInfom_thresholdMap
 
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdNames
 
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdTypes
 
std::set< TrigCompositeUtils::DecisionIDm_monitoredThresholds
 
virtual StatusCode initialize () override
 
virtual StatusCode start () override
 
StatusCode consistencyCheck (const HLT::IDVec &l1SeededChains, const EventContext &ctx) const
 Perform the check and fill the corresponding histograms. More...
 
bool doDebug () const
 Shorter alias for a check whether we are in DEBUG logging mode. More...
 

Detailed Description

Checks the consistency between CTP active items and L1 RoIs (TOBs) received from RoIB/readout.

Definition at line 22 of file L1DataConsistencyChecker.h.

Member Typedef Documentation

◆ MultiplicityInfo

using L1DataConsistencyChecker::MultiplicityInfo = std::unordered_map<TrigCompositeUtils::DecisionID, unsigned int>
private

Definition at line 61 of file L1DataConsistencyChecker.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1DataConsistencyChecker()

L1DataConsistencyChecker::L1DataConsistencyChecker ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)
inline

Definition at line 24 of file L1DataConsistencyChecker.h.

25  : AthAlgTool(type, name, parent) {}

Member Function Documentation

◆ consistencyCheck()

StatusCode L1DataConsistencyChecker::consistencyCheck ( const HLT::IDVec l1SeededChains,
const EventContext &  ctx 
) const

Perform the check and fill the corresponding histograms.

Counter for debug printouts

Definition at line 84 of file L1DataConsistencyChecker.cxx.

84  {
85  auto monTimer = Monitored::Timer<std::chrono::duration<float, std::milli>>("TIME_consistencyCheck");
86  StatusCode sc = StatusCode::SUCCESS;
87 
88  // ---------------------------------------------------------------------------
89  // Get information from TOBs
90  // ---------------------------------------------------------------------------
91  std::ostringstream ssPassedThresholds; // ss for debug printouts, allocate before loop
92  std::unordered_map<TrigCompositeUtils::DecisionID, size_t> tobThresholdCounts; // {thrName hash, nTOBs passing thr}
93  std::unordered_set<std::string> overflowThresholdTypes; // threshold types for which overflow was detected
94  // Loop over threshold types
95  for (const auto& [thrType, decisionsKey] : m_thresholdToDecisionMap.value()) {
97  if (!decisions.isValid()) {
98  ATH_MSG_DEBUG("No DecisionContainer " << decisionsKey << " for threshold type " << thrType << " found in this event");
99  continue;
100  }
101  size_t idec{0};
102  // Loop over TOBs of the given threshold type (one decision = one TOB)
103  for (const TrigCompositeUtils::Decision* d : *decisions) {
104  std::vector<TrigCompositeUtils::DecisionID> passedThresholdIDs;
105  const bool hasDetail = d->getDetail("thresholds", passedThresholdIDs);
106  if (!hasDetail) {
107  ATH_MSG_ERROR("Detail \"thresholds\" missing from Decision in the container " << decisionsKey);
108  return StatusCode::FAILURE;
109  }
110  bool overflow{false};
111  if (d->hasDetail<char>("overflow")) {
112  overflow = static_cast<bool>(d->getDetail<char>("overflow"));
113  }
114  if (doDebug()) {ssPassedThresholds.str("");}
115  for (const TrigCompositeUtils::DecisionID thrNameHash : passedThresholdIDs) {
116  if (overflow) {
117  overflowThresholdTypes.insert(m_thresholdTypes.at(thrNameHash));
118  }
119  if (tobThresholdCounts.find(thrNameHash)==tobThresholdCounts.end()) {
120  tobThresholdCounts[thrNameHash] = 1;
121  }
122  else {
123  tobThresholdCounts[thrNameHash] += 1;
124  }
125  if (doDebug()) {
126  if (!ssPassedThresholds.str().empty()) ssPassedThresholds << ", ";
127  ssPassedThresholds << m_thresholdNames.at(thrNameHash);
128  }
129  }
130  if (doDebug()) {
131  namespace RoIDefs = HLTSeedingRoIToolDefs;
132  std::optional<RoIDefs::AnyRoIPointer> optTob = RoIDefs::roiFromLink(*d, TrigCompositeUtils::initialRecRoIString());
133  if (optTob.has_value()) {
134  const RoIDefs::AnyRoIPointer& tob = optTob.value();
135  ATH_MSG_DEBUG("Decision " << decisionsKey << "[" << idec << "] corresponds to TOB with word / et / eta / phi = 0x"
136  << MSG::hex << RoIDefs::roiWord(tob) << MSG::dec << " / " << RoIDefs::roiTobEt(tob)
137  << " / " << RoIDefs::roiEta(tob) << " / " << RoIDefs::roiPhi(tob));
138  } else {
139  ATH_MSG_DEBUG("Decision " << decisionsKey << "[" << idec << "] TOB type not supported by template code for "
140  << "debug printout of word / et / eta / phi");
141  }
142  ATH_MSG_DEBUG("Decision " << decisionsKey << "[" << idec << "] TOB passes " << passedThresholdIDs.size()
143  << " thresholds: " << ssPassedThresholds.str());
144  ++idec;
145  }
146  }
147  }
148 
149  // ---------------------------------------------------------------------------
150  // Get information from CTP
151  // ---------------------------------------------------------------------------
152  std::unordered_map<TrigCompositeUtils::DecisionID, size_t> ctpThresholdCounts; // {thrName hash, max CTP multiplicity}
153  // Loop over HLT chains activated by CTP
154  for (const TrigCompositeUtils::DecisionID chainID : l1SeededChains) {
155  const auto it = m_thresholdMap.find(chainID);
156  if (it==m_thresholdMap.end()) {
157  ATH_MSG_DEBUG("Cannot monitor chain " << chainID << " -> " << HLT::Identifier(chainID).name() << ", skipping");
158  continue;
159  }
160  const MultiplicityInfo& thresholds = it->second;
161  // Loop over all thresholds required to activate this chain
162  for (const auto& [thrNameHash, multiplicity] : thresholds) {
163  if (ctpThresholdCounts.find(thrNameHash)==ctpThresholdCounts.end()) {
164  ctpThresholdCounts[thrNameHash] = multiplicity;
165  }
166  else if (multiplicity > ctpThresholdCounts[thrNameHash]) {
167  ctpThresholdCounts[thrNameHash] = multiplicity;
168  }
169  }
170  }
171 
172  // ---------------------------------------------------------------------------
173  // Perform the consistency check
174  // ---------------------------------------------------------------------------
175  for (const auto& [thrNameHash, ctpCount] : ctpThresholdCounts) {
176  size_t tobCount{0};
177  bool tooFew{false};
178  const auto it = m_thresholdNames.find(thrNameHash);
179  if (it==m_thresholdNames.end()) {
180  ATH_MSG_ERROR("Threshold with hash " << thrNameHash << " not found in the hash->name map");
181  return StatusCode::FAILURE;
182  }
183  const std::string& thrName = it->second;
184  const std::string& thrType = m_thresholdTypes.at(thrNameHash);
185 
186  // Check if overflow was detected
187  bool overflow{overflowThresholdTypes.find(thrType)!=overflowThresholdTypes.end()};
188  if (overflow) {
189  ATH_MSG_DEBUG("Threshold " << thrName << " accepted by the CTP with multiplicity " << ctpCount
190  << " is flagged as overflow and thus may be missing TOBs");
191  }
192 
193  // True if no TOBs found for this threshold but CTP accepted
194  bool missing = (tobThresholdCounts.find(thrNameHash)==tobThresholdCounts.end());
195 
196  if (missing) {
197  if (overflow || !m_errorOnMissingTOB) {
198  ATH_MSG_WARNING("No TOBs found passing the threshold " << thrName
199  << " accepted by the CTP with multiplicity " << ctpCount
200  << (overflow ? ", likely due to overflow" : ""));
201 
202  } else {
203  ATH_MSG_ERROR("No TOBs found passing the threshold " << thrName
204  << " accepted by the CTP with multiplicity " << ctpCount);
205  sc = StatusCode::FAILURE;
206  }
207  }
208  else {
209  tobCount = tobThresholdCounts.at(thrNameHash);
210  // True if fewer TOBs found for this threshold than the multiplicity accepted by CTP
211  tooFew = (tobCount < ctpCount);
212  }
213 
214  if (tooFew) {
215  if (overflow || !m_errorOnMissingTOB) {
216  ATH_MSG_WARNING("Too few (" << tobCount << ") TOBs found passing the threshold " << thrName
217  << " accepted by the CTP with multiplicity " << ctpCount
218  << (overflow ? ", likely due to overflow" : ""));
219  } else {
220  ATH_MSG_ERROR("Too few (" << tobCount << ") TOBs found passing the threshold " << thrName
221  << " accepted by the CTP with multiplicity " << ctpCount);
222  sc = StatusCode::FAILURE;
223  }
224  }
225 
226  if (missing || tooFew) {
227  // Fill the histograms
228  Monitored::Scalar monMissingTOBsIncludingOverflow{"MissingTOBsIncludingOverflow", thrName};
229  if (overflow) {
230  Monitored::Group{m_monTool, monMissingTOBsIncludingOverflow};
231  }
232  else {
233  Monitored::Scalar monMissingTOBs{"MissingTOBs", thrName};
234  Monitored::Group{m_monTool, monMissingTOBs, monMissingTOBsIncludingOverflow};
235  }
236  }
237  else {
238  ATH_MSG_DEBUG("Check passed. Found " << tobCount << " TOBs passing the threshold " << thrName
239  << " accepted by the CTP with multiplicity " << ctpCount);
240  }
241  }
242 
243  // Fill extra histograms for debugging
244  for (const TrigCompositeUtils::DecisionID thrNameHash : m_monitoredThresholds) {
245  const auto ctpIt = ctpThresholdCounts.find(thrNameHash);
246  size_t ctpCount = (ctpIt==ctpThresholdCounts.cend()) ? 0 : ctpIt->second;
247  const auto tobIt = tobThresholdCounts.find(thrNameHash);
248  size_t tobCount = (tobIt==tobThresholdCounts.cend()) ? 0 : tobIt->second;
249  int tobMinusCtpCount = static_cast<int>(ctpCount) - static_cast<int>(tobCount); // negative when TOBs are missing
250  const std::string& thrName = m_thresholdNames.at(thrNameHash);
251 
252  Monitored::Scalar monThrName{"ThrName", thrName};
253  Monitored::Scalar monCtpCount{"CtpCount", ctpCount};
254  Monitored::Scalar monTobCount{"TobCount", tobCount};
255  Monitored::Scalar monTobMinusCtpCount{"TobMinusCtpCount", tobMinusCtpCount};
256  Monitored::Group{m_monTool, monThrName, monCtpCount, monTobCount, monTobMinusCtpCount};
257  }
258 
259  Monitored::Group(m_monTool, monTimer);
260  return sc;
261 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ doDebug()

bool L1DataConsistencyChecker::doDebug ( ) const
inlineprivate

Shorter alias for a check whether we are in DEBUG logging mode.

Definition at line 68 of file L1DataConsistencyChecker.h.

68 {return ATH_UNLIKELY(msgLevel(MSG::DEBUG));}

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode L1DataConsistencyChecker::initialize ( )
overridevirtual

Definition at line 26 of file L1DataConsistencyChecker.cxx.

26  {
29  if (!m_monTool.empty()) {
30  ATH_CHECK(m_monTool.retrieve());
31  }
32  return StatusCode::SUCCESS;
33 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ start()

StatusCode L1DataConsistencyChecker::start ( )
overridevirtual

Definition at line 36 of file L1DataConsistencyChecker.cxx.

36  {
38  ATH_CHECK(l1Menu.isValid());
40  ATH_CHECK(hltMenu.isValid());
41 
42  TrigConf::LogicParser logicParser;
43 
44  m_thresholdMap.clear();
45  m_thresholdNames.clear();
46  m_thresholdTypes.clear();
47  m_monitoredThresholds.clear();
48 
49  for (const TrigConf::Chain& chain : *hltMenu) {
50  try {
51  // For chains with multiple seeds, we cannot determine in this tool which seed passed and which didn't,
52  // so we need to skip these kinds of chains
53  if (chain.l1item().empty() || chain.l1item().find(',')!=std::string::npos) {continue;}
54 
55  TrigConf::L1Item item = l1Menu->item(chain.l1item());
56  std::map<std::string,unsigned int> thresholds = logicParser.parse(item.definition())->elementsCount();
57  for (const auto& [thrName, multiplicity] : thresholds) {
58  const TrigConf::L1Threshold& thr = l1Menu->threshold(thrName);
59  // Skip thresholds for which there are no TOBs, e.g. randoms
60  if (vectorContains(m_excludedThresholdTypes.value(), thr.type())) {
61  continue;
62  }
64  m_thresholdMap[chain.namehash()].insert({thrNameHash, multiplicity});
65  m_monitoredThresholds.insert(thrNameHash);
66  }
67  }
68  catch (const std::exception& ex) {
69  ATH_MSG_ERROR("Exception caught while parsing L1 thresholds for chain " << chain.name() << ": " << ex.what());
70  return StatusCode::FAILURE;
71  }
72  }
73 
74  for (const std::shared_ptr<TrigConf::L1Threshold>& thr : l1Menu->thresholds()) {
76  m_thresholdNames[thrNameHash] = thr->name();
77  m_thresholdTypes[thrNameHash] = thr->type();
78  }
79 
80  return StatusCode::SUCCESS;
81 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_errorOnMissingTOB

Gaudi::Property<bool> L1DataConsistencyChecker::m_errorOnMissingTOB
private
Initial value:
{
this, "ErrorOnMissingTOB", true, "Set to true to enable strict-mode which will generate an ERROR on missing (non-overflow) TOB events in HLT-seeding from L1"}

Definition at line 45 of file L1DataConsistencyChecker.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_excludedThresholdTypes

Gaudi::Property<std::vector<std::string> > L1DataConsistencyChecker::m_excludedThresholdTypes
private
Initial value:
{
this, "ExcludedThresholdTypes", {
"internal",
"TOPO", "R2TOPO", "ZBTopo", "LArSaturation",
"TE", "XE", "XS", "jTE", "jXE", "gTE", "gXE",
"ALFA", "BCM", "BCMCMB", "BPTX", "CALREQ", "LUCID", "MBTS", "MBTSSI", "NIM", "ZDC", "NSWMon"
},
"L1 threshold types which are not subject to the consistency check "
"(because either there are no corresponding TOBs or HLT doesn't use them)"}

Definition at line 51 of file L1DataConsistencyChecker.h.

◆ m_hltMenuKey

SG::ReadHandleKey<TrigConf::HLTMenu> L1DataConsistencyChecker::m_hltMenuKey
private
Initial value:
{
this, "HLTMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"}

Definition at line 37 of file L1DataConsistencyChecker.h.

◆ m_l1MenuKey

SG::ReadHandleKey<TrigConf::L1Menu> L1DataConsistencyChecker::m_l1MenuKey
private
Initial value:
{
this, "L1Menu", "DetectorStore+L1TriggerMenu", "L1 Menu"}

Definition at line 39 of file L1DataConsistencyChecker.h.

◆ m_monitoredThresholds

std::set<TrigCompositeUtils::DecisionID> L1DataConsistencyChecker::m_monitoredThresholds
private

Definition at line 65 of file L1DataConsistencyChecker.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> L1DataConsistencyChecker::m_monTool
private
Initial value:
{
this, "MonTool", "", "Monitoring tool"}

Definition at line 42 of file L1DataConsistencyChecker.h.

◆ m_thresholdMap

std::unordered_map<TrigCompositeUtils::DecisionID, MultiplicityInfo> L1DataConsistencyChecker::m_thresholdMap
private

Definition at line 62 of file L1DataConsistencyChecker.h.

◆ m_thresholdNames

std::unordered_map<TrigCompositeUtils::DecisionID, std::string> L1DataConsistencyChecker::m_thresholdNames
private

Definition at line 63 of file L1DataConsistencyChecker.h.

◆ m_thresholdToDecisionMap

Gaudi::Property<std::map<std::string,std::string> > L1DataConsistencyChecker::m_thresholdToDecisionMap
private
Initial value:
{
this, "ThresholdToDecisionMap", {}, "Map between L1 threshold type and the corresponding DecisionContainer name"}

Definition at line 48 of file L1DataConsistencyChecker.h.

◆ m_thresholdTypes

std::unordered_map<TrigCompositeUtils::DecisionID, std::string> L1DataConsistencyChecker::m_thresholdTypes
private

Definition at line 64 of file L1DataConsistencyChecker.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
L1DataConsistencyChecker::m_thresholdNames
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdNames
Definition: L1DataConsistencyChecker.h:63
L1DataConsistencyChecker::m_hltMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_hltMenuKey
Definition: L1DataConsistencyChecker.h:37
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
HLTSeedingRoIToolDefs::AnyRoIPointer
std::variant< const eFexEM::T_RoI *, const eFexTau::T_RoI *, const jFexFwdEl::T_RoI *, const jFexTau::T_RoI *, const jFexSRJet::T_RoI *, const jFexLRJet::T_RoI *, const gFexSRJet::T_RoI *, const Muon::T_RoI * > AnyRoIPointer
std::variant of const ptr to RoI types. Note identical types are only entered once in the template (e...
Definition: HLTSeedingRoIToolDefs.h:144
HLTSeedingRoIToolDefs::roiPhi
constexpr float roiPhi(const AnyRoIPointer &roi)
Definition: HLTSeedingRoIToolDefs.h:167
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Monitored::Group
Group of local monitoring quantities and retain correlation when filling histograms
Definition: MonitoredGroup.h:54
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
L1DataConsistencyChecker::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: L1DataConsistencyChecker.h:42
TrigCompositeUtils::initialRecRoIString
const std::string & initialRecRoIString()
Definition: TrigCompositeUtilsRoot.cxx:874
xAOD::roiEta
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber roiEta
Definition: L2StandAloneMuon_v2.cxx:343
ATH_UNLIKELY
#define ATH_UNLIKELY(x)
Definition: AthUnlikelyMacros.h:17
TrigConf::L1Threshold::type
const std::string & type() const
Accessor to the threshold type.
Definition: L1ThresholdBase.h:157
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TrigConf::DataStructure::name
virtual const std::string & name() const final
Definition: DataStructure.cxx:109
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
L1DataConsistencyChecker::m_thresholdTypes
std::unordered_map< TrigCompositeUtils::DecisionID, std::string > m_thresholdTypes
Definition: L1DataConsistencyChecker.h:64
L1DataConsistencyChecker::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: L1DataConsistencyChecker.h:39
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
L1DataConsistencyChecker::m_errorOnMissingTOB
Gaudi::Property< bool > m_errorOnMissingTOB
Definition: L1DataConsistencyChecker.h:45
L1DataConsistencyChecker::m_thresholdMap
std::unordered_map< TrigCompositeUtils::DecisionID, MultiplicityInfo > m_thresholdMap
Definition: L1DataConsistencyChecker.h:62
L1DataConsistencyChecker::m_thresholdToDecisionMap
Gaudi::Property< std::map< std::string, std::string > > m_thresholdToDecisionMap
Definition: L1DataConsistencyChecker.h:48
Atlas::ExtendedEventContext
Definition: ExtendedEventContext.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
calibdata.exception
exception
Definition: calibdata.py:496
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigConf::L1Item
L1 threshold configuration.
Definition: L1Item.h:18
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1DataConsistencyChecker::MultiplicityInfo
std::unordered_map< TrigCompositeUtils::DecisionID, unsigned int > MultiplicityInfo
Definition: L1DataConsistencyChecker.h:61
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:81
HLTSeedingRoIToolDefs::roiFromLink
std::optional< AnyRoIPointer > roiFromLink(const xAOD::TrigComposite &tc, const std::string &linkName)
Recursively try each type from AnyRoIPointer variant to retrieve an object from a TrigComposite link.
Definition: HLTSeedingRoIToolDefs.h:154
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
L1DataConsistencyChecker::doDebug
bool doDebug() const
Shorter alias for a check whether we are in DEBUG logging mode.
Definition: L1DataConsistencyChecker.h:68
item
Definition: ItemListSvc.h:43
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
L1DataConsistencyChecker::m_excludedThresholdTypes
Gaudi::Property< std::vector< std::string > > m_excludedThresholdTypes
Definition: L1DataConsistencyChecker.h:51
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
HLTSeedingRoIToolDefs::roiTobEt
constexpr unsigned int roiTobEt(const AnyRoIPointer &roi)
Definition: HLTSeedingRoIToolDefs.h:206
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
L1DataConsistencyChecker::m_monitoredThresholds
std::set< TrigCompositeUtils::DecisionID > m_monitoredThresholds
Definition: L1DataConsistencyChecker.h:65
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigConf::Chain
HLT chain configuration.
Definition: TrigConfData/TrigConfData/HLTChain.h:18
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
HLTSeedingRoIToolDefs
Definition: HLTSeedingRoIToolDefs.cxx:7
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
TrigConf::L1Threshold
Standard L1 threshold configuration.
Definition: L1ThresholdBase.h:125
fitman.k
k
Definition: fitman.py:528