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

Class for vertex truth matching. More...

#include <InDetSecVtxTruthMatchTool.h>

Inheritance diagram for InDetSecVtxTruthMatchTool:
Collaboration diagram for InDetSecVtxTruthMatchTool:

Public Member Functions

 InDetSecVtxTruthMatchTool (const std::string &name)
 
virtual StatusCode initialize () override final
 Dummy implementation of the initialisation function. More...
 
virtual StatusCode matchVertices (std::vector< const xAOD::Vertex * > recoVerticesToMatch, std::vector< const xAOD::TruthVertex * > truthVerticesToMatch, const xAOD::TrackParticleContainer *trackParticles) override
 
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, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

int checkProduction (const xAOD::TruthParticle &truthPart, std::vector< const xAOD::TruthVertex * > truthVerticesToMatch) const
 
void countReconstructibleDescendentParticles (const xAOD::TruthVertex &signalTruthVertex, std::vector< const xAOD::TruthParticle * > &set, int counter) const
 
std::vector< int > checkParticle (const xAOD::TruthParticle &part, const xAOD::TrackParticleContainer *tkCont) const
 
bool isFrom (const xAOD::TruthParticle &truth, int flav) const
 
int checkSMProduction (const xAOD::TruthParticle &truthPart) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Gaudi::Property< float > m_trkMatchProb {this, "trackMatchProb", 0.5, "Required MC match probability to consider track a good match" }
 
Gaudi::Property< float > m_vxMatchWeight {this, "vertexMatchWeight", 0.5, "Relative weight threshold to consider vertex matched"}
 
Gaudi::Property< float > m_trkPtCut {this, "trackPtCut", 1000., "pt cut to apply on tracks"}
 
Gaudi::Property< std::string > m_selectedTrackFlag {this, "selectedTrackFlag", "is_selected", "Aux decoration on tracks for seeding efficiencies"}
 
Gaudi::Property< bool > m_doMuSA {this, "doMuSA", false, "Combination flag for special MuSA logic" }
 
Gaudi::Property< bool > m_doSMOrigin {this, "doSMOrigin", false, "Enable decoration of SM origin types"}
 
ToolHandle< InDet::IInDetTrackTruthOriginToolm_trackTruthOriginTool {this, "TrackTruthOriginTool", "InDet::InDetTrackTruthOriginTool/TrackTruthOriginTool"}
 
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

Class for vertex truth matching.

Match reconstructed vertices to truth level decay vertices Categorize reconstructed vertices depending on their composition.

Definition at line 129 of file InDetSecVtxTruthMatchTool.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

◆ InDetSecVtxTruthMatchTool()

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

Definition at line 14 of file InDetSecVtxTruthMatchTool.cxx.

14 : asg::AsgTool(name) {}

Member Function Documentation

◆ checkParticle()

std::vector< int > InDetSecVtxTruthMatchTool::checkParticle ( const xAOD::TruthParticle part,
const xAOD::TrackParticleContainer tkCont 
) const
private

Definition at line 406 of file InDetSecVtxTruthMatchTool.cxx.

406  {
407 
410  xAOD::TrackParticle::ConstAccessor<float> trk_truthProbAcc("truthMatchProbability");
411 
412  if(truthPart.pt() < m_trkPtCut){
413  ATH_MSG_DEBUG("Insufficient pt to reconstruct the particle");
414  return {0,0,0};
415  }
416  else{
417 
418  for(const xAOD::TrackParticle* trkPart : *trkCont){
419  // Handle differently for MuSA vs standard mode
420  if (m_doMuSA) {
421  if (!trk_truthPartAcc.isAvailable(*trkPart)) {
422  ATH_MSG_DEBUG("Truth link not available on MS track");
423  continue;
424  }
425  const ElementLink<xAOD::TruthParticleContainer>& truthLink = trk_truthPartAcc(*trkPart);
426  if (!truthLink.isValid()) {
427  ATH_MSG_DEBUG("Truth link on MS track not valid");
428  continue;
429  }
430  const xAOD::TruthParticle& linkedTruth = **truthLink;
431  if (HepMC::is_same_particle(linkedTruth, truthPart)) {
432  // We found a match between truth particle and MS track!
433  // no selected decoration so need to implement manually -- MSTP must be |eta| < 2.5
434  // ideally we would want to check if the MSTP is also an SA muon but this is more complicated given we need the muon container
435  if (std::abs(trkPart->eta()) < 2.5) {
436  ATH_MSG_DEBUG("Particle has a track that passes track selection.");
437  return {1,1,1};
438  } else {
439  ATH_MSG_DEBUG("Particle has a track, but did not pass track selection.");
440  return {1,1,0};
441  }
442  }
443  }
444 
445  // Standard mode - check truth matching
446  if (!trk_truthPartAcc.isAvailable(*trkPart)) {
447  ATH_MSG_DEBUG("truthParticleLink not available on track");
448  continue;
449  }
450 
451  const ElementLink<xAOD::TruthParticleContainer> & truthPartLink = trk_truthPartAcc(*trkPart);
452 
453  // Check if truth match probability is available
454  float matchProb = 0.0;
455  if (trk_truthProbAcc.isAvailable(*trkPart)) {
456  matchProb = trk_truthProbAcc(*trkPart);
457  } else {
458  ATH_MSG_DEBUG("truthMatchProbability not available on track");
459  continue;
460  }
461 
462  if(truthPartLink.isValid() && matchProb > m_trkMatchProb) {
463  const xAOD::TruthParticle& tmpPart = **truthPartLink;
464  if( HepMC::is_same_particle(tmpPart,truthPart) ) {
465  if(trackPass.isAvailable( *trkPart )) {
466  if(trackPass( *trkPart )) {
467  ATH_MSG_DEBUG("Particle has a track that passes track selection.");
468  return {1,1,1};
469  } else {
470  ATH_MSG_DEBUG("Particle has a track, but did not pass track selection.");
471  return {1,1,0};
472  }
473  } else {
474  ATH_MSG_DEBUG("Track selection decoration not available, calling the track selected");
475  return {1,1,1};
476  }
477  }
478  }
479  }
480  ATH_MSG_DEBUG("Particle has enough pt.");
481  return {1,0,0};
482 
483  }
484  return {0,0,0};
485 }

◆ checkProduction()

int InDetSecVtxTruthMatchTool::checkProduction ( const xAOD::TruthParticle truthPart,
std::vector< const xAOD::TruthVertex * >  truthVerticesToMatch 
) const
private

Definition at line 488 of file InDetSecVtxTruthMatchTool.cxx.

488  {
489 
490  if (truthPart.nParents() == 0){
491  ATH_MSG_DEBUG("Particle has no parents (end of loop)");
493  }
494  else{
495  const xAOD::TruthParticle * parent = truthPart.parent(0);
496  if(not parent) {
497  ATH_MSG_DEBUG("Particle parent is null");
499  }
500  ATH_MSG_DEBUG("Parent ID: " << parent->pdgId());
501 
502  const xAOD::TruthVertex* parentVertex = parent->decayVtx();
503  if(std::find(truthVerticesToMatch.begin(), truthVerticesToMatch.end(), parentVertex) != truthVerticesToMatch.end()) {
504  ATH_MSG_DEBUG("Found LLP decay.");
505  return HepMC::uniqueID(parentVertex);
506  }
507  // recurse on parent
508  return checkProduction(*parent, truthVerticesToMatch);
509  }
511 }

◆ checkSMProduction()

int InDetSecVtxTruthMatchTool::checkSMProduction ( const xAOD::TruthParticle truthPart) const
private

Definition at line 545 of file InDetSecVtxTruthMatchTool.cxx.

545  {
546  if (m_trackTruthOriginTool.isSet()) {
547  int trkOriginBits = m_trackTruthOriginTool->getTruthOrigin(&truthPart);
548  return mapTrkOriginToSecVtxOrigin(trkOriginBits);
549  }
550  ATH_MSG_WARNING("TrackTruthOriginTool not set, returning 0 for origin");
551  return 0;
552 }

◆ countReconstructibleDescendentParticles()

void InDetSecVtxTruthMatchTool::countReconstructibleDescendentParticles ( const xAOD::TruthVertex signalTruthVertex,
std::vector< const xAOD::TruthParticle * > &  set,
int  counter 
) const
private

Definition at line 554 of file InDetSecVtxTruthMatchTool.cxx.

555  {
556 
557  counter++;
558 
559  for (size_t itrk = 0; itrk < signalTruthVertex.nOutgoingParticles(); itrk++) {
560  const auto* particle = signalTruthVertex.outgoingParticle(itrk);
561  if (!particle) continue;
562 
563  // Recursively add descendents
564  if (particle->hasDecayVtx()) {
565 
566  TVector3 decayPos(particle->decayVtx()->x(), particle->decayVtx()->y(), particle->decayVtx()->z());
567  TVector3 prodPos(particle->prodVtx()->x(), particle->prodVtx()->y(), particle->prodVtx()->z());
568 
569  // Inner detector criteria
570  auto isInsideID = [](TVector3& v) { return (v.Perp() < 300. && std::abs(v.z()) < 1500.); };
571  auto isOutsideID = [](TVector3& v) { return (v.Perp() > 563. || std::abs(v.z()) > 2720.); };
572 
573  // Muon Spectrometer criteria
574  auto isOutsideID_MuSA = [](TVector3& v) { return (v.Perp() > 563. || std::abs(v.z()) > 2720.); };
575  auto isInsideMS_MuSA = [](TVector3& v) { return (v.Perp() < 8000. && std::abs(v.z()) < 10000.); };
576 
577  const auto distance = (decayPos - prodPos).Mag();
578 
579  if (counter > 100) {
580  ATH_MSG_WARNING("Vetoing particle that may be added recursively infinitely (potential loop in generator record");
581  break;
582  }
583 
584  // consider track reconstructible if it travels at least 10mm
585  if (distance < 10.0) {
587  } else if (m_doMuSA) {
588  // MuSA: particle originates outside ID and ends in MS
589  if (isOutsideID_MuSA(prodPos) && isInsideMS_MuSA(decayPos) && (particle->isCharged() || particle->isMuon())) {
590  set.push_back(particle);
591  }
592  } else {
593  // Regular tracking: particle originates inside ID and ends outside ID
594  if (isInsideID(prodPos) && isOutsideID(decayPos) && particle->isCharged()) {
595  set.push_back(particle);
596  } else if (particle->isElectron() || particle->isMuon()) {
597  set.push_back(particle);
598  }
599  }
600  } else {
601  if (!(particle->isCharged())) continue;
602  // For particles without decay vertex, include them if they're charged
603  set.push_back(particle);
604  }
605  }
606 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< 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, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< 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; }

◆ 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

◆ 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 InDetSecVtxTruthMatchTool::initialize ( )
finaloverridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 16 of file InDetSecVtxTruthMatchTool.cxx.

16  {
17  ATH_MSG_INFO("Initializing InDetSecVtxTruthMatchTool");
18 
19  // Retrieve the TrackTruthOriginTool
21 
22  return StatusCode::SUCCESS;
23 }

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

◆ isFrom()

bool InDetSecVtxTruthMatchTool::isFrom ( const xAOD::TruthParticle truth,
int  flav 
) const
private

Definition at line 608 of file InDetSecVtxTruthMatchTool.cxx.

608  {
609  if (m_trackTruthOriginTool.isSet()) {
610  return m_trackTruthOriginTool->isFrom(&truth, flav);
611  }
612  ATH_MSG_WARNING("TrackTruthOriginTool not set, returning false for isFrom");
613  return false;
614 }

◆ matchVertices()

StatusCode InDetSecVtxTruthMatchTool::matchVertices ( std::vector< const xAOD::Vertex * >  recoVerticesToMatch,
std::vector< const xAOD::TruthVertex * >  truthVerticesToMatch,
const xAOD::TrackParticleContainer trackParticles 
)
overridevirtual

Implements IInDetSecVtxTruthMatchTool.

Definition at line 41 of file InDetSecVtxTruthMatchTool.cxx.

43  {
44 
45  ATH_MSG_DEBUG("Start vertex matching");
46 
47  //setup decorators for truth matching info
48  static const xAOD::Vertex::Decorator<std::vector<VertexTruthMatchInfo> > matchInfoDecor("truthVertexMatchingInfos");
49  static const xAOD::Vertex::Decorator<int> recoMatchTypeDecor("vertexMatchType");
50  static const xAOD::Vertex::Decorator<std::vector<ElementLink<xAOD::VertexContainer> > > splitPartnerDecor("splitPartners");
51  //optional for SM origin matching
52  static const xAOD::Vertex::Decorator<int> smOriginDecor("vertexMatchOriginType");
53 
54  const xAOD::Vertex::Decorator<float> fakeScoreDecor("fakeScore");
55  const xAOD::Vertex::Decorator<float> otherScoreDecor("otherScore");
56 
57  //setup accessors
58  // can switch to built in method in xAOD::Vertex once don't have to deal with changing names anymore
60  xAOD::Vertex::ConstAccessor<std::vector<float> > weightAcc("trackWeights");
62  xAOD::TrackParticle::ConstAccessor<float> trk_truthProbAcc("truthMatchProbability");
63 
64  ATH_MSG_DEBUG("Starting Loop on Vertices");
65 
66  //=============================================================================
67  //First loop over vertices: get tracks, then TruthParticles, and store relative
68  //weights from each TruthVertex
69  //=============================================================================
70  for ( const xAOD::Vertex* vtx : recoVerticesToMatch ) {
71 
72  //create the vector we will add as matching info decoration later
73  std::vector<VertexTruthMatchInfo> matchinfo;
74 
75  const xAOD::Vertex::TrackParticleLinks_t& trackParticles = trkAcc( *vtx );
76  size_t ntracks = trackParticles.size();
77  const std::vector<float> & trkWeights = weightAcc( *vtx );
78 
79  xAOD::Vertex::TrackParticleLinks_t trkMuSATrkParts; // For MuSA mode, we will populate this with MuSA track particles
80 
81  // Create a local variable for track particles to use in the rest of the function
82  const xAOD::Vertex::TrackParticleLinks_t& trkParts = m_doMuSA ? trkMuSATrkParts : trackParticles;
83 
84  if ( m_doMuSA ) {
85  // MuSA also creates new "MuSA Track" collection which does not have truth particle links
86  // instead, we need to get the associated MS TrackParticle from the "MuSATrk_MSTPLink" decorations on the MuSA Track
87  // and then get the truth particle link from there
88  const SG::AuxElement::Accessor<ElementLink<xAOD::TrackParticleContainer>> acc_MSTPLink("MuSATrk_MSTPLink");
89  // populate the MuSA track particle vector
90  trkMuSATrkParts.reserve(ntracks);
91  for (const auto& trkLink : trackParticles) {
92  if (!trkLink.isValid()) continue;
93  const xAOD::TrackParticle& trackParticle = **trkLink;
94  if (acc_MSTPLink.isAvailable(trackParticle)) {
95  const ElementLink<xAOD::TrackParticleContainer>& trkMuSATrkLink = acc_MSTPLink(trackParticle);
96  if (trkMuSATrkLink.isValid()) {
97  trkMuSATrkParts.push_back(trkMuSATrkLink);
98  } else {
99  ATH_MSG_WARNING("MS track particle link is not valid");
100  }
101  } else {
102  ATH_MSG_WARNING("MuSATrk_MSTPLink decoration is not available on track particle");
103  }
104  }
105  }
106 
107  //if don't have track particles
108  if ((!trkAcc.isAvailable(*vtx) || !weightAcc.isAvailable(*vtx)) && !m_doMuSA) {
109  ATH_MSG_WARNING("trackParticles or trackWeights not available, vertex is missing info");
110  continue;
111  }
112  if ( trkWeights.size() != ntracks ) {
113  ATH_MSG_WARNING("Vertex without same number of tracks and trackWeights, vertex is missing info");
114  continue;
115  }
116 
117  ATH_MSG_DEBUG("Matching new vertex at (" << vtx->x() << ", " << vtx->y() << ", " << vtx->z() << ")" << " with " << ntracks << " tracks, at index: " << vtx->index());
118 
119  float totalWeight = 0.;
120  float totalPt = 0;
121  float otherPt = 0;
122  float fakePt = 0;
123 
124  // Add for SM origin tracking
125  int combinedSMOrigin = 0;
126 
127  //loop over the tracks in the vertex
128  for ( size_t t = 0; t < ntracks; ++t ) {
129 
130  ATH_MSG_DEBUG("Checking track number " << t);
131 
132  // First check if the original track particle link is valid
133  if (!trackParticles[t].isValid()) {
134  ATH_MSG_DEBUG("Original track " << t << " is bad!");
135  continue;
136  }
137 
138  // Then check if we have a valid track after potential MuSA processing
139  if (t >= trkParts.size() || !trkParts[t].isValid()) {
140  ATH_MSG_DEBUG("Track " << t << " is invalid or out of bounds in trkParts!");
141  continue;
142  }
143  const xAOD::TrackParticle trk = **trkParts[t];
144 
145  // Add to total weight
146  if (m_doMuSA) {
147  totalWeight += 1.0; // Add dummy weight of 1 for each track with MuSA
148  } else {
149  totalWeight += trkWeights[t];
150  }
151 
152  // Safely get the track pt
153  float trkPt = 0;
154  try {
155  trkPt = trk.pt();
156  totalPt += trkPt;
157  } catch (const std::exception& e) {
158  ATH_MSG_WARNING("Exception when accessing track pt: " << e.what());
159  continue;
160  }
161 
162  // get the linked truth particle
163  if (!trk_truthPartAcc.isAvailable(trk)) {
164  ATH_MSG_DEBUG("The truth particle link decoration isn't available.");
165  continue;
166  }
167  const ElementLink<xAOD::TruthParticleContainer> & truthPartLink = trk_truthPartAcc(trk);
168  float prob = 0.0;
169  if (m_doMuSA) {
170  // For MuSA mode, assign a dummy probability of 1.0
171  prob = 1.0;
172  ATH_MSG_DEBUG("MuSA mode: using dummy truth prob of 1.0");
173  } else {
174  // For regular mode, use the decoration
175  prob = trk_truthProbAcc(trk);
176  ATH_MSG_DEBUG("Truth prob: " << prob);
177  }
178 
179  // check the truth particle origin
180  if (truthPartLink.isValid() && prob > m_trkMatchProb) {
181  const xAOD::TruthParticle & truthPart = **truthPartLink;
182 
183  const int ancestorVertexUniqueID = checkProduction(truthPart, truthVerticesToMatch);
184  // optional SM origin classification
185  if (m_doSMOrigin) {
186  const int smOrigin = checkSMProduction(truthPart);
187  combinedSMOrigin |= smOrigin;
188 
189  // Check if this track is from LLP signal
190  if (ancestorVertexUniqueID != HepMC::INVALID_VERTEX_ID) {
191  combinedSMOrigin |= (0x1 << InDetSecVtxTruthMatchUtils::Signal);
192  }
193  }
194 
195  //check if the truth particle is "good"
196  if (ancestorVertexUniqueID != HepMC::INVALID_VERTEX_ID) {
197  //track in vertex is linked to LLP descendant
198  //create link to truth vertex and add to matchInfo
199  auto it = std::find_if(truthVerticesToMatch.begin(), truthVerticesToMatch.end(),
200  [&](const auto& ele){ return HepMC::uniqueID(ele) == ancestorVertexUniqueID;} );
201 
202  if (it == truthVerticesToMatch.end()) {
203  ATH_MSG_WARNING("Truth vertex with unique ID " << ancestorVertexUniqueID << " not found!");
204  } else {
206  elLink.setElement(*it);
207  elLink.setStorableObject(*dynamic_cast<const xAOD::TruthVertexContainer*>((*it)->container()));
208  size_t matchIdx = indexOfMatchInfo(matchinfo, elLink);
209 
210  if (m_doMuSA) {
211  std::get<1>(matchinfo[matchIdx]) += 1.0; // Add dummy weight of 1 for MuSA
212  } else {
213  std::get<1>(matchinfo[matchIdx]) += trkWeights[t];
214  }
215  std::get<2>(matchinfo[matchIdx]) += trk.pt();
216  }
217  } else {
218  //truth particle failed cuts
219  ATH_MSG_DEBUG("Truth particle not from LLP decay.");
220  otherPt += trk.pt();
221  }
222  } else {
223  //not valid or low matching probability
224  ATH_MSG_DEBUG("Invalid or low prob truth link!");
225  fakePt += trk.pt();
226  // Mark as fake for SM origin tracking
227  if (m_doSMOrigin) {
228  combinedSMOrigin |= (0x1 << InDetSecVtxTruthMatchUtils::FakeOrigin);
229  }
230  }
231  }//end loop over tracks in vertex
232 
233  // normalize by total weight and pT
234  std::for_each( matchinfo.begin(), matchinfo.end(), [&](VertexTruthMatchInfo& link)
235  {
236  std::get<1>(link) /= totalWeight;
237  std::get<2>(link) /= totalPt;
238  });
239 
240  float fakeScore = fakePt/totalPt;
241  float otherScore = otherPt/totalPt;
242 
243  matchInfoDecor ( *vtx ) = matchinfo;
244  fakeScoreDecor ( *vtx ) = fakeScore;
245  otherScoreDecor( *vtx ) = otherScore;
246 
247  // Decorate with SM origin if enabled
248  if (m_doSMOrigin) {
249  smOriginDecor( *vtx ) = combinedSMOrigin;
250  }
251  }
252 
253  //After first loop, all vertices have been decorated with their vector of match info (link to TruthVertex paired with weight)
254  //now we want to use that information from the whole collection to assign types
255  //keep track of whether a type is assigned
256  //useful since looking for splits involves a double loop, and then setting types ahead in the collection
257  std::vector<bool> assignedType( recoVerticesToMatch.size(), false );
258  static const xAOD::TruthVertex::Decorator<bool> isMatched("matchedToRecoVertex");
259  static const xAOD::TruthVertex::Decorator<bool> isSplit("vertexSplit");
260 
261  for ( size_t i = 0; i < recoVerticesToMatch.size(); ++i ) {
262 
263  int recoVertexMatchType = 0;
264 
265  if ( assignedType[i] ) {
266  ATH_MSG_DEBUG("Vertex already defined as split.");
267  continue; // make sure we don't reclassify vertices already found in the split loop below
268  }
269 
270  std::vector<VertexTruthMatchInfo> & info = matchInfoDecor( *recoVerticesToMatch[i] );
271  float fakeScore = fakeScoreDecor( *recoVerticesToMatch[i] );
272 
273  if(fakeScore > m_vxMatchWeight) {
274  ATH_MSG_DEBUG("Vertex is fake.");
275  recoVertexMatchType = recoVertexMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Fake);
276  } else if (info.size() == 1) {
277  if(std::get<2>(info[0]) > m_vxMatchWeight ) { // one truth matched vertex, sufficient weight
278  ATH_MSG_DEBUG("One true decay vertices matched with sufficient weight. Vertex is matched.");
279  recoVertexMatchType = recoVertexMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Matched);
280  isMatched(**std::get<0>(info[0])) = true;
281  }
282  else {
283  ATH_MSG_DEBUG("One true decay vertices matched with insufficient weight. Vertex is other.");
284  recoVertexMatchType = recoVertexMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Other);
285  }
286  } else if (info.size() >= 2 ) { // more than one true deacy vertices matched
287  ATH_MSG_DEBUG("Multiple true decay vertices matched. Vertex is merged.");
288  recoVertexMatchType = recoVertexMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Merged);
289  std::for_each( info.begin(), info.end(), [](VertexTruthMatchInfo& link)
290  {
291  isMatched(**std::get<0>(link)) = true;
292  });
293  } else { // zero truth matched vertices, but not fake
294  ATH_MSG_DEBUG("Vertex is neither fake nor LLP. Marking as OTHER.");
295  recoVertexMatchType = recoVertexMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Other);
296  }
297 
298  recoMatchTypeDecor(*recoVerticesToMatch[i]) = recoVertexMatchType;
299 
300  //check for splitting
301  if ( InDetSecVtxTruthMatchUtils::isMatched(recoMatchTypeDecor(*recoVerticesToMatch[i])) ||
302  InDetSecVtxTruthMatchUtils::isMerged(recoMatchTypeDecor(*recoVerticesToMatch[i])) ) {
303  std::vector<size_t> foundSplits;
304  for ( size_t j = i + 1; j < recoVerticesToMatch.size(); ++j ) {
305  std::vector<VertexTruthMatchInfo> & info2 = matchInfoDecor( *recoVerticesToMatch[j] );
306  //check second vertex is not dummy or fake, and that it has same elementlink as first vertex
307  //equality test is in code but doesnt seem to work for ElementLinks that I have?
308  //so i am just checking that the contianer key hash and the index are the same
309  if (recoMatchTypeDecor( *recoVerticesToMatch[j] ) & (0x1 << InDetSecVtxTruthMatchUtils::Fake)) continue;
310  if (!info2.empty() && std::get<0>(info2[0]).isValid() && std::get<0>(info[0]).key() == std::get<0>(info2[0]).key() && std::get<0>(info[0]).index() == std::get<0>(info2[0]).index() ) {
311  //add split links; first between first one found and newest one
313  splitLink_ij.setElement( recoVerticesToMatch[j] );
314  splitLink_ij.setStorableObject( *dynamic_cast<const xAOD::VertexContainer*>(recoVerticesToMatch[j]->container()));
315  splitPartnerDecor( *recoVerticesToMatch[i] ).emplace_back(splitLink_ij);
316 
318  splitLink_ji.setElement( recoVerticesToMatch[i] );
319  splitLink_ji.setStorableObject( *dynamic_cast<const xAOD::VertexContainer*>(recoVerticesToMatch[i]->container()));
320  splitPartnerDecor( *recoVerticesToMatch[j] ).emplace_back(splitLink_ji);
321 
322  //then between any others we found along the way
323  for ( auto k : foundSplits ) { //k is a size_t in the vector of splits
325  splitLink_kj.setElement( recoVerticesToMatch[j] );
326  splitLink_kj.setStorableObject( *dynamic_cast<const xAOD::VertexContainer*>(recoVerticesToMatch[j]->container()));
327  splitPartnerDecor( *recoVerticesToMatch[k] ).emplace_back(splitLink_kj);
328 
330  splitLink_jk.setElement( recoVerticesToMatch[k] );
331  splitLink_jk.setStorableObject( *dynamic_cast<const xAOD::VertexContainer*>(recoVerticesToMatch[k]->container()));
332  splitPartnerDecor( *recoVerticesToMatch[j] ).emplace_back(splitLink_jk);
333  }
334  //then keep track that we found this one
335  foundSplits.push_back(j);
336  recoMatchTypeDecor( *recoVerticesToMatch[i] ) = recoMatchTypeDecor( *recoVerticesToMatch[i] ) | (0x1 << InDetSecVtxTruthMatchUtils::Split);
337  recoMatchTypeDecor( *recoVerticesToMatch[j] ) = recoMatchTypeDecor( *recoVerticesToMatch[j] ) | (0x1 << InDetSecVtxTruthMatchUtils::Split);
338  isSplit(**std::get<0>(info[0])) = true;
339  assignedType[j] = true;
340  } //if the two vertices match to same TruthVertex
341  }//inner loop over vertices
342  } //if matched or merged
343 
344  } //outer loop
345 
346  // now label truth vertices
347 
348  ATH_MSG_DEBUG("Labeling truth vertices");
349 
350  static const xAOD::TruthVertex::Decorator<int> truthMatchTypeDecor("truthVertexMatchType");
351 
352  for(const xAOD::TruthVertex* truthVtx : truthVerticesToMatch) {
353 
354  std::vector<const xAOD::TruthParticle*> reconstructibleParticles;
355  int counter = 0;
356  countReconstructibleDescendentParticles( *truthVtx, reconstructibleParticles, counter );
357 
358  // hacky solution for keeping track of particles in the vertex
359  std::vector<int> particleInfo = {0,0,0};
360  std::vector<int> vertexInfo = {0,0,0};
361 
362  for(size_t n = 0; n < reconstructibleParticles.size(); n++){
363  ATH_MSG_DEBUG("Checking daughter no. " << n);
364  const xAOD::TruthParticle* outPart = reconstructibleParticles.at(n);
365 
366  if (trackParticles){
367  particleInfo = checkParticle(*outPart, trackParticles);
368 
369  for(size_t h = 0; h < particleInfo.size(); h++){
370  vertexInfo.at(h) += particleInfo.at(h);
371  }
372  }
373  }
374 
375  int truthMatchType = 0;
376  if( vertexInfo.at(0) > 1 &&
377  ((m_doMuSA && truthVtx->perp() < 8000 && std::abs(truthVtx->z()) < 10000) ||
378  (!m_doMuSA && truthVtx->perp() < 320 && std::abs(truthVtx->z()) < 1500))){
379  ATH_MSG_DEBUG("Vertex is reconstructable and in " << (m_doMuSA ? "Muon Spectrometer" : "Inner Det") << " region");
380  truthMatchType = truthMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Reconstructable);
381  }
382  if( InDetSecVtxTruthMatchUtils::isReconstructable(truthMatchType) and vertexInfo.at(1) > 1){
383  ATH_MSG_DEBUG("Vertex has at least two tracks");
384  truthMatchType = truthMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Accepted);
385  }
386  if(InDetSecVtxTruthMatchUtils::isAccepted(truthMatchType) and vertexInfo.at(2) > 1){
387  ATH_MSG_DEBUG("Vertex is has at least two tracks passing track selection: " << vertexInfo.at(2));
388  truthMatchType = truthMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Seeded);
389  }
390  if(InDetSecVtxTruthMatchUtils::isSeeded(truthMatchType) and isMatched(*truthVtx)){
391  ATH_MSG_DEBUG("Vertex is matched to a reconstructed secVtx");
392  truthMatchType = truthMatchType | (0x1 << InDetSecVtxTruthMatchUtils::Reconstructed);
393  }
394  if(InDetSecVtxTruthMatchUtils::isSeeded(truthMatchType) and isSplit(*truthVtx)){
395  ATH_MSG_DEBUG("Vertex is matched to multiple secVtx");
396  truthMatchType = truthMatchType | (0x1 << InDetSecVtxTruthMatchUtils::ReconstructedSplit);
397  }
398  truthMatchTypeDecor(*truthVtx) = truthMatchType;
399  }
400  ATH_MSG_DEBUG("Done labeling truth vertices");
401 
402  return StatusCode::SUCCESS;
403 
404 }

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

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doMuSA

Gaudi::Property<bool> InDetSecVtxTruthMatchTool::m_doMuSA {this, "doMuSA", false, "Combination flag for special MuSA logic" }
private

Definition at line 149 of file InDetSecVtxTruthMatchTool.h.

◆ m_doSMOrigin

Gaudi::Property<bool> InDetSecVtxTruthMatchTool::m_doSMOrigin {this, "doSMOrigin", false, "Enable decoration of SM origin types"}
private

Definition at line 150 of file InDetSecVtxTruthMatchTool.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_selectedTrackFlag

Gaudi::Property<std::string> InDetSecVtxTruthMatchTool::m_selectedTrackFlag {this, "selectedTrackFlag", "is_selected", "Aux decoration on tracks for seeding efficiencies"}
private

Definition at line 148 of file InDetSecVtxTruthMatchTool.h.

◆ m_trackTruthOriginTool

ToolHandle<InDet::IInDetTrackTruthOriginTool> InDetSecVtxTruthMatchTool::m_trackTruthOriginTool {this, "TrackTruthOriginTool", "InDet::InDetTrackTruthOriginTool/TrackTruthOriginTool"}
private

Definition at line 152 of file InDetSecVtxTruthMatchTool.h.

◆ m_trkMatchProb

Gaudi::Property<float> InDetSecVtxTruthMatchTool::m_trkMatchProb {this, "trackMatchProb", 0.5, "Required MC match probability to consider track a good match" }
private

Definition at line 145 of file InDetSecVtxTruthMatchTool.h.

◆ m_trkPtCut

Gaudi::Property<float> InDetSecVtxTruthMatchTool::m_trkPtCut {this, "trackPtCut", 1000., "pt cut to apply on tracks"}
private

Definition at line 147 of file InDetSecVtxTruthMatchTool.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.

◆ m_vxMatchWeight

Gaudi::Property<float> InDetSecVtxTruthMatchTool::m_vxMatchWeight {this, "vertexMatchWeight", 0.5, "Relative weight threshold to consider vertex matched"}
private

Definition at line 146 of file InDetSecVtxTruthMatchTool.h.


The documentation for this class was generated from the following files:
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:74
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:215
InDetSecVtxTruthMatchTool::m_selectedTrackFlag
Gaudi::Property< std::string > m_selectedTrackFlag
Definition: InDetSecVtxTruthMatchTool.h:148
InDetSecVtxTruthMatchUtils::ReconstructedSplit
@ ReconstructedSplit
Definition: InDetSecVtxTruthMatchTool.h:72
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
InDetSecVtxTruthMatchTool::m_doSMOrigin
Gaudi::Property< bool > m_doSMOrigin
Definition: InDetSecVtxTruthMatchTool.h:150
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
InDetSecVtxTruthMatchUtils::isReconstructable
bool isReconstructable(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:96
InDetSecVtxTruthMatchUtils::Signal
@ Signal
Definition: InDetSecVtxTruthMatchTool.h:62
skel.it
it
Definition: skel.GENtoEVGEN.py:407
InDetSecVtxTruthMatchTool::countReconstructibleDescendentParticles
void countReconstructibleDescendentParticles(const xAOD::TruthVertex &signalTruthVertex, std::vector< const xAOD::TruthParticle * > &set, int counter) const
Definition: InDetSecVtxTruthMatchTool.cxx:554
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
InDetSecVtxTruthMatchUtils::isMerged
bool isMerged(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:79
InDetSecVtxTruthMatchUtils::isMatched
bool isMatched(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:75
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
InDetSecVtxTruthMatchUtils::isSplit
bool isSplit(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:83
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:872
mapTrkOriginToSecVtxOrigin
int mapTrkOriginToSecVtxOrigin(int trkOriginBits)
Definition: InDetSecVtxTruthMatchTool.cxx:514
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
covarianceTool.prob
prob
Definition: covarianceTool.py:678
InDetSecVtxTruthMatchUtils::Fake
@ Fake
Definition: InDetSecVtxTruthMatchTool.h:37
HepMC::is_same_particle
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
Definition: MagicNumbers.h:366
InDetSecVtxTruthMatchTool::checkProduction
int checkProduction(const xAOD::TruthParticle &truthPart, std::vector< const xAOD::TruthVertex * > truthVerticesToMatch) const
Definition: InDetSecVtxTruthMatchTool.cxx:488
InDetSecVtxTruthMatchUtils::Split
@ Split
Definition: InDetSecVtxTruthMatchTool.h:36
InDetSecVtxTruthMatchTool::m_doMuSA
Gaudi::Property< bool > m_doMuSA
Definition: InDetSecVtxTruthMatchTool.h:149
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
InDetSecVtxTruthMatchUtils::Other
@ Other
Definition: InDetSecVtxTruthMatchTool.h:38
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::TruthParticle_v1::nParents
size_t nParents() const
Number of parents of this particle.
Definition: TruthParticle_v1.cxx:117
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetSecVtxTruthMatchTool::m_vxMatchWeight
Gaudi::Property< float > m_vxMatchWeight
Definition: InDetSecVtxTruthMatchTool.h:146
InDetSecVtxTruthMatchUtils::isAccepted
bool isAccepted(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:100
h
beamspotman.n
n
Definition: beamspotman.py:727
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
InDetSecVtxTruthMatchUtils::Reconstructable
@ Reconstructable
Definition: InDetSecVtxTruthMatchTool.h:68
InDetSecVtxTruthMatchTool::m_trkMatchProb
Gaudi::Property< float > m_trkMatchProb
Definition: InDetSecVtxTruthMatchTool.h:145
calibdata.exception
exception
Definition: calibdata.py:495
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetSecVtxTruthMatchTool::m_trackTruthOriginTool
ToolHandle< InDet::IInDetTrackTruthOriginTool > m_trackTruthOriginTool
Definition: InDetSecVtxTruthMatchTool.h:152
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
xAOD::Vertex_v1::TrackParticleLinks_t
std::vector< ElementLink< xAOD::TrackParticleContainer > > TrackParticleLinks_t
Type for the associated track particles.
Definition: Vertex_v1.h:128
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
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
HepMC::INVALID_VERTEX_ID
constexpr int INVALID_VERTEX_ID
Definition: MagicNumbers.h:58
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
python.PyAthena.v
v
Definition: PyAthena.py:154
InDetSecVtxTruthMatchUtils::Reconstructed
@ Reconstructed
Definition: InDetSecVtxTruthMatchTool.h:71
InDetSecVtxTruthMatchUtils::Seeded
@ Seeded
Definition: InDetSecVtxTruthMatchTool.h:70
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDetSecVtxTruthMatchUtils::Merged
@ Merged
Definition: InDetSecVtxTruthMatchTool.h:35
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
InDetSecVtxTruthMatchUtils::VertexTruthMatchInfo
std::tuple< ElementLink< xAOD::TruthVertexContainer >, float, float > VertexTruthMatchInfo
Definition: InDetSecVtxTruthMatchTool.h:30
InDetSecVtxTruthMatchUtils::Matched
@ Matched
Definition: InDetSecVtxTruthMatchTool.h:34
xAOD::TruthParticle_v1::parent
const TruthParticle_v1 * parent(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
Definition: TruthParticle_v1.cxx:126
InDetSecVtxTruthMatchTool::checkParticle
std::vector< int > checkParticle(const xAOD::TruthParticle &part, const xAOD::TrackParticleContainer *tkCont) const
Definition: InDetSecVtxTruthMatchTool.cxx:406
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
InDetSecVtxTruthMatchUtils::FakeOrigin
@ FakeOrigin
Definition: InDetSecVtxTruthMatchTool.h:47
InDetSecVtxTruthMatchUtils::isSeeded
bool isSeeded(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:104
test_pyathena.counter
counter
Definition: test_pyathena.py:15
SG::DataProxy
Definition: DataProxy.h:45
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:120
InDetSecVtxTruthMatchUtils::Accepted
@ Accepted
Definition: InDetSecVtxTruthMatchTool.h:69
InDetSecVtxTruthMatchTool::checkSMProduction
int checkSMProduction(const xAOD::TruthParticle &truthPart) const
Definition: InDetSecVtxTruthMatchTool.cxx:545
fitman.k
k
Definition: fitman.py:528
InDetSecVtxTruthMatchTool::m_trkPtCut
Gaudi::Property< float > m_trkPtCut
Definition: InDetSecVtxTruthMatchTool.h:147