ATLAS Offline Software
OfflineObjectDecorHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETTRACKPERFMON_OFFLINEOBJECTDECORHELPER_H
6 #define INDETTRACKPERFMON_OFFLINEOBJECTDECORHELPER_H
7 
19 #include "xAODMuon/MuonContainer.h"
22 
24 #include <string>
25 
26 
27 namespace IDTPM {
28 
30  template < typename container_t >
32  const std::string& decoName ) {
33  using elementLink_t = ElementLink< container_t >;
34  return ( not track.isAvailable< elementLink_t >( decoName ) );
35  }
36 
38  template < typename container_t >
39  typename container_t::const_value_type getLinkedObject(
41  const std::string& decoName )
42  {
43  using elementLink_t = ElementLink< container_t >;
44 
45  if( isUnlinkedObject< container_t >( track, decoName ) ) return nullptr;
46 
47  elementLink_t eleLink = track.auxdata< elementLink_t >( decoName );
48 
49  if( not eleLink.isValid() ) return nullptr;
50 
51  return *eleLink;
52  }
53 
57  const std::string& quality="All" );
58 
61  const std::string& quality="All" );
62 
65  const int requiredNtracks,
66  const std::string& type="RNN",
67  const std::string& quality="" );
68 
71 
73 
75  const float truthProbCut=0. );
76 
77 } // namespace IDTPM
78 
79 #endif // > ! INDETTRACKPERFMON_OFFLINEOBJECTDECORHELPER_H
IDTPM::getTruthMatchProb
float getTruthMatchProb(const xAOD::TrackParticle &track)
getTruthMatchProb
Definition: OfflineObjectDecorHelper.cxx:51
IDTPM::getLinkedTau
const xAOD::TauJet * getLinkedTau(const xAOD::TrackParticle &track, const int requiredNtracks, const std::string &type, const std::string &quality)
getLinkedTau
Definition: OfflineObjectDecorHelper.cxx:33
IDTPM::getLinkedTruth
const xAOD::TruthParticle * getLinkedTruth(const xAOD::TrackParticle &track, const float truthProbCut)
getLinkedTruth
Definition: OfflineObjectDecorHelper.cxx:58
TruthParticleContainer.h
IDTPM::getLinkedElectron
const xAOD::Electron * getLinkedElectron(const xAOD::TrackParticle &track, const std::string &quality)
getLinkedElectron
Definition: OfflineObjectDecorHelper.cxx:17
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
ElectronContainer.h
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
IDTPM::getLinkedMuon
const xAOD::Muon * getLinkedMuon(const xAOD::TrackParticle &track, const std::string &quality)
getLinkedMuon
Definition: OfflineObjectDecorHelper.cxx:25
TauJetContainer.h
xAOD::Electron_v1
Definition: Electron_v1.h:34
MuonContainer.h
TrackParticle.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IDTPM::getLinkedObject
container_t::const_value_type getLinkedObject(const xAOD::TrackParticle &track, const std::string &decoName)
Templated method to retrieve object linked to a track.
Definition: OfflineObjectDecorHelper.h:39
IDTPM::isUnlinkedObject
bool isUnlinkedObject(const xAOD::TrackParticle &track, const std::string &decoName)
Templated method to check if a track is not linked to an object.
Definition: OfflineObjectDecorHelper.h:31
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
IDTPM
Athena include(s).
Definition: IPlotsDefinitionSvc.h:25
IDTPM::isUnlinkedTruth
bool isUnlinkedTruth(const xAOD::TrackParticle &track)
isUnlinkedTruth
Definition: OfflineObjectDecorHelper.cxx:44