ATLAS Offline Software
Loading...
Searching...
No Matches
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
73public:
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))
90 {}
91
96 ~TrackWithIndex() = default;
97
98 std::unique_ptr<Trk::Track> track;
99 size_t origIndex;
100 };
101
102private:
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
108 StatusCode createCollections(
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
117 StatusCode createNew(
118 const EventContext& ctx,
119 TrackWithIndex& Info,
120 TrackCollection* finalTracks,
121 xAOD::TrackParticleContainer* finalTrkPartContainer,
122 const xAOD::TrackParticleContainer* inputTrkPartContainer,
123 bool isRefitted) const;
124
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 //
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< bool > m_doTruth
Option to do truth.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
ToolHandle< Trk::ITrackSlimmingTool > m_slimTool
Tool to slim tracks.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_OutputTrkPartContainerKey
Gaudi::Property< bool > m_doTRT
Option to copy TRT holes estimation.
Gaudi::Property< bool > m_doHGTD
Option to copy HGTD time to new gsf tracks.
void copyOverInfo(xAOD::TrackParticle &created, const xAOD::TrackParticle &original, bool isRefitted) const
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_selectedTrackParticleContainerKey
Names of input output collections.
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
StatusCode createNew(const EventContext &ctx, TrackWithIndex &Info, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer, bool isRefitted) const
virtual StatusCode finalize() override final
Gaudi::Property< bool > m_doSCT
Option to copy SCT holes estimation.
virtual StatusCode initialize() override final
ToolHandle< IegammaTrkRefitterTool > m_trkRefitTool
The track refitter.
std::atomic_uint m_FailedSiliconRequirFit
Gaudi::Property< bool > m_doSlimTrkTracks
Option to slim the Trk::Tracks.
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool
Tool to create track particle.
SG::WriteHandleKey< TrackCollection > m_OutputTrackContainerKey
StatusCode refitTracks(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &input, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit) const
EMBremCollectionBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< int > m_MinNoSiHits
@Cut on minimum silicon hits
virtual StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< bool > m_doPix
Option to copy pixel holes estimation.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition index.py:1
STL namespace.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Helper struct to store the Trk::Track corresponding to a TrackParticle and the index of the Track Par...
TrackWithIndex(TrackWithIndex &&)=default
TrackWithIndex & operator=(const TrackWithIndex &)=delete
TrackWithIndex(std::unique_ptr< Trk::Track > intrack, size_t index)
TrackWithIndex(const TrackWithIndex &)=delete
TrackWithIndex & operator=(TrackWithIndex &&)=default