ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
dRMatchingTool Class Referenceabstract

Tool to perform dR-based matching of tracks and truth particles. More...

#include <dRMatchingTool.h>

Inheritance diagram for dRMatchingTool:
Collaboration diagram for dRMatchingTool:

Classes

struct  CacheEntry
 

Public Member Functions

 dRMatchingTool (const std::string &name)
 Constructor(s). More...
 
virtual ~dRMatchingTool ()
 Destructor. More...
 
virtual StatusCode initialize () override
 SelectionTool method(s). More...
 
virtual StatusCode finalize () override
 
virtual const asg::AcceptInfogetAcceptInfo () const override
 Declare the interface ID for this pure-virtual interface class to the Athena framework. More...
 
virtual asg::AcceptData accept (const xAOD::IParticle *p) const override
 The main accept method: the actual cuts are applied here. More...
 
virtual asg::AcceptData acceptLegacy (const xAOD::TrackParticle *p, const xAOD::TruthParticleContainer *truthParticles, bool(*truthSelectionTool)(const xAOD::TruthParticle *)=nullptr) const
 dR-matching specific method(s). More...
 
asg::AcceptData accept (const xAOD::TrackParticle *p, const xAOD::TruthParticleContainer *truthParticles, bool(*truthSelectionTool)(const xAOD::TruthParticle *)=nullptr) const
 
virtual asg::AcceptData acceptLegacy (const xAOD::TruthParticle *p, const xAOD::TrackParticleContainer *trackParticles, bool(*trackSelectionTool)(const xAOD::TrackParticle *)=nullptr) const
 
asg::AcceptData accept (const xAOD::TruthParticle *p, const xAOD::TrackParticleContainer *trackParticles, bool(*trackSelectionTool)(const xAOD::TrackParticle *)=nullptr) const
 
float dRmin () const
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void checkCacheTrackParticles (const xAOD::TrackParticleContainer *trackParticles, CacheEntry *ent, bool(*trackSelectionTool)(const xAOD::TrackParticle *)=nullptr) const
 Internal method(s). More...
 
void checkCacheTruthParticles (const xAOD::TruthParticleContainer *truthParticles, CacheEntry *ent, bool(*truthSelectionTool)(const xAOD::TruthParticle *)=nullptr) const
 
void clearTrackParticles (CacheEntry *ent) const
 
void clearTruthParticles (CacheEntry *ent) const
 
template<class T , class U >
void sortVectors (const T *container, std::vector< const U * > &vec_pt, std::vector< const U * > &vec_eta, std::vector< const U * > &vec_phi, bool(*selectionTool)(const U *)) const
 
template<class U , class V >
bool sortedMatch (const U *p, std::vector< const V * > &vec_pt, std::vector< const V * > &vec_eta, std::vector< const V * > &vec_phi, float &dRmin) const
 
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

 ASG_TOOL_CLASS1 (dRMatchingTool, IAsgSelectionTool)
 
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

asg::AcceptInfo m_accept {"dRMatching"}
 Data member(s). More...
 
std::vector< std::pair< std::string, std::string > > m_cuts
 
std::atomic< ULong64_t > m_numProcessed {0}
 
std::atomic< ULong64_t > m_numPassed {0}
 
std::vector< ULong64_t > m_numPassedCuts ATLAS_THREAD_SAFE
 
std::mutex m_mutex
 
FloatProperty m_dRmax {this, "dRmax", -1.}
 Cut vales. More...
 
FloatProperty m_pTResMax {this, "pTResMax", -1.}
 
SG::SlotSpecificObj< CacheEntry > m_cache ATLAS_THREAD_SAFE
 
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

Tool to perform dR-based matching of tracks and truth particles.

The tool can match both a single track to a set of truth particles, and vice versa. As the tool derives from the general IAsgSelectionTool interface, the actual 'accept' methods has to be invoked using (dynamic) type casting, e.g.

bool dRMatched = (bool) dynamic_cast<dRMatchingTool&>(*m_dRMatchingTool) \ .accept(track, truthParticles, &truthSelectionTool);

to match a track to a subset of truth particle, or

bool dRMatched = (bool) dynamic_cast<dRMatchingTool&>(*m_dRMatchingTool) \ .accept(truth, trackParticles);

to match a truth particle to all tracks. The standard accept(const xAOD::IParticle*) method is disabled.

Optional track- and truth particle selection functions are allowed, to perform the matching to only a subset of the respective containers. If these functions are omitted as arguments, the matching is performed to the all particles in the specified container.

The tool is able to perform matching wrt. dR as well relative pT-resolution, i.e. \Delta p_{T}/p_{T} = \frac{|p_{T,this} - p_{T,other}|}{p_{T,this}} The tool is configured such that a successful match means that all set cuts were passed. That means that if only the dR-cut is set, no pT-resoution cut is imposed, and conversely. In particular, if neither cut is set, no particles pass the matching. The cut values are set in the job option as e.g.

from InDetPhysValMonitoring.InDetPhysValMonitoringConf import \ dRMatchingTool dRMatcher = dRMatchingTool() dRMatcher.dRmax = 0.1 # Disabled: -1 dRMatcher.pTResMax = 0.1 # Disabled: -1 ToolSvc += dRMatcher

The main 'accept' methods are implemented using caching and sorting to avoid O(N^2) complexity from what is essentially nested loops. This speeds up performance drastically, at the cost of transparency. To this end, and for validation purposes, 'acceptLegacy' methods are kept in, which are conceptually simpler and more intuitive, but much slower, than the main methods. However, these legacy methods ought not to be used for actual, even just moderately large runs.

Definition at line 84 of file dRMatchingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ dRMatchingTool()

dRMatchingTool::dRMatchingTool ( const std::string &  name)

Constructor(s).

Definition at line 94 of file dRMatchingTool.cxx.

94  :
96  declareInterface<IAsgSelectionTool>(this);
97 }

◆ ~dRMatchingTool()

dRMatchingTool::~dRMatchingTool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ accept() [1/3]

asg::AcceptData dRMatchingTool::accept ( const xAOD::IParticle ) const
overridevirtual

The main accept method: the actual cuts are applied here.

Implements IAsgSelectionTool.

Definition at line 150 of file dRMatchingTool.cxx.

150  {
151 
153  "accept(...) function called without needed Truth- or TrackParticleContainer. Please use one of the dRMatchingTool-specific accept methods.");
154 
155  return asg::AcceptData (&m_accept);
156 }

◆ accept() [2/3]

asg::AcceptData dRMatchingTool::accept ( const xAOD::TrackParticle p,
const xAOD::TruthParticleContainer truthParticles,
bool(*)(const xAOD::TruthParticle *)  truthSelectionTool = nullptr 
) const

Definition at line 364 of file dRMatchingTool.cxx.

366  {
367  asg::AcceptData acceptData (&m_accept);
368 
369  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_numPassedCuts and m_cache
370  const EventContext& ctx{Gaudi::Hive::currentContext()};
371  CacheEntry* ent{m_cache.get(ctx)};
372  ent->check(ctx.evt());
373 
374  // Determine whether to cache current truth particle container
375  checkCacheTruthParticles(truthParticles, ent, truthSelectionTool);
376 
377  bool passes = sortedMatch<xAOD::TrackParticle,
379  ent->m_truthParticlesSortedPt,
380  ent->m_truthParticlesSortedEta,
381  ent->m_truthParticlesSortedPhi,
382  ent->m_dRmin);
383 
384  // Set cut values.
385  if (m_dRmax > -1) {
386  acceptData.setCutResult("dRmax", passes);
387  }
388  if (m_pTResMax > -1) {
389  acceptData.setCutResult("pTResMax", passes);
390  }
391 
392  // Book keep cuts
393  for (const auto& cut : m_cuts) {
394  unsigned int pos = acceptData.getCutPosition(cut.first);
395  if (acceptData.getCutResult(pos)) {
396  m_numPassedCuts[pos]++;
397  }
398  }
399 
400  m_numProcessed++;
401  if (acceptData) {
402  m_numPassed++;
403  }
404 
405  return acceptData;
406 }

◆ accept() [3/3]

asg::AcceptData dRMatchingTool::accept ( const xAOD::TruthParticle p,
const xAOD::TrackParticleContainer trackParticles,
bool(*)(const xAOD::TrackParticle *)  trackSelectionTool = nullptr 
) const

Definition at line 409 of file dRMatchingTool.cxx.

411  {
412  asg::AcceptData acceptData (&m_accept);
413 
414  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_numPassedCuts and m_cache
415  const EventContext& ctx{Gaudi::Hive::currentContext()};
416  CacheEntry* ent{m_cache.get(ctx)};
417  ent->check(ctx.evt());
418 
419  // Determine whether to cache current track particle container
420  checkCacheTrackParticles(trackParticles, ent, trackSelectionTool);
421 
422  bool passes = sortedMatch<xAOD::TruthParticle,
423  xAOD::TrackParticle>(truth,
424  ent->m_trackParticlesSortedPt,
425  ent->m_trackParticlesSortedEta,
426  ent->m_trackParticlesSortedPhi,
427  ent->m_dRmin);
428 
429  // Set cut values.
430  if (m_dRmax > -1) {
431  acceptData.setCutResult("dRmax", passes);
432  }
433  if (m_pTResMax > -1) {
434  acceptData.setCutResult("pTResMax", passes);
435  }
436 
437  // Book keep cuts
438  for (const auto& cut : m_cuts) {
439  unsigned int pos = acceptData.getCutPosition(cut.first);
440  if (acceptData.getCutResult(pos)) {
441  m_numPassedCuts[pos]++;
442  }
443  }
444 
445  m_numProcessed++;
446  if (acceptData) {
447  m_numPassed++;
448  }
449 
450  return acceptData;
451 }

◆ acceptLegacy() [1/2]

asg::AcceptData dRMatchingTool::acceptLegacy ( const xAOD::TrackParticle p,
const xAOD::TruthParticleContainer truthParticles,
bool(*)(const xAOD::TruthParticle *)  truthSelectionTool = nullptr 
) const
virtual

dR-matching specific method(s).

Definition at line 454 of file dRMatchingTool.cxx.

456  {
457  asg::AcceptData acceptData (&m_accept);
458 
459  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_numPassedCuts and m_cache
460  const EventContext& ctx{Gaudi::Hive::currentContext()};
461  CacheEntry* ent{m_cache.get(ctx)};
462  ent->check(ctx.evt());
463 
464  ent->m_dRmin = 9999.;
465 
466  // Define variables.
467  const unsigned int Ncuts(m_cuts.size());
468  bool passes(false), passesThis(false);
469 
470  // Loop all truth particles.
471  for (const xAOD::TruthParticle* truth : *truthParticles) {
472  // Ignore all truth particles failing the selection.
473  if (truthSelectionTool and !(*truthSelectionTool)(truth)) {
474  continue;
475  }
476 
477  // Compute cut variable values.
478  float dR = comp_deltaR(p, truth);
479  float pTRes = std::fabs(pt(truth) / pt(p) - 1.);
480 
481  // Initialise cut monitoring objects.
482  std::vector<bool> vecPassesThis(Ncuts, false);
483 
484  // Check whether each individual cut passed.
485  unsigned int icut = 0;
486  if (m_dRmax > -1) {
487  vecPassesThis[icut++] = dR < m_dRmax;
488  }
489  if (m_pTResMax > -1) {
490  vecPassesThis[icut++] = pTRes < m_pTResMax;
491  }
492 
493  // Check whether all cuts passed.
494  passesThis = std::all_of(vecPassesThis.begin(),
495  vecPassesThis.end(),
496  [](const bool& v) {
497  return v;
498  });
499  passes |= passesThis;
500 
501  // If the current truth particle was matched, check minimal dR.
502  if (passesThis) {
503  ent->m_dRmin = (dR < ent->m_dRmin ? dR : ent->m_dRmin);
504  }
505  }
506 
507  // Set cut values.
508  if (m_dRmax > -1) {
509  acceptData.setCutResult("dRmax", passes);
510  }
511  if (m_pTResMax > -1) {
512  acceptData.setCutResult("pTResMax", passes);
513  }
514 
515  // Book keep cuts
516  for (const auto& cut : m_cuts) {
517  unsigned int pos = acceptData.getCutPosition(cut.first);
518  if (acceptData.getCutResult(pos)) {
519  m_numPassedCuts[pos]++;
520  }
521  }
522 
523  m_numProcessed++;
524  if (acceptData) {
525  m_numPassed++;
526  }
527 
528  return acceptData;
529 }

◆ acceptLegacy() [2/2]

asg::AcceptData dRMatchingTool::acceptLegacy ( const xAOD::TruthParticle p,
const xAOD::TrackParticleContainer trackParticles,
bool(*)(const xAOD::TrackParticle *)  trackSelectionTool = nullptr 
) const
virtual

Definition at line 532 of file dRMatchingTool.cxx.

534  {
535  // Reset the results.
536  asg::AcceptData acceptData (&m_accept);
537 
538  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_numPassedCuts and m_cache
539  const EventContext& ctx{Gaudi::Hive::currentContext()};
540  CacheEntry* ent{m_cache.get(ctx)};
541  ent->check(ctx.evt());
542 
543  ent->m_dRmin = 9999.;
544 
545  // Define variables.
546  const unsigned int Ncuts(m_cuts.size());
547  bool passes(false), passesThis(false);
548 
549  // Loop all track particles.
550  for (const xAOD::TrackParticle* track : *trackParticles) {
551  // Ignore all tracks failing the selection.
552  if (trackSelectionTool and !(*trackSelectionTool)(track)) {
553  continue;
554  }
555 
556  // Compute cut variable values.
557  float dR = comp_deltaR(p, track);
558  float pTRes = std::fabs(pt(track) / pt(p) - 1.);
559 
560  // Initialise cut monitoring objects.
561  std::vector<bool> vecPassesThis(Ncuts, false);
562 
563  // Check whether each individual cut passed.
564  unsigned int icut = 0;
565  if (m_dRmax > -1) {
566  vecPassesThis[icut++] = dR < m_dRmax;
567  }
568  if (m_pTResMax > -1) {
569  vecPassesThis[icut++] = pTRes < m_pTResMax;
570  }
571 
572  // Check whether all cuts passed.
573  passesThis = std::all_of(vecPassesThis.begin(),
574  vecPassesThis.end(),
575  [](const bool& v) {
576  return v;
577  });
578  passes |= passesThis;
579 
580  // If the current track particle was matched, check minimal dR.
581  if (passesThis) {
582  ent->m_dRmin = (dR < ent->m_dRmin ? dR : ent->m_dRmin);
583  }
584  }
585 
586  // Set cut values.
587  if (m_dRmax > -1) {
588  acceptData.setCutResult("dRmax", passes);
589  }
590  if (m_pTResMax > -1) {
591  acceptData.setCutResult("pTResMax", passes);
592  }
593 
594  // Book keep cuts
595  for (const auto& cut : m_cuts) {
596  unsigned int pos = acceptData.getCutPosition(cut.first);
597  if (acceptData.getCutResult(pos)) {
598  m_numPassedCuts[pos]++;
599  }
600  }
601 
602  m_numProcessed++;
603  if (acceptData) {
604  m_numPassed++;
605  }
606 
607  return acceptData;
608 }

◆ ASG_TOOL_CLASS1()

dRMatchingTool::ASG_TOOL_CLASS1 ( dRMatchingTool  ,
IAsgSelectionTool   
)
private

◆ checkCacheTrackParticles()

void dRMatchingTool::checkCacheTrackParticles ( const xAOD::TrackParticleContainer trackParticles,
CacheEntry ent,
bool(*)(const xAOD::TrackParticle *)  trackSelectionTool = nullptr 
) const
protected

Internal method(s).

Definition at line 185 of file dRMatchingTool.cxx.

187  {
188  // Check whether to cache.
189  if (*trackParticles == ent->m_baseTrackContainer) {
190  return;
191  }
192 
193  // Clear existing cache.
194  clearTrackParticles(ent);
195 
196  // Cache track particles.
198  xAOD::TrackParticle>(trackParticles,
199  ent->m_trackParticlesSortedPt,
200  ent->m_trackParticlesSortedEta,
201  ent->m_trackParticlesSortedPhi,
202  trackSelectionTool);
203 
204  // Store copy of base track container.
205  ent->m_baseTrackContainer = *trackParticles;
206 }

◆ checkCacheTruthParticles()

void dRMatchingTool::checkCacheTruthParticles ( const xAOD::TruthParticleContainer truthParticles,
CacheEntry ent,
bool(*)(const xAOD::TruthParticle *)  truthSelectionTool = nullptr 
) const
protected

Definition at line 209 of file dRMatchingTool.cxx.

211  {
212  // Check whether to cache.
213  if (*truthParticles == ent->m_baseTruthContainer) {
214  return;
215  }
216 
217  // Clear existing cache.
218  clearTruthParticles(ent);
219 
220  // Cache truth particles.
222  xAOD::TruthParticle>(truthParticles,
223  ent->m_truthParticlesSortedPt,
224  ent->m_truthParticlesSortedEta,
225  ent->m_truthParticlesSortedPhi,
226  truthSelectionTool);
227 
228  // Store copy of base truth container.
229  ent->m_baseTruthContainer = *truthParticles;
230 }

◆ clearTrackParticles()

void dRMatchingTool::clearTrackParticles ( CacheEntry ent) const
inlineprotected

Definition at line 180 of file dRMatchingTool.h.

180  {
181  ent->m_trackParticlesSortedPt.clear();
182  ent->m_trackParticlesSortedEta.clear();
183  ent->m_trackParticlesSortedPhi.clear();
184  return;
185  }

◆ clearTruthParticles()

void dRMatchingTool::clearTruthParticles ( CacheEntry ent) const
inlineprotected

Definition at line 189 of file dRMatchingTool.h.

189  {
190  ent->m_truthParticlesSortedPt.clear();
191  ent->m_truthParticlesSortedEta.clear();
192  ent->m_truthParticlesSortedPhi.clear();
193  return;
194  }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ dRmin()

float dRMatchingTool::dRmin ( ) const

Definition at line 631 of file dRMatchingTool.cxx.

631  {
632  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_cache
633  const EventContext& ctx{Gaudi::Hive::currentContext()};
634  CacheEntry* ent{m_cache.get(ctx)};
635  ent->check(ctx.evt());
636 
637  return ent->m_dRmin;
638 }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ finalize()

StatusCode dRMatchingTool::finalize ( )
overridevirtual

Definition at line 611 of file dRMatchingTool.cxx.

611  {
612  ATH_MSG_INFO("Finalizing " << name() << "...");
613 
614  if (m_numProcessed == 0) {
615  ATH_MSG_INFO("No tracks processed in selection tool.");
616  return StatusCode::SUCCESS;
617  }
618  ATH_MSG_INFO(m_numPassed << " / " << m_numProcessed << " = "
619  << m_numPassed * 100. / m_numProcessed
620  << "% passed all cuts.");
621  for (const auto& cut : m_cuts) {
622  ULong64_t numPassed = m_numPassedCuts.at(m_accept.getCutPosition(cut.first));
623  ATH_MSG_INFO(numPassed << " = " << numPassed * 100. / m_numProcessed
624  << "% passed " << cut.first << " cut.");
625  }
626 
627  return StatusCode::SUCCESS;
628 }

◆ getAcceptInfo()

const asg::AcceptInfo & dRMatchingTool::getAcceptInfo ( ) const
overridevirtual

Declare the interface ID for this pure-virtual interface class to the Athena framework.

Method to get the AcceptInfo to query what cuts are defined.

Implements IAsgSelectionTool.

Definition at line 145 of file dRMatchingTool.cxx.

145  {
146  return m_accept;
147 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode dRMatchingTool::initialize ( )
overridevirtual

SelectionTool method(s).

If no cuts are enabled, force to have length one, such that it will always return 'false'. This is because we want the dRMatchingTool to be ineffecitive in this case, and not select all tracks.

Reimplemented from asg::AsgTool.

Definition at line 102 of file dRMatchingTool.cxx.

102  {
103  if (asg::AsgTool::initialize().isFailure()) {
104  return StatusCode::FAILURE;
105  }
106 
107  ATH_MSG_INFO("Initializing " << name() << "...");
108 
109  // Clear cuts container.
110  m_cuts.clear();
111 
112  // Define cut names and descriptions.
113  if (m_dRmax > -1) {
114  m_cuts.emplace_back("dRmax", "Cut on maximal dR between track and truth particle.");
115  }
116  if (m_pTResMax > -1) {
117  m_cuts.emplace_back("pTResMax",
118  "Cut on maximal, relativ pT difference between track and truth particle.");
119  }
120 
121  // Add cuts to the AcceptOmfp.
122  for (const auto& cut : m_cuts) {
123  if (m_accept.addCut(cut.first, cut.second) < 0) {
124  ATH_MSG_ERROR("Failed to add cut " << cut.first << " because the AcceptInfo object is full.");
125  return StatusCode::FAILURE;
126  }
127  }
128 
129  // Initialise counters.
130  m_numPassedCuts.resize(m_accept.getNCuts(), 0);
131 
137  if (m_accept.getNCuts() == 0) {
138  m_accept.addCut("nop", "Forcing to have length 1.");
139  }
140 
141  return StatusCode::SUCCESS;
142 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sortedMatch()

template<class U , class V >
bool dRMatchingTool::sortedMatch ( const U *  p,
std::vector< const V * > &  vec_pt,
std::vector< const V * > &  vec_eta,
std::vector< const V * > &  vec_phi,
float &  dRmin 
) const
protected

Definition at line 234 of file dRMatchingTool.cxx.

238  {
239  // (Re-)set variables.
240  dRmin = 9999.;
241 
242  // Perform search in cached vectors.
243  auto it_pt_lower = m_pTResMax < 0 ? vec_pt.begin() :
244  std::lower_bound(vec_pt.begin(), vec_pt.end(),
245  pt(p) * (1. - m_pTResMax),
246  [](const V* o, const float& val) -> bool {
247  return pt(o) < val;
248  });
249 
250  auto it_pt_upper = m_pTResMax < 0 ? vec_pt.end() :
251  std::upper_bound(vec_pt.begin(), vec_pt.end(),
252  pt(p) * (1. + m_pTResMax),
253  [](const float& val, const V* o) -> bool {
254  return val < pt(o);
255  });
256 
257  auto it_eta_lower = m_dRmax < 0 ? vec_eta.begin() :
258  std::lower_bound(vec_eta.begin(), vec_eta.end(),
259  eta(p) - m_dRmax,
260  [](const V* o, const float& val) -> bool {
261  return eta(o) < val;
262  });
263 
264  auto it_eta_upper = m_dRmax < 0 ? vec_eta.end() :
265  std::upper_bound(vec_eta.begin(), vec_eta.end(),
266  eta(p) + m_dRmax,
267  [](const float& val, const V* o) -> bool {
268  return val < eta(o);
269  });
270 
271  // Dealing with cyclic nature of phi: Determining whether phi range wraps
272  // around +-pi.
273  bool wrapLow = phi(p) - m_dRmax < -M_PI;
274  bool wrapHigh = phi(p) + m_dRmax > M_PI;
275  bool wrap = wrapLow or wrapHigh;
276 
277  auto it_phi_lower = m_dRmax < 0 ? vec_phi.begin() :
278  std::lower_bound(vec_phi.begin(), vec_phi.end(),
279  phi(p) - m_dRmax + (wrapLow ? 2.*M_PI : 0),
280  [](const V* o, const float& val) -> bool {
281  return phi(o) < val;
282  });
283 
284  auto it_phi_upper = m_dRmax < 0 ? vec_phi.end() :
285  std::upper_bound(vec_phi.begin(), vec_phi.end(),
286  phi(p) + m_dRmax + (wrapHigh ? -2.*M_PI : 0),
287  [](const float& val, const V* o) -> bool {
288  return val < phi(o);
289  });
290 
291  // Break early if no truth particles passed selection.
292  if (m_pTResMax > 0 and it_pt_upper < it_pt_lower) {
293  return false;
294  } else if (m_dRmax > 0 and it_eta_upper < it_eta_lower) {
295  return false;
296  } else if (m_dRmax > 0 and((!wrap and it_phi_upper < it_phi_lower)or
297  (wrap and it_phi_upper > it_phi_lower))) {
298  return false;
299  }
300 
301  // Initialise base set.
302  std::vector< const V* > set(vec_pt);
303 
304  // -- Sort, pointer-based; necessary for set_intersection.
305  std::sort(set.begin(), set.end());
306 
307  // Compute subset of selected truth particles.
308  std::vector< const V* > subset_pt(it_pt_lower, it_pt_upper);
309  std::vector< const V* > subset_eta(it_eta_lower, it_eta_upper);
310  std::vector< const V* > subset_phi;
311  if (!wrap) {
312  subset_phi = std::vector< const V* >(it_phi_lower, it_phi_upper);
313  } else {
314  subset_phi = std::vector< const V* >(vec_phi.begin(), it_phi_upper);
315  subset_phi.insert(subset_phi.end(), it_phi_lower, vec_phi.end());
316  }
317 
318  // Add subsets according to specified cut values.
319  std::vector< std::vector< const V* > > subsets;
320  if (m_pTResMax > 0) {
321  subsets.push_back(subset_pt);
322  }
323  if (m_dRmax > 0) {
324  subsets.push_back(subset_eta);
325  subsets.push_back(subset_phi);
326  }
327 
328  // Compute successive intersections between base set and subset.
329  for (std::vector< const V* > subset : subsets) {
330  // -- Sort, pointer-based; necessary for set::set_intersection.
331  std::sort(subset.begin(), subset.end());
332 
333  // -- Set intersection.
334  std::vector< const V* > intersection;
335  std::set_intersection(set.begin(), set.end(),
336  subset.begin(), subset.end(),
337  std::back_inserter(intersection));
338 
339  // -- Break early if intersection is empty.
340  if (intersection.size() == 0) {
341  return false;
342  }
343 
344  set = intersection;
345  }
346 
347  // If only pT-matching, we're done.
348  if (m_dRmax < 0) {
349  return set.size() > 0;
350  }
351 
352  // Otherwise, compute dR for all remaining particles.
353  bool passes = false;
354  for (const V* other : set) {
355  float dR = comp_deltaR(p, other);
356  dRmin = (dR < dRmin ? dR : dRmin);
357  passes |= dRmin < m_dRmax;
358  }
359 
360  return passes;
361 }

◆ sortVectors()

template<class T , class U >
void dRMatchingTool::sortVectors ( const T *  container,
std::vector< const U * > &  vec_pt,
std::vector< const U * > &  vec_eta,
std::vector< const U * > &  vec_phi,
bool(*)(const U *)  selectionTool 
) const
protected

Definition at line 160 of file dRMatchingTool.cxx.

164  {
165  // Look all particles in container.
166  for (const U* p : *container) {
167  // Ignore particles not passing the selection, if applicable.
168  if (selectionTool and !(*selectionTool)(p)) {
169  continue;
170  }
171 
172  // Append passing particles to cached vectors.
173  vec_pt.push_back(p);
174  vec_eta.push_back(p);
175  vec_phi.push_back(p);
176  }
177 
178  // Sort vectors.
179  std::sort(vec_pt.begin(), vec_pt.end(), sort_pt <U>);
180  std::sort(vec_eta.begin(), vec_eta.end(), sort_eta<U>);
181  std::sort(vec_phi.begin(), vec_phi.end(), sort_phi<U>);
182 }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

std::vector<ULong64_t> m_numPassedCuts dRMatchingTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 223 of file dRMatchingTool.h.

◆ ATLAS_THREAD_SAFE [2/2]

SG::SlotSpecificObj<CacheEntry> m_cache dRMatchingTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 233 of file dRMatchingTool.h.

◆ m_accept

asg::AcceptInfo dRMatchingTool::m_accept {"dRMatching"}
private

Data member(s).

Definition at line 216 of file dRMatchingTool.h.

◆ m_cuts

std::vector<std::pair<std::string, std::string> > dRMatchingTool::m_cuts
private

Definition at line 218 of file dRMatchingTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dRmax

FloatProperty dRMatchingTool::m_dRmax {this, "dRmax", -1.}
private

Cut vales.

Definition at line 228 of file dRMatchingTool.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_mutex

std::mutex dRMatchingTool::m_mutex
mutableprivate

Definition at line 224 of file dRMatchingTool.h.

◆ m_numPassed

std::atomic<ULong64_t> dRMatchingTool::m_numPassed {0}
mutableprivate

Definition at line 222 of file dRMatchingTool.h.

◆ m_numProcessed

std::atomic<ULong64_t> dRMatchingTool::m_numProcessed {0}
mutableprivate

Definition at line 221 of file dRMatchingTool.h.

◆ m_pTResMax

FloatProperty dRMatchingTool::m_pTResMax {this, "pTResMax", -1.}
private

Definition at line 230 of file dRMatchingTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
dRMatchingTool::checkCacheTruthParticles
void checkCacheTruthParticles(const xAOD::TruthParticleContainer *truthParticles, CacheEntry *ent, bool(*truthSelectionTool)(const xAOD::TruthParticle *)=nullptr) const
Definition: dRMatchingTool.cxx:209
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
dRMatchingTool::m_pTResMax
FloatProperty m_pTResMax
Definition: dRMatchingTool.h:230
test_pyathena.pt
pt
Definition: test_pyathena.py:11
xAOD::TrackParticleContainer
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticleContainer.h:14
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
asg::AcceptInfo::getCutPosition
unsigned int getCutPosition(const std::string &cutName) const
Get the bit position of a cut.
Definition: AcceptInfo.h:73
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
Ncuts
const size_t Ncuts
Definition: SUSYToolsTester.cxx:82
dRMatchingTool::sortedMatch
bool sortedMatch(const U *p, std::vector< const V * > &vec_pt, std::vector< const V * > &vec_eta, std::vector< const V * > &vec_phi, float &dRmin) const
Definition: dRMatchingTool.cxx:234
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
dRMatchingTool::m_cuts
std::vector< std::pair< std::string, std::string > > m_cuts
Definition: dRMatchingTool.h:218
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
asg::AcceptInfo::getNCuts
unsigned int getNCuts() const
Get the number of cuts defined.
Definition: AcceptInfo.h:46
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
dRMatchingTool::checkCacheTrackParticles
void checkCacheTrackParticles(const xAOD::TrackParticleContainer *trackParticles, CacheEntry *ent, bool(*trackSelectionTool)(const xAOD::TrackParticle *)=nullptr) const
Internal method(s).
Definition: dRMatchingTool.cxx:185
python.xAODType.dummy
dummy
Definition: xAODType.py:4
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
dRMatchingTool::m_numPassed
std::atomic< ULong64_t > m_numPassed
Definition: dRMatchingTool.h:222
dRMatchingTool::m_mutex
std::mutex m_mutex
Definition: dRMatchingTool.h:224
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
h
dRMatchingTool::sortVectors
void sortVectors(const T *container, std::vector< const U * > &vec_pt, std::vector< const U * > &vec_eta, std::vector< const U * > &vec_phi, bool(*selectionTool)(const U *)) const
Definition: dRMatchingTool.cxx:160
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
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
dRMatchingTool::m_dRmax
FloatProperty m_dRmax
Cut vales.
Definition: dRMatchingTool.h:228
dRMatchingTool::clearTruthParticles
void clearTruthParticles(CacheEntry *ent) const
Definition: dRMatchingTool.h:189
dRMatchingTool::m_accept
asg::AcceptInfo m_accept
Data member(s).
Definition: dRMatchingTool.h:216
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
dRMatchingTool::dRmin
float dRmin() const
Definition: dRMatchingTool.cxx:631
asg::AcceptData
Definition: AcceptData.h:30
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
SG::DataProxy
Definition: DataProxy.h:45
asg::AsgTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: AsgTool.h:133
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
dRMatchingTool::m_numProcessed
std::atomic< ULong64_t > m_numProcessed
Definition: dRMatchingTool.h:221
dRMatchingTool::clearTrackParticles
void clearTrackParticles(CacheEntry *ent) const
Definition: dRMatchingTool.h:180
fitman.k
k
Definition: fitman.py:528
asg::AcceptInfo::addCut
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.
Definition: AcceptInfo.h:53