ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::TruthTrackRecordsAlg Class Reference

#include <TruthTrackRecordsAlg.h>

Inheritance diagram for Muon::TruthTrackRecordsAlg:
Collaboration diagram for Muon::TruthTrackRecordsAlg:

Classes

struct  SummaryDecors

Public Member Functions

virtual StatusCode initialize () 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 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

using WriteDecorArray_f = DecorHandlePtrVec_t<xAOD::TruthParticleContainer, float>
 Struct object encapsulating all write-decorators.
using WriteDecorArray_b = DecorHandlePtrVec_t<xAOD::TruthParticleContainer, char>
using WriteDecorArray_fvec = DecorHandlePtrVec_t<xAOD::TruthParticleContainer, std::vector<float>>
using DecorKey_t = SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer>
 Declaration of the key arrays, which are all initialized as empty (they will be filled up by @fillWriteDecorator).
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode addTrackRecords (const EventContext &ctx, const xAOD::TruthParticle &truthParticle, SummaryDecors &myDecors) const
 addTrackRecords is the actual function that decorates muons with track records.
template<typename T>
StatusCode fillWriteDecorator (SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, T > &writeKey, const std::string &keyName) const
 This function fills the arrays of write-decorator keys and initializes them.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::TruthParticleContainerm_muonTruth {this, "muonTruth", "MuonTruthParticles"}
 Key of the container of truth muons that will be decorated.
SG::ReadHandleKeyArray< TrackRecordCollectionm_trackRecords
 Keys of the containers of track records in different detector positions.
DecorKey_t m_muonSnapShotX {this, "SnapShotX", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotY {this, "SnapShotY", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotZ {this, "SnapShotZ", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotPx {this, "SnapShotPx", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotPy {this, "SnapShotPy", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotPz {this, "SnapShotPz", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotMtc {this, "SnapShotMtc", { }, "is matched decoration..."}
DecorKey_t m_muonSnapShotEX {this, "SnapShotEX", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotEY {this, "SnapShotEY", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotEZ {this, "SnapShotEZ", { }, "Position decoration..."}
DecorKey_t m_muonSnapShotEPx {this, "SnapShotEPx", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotEPy {this, "SnapShotEPy", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotEPz {this, "SnapShotEPz", { }, "Momentum decoration..."}
DecorKey_t m_muonSnapShotEcov {this, "SnapShotEcov", { }, "Covariance decoration"}
DecorKey_t m_muonSnapShotEis {this, "SnapShotEis", { }, "Flag decoration whether the extrapolation worked"}
ToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
 Extrapolation tool handle.
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

Definition at line 26 of file TruthTrackRecordsAlg.h.

Member Typedef Documentation

◆ DecorKey_t

Declaration of the key arrays, which are all initialized as empty (they will be filled up by @fillWriteDecorator).

Each decorKeyArray, which is an array of keys, represents a property, and its elements represents that property evaluated at different detector positions. List of properties: x,y,x,px,py,pz are position and momentum in a given layer; matchedDecor is a flag saying if a record has been recorded in that layer; ex,ey,ez,epx,epy,epz are extrapolated position and momentum; ecov is a vector encapsulating the covariance matrix from extrapolation; eis is a flag representing if the extrapolation has been successful.

Definition at line 106 of file TruthTrackRecordsAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ WriteDecorArray_b

◆ WriteDecorArray_f

Struct object encapsulating all write-decorators.

Each decorArray represents a property, and its elements represents that property evaluated at different detector positions. List of properties: x,y,x,px,py,pz are position and momentum in a given layer; matchedDecor is a flag saying if a record has been recorded in that layer; ex,ey,ez,epx,epy,epz are extrapolated position and momentum; ecov is a vector encapsulating the covariance matrix from extrapolation; eis is a flag representing if the extrapolation has been successful. We can decouple declaration and population of this object because vectors can be initialized empty.

Definition at line 45 of file TruthTrackRecordsAlg.h.

◆ WriteDecorArray_fvec

Member Function Documentation

◆ addTrackRecords()

StatusCode Muon::TruthTrackRecordsAlg::addTrackRecords ( const EventContext & ctx,
const xAOD::TruthParticle & truthParticle,
SummaryDecors & myDecors ) const
private

addTrackRecords is the actual function that decorates muons with track records.

Firstly, if production vertex is available, we save position and momentum at production. Then we loop over snapshot positions (e.g. calo entry level) and, in each position, we loop over track records. If the record is descendand of the muon, we save position and momentum in that position, as well as the tracking volume and record name (= snapshot position). Then, by means of another loop over all records of a truth muon, we extrapolate each record to the next shapshot position. Specifically, we save the extrapolated position and momentum, the extrapolation's covariance matrix, and a flag representing the extrapolation outcome.

Parameters
ctxtells in which event we are
truthParticlea pointer to the truth muon
myDecorsreference to the decorator summary object

loop over collection and find trackRecord with the same bar code. If we find a record, we save position and momentum

Make sure that the parameter vector has the same size

Save record name

Save tracking volume

Second loop, extrapolate between the points

If the track record is named, then we should have a volume

Definition at line 105 of file TruthTrackRecordsAlg.cxx.

105 {
106
107 // first loop over track records, store parameters at the different positions
108 const xAOD::TruthVertex* vertex = truthParticle.prodVtx();
109 const Trk::TrackingGeometry* trackingGeometry = m_extrapolator->trackingGeometry();
110
111 std::vector<RecordPars> parameters;
112 if (vertex) {
113 parameters.emplace_back(Amg::Vector3D{vertex->x(), vertex->y(), vertex->z()},
114 Amg::Vector3D{truthParticle.px(), truthParticle.py(), truthParticle.pz()});
115 }
116 else {parameters.emplace_back();}
117
118 size_t idx{0};
119 for (SG::ReadHandle<TrackRecordCollection>& trackRecordCollection : m_trackRecords.makeHandles(ctx)) {
120 ATH_CHECK(trackRecordCollection.isPresent());
121
122 const std::string r_name = trackRecordCollection.key();
123 float& x = (*myDecors.xDecor[idx])(truthParticle);
124 float& y = (*myDecors.yDecor[idx])(truthParticle);
125 float& z = (*myDecors.zDecor[idx])(truthParticle);
126 float& px = (*myDecors.pxDecor[idx])(truthParticle);
127 float& py = (*myDecors.pyDecor[idx])(truthParticle);
128 float& pz = (*myDecors.pzDecor[idx])(truthParticle);
129
130 char& found_truth = (*myDecors.matchedDecor[idx])(truthParticle);
131
132 x = y = z = px = py = pz = dummy_val;
133 found_truth = false;
134
135 // Need to always make these, to avoid crashes later
136 float& ex = (*myDecors.exDecor[idx])(truthParticle);
137 float& ey = (*myDecors.eyDecor[idx])(truthParticle);
138 float& ez = (*myDecors.ezDecor[idx])(truthParticle);
139 float& epx = (*myDecors.epxDecor[idx])(truthParticle);
140 float& epy = (*myDecors.epyDecor[idx])(truthParticle);
141 float& epz = (*myDecors.epzDecor[idx])(truthParticle);
142
143 ex = ey = ez = epx = epy = epz = dummy_val;
144
146 for (const TrackRecord& trackRecord : *trackRecordCollection) {
147 if (!HepMC::is_sim_descendant(&trackRecord,&truthParticle)) continue;
148 CLHEP::Hep3Vector pos = trackRecord.GetPosition();
149 CLHEP::Hep3Vector mom = trackRecord.GetMomentum();
150 ATH_MSG_VERBOSE("Found associated " << r_name << " pt " << mom.perp() << " position: r " << pos.perp() << " z " << pos.z());
151 x = pos.x(); y = pos.y(); z = pos.z();
152 px = mom.x(); py = mom.y(); pz = mom.z();
153 parameters.emplace_back(pos, mom);
154 found_truth = true;
155 break;
156 }
157
159 if (!found_truth) {parameters.emplace_back();}
161 RecordPars& r_pars = parameters.back();
162 r_pars.record_name = r_name;
163 r_pars.idx = idx++;
164
166 if (!found_truth) continue;
167 const Trk::TrackingVolume* volume = nullptr;
168 if (r_name == "CaloEntryLayer")
169 volume = trackingGeometry->trackingVolume("InDet::Containers::InnerDetector");
170 else if (r_name == "MuonEntryLayer")
171 volume = trackingGeometry->trackingVolume("Calo::Container");
172 else if (r_name == "MuonExitLayer")
173 volume = trackingGeometry->trackingVolume("Muon::Containers::MuonSystem");
174 else {
175 ATH_MSG_WARNING("no destination surface for track record "<<r_name);
176 }
177 r_pars.volume = volume;
178 }
179
181 AmgSymMatrix(5) cov{AmgSymMatrix(5)::Identity()};
182 cov(0, 0) = cov(1, 1) = 1e-3;
183 cov(2, 2) = cov(3, 3) = 1e-6;
184 cov(4, 4) = 1e-3 / truthParticle.p4().P();
185 for (unsigned int i = 0; i < parameters.size() - 1; ++i) {
186 const RecordPars& start_pars = parameters[i];
187 const RecordPars& end_pars = parameters[i+1];
189 if ( (!start_pars.record_name.empty() && !start_pars.volume) || !end_pars.volume) continue;
190 Trk::CurvilinearParameters pars(start_pars.pos, start_pars.mom, truthParticle.charge(), cov);
191
192 const Trk::TrackingVolume* volume = end_pars.volume;
193 const std::string& r_name = end_pars.record_name;
194
195 float& ex = (*myDecors.exDecor[end_pars.idx])(truthParticle);
196 float& ey = (*myDecors.eyDecor[end_pars.idx])(truthParticle);
197 float& ez = (*myDecors.ezDecor[end_pars.idx])(truthParticle);
198 float& epx = (*myDecors.epxDecor[end_pars.idx])(truthParticle);
199 float& epy = (*myDecors.epyDecor[end_pars.idx])(truthParticle);
200 float& epz = (*myDecors.epzDecor[end_pars.idx])(truthParticle);
201
202 std::vector<float>& covMat = (*myDecors.ecovDecor[end_pars.idx])(truthParticle);
203
204 std::unique_ptr<Trk::TrackParameters> exPars{
205 m_extrapolator->extrapolateToVolume(ctx, pars, *volume, Trk::alongMomentum, Trk::muon)};
206 if (! exPars || !exPars->covariance() || !Amg::hasPositiveDiagElems(*exPars->covariance())) {
207 ATH_MSG_VERBOSE("Extrapolation to "<<r_name<<" failed. ");
208 continue;
209 }
210 (*myDecors.eisDecor[end_pars.idx])(truthParticle) = true;
211 ex = exPars->position().x();
212 ey = exPars->position().y();
213 ez = exPars->position().z();
214 epx = exPars->momentum().x();
215 epy = exPars->momentum().y();
216 epz = exPars->momentum().z();
217 Amg::compress(*exPars->covariance(), covMat);
218
219 const double errorp = Amg::error(*exPars->covariance(), Trk::qOverP);
220 ATH_MSG_VERBOSE( " Extrapolated to " << r_name << std::endl
221 << " truth: r " << end_pars.pos.perp() << " z "
222 << end_pars.pos.z() << " p "
223 << end_pars.mom.mag() << std::endl
224 << " extrp: r " << exPars->position().perp() << " z "
225 << exPars->position().z() << " p "
226 << exPars->momentum().mag() << " res p "
227 << (end_pars.mom.mag() -
228 exPars->momentum().mag())
229 << " error " << errorp << " cov "
230 << (*exPars->covariance())(Trk::qOverP, Trk::qOverP)
231 << " pull p "
232 << (end_pars.mom.mag() -
233 exPars->momentum().mag()) /
234 errorp);
235 }
236 return StatusCode::SUCCESS;
237 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define AmgSymMatrix(dim)
#define y
#define x
#define z
ToolHandle< Trk::IExtrapolator > m_extrapolator
Extrapolation tool handle.
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecords
Keys of the containers of track records in different detector positions.
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
float px() const
The x component of the particle's momentum.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
float py() const
The y component of the particle's momentum.
double charge() const
Physical charge.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
float pz() const
The z component of the particle's momentum.
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Eigen::Matrix< double, 3, 1 > Vector3D
bool is_sim_descendant(const T1 &p1, const T2 &p2)
Method to check if the first particle is a descendant of the second in the simulation,...
@ alongMomentum
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters
@ qOverP
perigee
Definition ParamDefs.h:67
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15

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

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

Definition at line 76 of file TruthTrackRecordsAlg.cxx.

76 {
77 // skip if no input data found
78 SG::ReadHandle muonTruthContainer(m_muonTruth, ctx);
79 ATH_CHECK(muonTruthContainer.isPresent());
80
81 SummaryDecors myDecors;
83 myDecors.yDecor = makeHandles<float>(ctx, m_muonSnapShotY);
84 myDecors.zDecor = makeHandles<float>(ctx, m_muonSnapShotZ);
85 myDecors.pxDecor = makeHandles<float>(ctx, m_muonSnapShotPx);
86 myDecors.pyDecor = makeHandles<float>(ctx, m_muonSnapShotPy);
87 myDecors.pzDecor = makeHandles<float>(ctx, m_muonSnapShotPz);
88 myDecors.matchedDecor = makeHandles<char>(ctx, m_muonSnapShotMtc);
89 myDecors.exDecor = makeHandles<float>(ctx, m_muonSnapShotEX);
90 myDecors.eyDecor = makeHandles<float>(ctx, m_muonSnapShotEY);
91 myDecors.ezDecor = makeHandles<float>(ctx, m_muonSnapShotEZ);
92 myDecors.epxDecor = makeHandles<float>(ctx, m_muonSnapShotEPx);
93 myDecors.epyDecor = makeHandles<float>(ctx, m_muonSnapShotEPy);
94 myDecors.epzDecor = makeHandles<float>(ctx, m_muonSnapShotEPz);
95 myDecors.ecovDecor = makeHandles<std::vector<float>>(ctx, m_muonSnapShotEcov);
96 myDecors.eisDecor = makeHandles<char>(ctx, m_muonSnapShotEis);
97
98 // loop over truth coll
99 for (const xAOD::TruthParticle* truthParticle : *muonTruthContainer) {
100 ATH_CHECK(addTrackRecords(ctx, *truthParticle, myDecors));
101 }
102 return StatusCode::SUCCESS;
103 }
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_muonTruth
Key of the container of truth muons that will be decorated.
StatusCode addTrackRecords(const EventContext &ctx, const xAOD::TruthParticle &truthParticle, SummaryDecors &myDecors) const
addTrackRecords is the actual function that decorates muons with track records.
DecorHandlePtrVec_t< ContType, DataType > makeHandles(const EventContext &ctx, const SG::WriteDecorHandleKeyArray< ContType > &keys, const DataType defVal={})
Definition DecorUtils.h:36
TruthParticle_v1 TruthParticle
Typedef to implementation.

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

◆ fillWriteDecorator()

template<typename T>
StatusCode Muon::TruthTrackRecordsAlg::fillWriteDecorator ( SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, T > & writeKey,
const std::string & keyName ) const
private

This function fills the arrays of write-decorator keys and initializes them.

Specifically, the key that will be written at i-th position is <property_name>_<detector_position(i)>, where property_name = writeKey, and detector_position(i) is retrieved from (= is an element of) m_trackRecords

Parameters
writeKeyreference to the (empty) array of write-decor keys that is going to be populated
keyNamereference to the property name (e.g. x, x_extr, ...)

Definition at line 41 of file TruthTrackRecordsAlg.cxx.

42 {
43 for (const SG::ReadHandleKey<TrackRecordCollection>& recordKey : m_trackRecords){
44 const std::string fullKey = recordKey.key() + "_" + keyName;
45 writeKey.emplace_back(m_muonTruth, fullKey);
46 }
47 return writeKey.initialize();
48 }
StatusCode initialize(bool used=true)
forward the initialization to the member VarHandleKeys

◆ 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

◆ initialize()

StatusCode Muon::TruthTrackRecordsAlg::initialize ( )
overridevirtual

Definition at line 51 of file TruthTrackRecordsAlg.cxx.

51 {
52 ATH_CHECK(m_muonTruth.initialize());
53 ATH_CHECK(m_trackRecords.initialize());
54
70
71 ATH_CHECK(m_extrapolator.retrieve());
72 return StatusCode::SUCCESS;
73 }
StatusCode fillWriteDecorator(SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, T > &writeKey, const std::string &keyName) const
This function fills the arrays of write-decorator keys and initializes them.

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

◆ 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_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_extrapolator

ToolHandle<Trk::IExtrapolator> Muon::TruthTrackRecordsAlg::m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
private

Extrapolation tool handle.

Definition at line 124 of file TruthTrackRecordsAlg.h.

124{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};

◆ m_muonSnapShotEcov

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEcov {this, "SnapShotEcov", { }, "Covariance decoration"}
private

Definition at line 120 of file TruthTrackRecordsAlg.h.

120{this, "SnapShotEcov", { }, "Covariance decoration"};

◆ m_muonSnapShotEis

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEis {this, "SnapShotEis", { }, "Flag decoration whether the extrapolation worked"}
private

Definition at line 121 of file TruthTrackRecordsAlg.h.

121{this, "SnapShotEis", { }, "Flag decoration whether the extrapolation worked"};

◆ m_muonSnapShotEPx

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEPx {this, "SnapShotEPx", { }, "Momentum decoration..."}
private

Definition at line 117 of file TruthTrackRecordsAlg.h.

117{this, "SnapShotEPx", { }, "Momentum decoration..."};

◆ m_muonSnapShotEPy

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEPy {this, "SnapShotEPy", { }, "Momentum decoration..."}
private

Definition at line 118 of file TruthTrackRecordsAlg.h.

118{this, "SnapShotEPy", { }, "Momentum decoration..."};

◆ m_muonSnapShotEPz

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEPz {this, "SnapShotEPz", { }, "Momentum decoration..."}
private

Definition at line 119 of file TruthTrackRecordsAlg.h.

119{this, "SnapShotEPz", { }, "Momentum decoration..."};

◆ m_muonSnapShotEX

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEX {this, "SnapShotEX", { }, "Position decoration..."}
private

Definition at line 114 of file TruthTrackRecordsAlg.h.

114{this, "SnapShotEX", { }, "Position decoration..."};

◆ m_muonSnapShotEY

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEY {this, "SnapShotEY", { }, "Position decoration..."}
private

Definition at line 115 of file TruthTrackRecordsAlg.h.

115{this, "SnapShotEY", { }, "Position decoration..."};

◆ m_muonSnapShotEZ

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotEZ {this, "SnapShotEZ", { }, "Position decoration..."}
private

Definition at line 116 of file TruthTrackRecordsAlg.h.

116{this, "SnapShotEZ", { }, "Position decoration..."};

◆ m_muonSnapShotMtc

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotMtc {this, "SnapShotMtc", { }, "is matched decoration..."}
private

Definition at line 113 of file TruthTrackRecordsAlg.h.

113{this, "SnapShotMtc", { }, "is matched decoration..."};

◆ m_muonSnapShotPx

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotPx {this, "SnapShotPx", { }, "Momentum decoration..."}
private

Definition at line 110 of file TruthTrackRecordsAlg.h.

110{this, "SnapShotPx", { }, "Momentum decoration..."};

◆ m_muonSnapShotPy

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotPy {this, "SnapShotPy", { }, "Momentum decoration..."}
private

Definition at line 111 of file TruthTrackRecordsAlg.h.

111{this, "SnapShotPy", { }, "Momentum decoration..."};

◆ m_muonSnapShotPz

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotPz {this, "SnapShotPz", { }, "Momentum decoration..."}
private

Definition at line 112 of file TruthTrackRecordsAlg.h.

112{this, "SnapShotPz", { }, "Momentum decoration..."};

◆ m_muonSnapShotX

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotX {this, "SnapShotX", { }, "Position decoration..."}
private

Definition at line 107 of file TruthTrackRecordsAlg.h.

107{this, "SnapShotX", { }, "Position decoration..."};

◆ m_muonSnapShotY

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotY {this, "SnapShotY", { }, "Position decoration..."}
private

Definition at line 108 of file TruthTrackRecordsAlg.h.

108{this, "SnapShotY", { }, "Position decoration..."};

◆ m_muonSnapShotZ

DecorKey_t Muon::TruthTrackRecordsAlg::m_muonSnapShotZ {this, "SnapShotZ", { }, "Position decoration..."}
private

Definition at line 109 of file TruthTrackRecordsAlg.h.

109{this, "SnapShotZ", { }, "Position decoration..."};

◆ m_muonTruth

SG::ReadHandleKey<xAOD::TruthParticleContainer> Muon::TruthTrackRecordsAlg::m_muonTruth {this, "muonTruth", "MuonTruthParticles"}
private

Key of the container of truth muons that will be decorated.

Definition at line 92 of file TruthTrackRecordsAlg.h.

92{this, "muonTruth", "MuonTruthParticles"};

◆ m_trackRecords

SG::ReadHandleKeyArray<TrackRecordCollection> Muon::TruthTrackRecordsAlg::m_trackRecords
private
Initial value:
{
this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}}

Keys of the containers of track records in different detector positions.

Definition at line 96 of file TruthTrackRecordsAlg.h.

96 {
97 this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}};

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