ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CETmaterial Class Reference

The ExtrapolatorTest Algorithm runs a number of n test extrapolations from randomly distributed Track Parameters to geometry outer boundary and back to perigee. More...

#include <CETmaterial.h>

Inheritance diagram for Trk::CETmaterial:
Collaboration diagram for Trk::CETmaterial:

Public Member Functions

 CETmaterial (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
 ~CETmaterial ()
 Default Destructor.
StatusCode initialize ()
 standard Athena-Algorithm method
StatusCode execute (const EventContext &ctx)
 standard Athena-Algorithm method
StatusCode finalize ()
 standard Athena-Algorithm method
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

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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< IChronoStatSvc > IChronoStatSvc_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void printMat (double th, double ph, double mat, double dtheta=0., double dphi=0.) const
void printMatScan (double theta, double phi, double r, double z, double mat, const std::string &name) const
void printMatPrec (double theta, double phi, const Trk::TrackParameters *, const Trk::TrackParameters *, double mat, int id, const std::string &name)
void printMatComp (double theta, double phi, const Trk::TrackParameters *currPar, const std::string &name, double mat, double matApp, double dx, double dy) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
 The Extrapolator(s) to be retrieved.
ToolHandle< IExtrapolatorm_extraprec {this, "ExtraExtrapolator", "Trk::Extrapolator/MuonExtrapolator"}
DoubleProperty m_minZ0 {this, "StartPerigeeMinZ0", 0.}
DoubleProperty m_maxZ0 {this, "StartPerigeeMaxZ0", 0.}
DoubleProperty m_minTheta {this, "StartPerigeeMinTheta", 0.}
DoubleProperty m_maxTheta {this, "StartPerigeeMaxTheta", M_PI}
DoubleProperty m_minP {this, "StartPerigeeMinP", 50000*Gaudi::Units::GeV}
DoubleProperty m_maxP {this, "StartPerigeeMaxP", 50000*Gaudi::Units::GeV}
DoubleProperty m_charge {this, "StartPerigeeCharge", 1.}
UnsignedIntegerProperty m_numScan {this, "NumberOfScanTracks", 10}
BooleanProperty m_checkStepWise {this, "CheckActiveLayers", false}
BooleanProperty m_printMaterial {this, "PrintMaterial", false}
BooleanProperty m_printActive {this, "PrintActivePos", false}
const char * m_matTotFile = "material.txt"
const char * m_matScanFile = "material_scan.txt"
const char * m_matActiveFile = "mat_active.txt"
const char * m_matCompFile = "material_comp.txt"
BooleanProperty m_backward {this, "CheckBackward", false}
BooleanProperty m_domsentry {this, "CheckMSentry", false}
BooleanProperty m_doprecision {this, "CheckPrecision", false}
double m_th = 0.
double m_ph = 0.
int m_id = 0
double m_matSaved = 0.
Trk::TrackParametersm_next = nullptr
Amg::MatrixXm_err = nullptr
const Trk::Surfacem_outerBoundary = nullptr
const Trk::TrackingGeometrym_trackingGeometry = nullptr
const Trk::TrackingVolumem_msentry = nullptr
IntegerProperty m_particleType
IChronoStatSvc_t m_chronoStatSvc
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

The ExtrapolatorTest Algorithm runs a number of n test extrapolations from randomly distributed Track Parameters to geometry outer boundary and back to perigee.

Author
Sarka Todorova sarka.nosp@m..tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch

Definition at line 39 of file CETmaterial.h.

Member Typedef Documentation

◆ IChronoStatSvc_t

typedef ServiceHandle<IChronoStatSvc> Trk::CETmaterial::IChronoStatSvc_t
private

Definition at line 103 of file CETmaterial.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CETmaterial()

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

Standard Athena-Algorithm Constructor.

Definition at line 24 of file CETmaterial.cxx.

25 :
26 AthAlgorithm(name,pSvcLocator),
27 m_chronoStatSvc( "ChronoStatSvc", name )
28{ }
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
IChronoStatSvc_t m_chronoStatSvc

◆ ~CETmaterial()

Trk::CETmaterial::~CETmaterial ( )

Default Destructor.

Definition at line 32 of file CETmaterial.cxx.

33{
34 delete m_err;
35}
Amg::MatrixX * m_err
Definition CETmaterial.h:94

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 Trk::CETmaterial::execute ( const EventContext & ctx)
virtual

standard Athena-Algorithm method

Implements AthAlgorithm.

Definition at line 73 of file CETmaterial.cxx.

74{
75 ATH_MSG_INFO( "execute()" );
76 // retrieve outer boundary cylinder surface
77 if (!m_outerBoundary) {
78 m_trackingGeometry = m_extrapolator->trackingGeometry();
79 m_outerBoundary = &(m_trackingGeometry->highestTrackingVolume()->boundarySurfaces()[2]->surfaceRepresentation());
80 if (!m_outerBoundary) {
81 ATH_MSG_FATAL( "Could not retrieve cylinder boundary from " << m_extrapolator << ". Exiting." );
82 return StatusCode::FAILURE;
83 }
84 ATH_MSG_INFO( "boundary retrieved " );
85 }
86
87 if (m_chronoStatSvc) m_chronoStatSvc->chronoStart("MS::scan");
88
89 // scan
90 std::vector<const TrackStateOnSurface*> material;
91 std::vector<const TrackStateOnSurface*> matPrec;
92 double phi = -M_PI;
93 for ( unsigned int it = 0; it < m_numScan+1; it++) {
94 // the initial perigee
95 double z0 = m_minZ0 + (m_maxZ0-m_minZ0)/m_numScan *it;
96 phi += 1*Gaudi::Units::deg; if (phi>M_PI) phi -=2*M_PI;
97
99 double p = m_minP + (m_maxP-m_minP)/m_numScan *it;
100 Trk::PerigeeSurface surface( Amg::Vector3D(0.,0.,0.));
101 Trk::Perigee initialPerigee(0., z0, phi, theta, m_charge/p, surface);
102
103 const Trk::TrackParameters* seed = initialPerigee.clone();
104 const Trk::PerigeeSurface& pSf = initialPerigee.associatedSurface();
105 material.clear(); matPrec.clear();
106 const Trk::TrackParameters* currPar = seed;
107 const Trk::TrackParameters* precPar = seed;
108 if (m_domsentry) {
109 if (!m_msentry) {
110 m_msentry = m_trackingGeometry->trackingVolume("Calo::Containers::Calorimeter");
111 }
112 if (m_msentry) {
113 const Trk::TrackParameters* msEntry =
114 m_extrapolator->extrapolateToVolume(
115 ctx,
116 *currPar,
117 *m_msentry,
119 static_cast<Trk::ParticleHypothesis>(m_particleType.value())).release();
120 if (msEntry) {
121 printMat(
122 theta,
123 phi,
124 currPar->momentum().mag() - msEntry->momentum().mag(),
125 Amg::error(msEntry->covariance()->inverse().eval(), Trk::theta),
126 Amg::error(msEntry->covariance()->inverse().eval(), Trk::phi));
127
128 const std::vector<const Trk::TrackStateOnSurface*>* mmsentry = m_extrapolator->extrapolateM(ctx,
129 *currPar,
130 msEntry->associatedSurface(),
132 false,
133 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
134 if (mmsentry ) {
135 for (const auto& entry : *mmsentry) {
136 if (entry) {
137 ATH_MSG_DEBUG("position:eloss:"
138 << entry->trackParameters()->position() << ":"
139 << entry->trackParameters()->momentum().mag() - currPar->momentum().mag());
140 }
141 }
142
143 currPar = (mmsentry->back()) ? mmsentry->back()->trackParameters() : msEntry;
144
145 const std::vector<const Trk::TrackStateOnSurface*>* peri = m_extrapolator->extrapolateM(ctx,
146 *currPar,
147 pSf,
149 false,
150 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
151 ATH_MSG_INFO ( "material scan:backward:" );
152 if (peri){
153 ATH_MSG_DEBUG ("trPar vector size:" << peri->size() );
154 } else {
155 ATH_MSG_ERROR ("Perigee pointer is null in CETmaterial.cxx");
156 delete msEntry;
157 return StatusCode::FAILURE;
158 }
159 for (const auto& entry : *peri) {
160 if (entry && entry->trackParameters()) {
161 ATH_MSG_DEBUG("position:eloss:"
162 << entry->trackParameters()->position() << ":"
163 << entry->trackParameters()->momentum().mag() - msEntry->momentum().mag());
164 }
165 }
166
167 if (peri->back() && peri->back()->trackParameters()) {
168 ATH_MSG_INFO( "extrapolation to perigee:input: "
169 << initialPerigee.parameters()[0] << ","
170 << initialPerigee.parameters()[1] << ","
171 << initialPerigee.parameters()[2] << ","
172 << initialPerigee.parameters()[3] << ","
173 << initialPerigee.momentum().mag() );
174 ATH_MSG_INFO( "extrapolation to perigee:output: "
175 << peri->back()->trackParameters()->parameters()[0] << ","
176 << peri->back()->trackParameters()->parameters()[1] << ","
177 << peri->back()->trackParameters()->parameters()[2] << ","
178 << peri->back()->trackParameters()->parameters()[3] << ","
179 << peri->back()->trackParameters()->momentum().mag() );
180 } else {
181 ATH_MSG_ERROR( "extrapolation to perigee failed for input parameters: " << msEntry->parameters() );
182 }
183 delete peri;
184 delete msEntry;
185 } else {
186 ATH_MSG_ERROR( "extrapolation to MSentry failed for input parameters: " << currPar->parameters() );
187 printMat(theta,phi,0.);
188 }
189 }
190 }
191 delete currPar;
192 continue;
193 }
194 if (m_checkStepWise) {
195 double matApp = 0.;
196 while (currPar) {
197 std::pair<std::unique_ptr<Trk::TrackParameters>,const Trk::Layer*> next = m_extrapolator->extrapolateToNextActiveLayerM(
198 ctx,
199 *currPar,
201 true,
202 material,
203 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
204
205
206 const Trk::TrackParameters* nextPar = next.first.release();
207 const Trk::Layer* lay = next.second;
208 currPar = nextPar;
209
210 if (m_doprecision && precPar && currPar ) {
211 // try to extrapolate to the same surface
212 const std::vector<const Trk::TrackStateOnSurface*>* nextPrec = m_extraprec->extrapolateM(
213 ctx,
214 *precPar,currPar->associatedSurface(),
216 false,
217 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
218 delete precPar;
219 // collect material
220 if (nextPrec) {
221 for (const auto *i : *nextPrec) {
222 const Trk::MaterialEffectsBase* mEff = i->materialEffectsOnTrack();
223 const Trk::TrackParameters* trPar = i->trackParameters();
224 if (mEff && trPar) {
225 matApp += mEff->thicknessInX0();
226 }
227 }
228 }
229 // stop of extrapolation failed
230 if (!lay || !nextPrec || nextPrec->empty() || !nextPrec->back() ) break;
231 precPar = nextPrec->back()->trackParameters();
232 double mat=0.;
233 if (!material.empty()) for (auto & i : material) {
234 if (i->materialEffectsOnTrack()) mat += i->materialEffectsOnTrack()->thicknessInX0();
235 }
236 if ( precPar ) printMatComp(theta,phi,currPar,lay->enclosingDetachedTrackingVolume()->name(),mat,matApp,currPar->parameters()[0]-precPar->parameters()[0],
237 currPar->parameters()[1]-precPar->parameters()[1]);
238 else if (currPar) {
239 //precPar is nullptr here
240 ATH_MSG_INFO( "expected layer not reached:" << currPar->position() );
241 }
242 }
243 if (nextPar && m_printActive) {
244 int id = 0;
245 if (lay) id = lay->layerType();
246 double matc=0.;
247 if (!material.empty()) for (auto & i : material) {
248 if (i->materialEffectsOnTrack()) matc += i->materialEffectsOnTrack()->thicknessInX0();
249 }
250 else ATH_MSG_INFO( "mat & error:" << theta << "," << phi << "," << matc << ","
251 << Amg::error(nextPar->covariance()->inverse().eval(),Trk::theta) << ","
252 << Amg::error(nextPar->covariance()->inverse().eval(),Trk::phi) );
253
254 printMatPrec(theta,phi,nextPar,nextPar,matc,id,"unknown");
255 }
256 if (!lay) break;
257 }
258 if (m_printMaterial) {
259 double mat=0.;
260 if (!material.empty()) for (auto & i : material) {
261 if (i->materialEffectsOnTrack()) {
262 mat += i->materialEffectsOnTrack()->thicknessInX0();
263 }
264 }
265 printMat(theta,phi,mat);
266 }
267 } else {
268 const std::vector<const Trk::TrackStateOnSurface*>* destParameters = m_extrapolator->extrapolateM(
269 ctx,
270 *currPar,
273 false,
274 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
275
276 if (m_printMaterial) {
277 double mat=0.;
278 if (destParameters) for (const auto *destParameter : *destParameters) {
279 const Trk::MaterialEffectsBase* mEff = destParameter->materialEffectsOnTrack();
280 const Trk::TrackParameters* trPar = destParameter->trackParameters();
281 if (trPar) {
282 //const Trk::MeasuredTrackParameters* mdest = dynamic_cast<const Trk::MeasuredTrackParameters*> (trPar);
283 //if (mdest) ATH_MSG_INFO( "radiation thickness and errors(theta,phi):" << theta << "," << phi << "," << mat << "," <<
284 // mdest->localErrorMatrix().error(Trk::theta) << "," << mdest->localErrorMatrix().error(Trk::phi) );
285 }
286 if (mEff && trPar) {
287 mat += mEff->thicknessInX0();
288 // find volume
289 std::vector<const Trk::DetachedTrackingVolume*> detVols = m_extrapolator->trackingGeometry()->lowestDetachedTrackingVolumes(trPar->position());
290 if (!detVols.empty()) printMatScan(theta,phi,trPar->position().perp(),trPar->position().z(),mEff->thicknessInX0(),(detVols)[0]->name());
291 else printMatScan(theta,phi,trPar->position().perp(),trPar->position().z(),mEff->thicknessInX0(),m_extrapolator->trackingGeometry()->lowestStaticTrackingVolume(trPar->position())->volumeName());
292 }
293 }
294 if (destParameters) {
295 //const Trk::MeasuredTrackParameters* mdest = dynamic_cast<const Trk::MeasuredTrackParameters*> ((*destParameters).back()->trackParameters());
296 //if (mdest) ATH_MSG_INFO( "radiation thickness and errors(theta,phi):" << theta << "," << phi << "," << mat << "," <<
297 //mdest->localErrorMatrix().error(Trk::theta) << "," << mdest->localErrorMatrix().error(Trk::phi) );
298 }
299 printMat(theta,phi,mat);
300 }
301
302 if (!destParameters || destParameters->empty() ) {
303 ATH_MSG_ERROR( "extrapolation to outer boundary failed for input parameters: " << initialPerigee.parameters() );
304 } else if (destParameters->back()->trackParameters()) {
305 // forward extrapolation ok
306 if (m_backward) {
307 material.clear();
308 const std::vector<const Trk::TrackStateOnSurface*>* peri = m_extrapolator->extrapolateM(
309 ctx, *(destParameters->back()->trackParameters()),
310 pSf,
312 false,
313 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
314
315 if (peri) {
316 ATH_MSG_INFO( "trPar vector size:" << peri->size() );
317 for (unsigned int i=0; i< peri->size(); i++)
318 ATH_MSG_INFO( "position:" << i << "," << (*peri)[i]->trackParameters()->position() );
319 ATH_MSG_INFO( "extrapolation to perigee:input: " << initialPerigee.parameters() );
320 ATH_MSG_INFO( "extrapolation to perigee:output: " << peri->back()->trackParameters()->parameters() );
321 } else {
322 ATH_MSG_ERROR( "extrapolation to perigee failed for input parameters: " << destParameters->back()->trackParameters()->parameters() );
323 }
324 delete peri;
325 }
326 }
327
328 delete destParameters;
329 }
330 }
331
332 if (m_chronoStatSvc) m_chronoStatSvc->chronoStop("MS::scan");
333
334 return StatusCode::SUCCESS;
335}
#define M_PI
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
void printMat(double th, double ph, double mat, double dtheta=0., double dphi=0.) const
BooleanProperty m_backward
Definition CETmaterial.h:85
BooleanProperty m_domsentry
Definition CETmaterial.h:86
const Trk::TrackingGeometry * m_trackingGeometry
Definition CETmaterial.h:97
IntegerProperty m_particleType
void printMatPrec(double theta, double phi, const Trk::TrackParameters *, const Trk::TrackParameters *, double mat, int id, const std::string &name)
BooleanProperty m_doprecision
Definition CETmaterial.h:87
DoubleProperty m_charge
Definition CETmaterial.h:74
void printMatScan(double theta, double phi, double r, double z, double mat, const std::string &name) const
DoubleProperty m_minP
Definition CETmaterial.h:72
BooleanProperty m_printActive
Definition CETmaterial.h:78
DoubleProperty m_minZ0
Definition CETmaterial.h:68
BooleanProperty m_checkStepWise
Definition CETmaterial.h:76
ToolHandle< IExtrapolator > m_extraprec
Definition CETmaterial.h:66
UnsignedIntegerProperty m_numScan
Definition CETmaterial.h:75
DoubleProperty m_maxP
Definition CETmaterial.h:73
const Trk::Surface * m_outerBoundary
Definition CETmaterial.h:96
BooleanProperty m_printMaterial
Definition CETmaterial.h:77
void printMatComp(double theta, double phi, const Trk::TrackParameters *currPar, const std::string &name, double mat, double matApp, double dx, double dy) const
DoubleProperty m_minTheta
Definition CETmaterial.h:70
DoubleProperty m_maxTheta
Definition CETmaterial.h:71
const Trk::TrackingVolume * m_msentry
Definition CETmaterial.h:98
ToolHandle< IExtrapolator > m_extrapolator
The Extrapolator(s) to be retrieved.
Definition CETmaterial.h:64
DoubleProperty m_maxZ0
Definition CETmaterial.h:69
const std::string & name() const
returns the Name
int layerType() const
get the Layer coding
const DetachedTrackingVolume * enclosingDetachedTrackingVolume() const
get the confining DetachedTrackingVolume
double thicknessInX0() const
returns the actually traversed material .
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
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 ...
Eigen::Matrix< double, 3, 1 > Vector3D
@ oppositeMomentum
@ alongMomentum
@ next
Definition BinningData.h:33
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75
@ z0
Definition ParamDefs.h:64
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ 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 Trk::CETmaterial::finalize ( )

standard Athena-Algorithm method

Definition at line 62 of file CETmaterial.cxx.

63{
64 // Code entered here will be executed once at the end of the program run.
65
66 if (m_chronoStatSvc) m_chronoStatSvc->chronoPrint("MS::scan");
67
68 return StatusCode::SUCCESS;
69}

◆ initialize()

StatusCode Trk::CETmaterial::initialize ( )

standard Athena-Algorithm method

Definition at line 40 of file CETmaterial.cxx.

41{
42 // Code entered here will be executed once at program start.
43
44 ATH_MSG_INFO( "initialize()" );
45
46 // Get Extrapolator from ToolService
47 if (m_extrapolator.retrieve().isFailure()) {
48 ATH_MSG_FATAL( "Could not retrieve Tool " << m_extrapolator << ". Exiting." );
49 return StatusCode::FAILURE;
50 }
51 if (m_extraprec.retrieve().isFailure()) {
52 ATH_MSG_FATAL( "Could not retrieve Tool " << m_extraprec << ". Exiting." );
53 return StatusCode::FAILURE;
54 }
55
56 ATH_MSG_INFO( "initialize() successful" );
57 return StatusCode::SUCCESS;
58}

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

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

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

◆ printMat()

void Trk::CETmaterial::printMat ( double th,
double ph,
double mat,
double dtheta = 0.,
double dphi = 0. ) const
private

Definition at line 339 of file CETmaterial.cxx.

339 {
340
341 std::ofstream myfilemat;
342 myfilemat.open (m_matTotFile,std::ios::app);
343 myfilemat<<theta<<" "<<phi<<" "<<mat<<" "<<dtheta<<" "<<dphi<<std::endl;
344}
const char * m_matTotFile
Definition CETmaterial.h:80

◆ printMatComp()

void Trk::CETmaterial::printMatComp ( double theta,
double phi,
const Trk::TrackParameters * currPar,
const std::string & name,
double mat,
double matApp,
double dx,
double dy ) const
private

Definition at line 420 of file CETmaterial.cxx.

421{
422 std::ofstream myfilemat;
423 myfilemat.open(m_matCompFile,std::ios::app);
424 myfilemat << theta << " " << phi << " " << currPar->position().perp() << " " << currPar->position().z() << " " << name.substr(0,2)
425 << " " << mat << " " << matApp << " " << dx << " " << dy << std::endl;
426}
const char * m_matCompFile
Definition CETmaterial.h:83

◆ printMatPrec()

void Trk::CETmaterial::printMatPrec ( double theta,
double phi,
const Trk::TrackParameters * nextPar,
const Trk::TrackParameters * mdest,
double mat,
int id,
const std::string & name )
private

Definition at line 354 of file CETmaterial.cxx.

354 {
355
356 if (name.empty()) {}; // dummy to get rid of warning message (unused variable name)
357 std::ofstream myfilemat;
358 myfilemat.open(m_matActiveFile,std::ios::app);
359
360 if (!m_th && !m_ph) {
361 m_th = theta;
362 m_ph = phi;
363 m_id = id;
364 m_matSaved = mat;
365 delete m_next; m_next=nextPar->clone();
366 delete m_err;
367 m_err=nullptr;
368 if (mdest) {
370 *m_err = mdest->covariance()->inverse().eval();
371 }
372 return;
373 }
374
375 if ( theta!=m_th || phi!=m_ph ) {
376
377 if (m_err && m_id>0) {
378 myfilemat << m_th << " " << m_ph << " " << 1 << " " << m_id << " " << m_matSaved << std::endl;
379 myfilemat << m_next->parameters()[Trk::locX] << " " << m_next->parameters()[Trk::locY] << " " << m_next->parameters()[Trk::phi]
380 << " " << m_next->parameters()[Trk::theta] << " " << m_next->parameters()[Trk::qOverP] << std::endl;
381 myfilemat << Amg::error(*m_err,Trk::locX) << " " << Amg::error(*m_err,Trk::locY)
382 << " " << Amg::error(*m_err,Trk::phi) << " " << Amg::error(*m_err,Trk::theta)
383 << " " << Amg::error(*m_err,Trk::qOverP) << std::endl;
384 } else {
385 myfilemat << m_th << " " << m_ph << " " << 0 << " " << m_id << std::endl;
386 myfilemat << m_next->parameters()[Trk::locX] << " " << m_next->parameters()[Trk::locY] << " " << m_next->parameters()[Trk::phi]
387 << " " << m_next->parameters()[Trk::theta] << " " << m_next->parameters()[Trk::qOverP] << std::endl;
388 }
389 m_th = theta;
390 m_ph = phi;
391 m_id = id;
392 m_matSaved = mat;
393 delete m_next; m_next=nextPar->clone();
394 delete m_err;
395 m_err=nullptr;
396
397 if (mdest) {
399 *m_err = mdest->covariance()->inverse().eval();
400 }
401 return;
402 }
403
404 // update data
405 if (id>1) {
406 m_th = theta;
407 m_ph = phi;
408 m_id = id;
409 m_matSaved = mat;
410 delete m_next; m_next=nextPar->clone();
411 delete m_err;
412 m_err=nullptr;
413 if (mdest) {
415 *m_err = mdest->covariance()->inverse().eval();
416 }
417 }
418 }
Trk::TrackParameters * m_next
Definition CETmaterial.h:93
const char * m_matActiveFile
Definition CETmaterial.h:82
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
@ qOverP
perigee
Definition ParamDefs.h:67

◆ printMatScan()

void Trk::CETmaterial::printMatScan ( double theta,
double phi,
double r,
double z,
double mat,
const std::string & name ) const
private

Definition at line 347 of file CETmaterial.cxx.

347 {
348
349 std::ofstream myfilemat;
350 myfilemat.open(m_matScanFile,std::ios::app);
351 myfilemat << theta << " " << phi << " " << r << " " << z << " " << mat << " " << name << std::endl;
352}
const char * m_matScanFile
Definition CETmaterial.h:81
int r
Definition globals.cxx:22
@ z
global position (cartesian)
Definition ParamDefs.h:57

◆ 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}
#define ATH_MSG_WARNING(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 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_backward

BooleanProperty Trk::CETmaterial::m_backward {this, "CheckBackward", false}
private

Definition at line 85 of file CETmaterial.h.

85{this, "CheckBackward", false};

◆ m_charge

DoubleProperty Trk::CETmaterial::m_charge {this, "StartPerigeeCharge", 1.}
private

Definition at line 74 of file CETmaterial.h.

74{this, "StartPerigeeCharge", 1.};

◆ m_checkStepWise

BooleanProperty Trk::CETmaterial::m_checkStepWise {this, "CheckActiveLayers", false}
private

Definition at line 76 of file CETmaterial.h.

76{this, "CheckActiveLayers", false};

◆ m_chronoStatSvc

IChronoStatSvc_t Trk::CETmaterial::m_chronoStatSvc
private

Definition at line 104 of file CETmaterial.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_domsentry

BooleanProperty Trk::CETmaterial::m_domsentry {this, "CheckMSentry", false}
private

Definition at line 86 of file CETmaterial.h.

86{this, "CheckMSentry", false};

◆ m_doprecision

BooleanProperty Trk::CETmaterial::m_doprecision {this, "CheckPrecision", false}
private

Definition at line 87 of file CETmaterial.h.

87{this, "CheckPrecision", false};

◆ m_err

Amg::MatrixX* Trk::CETmaterial::m_err = nullptr
private

Definition at line 94 of file CETmaterial.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 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_extrapolator

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

The Extrapolator(s) to be retrieved.

Definition at line 63 of file CETmaterial.h.

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

◆ m_extraprec

ToolHandle<IExtrapolator> Trk::CETmaterial::m_extraprec {this, "ExtraExtrapolator", "Trk::Extrapolator/MuonExtrapolator"}
private

Definition at line 65 of file CETmaterial.h.

66{this, "ExtraExtrapolator", "Trk::Extrapolator/MuonExtrapolator"};

◆ m_id

int Trk::CETmaterial::m_id = 0
private

Definition at line 91 of file CETmaterial.h.

◆ m_matActiveFile

const char* Trk::CETmaterial::m_matActiveFile = "mat_active.txt"
private

Definition at line 82 of file CETmaterial.h.

◆ m_matCompFile

const char* Trk::CETmaterial::m_matCompFile = "material_comp.txt"
private

Definition at line 83 of file CETmaterial.h.

◆ m_matSaved

double Trk::CETmaterial::m_matSaved = 0.
private

Definition at line 92 of file CETmaterial.h.

◆ m_matScanFile

const char* Trk::CETmaterial::m_matScanFile = "material_scan.txt"
private

Definition at line 81 of file CETmaterial.h.

◆ m_matTotFile

const char* Trk::CETmaterial::m_matTotFile = "material.txt"
private

Definition at line 80 of file CETmaterial.h.

◆ m_maxP

DoubleProperty Trk::CETmaterial::m_maxP {this, "StartPerigeeMaxP", 50000*Gaudi::Units::GeV}
private

Definition at line 73 of file CETmaterial.h.

73{this, "StartPerigeeMaxP", 50000*Gaudi::Units::GeV};

◆ m_maxTheta

DoubleProperty Trk::CETmaterial::m_maxTheta {this, "StartPerigeeMaxTheta", M_PI}
private

Definition at line 71 of file CETmaterial.h.

71{this, "StartPerigeeMaxTheta", M_PI};

◆ m_maxZ0

DoubleProperty Trk::CETmaterial::m_maxZ0 {this, "StartPerigeeMaxZ0", 0.}
private

Definition at line 69 of file CETmaterial.h.

69{this, "StartPerigeeMaxZ0", 0.};

◆ m_minP

DoubleProperty Trk::CETmaterial::m_minP {this, "StartPerigeeMinP", 50000*Gaudi::Units::GeV}
private

Definition at line 72 of file CETmaterial.h.

72{this, "StartPerigeeMinP", 50000*Gaudi::Units::GeV};

◆ m_minTheta

DoubleProperty Trk::CETmaterial::m_minTheta {this, "StartPerigeeMinTheta", 0.}
private

Definition at line 70 of file CETmaterial.h.

70{this, "StartPerigeeMinTheta", 0.};

◆ m_minZ0

DoubleProperty Trk::CETmaterial::m_minZ0 {this, "StartPerigeeMinZ0", 0.}
private

Definition at line 68 of file CETmaterial.h.

68{this, "StartPerigeeMinZ0", 0.};

◆ m_msentry

const Trk::TrackingVolume* Trk::CETmaterial::m_msentry = nullptr
private

Definition at line 98 of file CETmaterial.h.

◆ m_next

Trk::TrackParameters* Trk::CETmaterial::m_next = nullptr
private

Definition at line 93 of file CETmaterial.h.

◆ m_numScan

UnsignedIntegerProperty Trk::CETmaterial::m_numScan {this, "NumberOfScanTracks", 10}
private

Definition at line 75 of file CETmaterial.h.

75{this, "NumberOfScanTracks", 10};

◆ m_outerBoundary

const Trk::Surface* Trk::CETmaterial::m_outerBoundary = nullptr
private

Definition at line 96 of file CETmaterial.h.

◆ m_particleType

IntegerProperty Trk::CETmaterial::m_particleType
private
Initial value:
{this, "ParticleType", Trk::muon,
"the particle type for the extrap."}

Definition at line 100 of file CETmaterial.h.

100 {this, "ParticleType", Trk::muon,
101 "the particle type for the extrap."};

◆ m_ph

double Trk::CETmaterial::m_ph = 0.
private

Definition at line 90 of file CETmaterial.h.

◆ m_printActive

BooleanProperty Trk::CETmaterial::m_printActive {this, "PrintActivePos", false}
private

Definition at line 78 of file CETmaterial.h.

78{this, "PrintActivePos", false};

◆ m_printMaterial

BooleanProperty Trk::CETmaterial::m_printMaterial {this, "PrintMaterial", false}
private

Definition at line 77 of file CETmaterial.h.

77{this, "PrintMaterial", false};

◆ m_th

double Trk::CETmaterial::m_th = 0.
private

Definition at line 89 of file CETmaterial.h.

◆ m_trackingGeometry

const Trk::TrackingGeometry* Trk::CETmaterial::m_trackingGeometry = nullptr
private

Definition at line 97 of file CETmaterial.h.

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