ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::TrackToTruthAssociationAlg Class Reference

#include <TrackToTruthAssociationAlg.h>

Inheritance diagram for ActsTrk::TrackToTruthAssociationAlg:
Collaboration diagram for ActsTrk::TrackToTruthAssociationAlg:

Classes

struct  AssociationCounter

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ContextUtility m_ctxProvider {this}
 Context provider for geometry, magnetic field and calibration contexts.
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksContainerKey {this, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"}
SG::ReadHandleKeyArray< MeasurementToTruthParticleAssociation > m_measAssocKeys {this, "MeasurementAssocKeys", {}, "Association map from the measurements to generator particles." }
SG::WriteHandleKey< TrackToTruthParticleAssociation > m_trackToTruthOut {this, "AssociationMapOut", "", "Output association map from measurements to generator particles." }
Gaudi::Property< float > m_maxEnergyLoss {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." }
ElasticDecayUtil< TrackToTruthParticleAssociationDebugHists > m_elasticDecayUtil
Gaudi::Property< std::vector< float > > m_energyLossBinning {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." }
AssociationCounter< TrackToTruthParticleAssociationDebugHists > m_associationCounter
std::array< std::atomic< std::size_t >, s_NCounterForAssociatedTruth > m_nTracksWithAssociatedTruth ATLAS_THREAD_SAFE {}
std::atomic< std::size_t > m_nIncompatibleMeasurementContainer {}
std::atomic< std::size_t > m_nCcompatibleMeasurementContainer {}
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

Static Private Attributes

static constexpr float s_unitGeV = 1e3
static constexpr unsigned int s_NCounterForAssociatedTruth = 4

Detailed Description

Definition at line 45 of file TrackToTruthAssociationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ 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 ActsTrk::TrackToTruthAssociationAlg::execute ( const EventContext & ctx) const
overridevirtual

If no truth particle is associated mark it as noise

Loop over the associated truth particles

Definition at line 100 of file TrackToTruthAssociationAlg.cxx.

101 {
102 auto track_association = std::make_unique<TrackToTruthParticleAssociation>();
103
104 const ActsTrk::TrackContainer* tracksContainer{};
105 ATH_CHECK(SG::get(tracksContainer, m_tracksContainerKey, ctx));
106
107 track_association->resize( tracksContainer->size() );
108 track_association->setSourceContainer(DataLink<ActsTrk::TrackContainer>(*tracksContainer,ctx));
109 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
110
111 std::array<std::vector<const ActsTrk::MeasurementToTruthParticleAssociation*>,
112 Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> prdToTruthMaps{};
113
114 for (const auto& key : m_measAssocKeys) {
115 const MeasurementToTruthParticleAssociation* measAssocMap{};
116 ATH_CHECK(SG::get(measAssocMap, key, ctx));
117 if (measAssocMap->sourceContainer()->empty()) {
118 continue;
119 }
120 const xAOD::UncalibMeasType measType = measAssocMap->sourceContainer()->front()->type();
121 prdToTruthMaps[Acts::toUnderlying(measType)].push_back(measAssocMap);
122 }
123 std::array<unsigned int,s_NCounterForAssociatedTruth> tracks_with_associated_truth{};
124 std::pair<unsigned int, unsigned int> compatible_assoc_container_counts{};
126 // used to suppress reoccurring error messages
128 ++compatible_assoc_container_counts.second;
129 }
130
131 std::vector<unsigned int> counted_truth_particles;
132 counted_truth_particles.reserve(10);
133
134 for (const typename ActsTrk::TrackContainer::ConstTrackProxy track : *tracksContainer) {
135 const unsigned track_i = track.index();
136 unsigned int n_measurements=0u;
137
138 HitCounterArray &reco_hits = track_association->at(track_i).totalCounts();
139 HitCounterArray &noise_hits = track_association->at(track_i).noiseCounts();
140 ActsTrk::HitCountsPerTrack::container &truth_particle_counts = track_association->at(track_i).countsPerTruthParticle();
141 for (const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state : track.trackStatesReversed()) {
142 if (state.typeFlags().isOutlier() || !state.hasUncalibratedSourceLink()) {
143 continue;
144 }
145 const auto* uncalibMeas = detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink());
146 const auto typeIdx = Acts::toUnderlying(uncalibMeas->type());
147
148 ++n_measurements;
149
150 const ActsTrk::MeasurementToTruthParticleAssociation* association_map{};
151 if (auto map_itr = std::ranges::find_if(prdToTruthMaps.at(typeIdx),
152 [uncalibMeas](const auto* map){
153 return uncalibMeas->container() == map->sourceContainer();
154 }); map_itr != prdToTruthMaps.at(typeIdx).end()) {
155 association_map = (*map_itr);
156 } else {
157 continue;
158 }
159 ++compatible_assoc_container_counts.second;
161 if (association_map->at(uncalibMeas->index()).empty()) {
162 ++noise_hits.at(typeIdx);
163 }
164 counted_truth_particles.clear();
166 for (const xAOD::TruthParticle *truth_particle : association_map->at(uncalibMeas->index()) ) {
167 const xAOD::TruthParticle *mother_particle = m_elasticDecayUtil.getMother(*truth_particle, m_maxEnergyLoss.value());
168 ATH_MSG_VERBOSE("Fill truth counts for "<<uncalibMeas->type()<<" hit with particle "<<(mother_particle->pt()*1.e-3)<<" [GeV], eta:"
169 <<mother_particle->eta()<<", " <<", phi: "<<mother_particle->phi()<<", pdgId: "<<mother_particle->pdgId()<<", index: "<<mother_particle->index()
170 <<", "<<mother_particle->container());
171 // do not count hits of associated truth particles again if they are associated to the same elastic decay chain:
172 if (!Acts::rangeContainsValue(counted_truth_particles, mother_particle->index())) {
173 counted_truth_particles.push_back(mother_particle->index());
174
175 ActsTrk::HitCountsPerTrack::container::iterator
176 hit_count_iter = std::ranges::find_if(truth_particle_counts,
177 [mother_particle](const std::pair<const xAOD::TruthParticle *, HitCounterArray > &a) {
178 return a.first == mother_particle;
179 });
180 if (hit_count_iter == truth_particle_counts.end()) {
181 truth_particle_counts.push_back( std::make_pair(mother_particle, HitCounterArray{}));
182 hit_count_iter = truth_particle_counts.end()-1;
183 }
184 ++(hit_count_iter->second.at(typeIdx));
185 }
186 }
187 ++reco_hits.at(typeIdx);
188 }
189 std::ranges::stable_sort(truth_particle_counts,
190 [](const std::pair<const xAOD::TruthParticle*, HitCounterArray>& a,
191 const std::pair<const xAOD::TruthParticle*, HitCounterArray>& b) {
192 return std::accumulate(a.second.begin(),a.second.end(),0u) >
193 std::accumulate(b.second.begin(),b.second.end(),0u);
194 });
195 m_associationCounter.fillStatistics(n_measurements, truth_particle_counts.size());
196 ++(tracks_with_associated_truth[std::min(truth_particle_counts.size(),
197 tracks_with_associated_truth.size()-1u)]);
198 }
199 for (const auto[idx, elem] : Acts::enumerate(tracks_with_associated_truth)) {
200 m_nTracksWithAssociatedTruth[idx] += elem;
201
202 }
203 m_nIncompatibleMeasurementContainer += compatible_assoc_container_counts.second;
204 m_nCcompatibleMeasurementContainer += compatible_assoc_container_counts.first;
205
206 SG::WriteHandle associationOutHandle{m_trackToTruthOut, ctx};
207 ATH_CHECK(associationOutHandle.record( std::move(track_association)));
208 return StatusCode::SUCCESS;
209 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x,...)
static Double_t a
boost::container::small_vector< std::pair< const xAOD::TruthParticle *, HitCounterArray >, NTruthParticlesPerTrack > container
std::atomic< std::size_t > m_nCcompatibleMeasurementContainer
AssociationCounter< TrackToTruthParticleAssociationDebugHists > m_associationCounter
SG::WriteHandleKey< TrackToTruthParticleAssociation > m_trackToTruthOut
std::atomic< std::size_t > m_nIncompatibleMeasurementContainer
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksContainerKey
ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
SG::ReadHandleKeyArray< MeasurementToTruthParticleAssociation > m_measAssocKeys
ElasticDecayUtil< TrackToTruthParticleAssociationDebugHists > m_elasticDecayUtil
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
int pdgId() const
PDG ID code.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
std::array< uint8_t, NHitCounter > HitCounterArray
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77
TruthParticle_v1 TruthParticle
Typedef to implementation.
UncalibMeasType
Define the type of the uncalibrated measurement.

◆ 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 & AthCommonAlgorithm< 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 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode ActsTrk::TrackToTruthAssociationAlg::finalize ( )
overridevirtual

Definition at line 65 of file TrackToTruthAssociationAlg.cxx.

66 {
68 ATH_MSG_WARNING( "Encountered measurements not compaible with provided association maps in "
70 }
71 if (msgLvl(MSG::INFO)) {
72 msg(MSG::INFO) << "-- Statistics:" << std::endl;
73 unsigned int idx=0;
74 for (const std::atomic<std::size_t> &elm : m_nTracksWithAssociatedTruth) {
75 msg() << std::setw(20) << elm << " "
76 << (idx==0
77 ? std::string(" tracks without associated truth particles.")
78 : (idx==m_nTracksWithAssociatedTruth.size()-1
79 ? makeLabel(" tracks with more than",
80 m_nTracksWithAssociatedTruth.size()-1,
81 "associated truth particles.")
82 : makeLabel(" tracks with",
83 idx,
84 "associated truth particle(s).")));
85 if (idx!=m_nTracksWithAssociatedTruth.size()-1 || TrackToTruthParticleAssociationDebugHists) {
86 msg() << std::endl;
87 }
88 ++idx;
89 }
91 m_elasticDecayUtil.dumpStatistics(msg());
92 msg() << std::endl;
93 m_associationCounter.dumpStatistics(msg());
94 }
95 msg() << endmsg;
96 }
97 return StatusCode::SUCCESS;
98 }
#define endmsg
#define ATH_MSG_WARNING(x,...)
size_t size() const
Number of registered mappings.
bool msgLvl(const MSG::Level lvl) const
constexpr bool TrackToTruthParticleAssociationDebugHists
std::string makeLabel(const Parameters &pars)
Dumps the parameters into a string in the form of TLatex.

◆ initialize()

StatusCode ActsTrk::TrackToTruthAssociationAlg::initialize ( )
overridevirtual

Definition at line 27 of file TrackToTruthAssociationAlg.cxx.

28 {
29 ATH_CHECK( m_ctxProvider.initialize() );
30 ATH_CHECK( m_tracksContainerKey.initialize() );
31 ATH_CHECK( m_measAssocKeys.initialize() );
32 ATH_CHECK( m_trackToTruthOut.initialize() );
33
34 m_elasticDecayUtil.setEnergyLossBinning(m_energyLossBinning.value());
35 return StatusCode::SUCCESS;
36 }
Gaudi::Property< std::vector< float > > m_energyLossBinning

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

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

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

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

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

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
virtual StatusCode sysInitialize() override
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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::array<std::atomic<std::size_t>,s_NCounterForAssociatedTruth> m_nTracksWithAssociatedTruth ActsTrk::TrackToTruthAssociationAlg::ATLAS_THREAD_SAFE {}
mutableprivate

Definition at line 96 of file TrackToTruthAssociationAlg.h.

96{};

◆ m_associationCounter

AssociationCounter<TrackToTruthParticleAssociationDebugHists> ActsTrk::TrackToTruthAssociationAlg::m_associationCounter
private

Definition at line 94 of file TrackToTruthAssociationAlg.h.

◆ m_ctxProvider

ContextUtility ActsTrk::TrackToTruthAssociationAlg::m_ctxProvider {this}
private

Context provider for geometry, magnetic field and calibration contexts.

Definition at line 56 of file TrackToTruthAssociationAlg.h.

56{this};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_elasticDecayUtil

ElasticDecayUtil<TrackToTruthParticleAssociationDebugHists> ActsTrk::TrackToTruthAssociationAlg::m_elasticDecayUtil
private

Definition at line 69 of file TrackToTruthAssociationAlg.h.

◆ m_energyLossBinning

Gaudi::Property<std::vector<float> > ActsTrk::TrackToTruthAssociationAlg::m_energyLossBinning {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." }
private

Definition at line 71 of file TrackToTruthAssociationAlg.h.

72{this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_maxEnergyLoss

Gaudi::Property<float> ActsTrk::TrackToTruthAssociationAlg::m_maxEnergyLoss {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." }
private

Definition at line 66 of file TrackToTruthAssociationAlg.h.

67{this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." };

◆ m_measAssocKeys

SG::ReadHandleKeyArray<MeasurementToTruthParticleAssociation> ActsTrk::TrackToTruthAssociationAlg::m_measAssocKeys {this, "MeasurementAssocKeys", {}, "Association map from the measurements to generator particles." }
private

Definition at line 61 of file TrackToTruthAssociationAlg.h.

62{this, "MeasurementAssocKeys", {}, "Association map from the measurements to generator particles." };

◆ m_nCcompatibleMeasurementContainer

std::atomic<std::size_t> ActsTrk::TrackToTruthAssociationAlg::m_nCcompatibleMeasurementContainer {}
mutableprivate

Definition at line 98 of file TrackToTruthAssociationAlg.h.

98{};

◆ m_nIncompatibleMeasurementContainer

std::atomic<std::size_t> ActsTrk::TrackToTruthAssociationAlg::m_nIncompatibleMeasurementContainer {}
mutableprivate

Definition at line 97 of file TrackToTruthAssociationAlg.h.

97{};

◆ m_tracksContainerKey

SG::ReadHandleKey<ActsTrk::TrackContainer> ActsTrk::TrackToTruthAssociationAlg::m_tracksContainerKey {this, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"}
private

Definition at line 58 of file TrackToTruthAssociationAlg.h.

59{this, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"};

◆ m_trackToTruthOut

SG::WriteHandleKey<TrackToTruthParticleAssociation> ActsTrk::TrackToTruthAssociationAlg::m_trackToTruthOut {this, "AssociationMapOut", "", "Output association map from measurements to generator particles." }
private

Definition at line 63 of file TrackToTruthAssociationAlg.h.

64{this, "AssociationMapOut", "", "Output association map from measurements to generator particles." };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ s_NCounterForAssociatedTruth

unsigned int ActsTrk::TrackToTruthAssociationAlg::s_NCounterForAssociatedTruth = 4
staticconstexprprivate

Definition at line 95 of file TrackToTruthAssociationAlg.h.

◆ s_unitGeV

float ActsTrk::TrackToTruthAssociationAlg::s_unitGeV = 1e3
staticconstexprprivate

Definition at line 70 of file TrackToTruthAssociationAlg.h.


The documentation for this class was generated from the following files: