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

#include <MuonTruthAssociationAlg.h>

Inheritance diagram for MuonTruthAssociationAlg:
Collaboration diagram for MuonTruthAssociationAlg:

Public Member Functions

 MuonTruthAssociationAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
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 > &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 > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthMuKey
 
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::TrackParticleContainerm_trkTruthKeys
 
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 16 of file MuonTruthAssociationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonTruthAssociationAlg()

MuonTruthAssociationAlg::MuonTruthAssociationAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 38 of file MuonTruthAssociationAlg.cxx.

38  :
39  AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
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 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ clear_dummys()

void MuonTruthAssociationAlg::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 352 of file MuonTruthAssociationAlg.cxx.

352  {
355  if (identifiers.empty()) { return; }
356  for (unsigned int i = 0; i < vec.size(); ++i) {
357  if (vec[i] != dummy_unsigned) continue;
358  for (unsigned j = 0; j < identifiers.size(); ++j) {
360  if ((m_idHelperSvc->measuresPhi(id) && m_idHelperSvc->phiIndex(id) == (Muon::MuonStationIndex::PhiIndex)i) ||
361  (!m_idHelperSvc->measuresPhi(id) && m_idHelperSvc->chamberIndex(id) == (Muon::MuonStationIndex::ChIndex)i)) {
362  vec[i] = 0;
363  break;
364  }
365  }
366  }
367 }

◆ count_chamber_layers()

void MuonTruthAssociationAlg::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 247 of file MuonTruthAssociationAlg.cxx.

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

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonTruthAssociationAlg::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 68 of file MuonTruthAssociationAlg.cxx.

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

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode MuonTruthAssociationAlg::initialize ( )
override

Definition at line 42 of file MuonTruthAssociationAlg.cxx.

42  {
43  ATH_CHECK(m_idHelperSvc.retrieve());
45  ATH_CHECK(m_recoMuKey.initialize());
46 
47  if (m_recoLink.empty()){
48  m_muonTruthRecoLink = "" ;
49  } else {
51  }
52 
53  ATH_CHECK(m_muonTruthRecoLink.initialize(!m_recoLink.empty()));
54  ATH_CHECK(m_muonTruthParticleLink.initialize());
56  ATH_CHECK(m_muonTruthParticleType.initialize());
60  for (const std::string& trk_coll : m_assocTrkContainers.value()){
61  m_trkTruthKeys.emplace_back(trk_coll + ".truthParticleLink");
62  }
63  ATH_CHECK(m_trkTruthKeys.initialize());
64  return StatusCode::SUCCESS;
65 }

◆ 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 AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ 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 AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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> MuonTruthAssociationAlg::m_associateWithInDetTP {this, "AssociateWithInDetTP", false, "force use of ID track particles for association"}
private

Definition at line 67 of file MuonTruthAssociationAlg.h.

◆ m_assocTrkContainers

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

Definition at line 61 of file MuonTruthAssociationAlg.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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_idHelperSvc

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

Definition at line 69 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleLink

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 37 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleNPhiMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 50 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleNPrecMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 46 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleNTrigEtaMatched

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 53 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleOrigin

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 43 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthParticleType

SG::WriteDecorHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 40 of file MuonTruthAssociationAlg.h.

◆ m_muonTruthRecoLink

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> MuonTruthAssociationAlg::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 34 of file MuonTruthAssociationAlg.h.

◆ m_recoLink

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

Definition at line 66 of file MuonTruthAssociationAlg.h.

◆ m_recoMuKey

SG::ReadHandleKey<xAOD::MuonContainer> MuonTruthAssociationAlg::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 30 of file MuonTruthAssociationAlg.h.

◆ m_trkTruthKeys

SG::ReadDecorHandleKeyArray<xAOD::TrackParticleContainer> MuonTruthAssociationAlg::m_trkTruthKeys
private
Initial value:
{
this, "TrkTruthLinkKeys", {},
"Declare the decoration dependencies of this algorithm. Steer via TrackContainers property"}

Definition at line 58 of file MuonTruthAssociationAlg.h.

◆ m_truthMuKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> MuonTruthAssociationAlg::m_truthMuKey
private
Initial value:
{
this, "MuonTruthParticleContainerName", "MuonTruthParticles",
"container name for muon truth particles; the full handle name, including the reco muon link auxdata, is set in initialize()"}

Definition at line 26 of file MuonTruthAssociationAlg.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:195
MuonTruthAssociationAlg::m_muonTruthRecoLink
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_muonTruthRecoLink
Definition: MuonTruthAssociationAlg.h:34
xAOD::Muon_v1::allAuthors
uint16_t allAuthors() const
Get all the authors of this Muon.
MuonTruthAssociationAlg::m_recoMuKey
SG::ReadHandleKey< xAOD::MuonContainer > m_recoMuKey
Definition: MuonTruthAssociationAlg.h:30
xAOD::MuGirl
@ MuGirl
MuGirl.
Definition: TrackingPrimitives.h:141
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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.
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
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
xAOD::Muon_v1::author
Author author() const
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonTruthAssociationAlg::m_muonTruthParticleNPrecMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNPrecMatched
Definition: MuonTruthAssociationAlg.h:46
Muon::MuonStationIndex::PhiIndexMax
@ PhiIndexMax
Definition: MuonStationIndex.h:34
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
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition: MuonStationIndex.h:31
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonCombined::authorRank
int authorRank(const xAOD::Muon::Author &a)
Definition: TagBase.h:23
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
xAOD::Muon_v1::charge
float charge() const
MuonTruthAssociationAlg::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: MuonTruthAssociationAlg.cxx:247
MuonTruthAssociationAlg::m_trkTruthKeys
SG::ReadDecorHandleKeyArray< xAOD::TrackParticleContainer > m_trkTruthKeys
Definition: MuonTruthAssociationAlg.h:58
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonTruthAssociationAlg::m_muonTruthParticleOrigin
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleOrigin
Definition: MuonTruthAssociationAlg.h:43
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
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.
MuonTruthAssociationAlg::m_associateWithInDetTP
Gaudi::Property< bool > m_associateWithInDetTP
Definition: MuonTruthAssociationAlg.h:67
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonTruthAssociationAlg::m_muonTruthParticleType
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleType
Definition: MuonTruthAssociationAlg.h:40
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
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
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
xAOD::Muon_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
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
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
MuonTruthAssociationAlg::m_muonTruthParticleNPhiMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNPhiMatched
Definition: MuonTruthAssociationAlg.h:50
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
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
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:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
MuonParameters::MuidSA
@ MuidSA
Definition: MuonParamDefs.h:59
Muon::CompetingMuonClustersOnTrack::containedROTs
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
Definition: CompetingMuonClustersOnTrack.h:184
Muon::MuonStationIndex::ChIndexMax
@ ChIndexMax
Definition: MuonStationIndex.h:19
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
MuonTruthAssociationAlg::m_recoLink
Gaudi::Property< std::string > m_recoLink
Definition: MuonTruthAssociationAlg.h:66
MuonTruthAssociationAlg::m_muonTruthParticleNTrigEtaMatched
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleNTrigEtaMatched
Definition: MuonTruthAssociationAlg.h:53
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
h
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
MuonTruthAssociationAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTruthAssociationAlg.h:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
MuonTruthAssociationAlg::clear_dummys
void clear_dummys(const std::vector< unsigned long long > &identifiers, std::vector< unsigned int > &vec) const
Definition: MuonTruthAssociationAlg.cxx:352
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::STACO
@ STACO
Tracks produced by STACO.
Definition: TrackingPrimitives.h:99
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:360
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
MuonTruthAssociationAlg::m_truthMuKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuKey
Definition: MuonTruthAssociationAlg.h:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
MuonTruthAssociationAlg::m_assocTrkContainers
Gaudi::Property< std::vector< std::string > > m_assocTrkContainers
Definition: MuonTruthAssociationAlg.h:61
ServiceHandle< ICondSvc >
MuonTruthAssociationAlg::m_muonTruthParticleLink
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonTruthParticleLink
Definition: MuonTruthAssociationAlg.h:37
Identifier
Definition: IdentifierFieldParser.cxx:14