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
 Data member(s). More...
 
std::vector< std::pair< std::string, std::string > > m_cuts
 
std::atomic< ULong64_t > m_numProcessed
 
std::atomic< ULong64_t > m_numPassed
 
std::vector< ULong64_t > m_numPassedCuts ATLAS_THREAD_SAFE
 
std::mutex m_mutex
 
float m_dRmax
 Cut vales. More...
 
float m_pTResMax
 
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  m_accept("dRMatching"),
97  m_numProcessed(0),
98  m_numPassed(0) {
99  declareInterface<IAsgSelectionTool>(this);
100 
101  // Decleare cut properties, for access in job option.
102  declareProperty("dRmax", m_dRmax = -1);
103  declareProperty("pTResMax", m_pTResMax = -1);
104 }

◆ ~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 157 of file dRMatchingTool.cxx.

157  {
158 
160  "accept(...) function called without needed Truth- or TrackParticleContainer. Please use one of the dRMatchingTool-specific accept methods.");
161 
162  return asg::AcceptData (&m_accept);
163 }

◆ 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 371 of file dRMatchingTool.cxx.

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

◆ 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 416 of file dRMatchingTool.cxx.

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

◆ 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 461 of file dRMatchingTool.cxx.

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

◆ 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 539 of file dRMatchingTool.cxx.

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

◆ 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 192 of file dRMatchingTool.cxx.

194  {
195  // Check whether to cache.
196  if (*trackParticles == ent->m_baseTrackContainer) {
197  return;
198  }
199 
200  // Clear existing cache.
201  clearTrackParticles(ent);
202 
203  // Cache track particles.
205  xAOD::TrackParticle>(trackParticles,
206  ent->m_trackParticlesSortedPt,
207  ent->m_trackParticlesSortedEta,
208  ent->m_trackParticlesSortedPhi,
209  trackSelectionTool);
210 
211  // Store copy of base track container.
212  ent->m_baseTrackContainer = *trackParticles;
213 }

◆ checkCacheTruthParticles()

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

Definition at line 216 of file dRMatchingTool.cxx.

218  {
219  // Check whether to cache.
220  if (*truthParticles == ent->m_baseTruthContainer) {
221  return;
222  }
223 
224  // Clear existing cache.
225  clearTruthParticles(ent);
226 
227  // Cache truth particles.
229  xAOD::TruthParticle>(truthParticles,
230  ent->m_truthParticlesSortedPt,
231  ent->m_truthParticlesSortedEta,
232  ent->m_truthParticlesSortedPhi,
233  truthSelectionTool);
234 
235  // Store copy of base truth container.
236  ent->m_baseTruthContainer = *truthParticles;
237 }

◆ 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 638 of file dRMatchingTool.cxx.

638  {
639  std::lock_guard<std::mutex> lock{m_mutex}; // To guard m_cache
640  const EventContext& ctx{Gaudi::Hive::currentContext()};
641  CacheEntry* ent{m_cache.get(ctx)};
642  ent->check(ctx.evt());
643 
644  return ent->m_dRmin;
645 }

◆ 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 618 of file dRMatchingTool.cxx.

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

◆ 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 152 of file dRMatchingTool.cxx.

152  {
153  return m_accept;
154 }

◆ 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 109 of file dRMatchingTool.cxx.

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

◆ 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 241 of file dRMatchingTool.cxx.

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

◆ 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 167 of file dRMatchingTool.cxx.

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

◆ 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
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

float dRMatchingTool::m_dRmax
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
mutableprivate

Definition at line 222 of file dRMatchingTool.h.

◆ m_numProcessed

std::atomic<ULong64_t> dRMatchingTool::m_numProcessed
mutableprivate

Definition at line 221 of file dRMatchingTool.h.

◆ m_pTResMax

float dRMatchingTool::m_pTResMax
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:
dRMatchingTool::m_pTResMax
float m_pTResMax
Definition: dRMatchingTool.h:230
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
dRMatchingTool::checkCacheTruthParticles
void checkCacheTruthParticles(const xAOD::TruthParticleContainer *truthParticles, CacheEntry *ent, bool(*truthSelectionTool)(const xAOD::TruthParticle *)=nullptr) const
Definition: dRMatchingTool.cxx:216
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
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:77
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:241
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
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_dRmax
float m_dRmax
Cut vales.
Definition: dRMatchingTool.h:228
dRMatchingTool::m_cuts
std::vector< std::pair< std::string, std::string > > m_cuts
Definition: dRMatchingTool.h:218
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:41
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:192
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:224
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
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:157
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:167
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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:790
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:638
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:44
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