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

#include <RecoToTruthAssociationAlg.h>

Inheritance diagram for Muon::RecoToTruthAssociationAlg:
Collaboration diagram for Muon::RecoToTruthAssociationAlg:

Public Member Functions

StatusCode initialize () override
 
StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void count_chamber_layers (const xAOD::IParticle *truth_particle, const Trk::Track *ptrk, std::vector< unsigned int > &nprecHitsPerChamberLayer, std::vector< unsigned int > &nphiHitsPerChamberLayer, std::vector< unsigned int > &ntrigEtaHitsPerChamberLayer) const
 
void clear_dummys (const std::vector< unsigned long long > &identifiers, std::vector< unsigned int > &vec) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthMuKey
 Key to the filtered muon truth particles
More...
 
SG::ReadHandleKey< xAOD::MuonContainerm_recoMuKey
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_muonTruthRecoLink
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleLink
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleType
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleOrigin
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleNPrecMatched
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleNPhiMatched
 
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonTruthParticleNTrigEtaMatched
 
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainerm_inputDecorKey
 
Gaudi::Property< std::vector< std::string > > m_assocTrkContainers
 
Gaudi::Property< std::string > m_recoLink {this, "RecoLinkName", "recoMuonLink" , "Decoration to the truth particle pointing to the muon"}
 
Gaudi::Property< bool > m_associateWithInDetTP {this, "AssociateWithInDetTP", false, "force use of ID track particles for association"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 18 of file RecoToTruthAssociationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ cardinality()

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

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

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ clear_dummys()

void Muon::RecoToTruthAssociationAlg::clear_dummys ( const std::vector< unsigned long long > &  identifiers,
std::vector< unsigned int > &  vec 
) const
private

If the identifiers are empty then there is no change that a dummy value could be cleared from this list

Definition at line 353 of file RecoToTruthAssociationAlg.cxx.

353  {
356  if (identifiers.empty()) { return; }
357  for (unsigned int i = 0; i < vec.size(); ++i) {
358  if (vec[i] != dummy_unsigned) continue;
359  for (unsigned j = 0; j < identifiers.size(); ++j) {
360  const Identifier id{identifiers[j]};
361  if (m_idHelperSvc->measuresPhi(id)) {
362  const auto phiIdx = static_cast<PhiIndex>(i);
363  if (m_idHelperSvc->phiIndex(id) == phiIdx) {
364  vec[i] = 0;
365  break;
366  }
367  } else {
368  const auto chIdx = static_cast<ChIndex>(i);
369  if (m_idHelperSvc->chamberIndex(id) == chIdx) {
370  vec[i] = 0;
371  break;
372  }
373  }
374  }
375  }
376 }

◆ count_chamber_layers()

void Muon::RecoToTruthAssociationAlg::count_chamber_layers ( const xAOD::IParticle truth_particle,
const Trk::Track ptrk,
std::vector< unsigned int > &  nprecHitsPerChamberLayer,
std::vector< unsigned int > &  nphiHitsPerChamberLayer,
std::vector< unsigned int > &  ntrigEtaHitsPerChamberLayer 
) const
private

Definition at line 253 of file RecoToTruthAssociationAlg.cxx.

256  {
257 
258  if (!truthParticle || !truthMdtHitsAcc.isAvailable(*truthParticle)) {
259  ATH_MSG_DEBUG("muon has no truth hits vector in the truth association alg");
260  nprecHitsPerChamberLayer.clear();
261  nphiHitsPerChamberLayer.clear();
262  ntrigEtaHitsPerChamberLayer.clear();
263  return;
264  }
265  const std::vector<unsigned long long>& mdtTruth = truthMdtHitsAcc(*truthParticle);
266  std::vector<unsigned long long> cscTruth;
267 
268  if (m_idHelperSvc->hasCSC()) cscTruth = truthCscHitsAcc(*truthParticle);
269  const std::vector<unsigned long long>& rpcTruth = truthRpcHitsAcc(*truthParticle);
270  const std::vector<unsigned long long>& tgcTruth = truthTgcHitsAcc(*truthParticle);
271 
272  for (const Trk::TrackStateOnSurface* tsit : *ptrk->trackStateOnSurfaces()) {
273  if (!tsit || !tsit->trackParameters() || !tsit->measurementOnTrack()) continue;
274  const Trk::MeasurementBase* meas = tsit->measurementOnTrack();
275  Identifier id;
276  const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>(meas);
277  if (rot)
278  id = rot->identify();
279  else {
280  const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas);
281  if (crot && !crot->containedROTs().empty() && crot->containedROTs().front()) id = crot->containedROTs().front()->identify();
282  }
283  if (!m_idHelperSvc->isMuon(id)) continue;
284 
285  bool measPhi = m_idHelperSvc->measuresPhi(id);
286  bool isTgc = m_idHelperSvc->isTgc(id);
287  ChIndex chIndex = !isTgc ? m_idHelperSvc->chamberIndex(id) : ChIndex::ChUnknown;
288  if (m_idHelperSvc->isMdt(id)) {
289  for (unsigned int i = 0; i < mdtTruth.size(); ++i) {
290  if (id == mdtTruth[i]) {
291  if (chIndex != ChIndex::ChUnknown) {
292  increment_unsigned(nprecHitsPerChamberLayer.at(toInt(chIndex)));
293  }
294  break;
295  }
296  }
297  } else if (m_idHelperSvc->hasCSC() && m_idHelperSvc->isCsc(id)) {
298  for (unsigned int i = 0; i < cscTruth.size(); ++i) {
299  if (id != cscTruth[i]) continue;
300  if (measPhi) {
301  PhiIndex index = m_idHelperSvc->phiIndex(id);
302  if (index != PhiIndex::PhiUnknown) {
303  increment_unsigned(nphiHitsPerChamberLayer.at(toInt(index)));
304  }
305  } else {
306  if (chIndex != ChIndex::ChUnknown) {
307  increment_unsigned(nprecHitsPerChamberLayer.at(toInt(chIndex)));
308  }
309  }
310  break;
311  }
312  } else if (m_idHelperSvc->isRpc(id)) {
313  for (unsigned int i = 0; i < rpcTruth.size(); ++i) {
314  if (id != rpcTruth[i]) { continue; }
315  PhiIndex index = m_idHelperSvc->phiIndex(id);
316  if (index != PhiIndex::PhiUnknown) {
317  if (measPhi) {
318  increment_unsigned(nphiHitsPerChamberLayer.at(toInt(index)));
319  } else {
320  increment_unsigned(ntrigEtaHitsPerChamberLayer.at(toInt(index)));
321  }
322  }
323  break;
324  }
325  } else if (m_idHelperSvc->isTgc(id)) {
326  for (unsigned int i = 0; i < tgcTruth.size(); ++i) {
327  if (id != tgcTruth[i]) { continue; }
328  PhiIndex index = m_idHelperSvc->phiIndex(id);
329  if (index != PhiIndex::PhiUnknown) {
330  if (measPhi) {
331  increment_unsigned(nphiHitsPerChamberLayer.at(toInt(index)));
332  } else {
333  increment_unsigned(ntrigEtaHitsPerChamberLayer.at(toInt(index)));
334  }
335  }
336  break;
337  }
338  }
339  } // end loop over TSOS
340  ATH_MSG_DEBUG("finished loop over TSOS");
341 
342  // now, have to check if there are non-zero truth hits in indices without reco hits
343  clear_dummys(mdtTruth, nprecHitsPerChamberLayer);
344  clear_dummys(cscTruth, nprecHitsPerChamberLayer);
345 
346  clear_dummys(cscTruth, nphiHitsPerChamberLayer);
347  clear_dummys(rpcTruth, nphiHitsPerChamberLayer);
348  clear_dummys(tgcTruth, nphiHitsPerChamberLayer);
349 
350  clear_dummys(rpcTruth, ntrigEtaHitsPerChamberLayer);
351  clear_dummys(tgcTruth, ntrigEtaHitsPerChamberLayer);
352 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode Muon::RecoToTruthAssociationAlg::execute ( const EventContext &  ctx) const
override

Link the truth particle to the muon

Check first if the truth link already exists

May be both muons are reconstructed by the same author but one is commissioning

The last judge is a simple dR cut but this will hopefully never trigger

Zero supression do not want to store meaningless zeros

Decorate the results

Patch for STACO muons: Copy the truth information from the muon back to the combined track to avoid file corruptions reported in ATLASRECTS-6454

one more thing: need to have muonlink set for all truth particles to avoid ELReset errors

Definition at line 78 of file RecoToTruthAssociationAlg.cxx.

78  {
79  const xAOD::TruthParticleContainer* muonTruthContainer{nullptr};
80  ATH_CHECK(SG::get(muonTruthContainer, m_truthMuKey , ctx));
81  std::unique_ptr<SG::WriteDecorHandle<xAOD::TruthParticleContainer, ElementLink<xAOD::MuonContainer>>> muonTruthParticleRecoLink{};
82  if (!m_muonTruthRecoLink.empty()) {
83  muonTruthParticleRecoLink = std::make_unique<SG::WriteDecorHandle<xAOD::TruthParticleContainer, ElementLink<xAOD::MuonContainer>>>(m_muonTruthRecoLink, ctx);
84  }
85 
87  ctx);
88  if (!muonTruthParticleLink.isValid()) {
89  ATH_MSG_WARNING("muon particle container not valid");
90  return StatusCode::FAILURE;
91  }
95  ctx);
98 
99  // add link to reco muons and viceversa
100  bool saw_staco = false;
101  bool decor_staco = false;
102 
103  // loop over muons
104  for (const xAOD::Muon* muon : *muonTruthParticleLink) {
105  // use primary track particle to get the truth link (except for the case of STACO, where we must use the ID track particle, as the
106  // combined is not truth-matched)
107  ATH_MSG_DEBUG("muon with pT " << muon->pt() << " MeV, eta: " << muon->eta() << ", phi " << muon->phi() << " and author "
108  << muon->author());
109  const xAOD::TrackParticle* tp = nullptr;
110  if (m_associateWithInDetTP || muon->author() == xAOD::Muon::STACO || muon->author() == xAOD::Muon::MuGirl) {
111  tp = muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
112  } else {
113  tp = muon->primaryTrackParticle();
114  }
115 
116  bool foundTruth{false}, setOrigin{false};
117  if (tp) {
118  // Associate reco with truth muon. Loop over reconstructed muons, get track particle for each one.
119  // Each track particle should carry a link to the corresponding truth particle. Then compare this truth particle link with the
120  // given truth muon particle
121  if (acc_origin.isAvailable(*tp) && acc_origin(*tp) != 0) {
122  muonTruthParticleOrigin(*muon) = acc_origin(*tp);
123  muonTruthParticleType(*muon) = acc_type(*tp);
124  setOrigin = true;
125  }
126 
128  if (acc_link.isAvailable(*tp)) {
129  truthLink = acc_link(*tp);
130  } else {
131  ATH_MSG_DEBUG("Could not find any truth link associated with track having pt:"<<tp->pt()<<" MeV, eta: "<<tp->eta()<<", phi: "<<tp->phi()<<", charge: "<<tp->charge()<<". d0:"<<tp->d0()<<", z0: "<<tp->z0());
132  }
133 
134  if (truthLink.isValid()) {
135  ATH_MSG_VERBOSE(" Got valid truth link for muon author " << muon->author() << " uniqueID " << HepMC::uniqueID(*truthLink));
136  // loop over truth particles
137  for (const xAOD::TruthParticle* truthParticle : *muonTruthContainer) {
138  if (!MC::isStable(truthParticle)) continue;
139  ATH_MSG_DEBUG("Got truth muon with uniqueID " << HepMC::uniqueID(truthParticle) << " pt " << truthParticle->pt());
140  if ( !HepMC::is_sim_descendant(*truthLink, truthParticle)) {
141  ATH_MSG_VERBOSE("UniqueID truth link: " << HepMC::uniqueID(*truthLink)
142  << " is not decendant of " << HepMC::uniqueID(truthParticle));
143  continue;
144  }
145  ATH_MSG_VERBOSE("Truth muon uniqueID matches -> creating link with truth particle " << HepMC::uniqueID(*truthLink));
146  foundTruth = true;
148  ElementLink<xAOD::TruthParticleContainer> muonTruthLink{*muonTruthContainer,
149  truthParticle->index(),
150  ctx};
151  muonTruthLink.toPersistent();
152  muonTruthParticleLink(*muon) = muonTruthLink;
153  if (!setOrigin) {
154  muonTruthParticleOrigin(*muon) = acc_origin(*tp);
155  muonTruthParticleType(*muon) = acc_type(*tp);
156  setOrigin = true;
157  }
159  if (muonTruthParticleRecoLink && muonTruthParticleRecoLink->operator()(*truthParticle).isValid()){
160  const xAOD::Muon* decor_muon = *muonTruthParticleRecoLink->operator()(*truthParticle);
161  ATH_MSG_VERBOSE("Truth particle is already decorated with reco muon "<<decor_muon->pt()*1.e-3
162  <<" eta: "<<decor_muon->eta()<<" phi: "<<decor_muon->phi()<<" charge: "<<
163  decor_muon->charge()<<" author: "<<decor_muon->author()<<" all authors: "<<
164  decor_muon->allAuthors());
165 
166  // Check first if the exiting muon has a better author
167  if (MuonCombined::authorRank(decor_muon->author()) < MuonCombined::authorRank(muon->author())){
168  ATH_MSG_DEBUG("Author of the decorated muon is better than the one of the new candidate");
169  continue;
170  }
172  const int com_score = (muon->allAuthors() & com_bit) - (decor_muon->allAuthors() &com_bit);
173  if (com_score > 0){
174  ATH_MSG_DEBUG("Found two muons reconstructed by an equivalent author. But this one is from the commissioning chain");
175  continue;
176  }
178  if (deltaR2(muon,truthParticle) >= deltaR2(muon, decor_muon)) continue;
179  }
180 
181 
182  ElementLink<xAOD::MuonContainer> muonLink{muon, *muonTruthParticleLink, ctx};
183 
185  std::vector<unsigned int> nprecHitsPerChamberLayer(toInt(ChIndex::ChIndexMax), dummy_unsigned);
186  std::vector<unsigned int> nphiHitsPerChamberLayer(toInt(PhiIndex::PhiIndexMax), dummy_unsigned);
187  std::vector<unsigned int> ntrigEtaHitsPerChamberLayer(toInt(PhiIndex::PhiIndexMax), dummy_unsigned);
188 
189  constexpr int author_sel = (1<<xAOD::Muon::MuidCo) | (1<<xAOD::Muon::MuidSA) | (1<<xAOD::Muon::MuGirl);
190  count_chamber_layers(muon->allAuthors() & author_sel
191  ? truthParticle
192  : nullptr,
193  tp->track(), nprecHitsPerChamberLayer, nphiHitsPerChamberLayer, ntrigEtaHitsPerChamberLayer);
195  muonTruthParticleNPrecMatched(*muon) = nprecHitsPerChamberLayer;
196  muonTruthParticleNPhiMatched(*muon) = nphiHitsPerChamberLayer;
197  muonTruthParticleNTrigEtaMatched(*muon) = ntrigEtaHitsPerChamberLayer;
198 
199  if (muonTruthParticleRecoLink) (*muonTruthParticleRecoLink)(*truthParticle) = muonLink;
200  break;
201  }
202  } else {
203  ATH_MSG_DEBUG("Invalid truth link");
204  }
205  } else {
206  ATH_MSG_WARNING("Could not find the appropiate track particle for muon with pT: " << muon->pt() * 1.e-3 << " GeV, eta: "
207  << muon->eta() << ", phi: " << muon->phi()
208  << " author: " << muon->author());
209  }
210 
211  if (!setOrigin) {
212  muonTruthParticleOrigin(*muon) = 0;
213  muonTruthParticleType(*muon) = 0;
214  }
215  if (!foundTruth) {
216  muonTruthParticleLink(*muon) = ElementLink<xAOD::TruthParticleContainer>();
217  // add these empty vectors
218  muonTruthParticleNPrecMatched(*muon) = std::vector<unsigned int>{};
219  muonTruthParticleNPhiMatched(*muon) = std::vector<unsigned int>{};
220  muonTruthParticleNTrigEtaMatched(*muon) = std::vector<unsigned int>{};
221  }
224  if (muon->author() == xAOD::Muon::STACO) {
225  const xAOD::TrackParticle* cmb_trk = muon->trackParticle(xAOD::Muon::CombinedTrackParticle);
226  if (!cmb_trk){
227  ATH_MSG_WARNING("Even a STACO muon should have a combined track");
228  continue;
229  } else {
230  if (!saw_staco) {
231  saw_staco = true;
232  decor_staco = !dec_origin.isAvailable (*cmb_trk);
233  }
234  if (decor_staco) {
235  dec_origin(*cmb_trk) = acc_origin(*muon);
236  dec_type(*cmb_trk) = acc_type(*muon);
237  dec_link(*cmb_trk) = acc_link(*muon);
238  }
239  }
240  }
241  }
243  if (muonTruthParticleRecoLink && !muonTruthParticleRecoLink->isAvailable()) {
244  for (const xAOD::TruthParticle* truthParticle : **muonTruthParticleRecoLink) {
245  ATH_MSG_DEBUG("no reco muon link set, add an empty one");
246  (*muonTruthParticleRecoLink)(*truthParticle) = ElementLink<xAOD::MuonContainer>();
247  }
248  }
249 
250  return StatusCode::SUCCESS;
251 }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

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

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

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

◆ initialize()

StatusCode Muon::RecoToTruthAssociationAlg::initialize ( )
override

Definition at line 47 of file RecoToTruthAssociationAlg.cxx.

47  {
48  ATH_CHECK(m_idHelperSvc.retrieve());
51 
52  if (m_recoLink.empty()){
53  m_muonTruthRecoLink = "" ;
54  } else {
56  }
57 
59  ATH_CHECK(m_muonTruthParticleLink.initialize());
61  ATH_CHECK(m_muonTruthParticleType.initialize());
65  for (const std::string& trk_coll : m_assocTrkContainers.value()){
66  m_inputDecorKey.emplace_back(trk_coll + ".truthParticleLink");
67  }
68 
69  m_inputDecorKey.emplace_back(m_truthMuKey, SG::AuxTypeRegistry::instance().getName(acc_origin.auxid()));
70  m_inputDecorKey.emplace_back(m_truthMuKey, SG::AuxTypeRegistry::instance().getName(acc_type.auxid()));
71  m_inputDecorKey.emplace_back(m_truthMuKey, SG::AuxTypeRegistry::instance().getName(truthMdtHitsAcc.auxid()));
72 
73  ATH_CHECK(m_inputDecorKey.initialize());
74  return StatusCode::SUCCESS;
75 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

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

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

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

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_associateWithInDetTP

Gaudi::Property<bool> Muon::RecoToTruthAssociationAlg::m_associateWithInDetTP {this, "AssociateWithInDetTP", false, "force use of ID track particles for association"}
private

Definition at line 68 of file RecoToTruthAssociationAlg.h.

◆ m_assocTrkContainers

Gaudi::Property<std::vector<std::string> > Muon::RecoToTruthAssociationAlg::m_assocTrkContainers
private
Initial value:
{this, "TrackContainers", {"CombinedMuonTrackParticles",
"ExtrapolatedMuonTrackParticles",
"MSOnlyExtrapolatedMuonTrackParticles"},
"Collection of track containers to be decorated before this alg can be scheduled. truthLink decoration exploited "}

Definition at line 63 of file RecoToTruthAssociationAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::RecoToTruthAssociationAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 70 of file RecoToTruthAssociationAlg.h.

◆ m_inputDecorKey

SG::ReadDecorHandleKeyArray<xAOD::IParticleContainer> Muon::RecoToTruthAssociationAlg::m_inputDecorKey
private
Initial value:
{
this, "TrkTruthLinkKeys", {},
"Declare the decoration dependencies of this algorithm. Steer via TrackContainers property"}

Definition at line 60 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleLink

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleLink
private
Initial value:
{
this, "MuonTruthParticleLink", m_recoMuKey, "truthParticleLink",
"muon truth particle link auxdata name; name will be reset in initialize() based on m_muonName"}

Definition at line 39 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleNPhiMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNPhiMatched
private
Initial value:
{
this, "MuonTruthParticleNPhiMatched", m_recoMuKey, "nphiMatchedHitsPerChamberLayer",
"muon vector of number of phi matched hits per chamber layer auxdata name; name will be reset in initialize() based on m_muonName"}

Definition at line 52 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleNPrecMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNPrecMatched
private
Initial value:
{
this, "MuonTruthParticleNPrecMatched", m_recoMuKey, "nprecMatchedHitsPerChamberLayer",
"muon vector of number of precision matched hits per chamber layer auxdata name; name will be reset in initialize() based on "
"m_muonName"}

Definition at line 48 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleNTrigEtaMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNTrigEtaMatched
private
Initial value:
{
this, "MuonTruthParticleNTrigEtaMatched", m_recoMuKey, "ntrigEtaMatchedHitsPerChamberLayer",
"muon vector of number of phi matched hits per chamber layer auxdata name; name will be reset in initialize() based on m_muonName"}

Definition at line 55 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleOrigin

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleOrigin
private
Initial value:
{
this, "MuonTruthParticleOrigin", m_recoMuKey, "truthOrigin",
"muon truth origin auxdata name; name will be reset in initialize() based on m_muonName"}

Definition at line 45 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthParticleType

SG::WriteDecorHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthParticleType
private
Initial value:
{
this, "MuonTruthParticleType", m_recoMuKey, "truthType",
"muon truth type auxdata name; name will be reset in initialize() based on m_muonName"}

Definition at line 42 of file RecoToTruthAssociationAlg.h.

◆ m_muonTruthRecoLink

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> Muon::RecoToTruthAssociationAlg::m_muonTruthRecoLink
private
Initial value:
{
this, "MuonTruthParticleRecoLink", m_truthMuKey, "",
"container name for muon truth particles; the full handle name, including the reco muon link auxdata, is set in initialize()"}

Definition at line 36 of file RecoToTruthAssociationAlg.h.

◆ m_recoLink

Gaudi::Property<std::string> Muon::RecoToTruthAssociationAlg::m_recoLink {this, "RecoLinkName", "recoMuonLink" , "Decoration to the truth particle pointing to the muon"}
private

Definition at line 67 of file RecoToTruthAssociationAlg.h.

◆ m_recoMuKey

SG::ReadHandleKey<xAOD::MuonContainer> Muon::RecoToTruthAssociationAlg::m_recoMuKey
private
Initial value:
{
this, "MuonContainerName", "Muons",
"container name for muon truth particles; the full handle name, including the reco muon link auxdata, is set in initialize()"}

Definition at line 32 of file RecoToTruthAssociationAlg.h.

◆ m_truthMuKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> Muon::RecoToTruthAssociationAlg::m_truthMuKey
private
Initial value:
{
this, "MuonTruthParticleContainerName", "MuonTruthParticles"}

Key to the filtered muon truth particles

Definition at line 29 of file RecoToTruthAssociationAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
xAOD::Muon_v1::allAuthors
uint16_t allAuthors() const
Get all the authors of this Muon.
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNPhiMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNPhiMatched
Definition: RecoToTruthAssociationAlg.h:52
xAOD::MuGirl
@ MuGirl
MuGirl.
Definition: TrackingPrimitives.h:142
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
index
Definition: index.py:1
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
xAOD::Muon_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
AthCommonDataStore::renounce
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Definition: AthCommonDataStore.h:380
xAOD::Muon_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Muon::RecoToTruthAssociationAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: RecoToTruthAssociationAlg.h:70
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNPrecMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNPrecMatched
Definition: RecoToTruthAssociationAlg.h:48
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
xAOD::Muon_v1::author
Author author() const
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::CompetingMuonClustersOnTrack
Definition: CompetingMuonClustersOnTrack.h:54
xAOD::P4Helpers::deltaR2
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
Definition: xAODP4Helpers.h:111
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
Muon::RecoToTruthAssociationAlg::count_chamber_layers
void count_chamber_layers(const xAOD::IParticle *truth_particle, const Trk::Track *ptrk, std::vector< unsigned int > &nprecHitsPerChamberLayer, std::vector< unsigned int > &nphiHitsPerChamberLayer, std::vector< unsigned int > &ntrigEtaHitsPerChamberLayer) const
Definition: RecoToTruthAssociationAlg.cxx:253
Muon::RecoToTruthAssociationAlg::m_assocTrkContainers
Gaudi::Property< std::vector< std::string > > m_assocTrkContainers
Definition: RecoToTruthAssociationAlg.h:63
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
dumpTruth.getName
getName
Definition: dumpTruth.py:34
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Muon::RecoToTruthAssociationAlg::m_associateWithInDetTP
Gaudi::Property< bool > m_associateWithInDetTP
Definition: RecoToTruthAssociationAlg.h:68
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleType
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleType
Definition: RecoToTruthAssociationAlg.h:42
MuonCombined::authorRank
int authorRank(const xAOD::Muon::Author &a)
Definition: TagBase.h:23
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::Muon_v1::charge
float charge() const
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
Muon::MuonStationIndex::chIndex
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
Definition: MuonStationIndex.cxx:11
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
xAOD::Muon_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::RecoToTruthAssociationAlg::m_truthMuKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuKey
Key to the filtered muon truth particles
Definition: RecoToTruthAssociationAlg.h:29
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
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
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Muon::RecoToTruthAssociationAlg::m_recoMuKey
SG::ReadHandleKey< xAOD::MuonContainer > m_recoMuKey
Definition: RecoToTruthAssociationAlg.h:32
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
MuonParameters::MuidSA
@ MuidSA
Definition: MuonParamDefs.h:59
Muon::RecoToTruthAssociationAlg::clear_dummys
void clear_dummys(const std::vector< unsigned long long > &identifiers, std::vector< unsigned int > &vec) const
Definition: RecoToTruthAssociationAlg.cxx:353
Muon::CompetingMuonClustersOnTrack::containedROTs
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Definition: CompetingMuonClustersOnTrack.h:184
Muon::RecoToTruthAssociationAlg::m_muonTruthRecoLink
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_muonTruthRecoLink
Definition: RecoToTruthAssociationAlg.h:36
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition: MuonStationIndex.h:31
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleNTrigEtaMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNTrigEtaMatched
Definition: RecoToTruthAssociationAlg.h:55
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetSimDataHelpers::identifiers
std::vector< Identifier > identifiers(const InDetSimDataCollection &coll)
Definition: InDetSimDataDict.h:15
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
h
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleLink
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleLink
Definition: RecoToTruthAssociationAlg.h:39
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Muon::RecoToTruthAssociationAlg::m_inputDecorKey
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_inputDecorKey
Definition: RecoToTruthAssociationAlg.h:60
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
Muon::RecoToTruthAssociationAlg::m_muonTruthParticleOrigin
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleOrigin
Definition: RecoToTruthAssociationAlg.h:45
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
xAOD::STACO
@ STACO
Tracks produced by STACO.
Definition: TrackingPrimitives.h:100
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
HepMC::is_sim_descendant
bool is_sim_descendant(const T1 &p1, const T2 &p2)
Method to check if the first particle is a descendant of the second in the simulation,...
Definition: MagicNumbers.h:372
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Muon::RecoToTruthAssociationAlg::m_recoLink
Gaudi::Property< std::string > m_recoLink
Definition: RecoToTruthAssociationAlg.h:67
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14