ATLAS Offline Software
Loading...
Searching...
No Matches
EMBremCollectionBuilder Class Reference

Algorithm which creates new brem-refitted tracks. More...

#include <EMBremCollectionBuilder.h>

Inheritance diagram for EMBremCollectionBuilder:
Collaboration diagram for EMBremCollectionBuilder:

Classes

struct  TrackWithIndex
 Helper struct to store the Trk::Track corresponding to a TrackParticle and the index of the Track Particle in the original container. More...

Public Member Functions

 EMBremCollectionBuilder (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override final
virtual StatusCode finalize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode refitTracks (const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &input, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit) const
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
void copyOverInfo (xAOD::TrackParticle &created, const xAOD::TrackParticle &original, bool isRefitted) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_doTruth { this, "DoTruth", false, "do truth" }
 Option to do truth.
Gaudi::Property< bool > m_doSCT { this, "useSCT", true, "do SCT" }
 Option to copy SCT holes estimation.
Gaudi::Property< bool > m_doPix { this, "usePixel", true, "do Pix" }
 Option to copy pixel holes estimation.
Gaudi::Property< bool > m_doTRT { this, "useTRT", true, "do TRT" }
 Option to copy TRT holes estimation.
Gaudi::Property< bool > m_doSlimTrkTracks
 Option to slim the Trk::Tracks.
Gaudi::Property< bool > m_doHGTD { this, "useHGTD", false, "do HGTD" }
 Option to copy HGTD time to new gsf tracks.
Gaudi::Property< int > m_MinNoSiHits
 @Cut on minimum silicon hits
ToolHandle< IegammaTrkRefitterToolm_trkRefitTool
 The track refitter.
ToolHandle< Trk::ITrackParticleCreatorToolm_particleCreatorTool
 Tool to create track particle.
ToolHandle< Trk::ITrackSlimmingToolm_slimTool
 Tool to slim tracks.
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackParticleContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainerm_selectedTrackParticleContainerKey
 Names of input output collections.
SG::WriteHandleKey< xAOD::TrackParticleContainerm_OutputTrkPartContainerKey
SG::WriteHandleKey< TrackCollectionm_OutputTrackContainerKey
std::atomic_uint m_FailedFitTracks { 0 }
std::atomic_uint m_RefittedTracks { 0 }
std::atomic_uint m_FailedSiliconRequirFit { 0 }
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm which creates new brem-refitted tracks.

Author
Christos Anastopoulos
Anthony Morley

Input containers:

  • TrackParticleContainerName (default=InDetTrackParticles): all the track particles
  • SelectedTrackParticleContainerName (default=egammaSelectedTrackParticles): selected track particle to be refitted

Output continers:

  • OutputTrkPartContainerName (default=GSFTrackParticles): refitted track particle
  • OutputTrackContainerName (default=GSFTracks): refitted slimmed tracks

Only tracks with a minimum number of Si-hits (minNoSiHits) are refitted. The refitted Trk::Tracks, and "copies" of the selected but not refitted Trk:;Tracks (i.e TRT alone), are saved in the output containers.

The GSF refitting can be done only when the full xAOD::Track is available (e.g. not in standard AOD). The refitting is delegated to a tool implementing the IegammaTrkRefitterTool interface, configured with the TrackRefitTool property (by default ElectronRefitterTool).

The final track particles are created from the Trk::Tracks (refitted or copied) with a tool implementing the Trk::ITrackParticleCreatorTool interface configured with the property TrackParticleCreatorTool (by default TrackParticleCreatorTool). During the above summary creation we prefer to avoid the so called hole-search so we copy over this information for Pixel, SCT, TRT according to the property usePixel, useSCT, useTRT.

Truth information is copied from the original xAOD::TrackParticle. The Trk::Tracks (refitted or copied) are saved after slimming with a tool implementing the Trk::ITrackSlimmingTool interface, configurable with the TrackSlimmingTool property (by default TrkTrackSlimmingTool).

Definition at line 70 of file EMBremCollectionBuilder.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

◆ EMBremCollectionBuilder()

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

Definition at line 28 of file EMBremCollectionBuilder.cxx.

30 : AthReentrantAlgorithm(name, pSvcLocator)
31{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ copyOverInfo()

void EMBremCollectionBuilder::copyOverInfo ( xAOD::TrackParticle & created,
const xAOD::TrackParticle & original,
bool isRefitted ) const
private

◆ createCollections()

StatusCode EMBremCollectionBuilder::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
private

Definition at line 183 of file EMBremCollectionBuilder.cxx.

191{
192 // Now we can create the final ouput
193 // 1. Add the refitted
194 for (auto& trk : refitted) {
196 trk,
197 finalTracks,
198 finalTrkPartContainer,
199 inputTrkPartContainer,
200 true));
201 }
202 // 2. Add the failed fit
203 for (auto& trk : failedfit) {
205 trk,
206 finalTracks,
207 finalTrkPartContainer,
208 inputTrkPartContainer,
209 false));
210 }
211 // 3. Add the TRT alone
212 for (auto& trk : trtAlone) {
214 trk,
215 finalTracks,
216 finalTrkPartContainer,
217 inputTrkPartContainer,
218 false));
219 }
220 return StatusCode::SUCCESS;
221}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode createNew(const EventContext &ctx, TrackWithIndex &Info, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer, bool isRefitted) const

◆ createNew()

StatusCode EMBremCollectionBuilder::createNew ( const EventContext & ctx,
TrackWithIndex & Info,
TrackCollection * finalTracks,
xAOD::TrackParticleContainer * finalTrkPartContainer,
const xAOD::TrackParticleContainer * inputTrkPartContainer,
bool isRefitted ) const
private

Definition at line 224 of file EMBremCollectionBuilder.cxx.

231{
232
233 // Create new TrackParticle owned by finalTrkPartContainer
234 xAOD::TrackParticle* aParticle = m_particleCreatorTool->createParticle(
235 ctx, *(trk_info.track), finalTrkPartContainer, nullptr, xAOD::electron);
236
237 if (!aParticle) {
239 "Could not create TrackParticle!!! for Track: " << *(trk_info.track));
240 return StatusCode::SUCCESS;
241 }
242 size_t origIndex = trk_info.origIndex;
243 const xAOD::TrackParticle* original = inputTrkPartContainer->at(origIndex);
244
245 // Add an element link back to original Track Particle collection
246 static const SG::AuxElement::Accessor<
247 ElementLink<xAOD::TrackParticleContainer>>
248 tP("originalTrackParticle");
249 ElementLink<xAOD::TrackParticleContainer> linkToOriginal(
250 *inputTrkPartContainer, origIndex, ctx);
251 tP(*aParticle) = linkToOriginal;
252 // Add qoverP from the last measurement
253 float QoverPLast(0);
254 auto rtsos = trk_info.track->trackStateOnSurfaces()->rbegin();
255 for (; rtsos != trk_info.track->trackStateOnSurfaces()->rend(); ++rtsos) {
256 if ((*rtsos)->type(Trk::TrackStateOnSurface::Measurement) &&
257 (*rtsos)->trackParameters() != nullptr &&
258 (*rtsos)->measurementOnTrack() != nullptr &&
259 !(*rtsos)->measurementOnTrack()->type(
261 QoverPLast = (*rtsos)->trackParameters()->parameters()[Trk::qOverP];
262 break;
263 }
264 }
265 static const SG::AuxElement::Accessor<float> QoverPLM("QoverPLM");
266 QoverPLM(*aParticle) = QoverPLast;
267 egammaCopyTrackParticleInfo::ToCopy toCopy{.isRefitted = isRefitted,
268 .doTruth = m_doTruth,
269 .doPix = m_doPix,
270 .doSCT = m_doSCT,
271 .doTRT = m_doTRT,
272 .doHGTD = m_doHGTD};
273 egammaCopyTrackParticleInfo::copy(*aParticle, *original, toCopy);
274 // Slim the Trk::Track, store to the new
275 // Trk::Track collection and make the Track
276 // Particle point to it
277 if (m_doSlimTrkTracks) {
278 m_slimTool->slimTrack(*(trk_info.track));
279 }
280 finalTracks->push_back(std::move(trk_info.track));
281 ElementLink<TrackCollection> trackLink(
282 *finalTracks, finalTracks->size() - 1, ctx);
283 aParticle->setTrackLink(trackLink);
284 return StatusCode::SUCCESS;
285}
#define ATH_MSG_WARNING(x)
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< bool > m_doTruth
Option to do truth.
ToolHandle< Trk::ITrackSlimmingTool > m_slimTool
Tool to slim tracks.
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.
Gaudi::Property< bool > m_doSCT
Option to copy SCT holes estimation.
Gaudi::Property< bool > m_doSlimTrkTracks
Option to slim the Trk::Tracks.
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool
Tool to create track particle.
Gaudi::Property< bool > m_doPix
Option to copy pixel holes estimation.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
void setTrackLink(const ElementLink< TrackCollection > &track)
Set the link to the original track.
@ qOverP
perigee
Definition ParamDefs.h:67
void copy(xAOD::TrackParticle &created, const xAOD::TrackParticle &original, const egammaCopyTrackParticleInfo::ToCopy &toCopy)
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ 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.

◆ evtStore()

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.

◆ execute()

StatusCode EMBremCollectionBuilder::execute ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 68 of file EMBremCollectionBuilder.cxx.

69{
70 // Read the inputs
71 // The input track particles
72 SG::ReadHandle<xAOD::TrackParticleContainer> trackTES(
74 ATH_CHECK(trackTES.isValid());
75
76 // The input selected track particles (subset of "all" input
77 // read above).
78 SG::ReadHandle<xAOD::TrackParticleContainer> selectedTrackParticles(
80 ATH_CHECK(selectedTrackParticles.isValid());
81
82 // Create the final containers to be written out
83 // 1. Track particles
84 SG::WriteHandle<xAOD::TrackParticleContainer> finalTrkPartContainer(
86 ATH_CHECK(finalTrkPartContainer.record(
87 std::make_unique<xAOD::TrackParticleContainer>(),
88 std::make_unique<xAOD::TrackParticleAuxContainer>()));
89 xAOD::TrackParticleContainer* cPtrTrkPart = finalTrkPartContainer.ptr();
90
91 // 2. Trk::Tracks
92 SG::WriteHandle<TrackCollection> finalTracks(m_OutputTrackContainerKey, ctx);
93 ATH_CHECK(finalTracks.record(std::make_unique<TrackCollection>()));
94 TrackCollection* cPtrTracks = finalTracks.ptr();
95
96 // Loop over the selected track-particles
97 // Split TRT-alone from silicon ones.
98 // For the TRT we can get all the info
99 // already since we are not going to refit.
100 std::vector<const xAOD::TrackParticle*> siliconTrkTracks;
101 siliconTrkTracks.reserve(16);
102 std::vector<TrackWithIndex> trtAloneTrkTracks;
103 trtAloneTrkTracks.reserve(8);
104
105 for (const xAOD::TrackParticle* trackParticle : *selectedTrackParticles) {
106 ATH_CHECK(trackParticle->trackLink().isValid());
107 const Trk::Track* trktrack = trackParticle->track();
108 int nSiliconHits_trk = xAOD::EgammaHelpers::summaryValueInt(
109 *trackParticle, xAOD::numberOfSCTHits, 0);
110 nSiliconHits_trk += xAOD::EgammaHelpers::summaryValueInt(
111 *trackParticle, xAOD::numberOfPixelHits, 0);
112 if (nSiliconHits_trk >= m_MinNoSiHits) {
113 siliconTrkTracks.push_back(trackParticle);
114 } else {
115 // copy Trk::Track
116 trtAloneTrkTracks.emplace_back(std::make_unique<Trk::Track>(*trktrack),
117 trackParticle->index());
118 }
119 }
120
121 // Store the results of the GSF refit
122 std::vector<TrackWithIndex> refitted; // refit success
123 refitted.reserve(siliconTrkTracks.size());
124 std::vector<TrackWithIndex> failedfit; // refit failure
125
126 // Do the GSF refit.
127 // Note that altough the input is a xAOD::TrackParticle
128 // what we really refit is the corresponding Trk::Track.
129 // The output is two collections
130 // one for fit success or failure.
131 // TrackWithIndex means the newly created Trk::::Track
132 // and the index of the xAOD::TrackParticle to the
133 // original TrackParticle Collection.
134 ATH_CHECK(refitTracks(ctx, siliconTrkTracks, refitted, failedfit));
135
136 const size_t refittedCount = refitted.size();
137 const size_t failedCount = failedfit.size();
138 const size_t trtCount = trtAloneTrkTracks.size();
139 const size_t totalCount = refittedCount + failedCount + trtCount;
140
141 // reserve as we know how many we will create
142 cPtrTracks->reserve(totalCount);
143 cPtrTrkPart->reserve(totalCount);
144 // Fill the final collections
146 refitted,
147 failedfit,
148 trtAloneTrkTracks,
149 cPtrTracks,
150 cPtrTrkPart,
151 trackTES.ptr()));
152
153 // Update counters
154 m_RefittedTracks.fetch_add(refittedCount, std::memory_order_relaxed);
155 m_FailedFitTracks.fetch_add(failedCount, std::memory_order_relaxed);
156 m_FailedSiliconRequirFit.fetch_add(trtCount, std::memory_order_relaxed);
157 return StatusCode::SUCCESS;
158}
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_OutputTrkPartContainerKey
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
std::atomic_uint m_FailedSiliconRequirFit
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
Gaudi::Property< int > m_MinNoSiHits
@Cut on minimum silicon hits
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...
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].

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

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

virtual StatusCode EMBremCollectionBuilder::finalize ( )
finaloverridevirtual

◆ initialize()

StatusCode EMBremCollectionBuilder::initialize ( )
finaloverridevirtual

Definition at line 34 of file EMBremCollectionBuilder.cxx.

35{
36
41
42 /* retrieve the track refitter tool*/
43 ATH_CHECK(m_trkRefitTool.retrieve());
44 /* Get the particle creation tool */
46 /* Get the track slimming tool if needed */
48 ATH_CHECK(m_slimTool.retrieve());
49 } else {
50 m_slimTool.disable();
51 }
52
53 return StatusCode::SUCCESS;
54}
ToolHandle< IegammaTrkRefitterTool > m_trkRefitTool
The track refitter.

◆ 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()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ 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.

◆ refitTracks()

StatusCode EMBremCollectionBuilder::refitTracks ( const EventContext & ctx,
const std::vector< const xAOD::TrackParticle * > & input,
std::vector< TrackWithIndex > & refitted,
std::vector< TrackWithIndex > & failedfit ) const
private

Definition at line 161 of file EMBremCollectionBuilder.cxx.

166{
167 for (const xAOD::TrackParticle* in : input) {
168 const Trk::Track* track = in->track();
169 IegammaTrkRefitterTool::Cache cache{};
170 StatusCode status = m_trkRefitTool->refitTrack(ctx, track, cache);
171 if (status == StatusCode::SUCCESS) {
172 // this is new track
173 refitted.emplace_back(std::move(cache.refittedTrack), in->index());
174 } else {
175 // This is copy ctor
176 failedfit.emplace_back(std::make_unique<Trk::Track>(*track), in->index());
177 }
178 }
179 return StatusCode::SUCCESS;
180}
::StatusCode StatusCode
StatusCode definition for legacy code.
status
Definition merge.py:16
std::unique_ptr< Trk::Track > refittedTrack
Pointer to the refitted track.

◆ 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();
384 }
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)

◆ 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 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ 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_doHGTD

Gaudi::Property<bool> EMBremCollectionBuilder::m_doHGTD { this, "useHGTD", false, "do HGTD" }
private

Option to copy HGTD time to new gsf tracks.

Definition at line 148 of file EMBremCollectionBuilder.h.

148{ this, "useHGTD", false, "do HGTD" };

◆ m_doPix

Gaudi::Property<bool> EMBremCollectionBuilder::m_doPix { this, "usePixel", true, "do Pix" }
private

Option to copy pixel holes estimation.

Definition at line 136 of file EMBremCollectionBuilder.h.

136{ this, "usePixel", true, "do Pix" };

◆ m_doSCT

Gaudi::Property<bool> EMBremCollectionBuilder::m_doSCT { this, "useSCT", true, "do SCT" }
private

Option to copy SCT holes estimation.

Definition at line 133 of file EMBremCollectionBuilder.h.

133{ this, "useSCT", true, "do SCT" };

◆ m_doSlimTrkTracks

Gaudi::Property<bool> EMBremCollectionBuilder::m_doSlimTrkTracks
private
Initial value:
{ this,
"slimTrkTracks",
true,
"Slim the GSF Trk::Tracks" }

Option to slim the Trk::Tracks.

Definition at line 142 of file EMBremCollectionBuilder.h.

142 { this,
143 "slimTrkTracks",
144 true,
145 "Slim the GSF Trk::Tracks" };

◆ m_doTRT

Gaudi::Property<bool> EMBremCollectionBuilder::m_doTRT { this, "useTRT", true, "do TRT" }
private

Option to copy TRT holes estimation.

Definition at line 139 of file EMBremCollectionBuilder.h.

139{ this, "useTRT", true, "do TRT" };

◆ m_doTruth

Gaudi::Property<bool> EMBremCollectionBuilder::m_doTruth { this, "DoTruth", false, "do truth" }
private

Option to do truth.

Definition at line 130 of file EMBremCollectionBuilder.h.

130{ this, "DoTruth", false, "do truth" };

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_FailedFitTracks

std::atomic_uint EMBremCollectionBuilder::m_FailedFitTracks { 0 }
mutableprivate

Definition at line 206 of file EMBremCollectionBuilder.h.

206{ 0 };

◆ m_FailedSiliconRequirFit

std::atomic_uint EMBremCollectionBuilder::m_FailedSiliconRequirFit { 0 }
mutableprivate

Definition at line 208 of file EMBremCollectionBuilder.h.

208{ 0 };

◆ m_MinNoSiHits

Gaudi::Property<int> EMBremCollectionBuilder::m_MinNoSiHits
private
Initial value:
{ this,
"minNoSiHits",
4,
"Minimum number of silicon hits on track "
"before it is allowed to be refitted" }

@Cut on minimum silicon hits

Definition at line 151 of file EMBremCollectionBuilder.h.

151 { this,
152 "minNoSiHits",
153 4,
154 "Minimum number of silicon hits on track "
155 "before it is allowed to be refitted" };

◆ m_OutputTrackContainerKey

SG::WriteHandleKey<TrackCollection> EMBremCollectionBuilder::m_OutputTrackContainerKey
private
Initial value:
{
this,
"OutputTrackContainerName",
"GSFTracks",
"Output GSF Trk::Tracks"
}

Definition at line 198 of file EMBremCollectionBuilder.h.

198 {
199 this,
200 "OutputTrackContainerName",
201 "GSFTracks",
202 "Output GSF Trk::Tracks"
203 };

◆ m_OutputTrkPartContainerKey

SG::WriteHandleKey<xAOD::TrackParticleContainer> EMBremCollectionBuilder::m_OutputTrkPartContainerKey
private
Initial value:
{
this,
"OutputTrkPartContainerName",
"GSFTrackParticles",
"Output GSF TrackParticles"
}

Definition at line 191 of file EMBremCollectionBuilder.h.

191 {
192 this,
193 "OutputTrkPartContainerName",
194 "GSFTrackParticles",
195 "Output GSF TrackParticles"
196 };

◆ m_particleCreatorTool

ToolHandle<Trk::ITrackParticleCreatorTool> EMBremCollectionBuilder::m_particleCreatorTool
private
Initial value:
{
this,
"TrackParticleCreatorTool",
"TrackParticleCreatorTool",
"TrackParticle creator tool"
}

Tool to create track particle.

Definition at line 164 of file EMBremCollectionBuilder.h.

164 {
165 this,
166 "TrackParticleCreatorTool",
167 "TrackParticleCreatorTool",
168 "TrackParticle creator tool"
169 };

◆ m_RefittedTracks

std::atomic_uint EMBremCollectionBuilder::m_RefittedTracks { 0 }
mutableprivate

Definition at line 207 of file EMBremCollectionBuilder.h.

207{ 0 };

◆ m_selectedTrackParticleContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> EMBremCollectionBuilder::m_selectedTrackParticleContainerKey
private
Initial value:
{ this,
"SelectedTrackParticleContainerName",
"egammaSelectedTrackParticles",
"Input of Selected TrackParticles" }

Names of input output collections.

Definition at line 186 of file EMBremCollectionBuilder.h.

186 { this,
187 "SelectedTrackParticleContainerName",
188 "egammaSelectedTrackParticles",
189 "Input of Selected TrackParticles" };

◆ m_slimTool

ToolHandle<Trk::ITrackSlimmingTool> EMBremCollectionBuilder::m_slimTool
private
Initial value:
{ this,
"TrackSlimmingTool",
"TrkTrackSlimmingTool",
"Track slimming tool" }

Tool to slim tracks.

Definition at line 172 of file EMBremCollectionBuilder.h.

172 { this,
173 "TrackSlimmingTool",
174 "TrkTrackSlimmingTool",
175 "Track slimming tool" };

◆ m_trackParticleContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> EMBremCollectionBuilder::m_trackParticleContainerKey
private
Initial value:
{
this,
"TrackParticleContainerName",
"InDetTrackParticles",
"Input InDet TrackParticles"
}

Definition at line 177 of file EMBremCollectionBuilder.h.

177 {
178 this,
179 "TrackParticleContainerName",
180 "InDetTrackParticles",
181 "Input InDet TrackParticles"
182 };

◆ m_trkRefitTool

ToolHandle<IegammaTrkRefitterTool> EMBremCollectionBuilder::m_trkRefitTool
private
Initial value:
{ this,
"TrackRefitTool",
"ElectronRefitterTool",
"Track refitter tool" }

The track refitter.

Definition at line 158 of file EMBremCollectionBuilder.h.

158 { this,
159 "TrackRefitTool",
160 "ElectronRefitterTool",
161 "Track refitter tool" };

◆ 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: