ATLAS Offline Software
EGammaGSFCalo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  Contact: Raphael Haberle <raphael.julien.haberle@cern.ch>
4 */
5 
6 #ifndef DERIVATIONFRAMEWORKEGAMMA_EGammaGSFCalo_H
7 #define DERIVATIONFRAMEWORKEGAMMA_EGammaGSFCalo_H
8 
9 #include <atomic>
10 
12 
14 
17 
21 
24 
26 
27 
28 namespace DerivationFramework {
29  class EGammaGSFCalo : public extends<AthAlgTool, IAugmentationTool> {
30  public:
31 
32  using base_class::base_class;
33 
35  virtual StatusCode initialize() override final;
37  virtual StatusCode finalize() override final;
39  virtual StatusCode addBranches( const EventContext& ctx ) const override final;
40 
41  private:
43  this, "ElectronCollectionName", "Electrons", "Input electron collection"};
44 
46  this, "OutputTrkPartContainerName", "GSFCaloContainer",
47  "Output GSF+Calo container"};
48 
50  this, "GSFCaloTrackLinkKey", "Electrons.gsfCaloTrackParticleLink",
51  "Decoration linking electrons to refitted TrackParticles"};
53  ToolHandle<IegammaTrkRefitterTool> m_trkRefitTool{
54  this, "TrackRefitTool", "ElectronRefitterTool", "Track refitter tool"};
55 
57  ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreatorTool{
58  this, "TrackParticleCreatorTool", "TrackParticleCreatorTool",
59  "TrackParticle creator tool"};
60 
61  PublicToolHandle<Trk::IExtendedTrackSummaryTool> m_trackSummaryTool{
62  this, "TrackSummaryTool", "Trk::TrackSummaryTool/AtlasTrackSummaryTool"};
63 
66  Gaudi::Property<int> m_minNSiHits{this, "minNSiHits", 4,
67  "Minimum number of silicon hits on track "
68  "before it is allowed to be refitted"};
69  Gaudi::Property<bool> m_doPix{this, "usePixel", true,
70  "Bool to use pixel hits"};
71  Gaudi::Property<bool> m_doSCT{this, "useSCT", true, "Bool to use SCT hits"};
72  Gaudi::Property<bool> m_doTRT{this, "useTRT", true, "Bool to use TRT hits"};
73 
74  Gaudi::Property<bool> m_doTruth{this, "useTruth", true,
75  "Bool to add truth decorations"};
76 
77  Gaudi::Property<bool> m_isAOD{this, "isAOD", true, "AOD flag"};
78 
80  mutable std::atomic<unsigned int> m_allElectrons = 0;
81  mutable std::atomic<unsigned int> m_noTP = 0;
82  mutable std::atomic<unsigned int> m_onlyTRT = 0;
83  mutable std::atomic<unsigned int> m_noTrk = 0;
84  mutable std::atomic<unsigned int> m_failedFits = 0;
85  mutable std::atomic<unsigned int> m_successfulFits = 0;
86  mutable std::atomic<unsigned int> m_successfulCopyInfos = 0;
87  mutable std::atomic<unsigned int> m_noRefTP = 0;
88  mutable std::atomic<unsigned int> m_allNewTP = 0;
89  mutable std::atomic<unsigned int> m_tsos = 0;
90 
92  void copyInfo(const xAOD::TrackParticle& original,
93  xAOD::TrackParticle& created, bool isRefitted) const;
94 
97  const xAOD::SummaryType& information) const {
98  uint8_t value = summaryValueInt(src, information, 0);
99  dest.setSummaryValue(value, information);
100  }
101  };
102 } // namespace DerivationFramework
103 
104 #endif // DERIVATIONFRAMEWORKEGAMMA_EGammaGSFCalo_H
SG::WriteDecorHandleKey< xAOD::ElectronContainer >
DerivationFramework::EGammaGSFCalo::m_doSCT
Gaudi::Property< bool > m_doSCT
Definition: EGammaGSFCalo.h:71
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:553
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
IAugmentationTool.h
DerivationFramework::EGammaGSFCalo::m_tsos
std::atomic< unsigned int > m_tsos
Definition: EGammaGSFCalo.h:89
DerivationFramework::EGammaGSFCalo::m_trackSummaryTool
PublicToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: EGammaGSFCalo.h:61
ITrackParticleCreatorTool.h
DerivationFramework::EGammaGSFCalo::finalize
virtual StatusCode finalize() override final
finalize method
Definition: EGammaGSFCalo.cxx:27
athena.value
value
Definition: athena.py:124
DerivationFramework::EGammaGSFCalo::m_noTrk
std::atomic< unsigned int > m_noTrk
Definition: EGammaGSFCalo.h:83
DerivationFramework::EGammaGSFCalo::m_doTruth
Gaudi::Property< bool > m_doTruth
Definition: EGammaGSFCalo.h:74
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
DerivationFramework::EGammaGSFCalo::copySummaryValue
void copySummaryValue(const xAOD::TrackParticle &src, xAOD::TrackParticle &dest, const xAOD::SummaryType &information) const
Definition: EGammaGSFCalo.h:95
DerivationFramework::EGammaGSFCalo::m_trkRefitTool
ToolHandle< IegammaTrkRefitterTool > m_trkRefitTool
The track refitter.
Definition: EGammaGSFCalo.h:53
SG::ReadHandleKey< xAOD::ElectronContainer >
DerivationFramework::EGammaGSFCalo::m_particleCreatorTool
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool
Tool to create track particle.
Definition: EGammaGSFCalo.h:57
DerivationFramework::EGammaGSFCalo::m_onlyTRT
std::atomic< unsigned int > m_onlyTRT
Definition: EGammaGSFCalo.h:82
DerivationFramework::EGammaGSFCalo::m_electronCollectionKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronCollectionKey
Definition: EGammaGSFCalo.h:42
DerivationFramework::EGammaGSFCalo::m_allNewTP
std::atomic< unsigned int > m_allNewTP
Definition: EGammaGSFCalo.h:88
EgammaxAODHelpers.h
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:229
SG::WriteHandleKey< xAOD::TrackParticleContainer >
DerivationFramework::EGammaGSFCalo::copyInfo
void copyInfo(const xAOD::TrackParticle &original, xAOD::TrackParticle &created, bool isRefitted) const
Copy TrackParticle info from the original TP.
Definition: EGammaGSFCalo.cxx:200
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
DerivationFramework::EGammaGSFCalo::m_doPix
Gaudi::Property< bool > m_doPix
Definition: EGammaGSFCalo.h:69
DerivationFramework::EGammaGSFCalo::m_noTP
std::atomic< unsigned int > m_noTP
Definition: EGammaGSFCalo.h:81
DerivationFramework::EGammaGSFCalo::m_minNSiHits
Gaudi::Property< int > m_minNSiHits
Minimum number of silicon hits on track before it is allowed to be refitted.
Definition: EGammaGSFCalo.h:66
IegammaTrkRefitterTool.h
DerivationFramework::EGammaGSFCalo::m_isAOD
Gaudi::Property< bool > m_isAOD
Definition: EGammaGSFCalo.h:77
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::EGammaGSFCalo::m_successfulCopyInfos
std::atomic< unsigned int > m_successfulCopyInfos
Definition: EGammaGSFCalo.h:86
xAOD::EgammaHelpers::summaryValueInt
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
Definition: EgammaxAODHelpers.cxx:161
DerivationFramework::EGammaGSFCalo::m_OutputTrkPartContainerKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_OutputTrkPartContainerKey
Definition: EGammaGSFCalo.h:45
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
DerivationFramework::EGammaGSFCalo::m_gsfCaloTrackLinkKey
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_gsfCaloTrackLinkKey
Definition: EGammaGSFCalo.h:49
DerivationFramework::EGammaGSFCalo::initialize
virtual StatusCode initialize() override final
initialize method
Definition: EGammaGSFCalo.cxx:14
DerivationFramework::EGammaGSFCalo
Definition: EGammaGSFCalo.h:29
DerivationFramework::EGammaGSFCalo::m_failedFits
std::atomic< unsigned int > m_failedFits
Definition: EGammaGSFCalo.h:84
ElectronContainerFwd.h
IExtendedTrackSummaryTool.h
DerivationFramework::EGammaGSFCalo::m_successfulFits
std::atomic< unsigned int > m_successfulFits
Definition: EGammaGSFCalo.h:85
DerivationFramework::EGammaGSFCalo::m_noRefTP
std::atomic< unsigned int > m_noRefTP
Definition: EGammaGSFCalo.h:87
DerivationFramework::EGammaGSFCalo::m_allElectrons
std::atomic< unsigned int > m_allElectrons
Counters.
Definition: EGammaGSFCalo.h:80
DerivationFramework::EGammaGSFCalo::m_doTRT
Gaudi::Property< bool > m_doTRT
Definition: EGammaGSFCalo.h:72
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:44
DerivationFramework::EGammaGSFCalo::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
addBranches method
Definition: EGammaGSFCalo.cxx:46