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

#include <TruthParentDecoratorAlg.h>

Inheritance diagram for TruthParentDecoratorAlg:
Collaboration diagram for TruthParentDecoratorAlg:

Public Types

using Barcodex = std::map< int, std::set< int > >
 
using IPMap = std::map< int, std::set< const xAOD::TruthParticle * > >
 
using JC = xAOD::IParticleContainer
 
using J = xAOD::IParticle
 
using TPC = xAOD::TruthParticleContainer
 
using JL = ElementLink< JC >
 

Public Member Functions

 TruthParentDecoratorAlg (const std::string &name, ISvcLocator *loc)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &) const override
 
virtual StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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 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, V, H > &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

using cascade_counter_property_t = std::map< std::string, std::vector< int > >
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

Private Attributes

SG::ReadHandleKey< JCm_target_container_key
 
Gaudi::Property< std::string > m_prefix
 
Gaudi::Property< std::vector< int > > m_parent_pdgids
 
Gaudi::Property< std::vector< int > > m_cascade_pdgids
 
Gaudi::Property< bool > m_add_b
 
Gaudi::Property< bool > m_add_c
 
Gaudi::Property< bool > m_veto_soft_lepton
 
Gaudi::Property< bool > m_veto_soft_charm
 
Gaudi::Property< float > m_match_delta_r
 
SG::ReadHandleKey< TPCm_parents_key
 
SG::ReadHandleKeyArray< TPCm_cascades_key
 
SG::WriteDecorHandleKey< JCm_target_pdgid_key
 
SG::WriteDecorHandleKey< JCm_target_dr_truth_key
 
SG::WriteDecorHandleKey< JCm_target_link_key
 
SG::WriteDecorHandleKey< JCm_target_index_key
 
SG::WriteDecorHandleKey< JCm_target_n_matched_key
 
SG::WriteDecorHandleKey< JCm_target_match_mask_key
 
SG::WriteDecorHandleKey< JCm_match_pdgid_key
 
SG::WriteDecorHandleKey< JCm_match_children_key
 
SG::WriteDecorHandleKey< JCm_match_link_key
 
Gaudi::Property< cascade_counter_property_tm_counts_matching_cascade
 
SG::WriteDecorHandleKeyArray< JCm_cascade_count_writer_keys
 
std::vector< CascadeCountDecoratorm_cascade_count_decorators
 
Gaudi::Property< std::unordered_set< int > > m_allow_missing_children_pdgids
 
Gaudi::Property< float > m_missing_children_fraction_warning_threshold
 
Gaudi::Property< std::unordered_set< int > > m_warn_missing_children_pdgids
 
std::atomic< unsigned long long > m_missing_n_ignored
 
std::atomic< unsigned long long > m_missing_n_warned
 
std::atomic< unsigned long long > m_total_children
 
Gaudi::Property< bool > m_use_barcode
 
SG::ConstAccessor< int > m_uid {"uid"}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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
 

Detailed Description

Definition at line 31 of file TruthParentDecoratorAlg.h.

Member Typedef Documentation

◆ Barcodex

using TruthParentDecoratorAlg::Barcodex = std::map<int, std::set<int> >

Definition at line 34 of file TruthParentDecoratorAlg.h.

◆ cascade_counter_property_t

using TruthParentDecoratorAlg::cascade_counter_property_t = std::map<std::string,std::vector<int> >
private

Definition at line 45 of file TruthParentDecoratorAlg.h.

◆ IPMap

using TruthParentDecoratorAlg::IPMap = std::map<int, std::set<const xAOD::TruthParticle*> >

Definition at line 35 of file TruthParentDecoratorAlg.h.

◆ J

Definition at line 37 of file TruthParentDecoratorAlg.h.

◆ JC

Definition at line 36 of file TruthParentDecoratorAlg.h.

◆ JL

Definition at line 39 of file TruthParentDecoratorAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

◆ TPC

Definition at line 38 of file TruthParentDecoratorAlg.h.

Constructor & Destructor Documentation

◆ TruthParentDecoratorAlg()

TruthParentDecoratorAlg::TruthParentDecoratorAlg ( const std::string &  name,
ISvcLocator *  loc 
)

Definition at line 218 of file TruthParentDecoratorAlg.cxx.

218  :
220 {
221  // these aren't user configurable
222  declare(m_target_pdgid_key);
223  declare(m_target_dr_truth_key);
224  declare(m_target_link_key);
225  declare(m_target_index_key);
226  declare(m_target_n_matched_key);
227  declare(m_target_match_mask_key);
228  declare(m_match_pdgid_key);
229  declare(m_match_children_key);
230  declare(m_match_link_key);
231 }

Member Function Documentation

◆ addTruthContainer()

void TruthParentDecoratorAlg::addTruthContainer ( Barcodex barcodex,
IPMap ipmap,
const TPC container 
) const
private

Definition at line 452 of file TruthParentDecoratorAlg.cxx.

452  {
453 
454  std::set<int> targid(m_cascade_pdgids.begin(), m_cascade_pdgids.end());
455  // we allow decays through any of the parent pdgids
456  targid.insert(m_parent_pdgids.begin(), m_parent_pdgids.end());
457 
458  // this determines if a cascade vertex should be saved or not
459  auto cascadeWants = [
460  &targid,
461  b=m_add_b,
462  c=m_add_c,
463  vsl=m_veto_soft_lepton,
465  ] (const xAOD::TruthParticle* p) {
466  if (int n_parents = p->nParents(); n_parents == 1) {
467  if (vsl && isSoftLepton(p)) return false;
468  if (vsc && isSoftCharm(p)) return false;
469  }
470  if (targid.contains(p->pdgId())) return true;
471  if (b && p->hasBottom()) return true;
472  if (c && p->hasCharm()) return true;
473  return false;
474  };
475 
476  // insert a particle into the record, return the child set
477  // ATLASRECTS-8290: this should be replaced with ->uid()
478  auto insert = [this, &barcodex, &ipmap](const auto* p) -> auto& {
479  ipmap[m_uid(*p)].insert(p);
480  return barcodex[m_uid(*p)];
481  };
482 
483  for (const xAOD::TruthParticle* p: container) {
484  if (cascadeWants(p)) {
485  auto& child_set = insert(p);
486  for (unsigned int child_n = 0; child_n < p->nChildren(); child_n++) {
487  const xAOD::TruthParticle* c = p->child(child_n);
488 
489  // Unfortunately the truth record is often broken in various
490  // ways. There are a few configurable ways to deal with
491  // this. We keep track of the total number and how often we
492  // use these workarounds to make sure things don't go too
493  // crazy.
495  const auto& ok_missing = m_allow_missing_children_pdgids.value();
496  if (!c) {
497  if(ok_missing.contains(p->pdgId())) {
499  } else {
500  auto problem = std::format(
501  "null truth child [barcode={},pdg_id={},child={}of{}]",
502  // ATLASRECTS-8290: m_uid should be replaced with ->uid()
503  m_uid(*p), p->pdgId(), child_n, p->nChildren());
504  const auto& warn_missing = m_warn_missing_children_pdgids.value();
505  if (warn_missing.contains(p->pdgId())) {
507  ATH_MSG_WARNING(problem);
508  } else {
509  throw std::runtime_error(problem);
510  }
511  }
512  } else if (cascadeWants(c)) {
513  insert(c);
514  // ATLASRECTS-8290: m_uid should be replaced with ->uid()
515  child_set.insert(m_uid(*c));
516  }
517  };
518  }
519  }
520 }

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::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; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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; }

◆ execute()

StatusCode TruthParentDecoratorAlg::execute ( const EventContext &  cxt) const
overridevirtual

Definition at line 275 of file TruthParentDecoratorAlg.cxx.

276 {
277  ATH_MSG_DEBUG("Executing");
278 
280  // part 1: read in the particles
283 
284  using uc_t = unsigned char;
294 
295  if (targets->empty()) return StatusCode::SUCCESS;
296 
297  // read in and sort the parent collection
298  SG::ReadHandle<TPC> phandle(m_parents_key, cxt);
299  std::set<int> parentids(m_parent_pdgids.begin(), m_parent_pdgids.end());
300  std::vector<const xAOD::TruthParticle*> psort;
301  for (const xAOD::TruthParticle* p: *phandle) {
302  if (!parentids.contains(p->pdgId())) continue;
303  if (!isOriginal(p)) continue;
304  psort.push_back(p);
305  }
306  // for lack of a better idea, store truth parents sorted by mass
307  std::sort(psort.begin(), psort.end(),[](const auto* p1, const auto* p2) {return p1->m() > p2->m();});
308  // check to make sure we don't overflow the match mask
309  constexpr size_t max_idx = std::numeric_limits<parent_mask_t>::digits;
310  if (psort.size() > max_idx) {
312  "Found too many parent particles to store in parent match mask "
313  "truncating the parent collection [max: " << max_idx << ", "
314  "n: " << psort.size() << "]");
315  psort.resize(max_idx);
316  }
317 
318 
319  std::vector<SG::ReadHandle<TPC>> cascades_raw;
320  for (const auto& key: m_cascades_key) {
321  cascades_raw.emplace_back(key, cxt);
322  }
323  logInputs(msgStream(), targets, phandle, cascades_raw);
324 
326  // part 2: build the barcodex
328  Barcodex barcodex;
329  IPMap ipmap;
330  addTruthContainer(barcodex, ipmap, *phandle);
331  for (auto& cascade: cascades_raw) {
332  addTruthContainer(barcodex, ipmap, *cascade);
333  }
334  logIPMap(msg(), ipmap);
335 
336  ATH_MSG_DEBUG("merged cascade contains " << barcodex.size() << " particles");
337 
339  // Part 3: build map from targets to parents
341  std::unordered_map<const J*, std::vector<MatchedParent>> labeled_targets;
342  unsigned int n_parents = 0;
343  for (const auto* p: psort) {
344  unsigned int parent_index = n_parents++;
345  // ATLASRECTS-8290: this should be replaced with ->uid()
346  ATH_MSG_VERBOSE("pdgid: " << p->pdgId() << ", barcode: " << m_uid(*p));
347  for (auto& [cbar, histbars]: findAllDescendants(m_uid(*p), barcodex)) {
348  IPMap::mapped_type& barkids = ipmap.at(cbar);
349  const xAOD::TruthParticle* child = selectChild(barkids);
350  std::vector<std::pair<float, const J*>> drs;
351  float drsMinDR=9999;
352  const J* drsMinMatch = 0;
353  for (const auto* j: *targets) {
354  if(j->p4().DeltaR(child->p4()) < drsMinDR) {
355  drsMinDR=j->p4().DeltaR(child->p4());
356  drsMinMatch=j;
357  }
358  }
359  if(drsMinMatch){
361  match.parent = p;
362  match.child = child;
363  match.deltaR = drsMinDR;
364  match.parent_index = parent_index;
365  match.cascade_pids.insert(child->pdgId());
366  for (auto& histbar: histbars) {
367  match.cascade_pids.insert(selectChild(ipmap.at(histbar))->pdgId());
368  }
369  if (match.deltaR < m_match_delta_r) {
370  labeled_targets[drsMinMatch].push_back(match);
371  }
372  }
373  }
374  }
375 
377  // Part 4: decorate!
379 
380  for (const J* j: *targets) {
381  if (labeled_targets.contains(j)) {
382  const std::vector<MatchedParent>& matches = labeled_targets.at(j);
383  auto min_dr = [](auto& p1, auto& p2) {
384  return p1.deltaR < p2.deltaR;
385  };
386  const MatchedParent& nearest = *std::min_element(
387  matches.begin(), matches.end(), min_dr);
388  const xAOD::TruthParticle* p = nearest.parent;
389  pdgid(*j) = p->pdgId();
390  deltaR(*j) = nearest.deltaR;
391  auto* container = dynamic_cast<const TPC*>(p->container());
392  link(*j) = JL(*container, p->index());
393  index(*j) = nearest.parent_index;
394  nMatched(*j) = matches.size();
395  mask(*j) = matchMask(matches);
396  const xAOD::TruthParticle* child = nearest.child;
397  matchPdgId(*j) = child->pdgId();
398  matchChildCount(*j) = child->nChildren();
399  auto* matchedContainer = dynamic_cast<const TPC*>(child->container());
400  matchLink(*j) = JL(*matchedContainer, child->index());
401  for (const auto& cascadeCount: m_cascade_count_decorators) {
402  cascadeCount.decorate(*j, matches);
403  }
404  } else {
405  pdgid(*j) = 0;
406  deltaR(*j) = NAN;
407  link(*j) = JL();
408  index(*j) = -1;
409  nMatched(*j) = -1;
410  mask(*j) = 0x0;
411  matchPdgId(*j) = 0;
412  matchChildCount(*j) = 0;
413  matchLink(*j) = JL();
414  for (const auto& cascadeCount: m_cascade_count_decorators) {
415  cascadeCount.decorateDefault(*j);
416  }
417  }
418  }
419 
421  // Part 5: lock decorations
423 
424  for (const auto& dec: m_cascade_count_decorators) {
425  dec.lock(targets.get());
426  }
427 
428  return StatusCode::SUCCESS;
429 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ finalize()

StatusCode TruthParentDecoratorAlg::finalize ( )
overridevirtual

Definition at line 431 of file TruthParentDecoratorAlg.cxx.

431  {
432  if (!m_allow_missing_children_pdgids.empty()) {
433  float missing_fraction = double(m_missing_n_ignored) / m_total_children;
434  auto msg = std::format("ignored {} missing children out of {} ({:.2}%)",m_missing_n_ignored.load(),m_total_children.load(),missing_fraction * 100);
435  if (missing_fraction > m_missing_children_fraction_warning_threshold) {
437  } else {
438  ATH_MSG_INFO(msg);
439  }
440  }
441  if (!m_warn_missing_children_pdgids.empty()) {
442  auto msg = std::format("warned of {} missing children out of {}", m_missing_n_warned.load(), m_total_children.load());
443  if (m_missing_n_warned > 0) {
445  } else {
446  ATH_MSG_INFO(msg);
447  }
448  }
449  return StatusCode::SUCCESS;
450 }

◆ initialize()

StatusCode TruthParentDecoratorAlg::initialize ( )
overridevirtual

Definition at line 233 of file TruthParentDecoratorAlg.cxx.

233  {
234  // initialize inputs
235  ATH_CHECK(m_parents_key.initialize());
236  ATH_CHECK(m_target_container_key.initialize());
237  ATH_CHECK(m_cascades_key.initialize());
238  // weird hack because Gaudi can't handle an infinite default
239  if (m_match_delta_r.value() <= 0) m_match_delta_r.value() = INFINITY;
240  // initialize outputs
241  std::string jc = m_target_container_key.key();
242  std::string pfx = jc + "." + m_prefix.value();
243  m_target_pdgid_key = pfx + "PdgId";
244  m_target_dr_truth_key = pfx + "DRTruthParticle";
245  m_target_link_key = pfx + "Link";
246  m_target_index_key = pfx + "Index";
247  m_target_n_matched_key = pfx + "NMatchedChildren";
248  m_target_match_mask_key = pfx + "ParentsMask";
249  m_match_pdgid_key = pfx + "MatchingParticlePdgId";
250  m_match_children_key = pfx + "MatchingParticleNChildren";
251  m_match_link_key = pfx + "MatchingParticleLink";
252  ATH_CHECK(m_target_pdgid_key.initialize());
253  ATH_CHECK(m_target_dr_truth_key.initialize());
254  ATH_CHECK(m_target_link_key.initialize());
255  ATH_CHECK(m_target_index_key.initialize());
256  ATH_CHECK(m_target_n_matched_key.initialize());
257  ATH_CHECK(m_target_match_mask_key.initialize());
258  ATH_CHECK(m_match_pdgid_key.initialize());
259  ATH_CHECK(m_match_children_key.initialize());
260  ATH_CHECK(m_match_link_key.initialize());
261 
262  for (auto& [key, pids]: m_counts_matching_cascade) {
263  m_cascade_count_writer_keys.emplace_back(jc + "." + key);
264  m_cascade_count_decorators.emplace_back(key, pids);
265  }
266  for (auto& key: m_cascade_count_writer_keys) declare(key);
268 
269  // ATLASRECTS-8290: this should be removed eventually
270  if (m_use_barcode) m_uid = SG::ConstAccessor<int>("barcode");
271 
272  return StatusCode::SUCCESS;
273 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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_add_b

Gaudi::Property<bool> TruthParentDecoratorAlg::m_add_b
private
Initial value:
{
this, "addBsToCascade", false, "add all bhadrons to cascade"
}

Definition at line 59 of file TruthParentDecoratorAlg.h.

◆ m_add_c

Gaudi::Property<bool> TruthParentDecoratorAlg::m_add_c
private
Initial value:
{
this, "addCsToCascade", false, "add all chadrons to cascade"
}

Definition at line 62 of file TruthParentDecoratorAlg.h.

◆ m_allow_missing_children_pdgids

Gaudi::Property<std::unordered_set<int> > TruthParentDecoratorAlg::m_allow_missing_children_pdgids
private
Initial value:
{
this, "allowMissingChildrenPdgIds", {},
"Allow particles matching these PDG IDs to have missing children"
}

Definition at line 101 of file TruthParentDecoratorAlg.h.

◆ m_cascade_count_decorators

std::vector<CascadeCountDecorator> TruthParentDecoratorAlg::m_cascade_count_decorators
private

Definition at line 99 of file TruthParentDecoratorAlg.h.

◆ m_cascade_count_writer_keys

SG::WriteDecorHandleKeyArray<JC> TruthParentDecoratorAlg::m_cascade_count_writer_keys
private

Definition at line 98 of file TruthParentDecoratorAlg.h.

◆ m_cascade_pdgids

Gaudi::Property<std::vector<int> > TruthParentDecoratorAlg::m_cascade_pdgids
private
Initial value:
{
this, "cascadePdgIds", {}, "PDGIDs of particles in the decay chain"
}

Definition at line 56 of file TruthParentDecoratorAlg.h.

◆ m_cascades_key

SG::ReadHandleKeyArray<TPC> TruthParentDecoratorAlg::m_cascades_key
private
Initial value:
{
this, "cascades", {}, "truth hadron container"
}

Definition at line 80 of file TruthParentDecoratorAlg.h.

◆ m_counts_matching_cascade

Gaudi::Property<cascade_counter_property_t> TruthParentDecoratorAlg::m_counts_matching_cascade
private
Initial value:
{
this, "countChildrenInCascadeWithPdgIds", {},
"Create one counter for each entry, named by key. Counts children "
"with at least one overlapping value in the cascade."
}

Definition at line 93 of file TruthParentDecoratorAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_match_children_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_match_children_key
private

Definition at line 90 of file TruthParentDecoratorAlg.h.

◆ m_match_delta_r

Gaudi::Property<float> TruthParentDecoratorAlg::m_match_delta_r
private
Initial value:
{
this, "matchDeltaR", -1,
"width of delta R cone for matching (zero or less -> infinite)"
}

Definition at line 73 of file TruthParentDecoratorAlg.h.

◆ m_match_link_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_match_link_key
private

Definition at line 91 of file TruthParentDecoratorAlg.h.

◆ m_match_pdgid_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_match_pdgid_key
private

Definition at line 89 of file TruthParentDecoratorAlg.h.

◆ m_missing_children_fraction_warning_threshold

Gaudi::Property<float> TruthParentDecoratorAlg::m_missing_children_fraction_warning_threshold
private
Initial value:
{
this, "missingChildrenFractionWarningThreshold", 0.01,
"Turn the missing children info into a warning above this"
}

Definition at line 105 of file TruthParentDecoratorAlg.h.

◆ m_missing_n_ignored

std::atomic<unsigned long long> TruthParentDecoratorAlg::m_missing_n_ignored
mutableprivate

Definition at line 113 of file TruthParentDecoratorAlg.h.

◆ m_missing_n_warned

std::atomic<unsigned long long> TruthParentDecoratorAlg::m_missing_n_warned
mutableprivate

Definition at line 114 of file TruthParentDecoratorAlg.h.

◆ m_parent_pdgids

Gaudi::Property<std::vector<int> > TruthParentDecoratorAlg::m_parent_pdgids
private
Initial value:
{
this, "parentPdgIds", {}, "PDGIDs of allowed parent particles"
}

Definition at line 53 of file TruthParentDecoratorAlg.h.

◆ m_parents_key

SG::ReadHandleKey<TPC> TruthParentDecoratorAlg::m_parents_key
private
Initial value:
{
this, "parents", "", "truth parent container"
}

Definition at line 77 of file TruthParentDecoratorAlg.h.

◆ m_prefix

Gaudi::Property<std::string> TruthParentDecoratorAlg::m_prefix
private
Initial value:
{
this, "decoratorPrefix", "parentBoson", "prefix for decorations"
}

Definition at line 50 of file TruthParentDecoratorAlg.h.

◆ m_target_container_key

SG::ReadHandleKey<JC> TruthParentDecoratorAlg::m_target_container_key
private
Initial value:
{
this, "targetContainer", "", "target container to decorate"
}

Definition at line 47 of file TruthParentDecoratorAlg.h.

◆ m_target_dr_truth_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_dr_truth_key
private

Definition at line 84 of file TruthParentDecoratorAlg.h.

◆ m_target_index_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_index_key
private

Definition at line 86 of file TruthParentDecoratorAlg.h.

◆ m_target_link_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_link_key
private

Definition at line 85 of file TruthParentDecoratorAlg.h.

◆ m_target_match_mask_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_match_mask_key
private

Definition at line 88 of file TruthParentDecoratorAlg.h.

◆ m_target_n_matched_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_n_matched_key
private

Definition at line 87 of file TruthParentDecoratorAlg.h.

◆ m_target_pdgid_key

SG::WriteDecorHandleKey<JC> TruthParentDecoratorAlg::m_target_pdgid_key
private

Definition at line 83 of file TruthParentDecoratorAlg.h.

◆ m_total_children

std::atomic<unsigned long long> TruthParentDecoratorAlg::m_total_children
mutableprivate

Definition at line 115 of file TruthParentDecoratorAlg.h.

◆ m_uid

SG::ConstAccessor<int> TruthParentDecoratorAlg::m_uid {"uid"}
private

Definition at line 121 of file TruthParentDecoratorAlg.h.

◆ m_use_barcode

Gaudi::Property<bool> TruthParentDecoratorAlg::m_use_barcode
private
Initial value:
{
this, "useBarcode", false, "use barcode rather than UID"
}

Definition at line 118 of file TruthParentDecoratorAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_veto_soft_charm

Gaudi::Property<bool> TruthParentDecoratorAlg::m_veto_soft_charm
private
Initial value:
{
this, "vetoSoftCharmCascade", false,
"veto soft charm decays from cascade"
}

Definition at line 69 of file TruthParentDecoratorAlg.h.

◆ m_veto_soft_lepton

Gaudi::Property<bool> TruthParentDecoratorAlg::m_veto_soft_lepton
private
Initial value:
{
this, "vetoSoftLeptonCascade", false,
"veto soft lepton decays from cascade"
}

Definition at line 65 of file TruthParentDecoratorAlg.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_warn_missing_children_pdgids

Gaudi::Property<std::unordered_set<int> > TruthParentDecoratorAlg::m_warn_missing_children_pdgids
private
Initial value:
{
this, "warnMissingChildrenPdgIds", {},
"Warn if particles matching these PDF IDs have missing children"
}

Definition at line 109 of file TruthParentDecoratorAlg.h.


The documentation for this class was generated from the following files:
TruthParentDecoratorAlg::m_parent_pdgids
Gaudi::Property< std::vector< int > > m_parent_pdgids
Definition: TruthParentDecoratorAlg.h:53
TruthParentDecoratorAlg::m_cascades_key
SG::ReadHandleKeyArray< TPC > m_cascades_key
Definition: TruthParentDecoratorAlg.h:80
MatchedParent::child
const xAOD::TruthParticle * child
Definition: TruthParentDecoratorAlg.cxx:17
TruthParentDecoratorAlg::m_veto_soft_lepton
Gaudi::Property< bool > m_veto_soft_lepton
Definition: TruthParentDecoratorAlg.h:65
TruthParentDecoratorAlg::addTruthContainer
void addTruthContainer(Barcodex &, IPMap &, const TPC &) const
Definition: TruthParentDecoratorAlg.cxx:452
MatchedParent::deltaR
float deltaR
Definition: TruthParentDecoratorAlg.cxx:18
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TruthParentDecoratorAlg::JL
ElementLink< JC > JL
Definition: TruthParentDecoratorAlg.h:39
TruthParentDecoratorAlg::m_match_link_key
SG::WriteDecorHandleKey< JC > m_match_link_key
Definition: TruthParentDecoratorAlg.h:91
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TruthParentDecoratorAlg::m_target_container_key
SG::ReadHandleKey< JC > m_target_container_key
Definition: TruthParentDecoratorAlg.h:47
SG::ConstAccessor< int >
TruthParentDecoratorAlg::m_add_b
Gaudi::Property< bool > m_add_b
Definition: TruthParentDecoratorAlg.h:59
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TruthParentDecoratorAlg::TPC
xAOD::TruthParticleContainer TPC
Definition: TruthParentDecoratorAlg.h:38
TruthParentDecoratorAlg::m_cascade_count_decorators
std::vector< CascadeCountDecorator > m_cascade_count_decorators
Definition: TruthParentDecoratorAlg.h:99
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:459
TruthParentDecoratorAlg::m_parents_key
SG::ReadHandleKey< TPC > m_parents_key
Definition: TruthParentDecoratorAlg.h:77
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TruthParentDecoratorAlg::m_target_pdgid_key
SG::WriteDecorHandleKey< JC > m_target_pdgid_key
Definition: TruthParentDecoratorAlg.h:83
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TruthParentDecoratorAlg::m_match_delta_r
Gaudi::Property< float > m_match_delta_r
Definition: TruthParentDecoratorAlg.h:73
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
TruthParentDecoratorAlg::IPMap
std::map< int, std::set< const xAOD::TruthParticle * > > IPMap
Definition: TruthParentDecoratorAlg.h:35
TruthParentDecoratorAlg::m_add_c
Gaudi::Property< bool > m_add_c
Definition: TruthParentDecoratorAlg.h:62
TruthParentDecoratorAlg::m_cascade_pdgids
Gaudi::Property< std::vector< int > > m_cascade_pdgids
Definition: TruthParentDecoratorAlg.h:56
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
TruthParentDecoratorAlg::m_total_children
std::atomic< unsigned long long > m_total_children
Definition: TruthParentDecoratorAlg.h:115
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
TruthParentDecoratorAlg::Barcodex
std::map< int, std::set< int > > Barcodex
Definition: TruthParentDecoratorAlg.h:34
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
rerun_display.pfx
pfx
Definition: rerun_display.py:60
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
TruthParentDecoratorAlg::m_counts_matching_cascade
Gaudi::Property< cascade_counter_property_t > m_counts_matching_cascade
Definition: TruthParentDecoratorAlg.h:93
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
PyAlgorithmExample.min_dr
def min_dr(p, l)
Definition: PyAlgorithmExample.py:57
TruthParentDecoratorAlg::m_match_children_key
SG::WriteDecorHandleKey< JC > m_match_children_key
Definition: TruthParentDecoratorAlg.h:90
TruthParentDecoratorAlg::m_target_n_matched_key
SG::WriteDecorHandleKey< JC > m_target_n_matched_key
Definition: TruthParentDecoratorAlg.h:87
TruthParentDecoratorAlg::m_uid
SG::ConstAccessor< int > m_uid
Definition: TruthParentDecoratorAlg.h:121
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TruthParentDecoratorAlg::m_warn_missing_children_pdgids
Gaudi::Property< std::unordered_set< int > > m_warn_missing_children_pdgids
Definition: TruthParentDecoratorAlg.h:109
TruthParentDecoratorAlg::m_missing_n_ignored
std::atomic< unsigned long long > m_missing_n_ignored
Definition: TruthParentDecoratorAlg.h:113
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TruthParentDecoratorAlg::m_cascade_count_writer_keys
SG::WriteDecorHandleKeyArray< JC > m_cascade_count_writer_keys
Definition: TruthParentDecoratorAlg.h:98
MatchedParent::parent_index
unsigned int parent_index
Definition: TruthParentDecoratorAlg.cxx:19
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
TruthParentDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: TruthParentDecoratorAlg.h:50
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
TruthParentDecoratorAlg::m_missing_children_fraction_warning_threshold
Gaudi::Property< float > m_missing_children_fraction_warning_threshold
Definition: TruthParentDecoratorAlg.h:105
TruthParentDecoratorAlg::m_target_index_key
SG::WriteDecorHandleKey< JC > m_target_index_key
Definition: TruthParentDecoratorAlg.h:86
xAOD::TruthParticle_v1::nChildren
size_t nChildren() const
Number of children of this particle.
Definition: TruthParticle_v1.cxx:135
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
TruthParentDecoratorAlg::m_use_barcode
Gaudi::Property< bool > m_use_barcode
Definition: TruthParentDecoratorAlg.h:118
MatchedParent
Definition: TruthParentDecoratorAlg.cxx:15
TruthParentDecoratorAlg::m_target_dr_truth_key
SG::WriteDecorHandleKey< JC > m_target_dr_truth_key
Definition: TruthParentDecoratorAlg.h:84
DeMoScan.index
string index
Definition: DeMoScan.py:362
a
TList * a
Definition: liststreamerinfos.cxx:10
TruthParentDecoratorAlg::m_veto_soft_charm
Gaudi::Property< bool > m_veto_soft_charm
Definition: TruthParentDecoratorAlg.h:69
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TruthParentDecoratorAlg::m_target_match_mask_key
SG::WriteDecorHandleKey< JC > m_target_match_mask_key
Definition: TruthParentDecoratorAlg.h:88
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TruthParentDecoratorAlg::m_allow_missing_children_pdgids
Gaudi::Property< std::unordered_set< int > > m_allow_missing_children_pdgids
Definition: TruthParentDecoratorAlg.h:101
TruthParentDecoratorAlg::m_target_link_key
SG::WriteDecorHandleKey< JC > m_target_link_key
Definition: TruthParentDecoratorAlg.h:85
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
TruthParentDecoratorAlg::m_match_pdgid_key
SG::WriteDecorHandleKey< JC > m_match_pdgid_key
Definition: TruthParentDecoratorAlg.h:89
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:191
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
MatchedParent::parent
const xAOD::TruthParticle * parent
Definition: TruthParentDecoratorAlg.cxx:16
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
python.compressB64.c
def c
Definition: compressB64.py:93
TruthParentDecoratorAlg::m_missing_n_warned
std::atomic< unsigned long long > m_missing_n_warned
Definition: TruthParentDecoratorAlg.h:114
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TruthParentDecoratorAlg::J
xAOD::IParticle J
Definition: TruthParentDecoratorAlg.h:37