Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 > &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 > &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

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
 
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 217 of file TruthParentDecoratorAlg.cxx.

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

Member Function Documentation

◆ addTruthContainer()

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

Definition at line 447 of file TruthParentDecoratorAlg.cxx.

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

◆ 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 > &  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 > &  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 > &  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 > &  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 > &  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 271 of file TruthParentDecoratorAlg.cxx.

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

◆ 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 426 of file TruthParentDecoratorAlg.cxx.

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

◆ initialize()

StatusCode TruthParentDecoratorAlg::initialize ( )
overridevirtual

Definition at line 232 of file TruthParentDecoratorAlg.cxx.

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

◆ 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_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:16
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:447
MatchedParent::deltaR
float deltaR
Definition: TruthParentDecoratorAlg.cxx:17
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
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:460
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
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:210
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
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
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
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:18
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:140
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:77
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
MatchedParent
Definition: TruthParentDecoratorAlg.cxx:14
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:364
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:798
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:196
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:15
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
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
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