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

 TrackToTruthAssociationAlg (const std::string &name, ISvcLocator *pSvcLocator)
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< StoreGateSvcStoreGateSvc_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

PublicToolHandle< ActsTrk::ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", ""}
SG::ReadHandleKey< ActsTrk::TrackContainerm_tracksContainerKey {this, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"}
SG::ReadHandleKey< MeasurementToTruthParticleAssociationm_pixelClustersToTruth {this, "PixelClustersToTruthAssociationMap", "", "Association map from pixel measurements to generator particles." }
SG::ReadHandleKey< MeasurementToTruthParticleAssociationm_stripClustersToTruth {this, "StripClustersToTruthAssociationMap", "", "Association map from strip measurements to generator particles." }
SG::ReadHandleKey< MeasurementToTruthParticleAssociationm_hgtdClustersToTruth {this, "HgtdClustersToTruthAssociationMap", "", "Association map from HGTD measurements to generator particles." }
SG::WriteHandleKey< TrackToTruthParticleAssociationm_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< TrackToTruthParticleAssociationDebugHistsm_elasticDecayUtil
std::conditional< TrackToTruthParticleAssociationDebugHists, Gaudi::Property< std::vector< float > >, EmptyProperty >::type m_energyLossBinning {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." }
AssociationCounter< TrackToTruthParticleAssociationDebugHistsm_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 44 of file TrackToTruthAssociationAlg.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

◆ TrackToTruthAssociationAlg()

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

Definition at line 26 of file TrackToTruthAssociationAlg.cxx.

28 : AthReentrantAlgorithm(name, pSvcLocator)
29 {
30 }

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

Definition at line 107 of file TrackToTruthAssociationAlg.cxx.

108 {
109 std::unique_ptr<TrackToTruthParticleAssociation>
110 track_association( std::make_unique<TrackToTruthParticleAssociation>() );
111
112 SG::ReadHandle<ActsTrk::MeasurementToTruthParticleAssociation> pixelClustersToTruthAssociation = SG::makeHandle(m_pixelClustersToTruth, ctx);
113 if (!pixelClustersToTruthAssociation.isValid()) {
114 ATH_MSG_ERROR("No pixel clusterss for key " << m_pixelClustersToTruth.key() );
115 return StatusCode::FAILURE;
116 }
117 SG::ReadHandle<ActsTrk::MeasurementToTruthParticleAssociation> stripClustersToTruthAssociation = SG::makeHandle(m_stripClustersToTruth, ctx);
118 if (!stripClustersToTruthAssociation.isValid()) {
119 ATH_MSG_ERROR("No strip clusterss for key " << m_stripClustersToTruth.key() );
120 return StatusCode::FAILURE;
121 }
122
123 SG::ReadHandle<ActsTrk::TrackContainer> tracksContainer = SG::makeHandle( m_tracksContainerKey, ctx);
124 if (!tracksContainer.isValid()) {
125 ATH_MSG_ERROR("No tracks for key " << m_tracksContainerKey.key() );
126 return StatusCode::FAILURE;
127 }
128 track_association->resize( tracksContainer->size() );
129 track_association->setSourceContainer(DataLink<ActsTrk::TrackContainer>(*tracksContainer,ctx));
130 Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
131
132 std::array<const ActsTrk::MeasurementToTruthParticleAssociation *,
133 static_cast< std::underlying_type<xAOD::UncalibMeasType>::type >(xAOD::UncalibMeasType::nTypes)>
134 measurement_to_truth_association_maps{};
135
136 measurement_to_truth_association_maps[Acts::toUnderlying(xAOD::UncalibMeasType::PixelClusterType)]=pixelClustersToTruthAssociation.cptr();
137 measurement_to_truth_association_maps[Acts::toUnderlying(xAOD::UncalibMeasType::StripClusterType)]=stripClustersToTruthAssociation.cptr();
138
139 if (!m_hgtdClustersToTruth.key().empty()) {
140 SG::ReadHandle<ActsTrk::MeasurementToTruthParticleAssociation> hgtdClustersToTruthAssociation = SG::makeHandle(m_hgtdClustersToTruth, ctx);
141 if (!hgtdClustersToTruthAssociation.isValid()) {
142 ATH_MSG_DEBUG("No HGTD clusterss for key " << m_hgtdClustersToTruth.key() );
143 }
144 measurement_to_truth_association_maps[Acts::toUnderlying(xAOD::UncalibMeasType::HGTDClusterType)]=hgtdClustersToTruthAssociation.cptr();
145 }
146
147 auto assocSize = [&measurement_to_truth_association_maps](xAOD::UncalibMeasType type) {
148 const ActsTrk::MeasurementToTruthParticleAssociation *assoc = measurement_to_truth_association_maps[Acts::toUnderlying(type)];
149 return assoc ? assoc->size() : 0ul;
150 };
151
152 ATH_MSG_DEBUG("Measurement association entries: " << assocSize(xAOD::UncalibMeasType::PixelClusterType)
153 << " + " << assocSize(xAOD::UncalibMeasType::StripClusterType)
154 << " + " << assocSize(xAOD::UncalibMeasType::HGTDClusterType)
155 );
156 unsigned int track_i=0;
157 std::array<unsigned int,s_NCounterForAssociatedTruth> tracks_with_associated_truth{};
158 std::pair<unsigned int, unsigned int> compatible_assoc_container_counts{};
160 // used to suppress reoccurring error messages
162 ++compatible_assoc_container_counts.second;
163 }
164
165 std::vector<unsigned int> counted_truth_particles;
166 counted_truth_particles.reserve(10);
167
168 for (const typename ActsTrk::TrackContainer::ConstTrackProxy track : *tracksContainer) {
169 const auto lastMeasurementIndex = track.tipIndex();
170
171 unsigned int n_measurements=0u;
172
173 HitCounterArray &reco_hits = track_association->at(track_i).totalCounts();
174 HitCounterArray &noise_hits = track_association->at(track_i).noiseCounts();
175 ActsTrk::HitCountsPerTrack::container &truth_particle_counts = track_association->at(track_i).countsPerTruthParticle();
176 tracksContainer->trackStateContainer().visitBackwards(
177 lastMeasurementIndex,
178 [this,
179 &n_measurements,
180 &measurement_to_truth_association_maps,
181 &truth_particle_counts,
182 &reco_hits,
183 &noise_hits,
184 &counted_truth_particles,
185 &compatible_assoc_container_counts
186 ](const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) -> void
187 {
188 if (!state.typeFlags().isOutlier() && state.hasUncalibratedSourceLink()) {
189 const auto* uncalibMeas = detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink());
190
191 const ActsTrk::MeasurementToTruthParticleAssociation *association_map = measurement_to_truth_association_maps.at(Acts::toUnderlying(uncalibMeas->type()));
192 if (association_map) {
193 if (!association_map->isCompatibleWith(dynamic_cast< const xAOD::UncalibratedMeasurementContainer *>(uncalibMeas->container()))) {
194 if (compatible_assoc_container_counts.second==0) {
195 ATH_MSG_ERROR("MeasurementToTruthParticleAssociation for measurement type " << uncalibMeas->type()
196 << " is not compatible with the measurement on track.");
197 }
198 ++compatible_assoc_container_counts.second;
199 return;
200 }
201 else {
202 ++compatible_assoc_container_counts.first;
203 }
204 ++n_measurements;
205 counted_truth_particles.clear();
206 for (const xAOD::TruthParticle *truth_particle : association_map->at(uncalibMeas->index()) ) {
207 const xAOD::TruthParticle *mother_particle = m_elasticDecayUtil.getMother(*truth_particle, m_maxEnergyLoss.value());
208
209 // do not count hits of associated truth particles again if they are associated to the same elastic decay chain:
210 if (std::find(counted_truth_particles.begin(), counted_truth_particles.end(), mother_particle->index())
211 ==counted_truth_particles.end()) {
212 counted_truth_particles.push_back(mother_particle->index());
213
214 ActsTrk::HitCountsPerTrack::container::iterator
215 hit_count_iter = std::find_if(truth_particle_counts.begin(),
216 truth_particle_counts.end(),
217 [mother_particle](const std::pair<const xAOD::TruthParticle *, HitCounterArray > &a) {
218 return a.first == mother_particle;
219 });
220 if (hit_count_iter == truth_particle_counts.end()) {
221 truth_particle_counts.push_back( std::make_pair(mother_particle, HitCounterArray{}));
222 hit_count_iter = truth_particle_counts.end()-1;
223 }
224 ++(hit_count_iter->second.at( Acts::toUnderlying(uncalibMeas->type())));
225 }
226 }
227 if (association_map->at(uncalibMeas->index()).empty()) {
228 ++noise_hits.at( Acts::toUnderlying(uncalibMeas->type()));
229 }
230 }
231 ++reco_hits.at( Acts::toUnderlying(uncalibMeas->type()));
232 }
233
234 });
235 std::sort( truth_particle_counts.begin(),
236 truth_particle_counts.end(),
237 [](const std::pair<const xAOD::TruthParticle *, HitCounterArray > &a,
238 const std::pair<const xAOD::TruthParticle *, HitCounterArray > &b) {
239 return std::accumulate(a.second.begin(),a.second.end(),0u) > std::accumulate(b.second.begin(),b.second.end(),0u);
240 });
241 m_associationCounter.fillStatistics(n_measurements, truth_particle_counts.size());
242 ++(tracks_with_associated_truth[std::min(truth_particle_counts.size(),tracks_with_associated_truth.size()-1u)]);
243 ++track_i;
244 }
245 unsigned int idx=0;
246 for (unsigned int elm : tracks_with_associated_truth) {
247 m_nTracksWithAssociatedTruth[idx] += elm;
248 ++idx;
249 }
250 m_nIncompatibleMeasurementContainer += compatible_assoc_container_counts.second;
251 m_nCcompatibleMeasurementContainer += compatible_assoc_container_counts.first;
252
253 SG::WriteHandle<TrackToTruthParticleAssociation> associationOutHandle(m_trackToTruthOut, ctx);
254 if (associationOutHandle.record( std::move(track_association)).isFailure()) {
255 ATH_MSG_ERROR("Failed to record track to truth assocition with key " << m_trackToTruthOut.key() );
256 return StatusCode::FAILURE;
257 }
258 return StatusCode::SUCCESS;
259 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t a
boost::container::small_vector< std::pair< const xAOD::TruthParticle *, HitCounterArray >, NTruthParticlesPerTrack > container
bool isCompatibleWith(const xAOD::UncalibratedMeasurementContainer *container) const
std::atomic< std::size_t > m_nCcompatibleMeasurementContainer
AssociationCounter< TrackToTruthParticleAssociationDebugHists > m_associationCounter
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
SG::WriteHandleKey< TrackToTruthParticleAssociation > m_trackToTruthOut
std::atomic< std::size_t > m_nIncompatibleMeasurementContainer
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksContainerKey
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_hgtdClustersToTruth
ElasticDecayUtil< TrackToTruthParticleAssociationDebugHists > m_elasticDecayUtil
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_pixelClustersToTruth
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_stripClustersToTruth
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77
unsigned long ul
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
TruthParticle_v1 TruthParticle
Typedef to implementation.
UncalibMeasType
Define the type of the uncalibrated measurement.
UncalibratedMeasurementContainer_v1 UncalibratedMeasurementContainer
Define the version of the uncalibrated measurement container.

◆ 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 72 of file TrackToTruthAssociationAlg.cxx.

73 {
75 ATH_MSG_WARNING( "Encountered measurements not compaible with provided association maps in "
77 }
78 if (msgLvl(MSG::INFO)) {
79 msg(MSG::INFO) << "-- Statistics:" << std::endl;
80 unsigned int idx=0;
81 for (const std::atomic<std::size_t> &elm : m_nTracksWithAssociatedTruth) {
82 msg() << std::setw(20) << elm << " "
83 << (idx==0
84 ? std::string(" tracks without associated truth particles.")
85 : (idx==m_nTracksWithAssociatedTruth.size()-1
86 ? makeLabel(" tracks with more than",
87 m_nTracksWithAssociatedTruth.size()-1,
88 "associated truth particles.")
89 : makeLabel(" tracks with",
90 idx,
91 "associated truth particle(s).")));
92 if (idx!=m_nTracksWithAssociatedTruth.size()-1 || TrackToTruthParticleAssociationDebugHists) {
93 msg() << std::endl;
94 }
95 ++idx;
96 }
98 m_elasticDecayUtil.dumpStatistics(msg());
99 msg() << std::endl;
100 m_associationCounter.dumpStatistics(msg());
101 }
102 msg() << endmsg;
103 }
104 return StatusCode::SUCCESS;
105 }
#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 32 of file TrackToTruthAssociationAlg.cxx.

33 {
35 ATH_CHECK( m_tracksContainerKey.initialize() );
36 ATH_CHECK( m_pixelClustersToTruth.initialize() );
37 ATH_CHECK( m_stripClustersToTruth.initialize() );
38 if (!m_hgtdClustersToTruth.key().empty()) ATH_CHECK( m_hgtdClustersToTruth.initialize() );
39 ATH_CHECK( m_trackToTruthOut.initialize() );
40
41 m_elasticDecayUtil.setEnergyLossBinning(m_energyLossBinning.value());
42 return StatusCode::SUCCESS;
43 }
#define ATH_CHECK
Evaluate an expression and check for errors.
std::conditional< TrackToTruthParticleAssociationDebugHists, Gaudi::Property< std::vector< float > >, EmptyProperty >::type 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 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 AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

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, AthFilterAlgorithm, 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}
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 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

◆ ATLAS_THREAD_SAFE

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

Definition at line 103 of file TrackToTruthAssociationAlg.h.

103{};

◆ m_associationCounter

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

Definition at line 101 of file TrackToTruthAssociationAlg.h.

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

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

Definition at line 74 of file TrackToTruthAssociationAlg.h.

◆ m_energyLossBinning

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

Definition at line 78 of file TrackToTruthAssociationAlg.h.

79{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 390 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_hgtdClustersToTruth

SG::ReadHandleKey<MeasurementToTruthParticleAssociation> ActsTrk::TrackToTruthAssociationAlg::m_hgtdClustersToTruth {this, "HgtdClustersToTruthAssociationMap", "", "Association map from HGTD measurements to generator particles." }
private

Definition at line 65 of file TrackToTruthAssociationAlg.h.

66{this, "HgtdClustersToTruthAssociationMap", "", "Association map from HGTD measurements to generator particles." };

◆ 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 71 of file TrackToTruthAssociationAlg.h.

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

◆ m_nCcompatibleMeasurementContainer

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

Definition at line 105 of file TrackToTruthAssociationAlg.h.

105{};

◆ m_nIncompatibleMeasurementContainer

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

Definition at line 104 of file TrackToTruthAssociationAlg.h.

104{};

◆ m_pixelClustersToTruth

SG::ReadHandleKey<MeasurementToTruthParticleAssociation> ActsTrk::TrackToTruthAssociationAlg::m_pixelClustersToTruth {this, "PixelClustersToTruthAssociationMap", "", "Association map from pixel measurements to generator particles." }
private

Definition at line 61 of file TrackToTruthAssociationAlg.h.

62{this, "PixelClustersToTruthAssociationMap", "", "Association map from pixel measurements to generator particles." };

◆ m_stripClustersToTruth

SG::ReadHandleKey<MeasurementToTruthParticleAssociation> ActsTrk::TrackToTruthAssociationAlg::m_stripClustersToTruth {this, "StripClustersToTruthAssociationMap", "", "Association map from strip measurements to generator particles." }
private

Definition at line 63 of file TrackToTruthAssociationAlg.h.

64{this, "StripClustersToTruthAssociationMap", "", "Association map from strip measurements to generator particles." };

◆ m_trackingGeometryTool

PublicToolHandle<ActsTrk::ITrackingGeometryTool> ActsTrk::TrackToTruthAssociationAlg::m_trackingGeometryTool {this, "TrackingGeometryTool", ""}
private

Definition at line 55 of file TrackToTruthAssociationAlg.h.

56{this, "TrackingGeometryTool", ""};

◆ 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 68 of file TrackToTruthAssociationAlg.h.

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

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

◆ s_NCounterForAssociatedTruth

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

Definition at line 102 of file TrackToTruthAssociationAlg.h.

◆ s_unitGeV

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

Definition at line 75 of file TrackToTruthAssociationAlg.h.


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