ATLAS Offline Software
EMBremCollectionBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EGAMMAALGS_EMBREMCOLLECTIONBUILDER_H
6 #define EGAMMAALGS_EMBREMCOLLECTIONBUILDER_H
7 
13 
15 #include "GaudiKernel/EventContext.h"
16 #include "GaudiKernel/ToolHandle.h"
21 
23 #include "TrkTrack/Track.h"
26 
27 #include <memory>
28 
71 {
72 
73 public:
74  EMBremCollectionBuilder(const std::string& name, ISvcLocator* pSvcLocator);
75 
76  virtual StatusCode initialize() override final;
77  virtual StatusCode finalize() override final;
78  virtual StatusCode execute(const EventContext& ctx) const override final;
79 
85  {
86 
87  TrackWithIndex(std::unique_ptr<Trk::Track> intrack, size_t index)
88  : track(std::move(intrack))
89  , origIndex(index)
90  {}
91 
92  TrackWithIndex(const TrackWithIndex&) = delete;
96  ~TrackWithIndex() = default;
97 
98  std::unique_ptr<Trk::Track> track;
99  size_t origIndex;
100  };
101 
102 private:
103  StatusCode refitTracks(const EventContext& ctx,
104  const std::vector<const xAOD::TrackParticle*>& input,
105  std::vector<TrackWithIndex>& refitted,
106  std::vector<TrackWithIndex>& failedfit) const;
107 
109  const EventContext& ctx,
110  std::vector<TrackWithIndex>& refitted,
111  std::vector<TrackWithIndex>& failedfit,
112  std::vector<TrackWithIndex>& trtAlone,
113  TrackCollection* finalTracks,
114  xAOD::TrackParticleContainer* finalTrkPartContainer,
115  const xAOD::TrackParticleContainer* inputTrkPartContainer) const;
116 
118  const EventContext& ctx,
119  TrackWithIndex& Info,
120  TrackCollection* finalTracks,
121  xAOD::TrackParticleContainer* finalTrkPartContainer,
122  const xAOD::TrackParticleContainer* inputTrkPartContainer,
123  bool isRefitted) const;
124 
125  void copyOverInfo(xAOD::TrackParticle& created,
126  const xAOD::TrackParticle& original,
127  bool isRefitted) const;
128 
130  Gaudi::Property<bool> m_doTruth{ this, "DoTruth", false, "do truth" };
131 
133  Gaudi::Property<bool> m_doSCT{ this, "useSCT", true, "do SCT" };
134 
136  Gaudi::Property<bool> m_doPix{ this, "usePixel", true, "do Pix" };
137 
139  Gaudi::Property<bool> m_doTRT{ this, "useTRT", true, "do TRT" };
140 
142  Gaudi::Property<bool> m_doSlimTrkTracks{ this,
143  "slimTrkTracks",
144  true,
145  "Slim the GSF Trk::Tracks" };
146 
148  Gaudi::Property<bool> m_doHGTD{ this, "useHGTD", false, "do HGTD" };
149 
151  Gaudi::Property<int> m_MinNoSiHits{ this,
152  "minNoSiHits",
153  4,
154  "Minimum number of silicon hits on track "
155  "before it is allowed to be refitted" };
156 
158  ToolHandle<IegammaTrkRefitterTool> m_trkRefitTool{ this,
159  "TrackRefitTool",
160  "ElectronRefitterTool",
161  "Track refitter tool" };
162 
164  ToolHandle<Trk::ITrackParticleCreatorTool> m_particleCreatorTool{
165  this,
166  "TrackParticleCreatorTool",
167  "TrackParticleCreatorTool",
168  "TrackParticle creator tool"
169  };
170 
172  ToolHandle<Trk::ITrackSlimmingTool> m_slimTool{ this,
173  "TrackSlimmingTool",
174  "TrkTrackSlimmingTool",
175  "Track slimming tool" };
176 
178  this,
179  "TrackParticleContainerName",
180  "InDetTrackParticles",
181  "Input InDet TrackParticles"
182  };
183 
187  "SelectedTrackParticleContainerName",
188  "egammaSelectedTrackParticles",
189  "Input of Selected TrackParticles" };
190 
192  this,
193  "OutputTrkPartContainerName",
194  "GSFTrackParticles",
195  "Output GSF TrackParticles"
196  };
197 
199  this,
200  "OutputTrackContainerName",
201  "GSFTracks",
202  "Output GSF Trk::Tracks"
203  };
204 
205  // counters for final statistics
206  mutable std::atomic_uint m_FailedFitTracks{ 0 };
207  mutable std::atomic_uint m_RefittedTracks{ 0 };
208  mutable std::atomic_uint m_FailedSiliconRequirFit{ 0 };
209 };
210 #endif //
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
EMBremCollectionBuilder::createCollections
StatusCode createCollections(const EventContext &ctx, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit, std::vector< TrackWithIndex > &trtAlone, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer) const
Definition: EMBremCollectionBuilder.cxx:192
EMBremCollectionBuilder::m_trackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
Definition: EMBremCollectionBuilder.h:177
EMBremCollectionBuilder::TrackWithIndex::origIndex
size_t origIndex
Definition: EMBremCollectionBuilder.h:99
ITrackSummaryTool.h
EMBremCollectionBuilder::finalize
virtual StatusCode finalize() override final
EMBremCollectionBuilder::m_doSlimTrkTracks
Gaudi::Property< bool > m_doSlimTrkTracks
Option to slim the Trk::Tracks.
Definition: EMBremCollectionBuilder.h:142
EMBremCollectionBuilder::m_selectedTrackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_selectedTrackParticleContainerKey
Names of input output collections.
Definition: EMBremCollectionBuilder.h:186
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
index
Definition: index.py:1
ITrackParticleCreatorTool.h
EMBremCollectionBuilder::m_trkRefitTool
ToolHandle< IegammaTrkRefitterTool > m_trkRefitTool
The track refitter.
Definition: EMBremCollectionBuilder.h:158
EMBremCollectionBuilder::m_MinNoSiHits
Gaudi::Property< int > m_MinNoSiHits
@Cut on minimum silicon hits
Definition: EMBremCollectionBuilder.h:151
EMBremCollectionBuilder
Algorithm which creates new brem-refitted tracks.
Definition: EMBremCollectionBuilder.h:71
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::ReadHandleKey< xAOD::TrackParticleContainer >
EMBremCollectionBuilder::EMBremCollectionBuilder
EMBremCollectionBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EMBremCollectionBuilder.cxx:41
IEMExtrapolationTools.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
EMBremCollectionBuilder::createNew
StatusCode createNew(const EventContext &ctx, TrackWithIndex &Info, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer, bool isRefitted) const
Definition: EMBremCollectionBuilder.cxx:233
Track.h
EMBremCollectionBuilder::m_OutputTrkPartContainerKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_OutputTrkPartContainerKey
Definition: EMBremCollectionBuilder.h:191
ITrackSlimmingTool.h
EMBremCollectionBuilder::m_doHGTD
Gaudi::Property< bool > m_doHGTD
Option to copy HGTD time to new gsf tracks.
Definition: EMBremCollectionBuilder.h:148
EMBremCollectionBuilder::m_doSCT
Gaudi::Property< bool > m_doSCT
Option to copy SCT holes estimation.
Definition: EMBremCollectionBuilder.h:133
EMBremCollectionBuilder::initialize
virtual StatusCode initialize() override final
Definition: EMBremCollectionBuilder.cxx:47
EMBremCollectionBuilder::m_slimTool
ToolHandle< Trk::ITrackSlimmingTool > m_slimTool
Tool to slim tracks
Definition: EMBremCollectionBuilder.h:172
SG::WriteHandleKey< xAOD::TrackParticleContainer >
EMBremCollectionBuilder::TrackWithIndex::~TrackWithIndex
~TrackWithIndex()=default
IegammaTrkRefitterTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EMBremCollectionBuilder::TrackWithIndex::operator=
TrackWithIndex & operator=(const TrackWithIndex &)=delete
EMBremCollectionBuilder::TrackWithIndex::TrackWithIndex
TrackWithIndex(std::unique_ptr< Trk::Track > intrack, size_t index)
Definition: EMBremCollectionBuilder.h:87
EMBremCollectionBuilder::m_FailedSiliconRequirFit
std::atomic_uint m_FailedSiliconRequirFit
Definition: EMBremCollectionBuilder.h:208
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TrackCollection.h
EMBremCollectionBuilder::m_OutputTrackContainerKey
SG::WriteHandleKey< TrackCollection > m_OutputTrackContainerKey
Definition: EMBremCollectionBuilder.h:198
DataVector< Trk::Track >
EMBremCollectionBuilder::TrackWithIndex
Helper struct to store the Trk::Track corresponding to a TrackParticle and the index of the Track Par...
Definition: EMBremCollectionBuilder.h:85
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
EMBremCollectionBuilder::TrackWithIndex::TrackWithIndex
TrackWithIndex(TrackWithIndex &&)=default
EMBremCollectionBuilder::m_doTRT
Gaudi::Property< bool > m_doTRT
Option to copy TRT holes estimation.
Definition: EMBremCollectionBuilder.h:139
EMBremCollectionBuilder::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: EMBremCollectionBuilder.cxx:81
EMBremCollectionBuilder::m_RefittedTracks
std::atomic_uint m_RefittedTracks
Definition: EMBremCollectionBuilder.h:207
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EMBremCollectionBuilder::TrackWithIndex::operator=
TrackWithIndex & operator=(TrackWithIndex &&)=default
SiDetectorElementCollection.h
EMBremCollectionBuilder::m_doTruth
Gaudi::Property< bool > m_doTruth
Option to do truth.
Definition: EMBremCollectionBuilder.h:130
EMBremCollectionBuilder::TrackWithIndex::TrackWithIndex
TrackWithIndex(const TrackWithIndex &)=delete
TrackParticleFwd.h
EMBremCollectionBuilder::TrackWithIndex::track
std::unique_ptr< Trk::Track > track
Definition: EMBremCollectionBuilder.h:98
EMBremCollectionBuilder::m_FailedFitTracks
std::atomic_uint m_FailedFitTracks
Definition: EMBremCollectionBuilder.h:206
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
EMBremCollectionBuilder::refitTracks
StatusCode refitTracks(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &input, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit) const
Definition: EMBremCollectionBuilder.cxx:170
EMBremCollectionBuilder::copyOverInfo
void copyOverInfo(xAOD::TrackParticle &created, const xAOD::TrackParticle &original, bool isRefitted) const
Definition: EMBremCollectionBuilder.cxx:292
EMBremCollectionBuilder::m_particleCreatorTool
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool
Tool to create track particle.
Definition: EMBremCollectionBuilder.h:164
TrackParticleContainerFwd.h
EMBremCollectionBuilder::m_doPix
Gaudi::Property< bool > m_doPix
Option to copy pixel holes estimation.
Definition: EMBremCollectionBuilder.h:136