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

#include <MaterialValidation.h>

Inheritance diagram for Trk::MaterialValidation:
Collaboration diagram for Trk::MaterialValidation:

Public Member Functions

 MaterialValidation (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
 ~MaterialValidation ()
 Default Destructor.
StatusCode initialize ()
 standard Athena-Algorithm method
StatusCode execute ()
 standard Athena-Algorithm method
StatusCode finalize ()
 standard Athena-Algorithm method
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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

PositionAtBoundary collectMaterialAndExit (const Trk::TrackingVolume &tvol, const Amg::Vector3D &position, const Amg::Vector3D &direction)
const TrackingGeometrytrackingGeometry () const
void throwFailedToGetTrackingGeometry () const
const TrackingGeometryretrieveTrackingGeometry (const EventContext &ctx) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< TrackingGeometrym_trackingGeometryReadKey {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."}
ToolHandle< IMaterialMapperm_materialMapper
 Mapper and Inspector.
int m_maxMaterialValidationEvents
 limit the number of validation records to avoid 2G files
Rndm::Numbers * m_flatDist
 Random generator for flat distribution.
double m_etaMin
 eta boundary
double m_etaMax
 eta boundary
bool m_runNativeNavigation
 validate the native TG navigation
double m_accTinX0
 accumulated t in X0
DataObjIDColl m_extendedExtraObjects
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

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MaterialValidation()

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

Standard Athena-Algorithm Constructor.

Definition at line 29 of file MaterialValidation.cxx.

30: AthAlgorithm(name,pSvcLocator) ,
31 m_materialMapper("Trk::MaterialMapper/MappingMaterialMapper"),
33 m_flatDist(nullptr),
34 m_etaMin(-3.),
35 m_etaMax(3.),
37 m_accTinX0(0)
38{
39
40 // ---------------------- The Material Mapping -------------------------- //
41 // the toolhandle of the MaterialMapper to be used
42 declareProperty("MaterialMapper" , m_materialMapper);
43 declareProperty("MaximumMappingEvents" , m_maxMaterialValidationEvents);
44 // ---------------------- Range setup ----------------------------------- //
45 declareProperty("MinEta" , m_etaMin);
46 declareProperty("MaxEta" , m_etaMax);
47 // ---------------------- Native navigation ----------------------------- //
48 declareProperty("NativeNavigation" , m_runNativeNavigation);
49}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
int m_maxMaterialValidationEvents
limit the number of validation records to avoid 2G files
ToolHandle< IMaterialMapper > m_materialMapper
Mapper and Inspector.
Rndm::Numbers * m_flatDist
Random generator for flat distribution.
double m_etaMax
eta boundary
bool m_runNativeNavigation
validate the native TG navigation
double m_etaMin
eta boundary
double m_accTinX0
accumulated t in X0

◆ ~MaterialValidation()

Trk::MaterialValidation::~MaterialValidation ( )

Default Destructor.

Definition at line 51 of file MaterialValidation.cxx.

52{
53 delete m_flatDist;
54}

Member Function Documentation

◆ collectMaterialAndExit()

Trk::PositionAtBoundary Trk::MaterialValidation::collectMaterialAndExit ( const Trk::TrackingVolume & tvol,
const Amg::Vector3D & position,
const Amg::Vector3D & direction )
private

Definition at line 100 of file MaterialValidation.cxx.

103{
104 // get the entry layers -----------------------------------------------------------
105 std::map<double, Trk::AssociatedMaterial> collectedMaterial;
106
107 // all boundaries found --- proceed
108 Trk::PositionAtBoundary pab(position, 0);
109
110 ATH_MSG_DEBUG("[>>] Entering Volume: " << tvol.volumeName() << "- at " << Amg::toString(position));
111
112 Trk::NeutralCurvilinearParameters cvp(position,direction,0.);
113
115 // A : collect all hit layers
116 auto layerIntersections = tvol.materialLayersOrdered<Trk::NeutralCurvilinearParameters>(nullptr,nullptr,cvp,Trk::alongMomentum);
117 // loop over the layers
118 for (auto& lCandidate : layerIntersections ) {
119 // get the layer
120 const Trk::Layer* layer = lCandidate.object;
121 double pathLength = lCandidate.intersection.pathLength;
122 // get the associate material
123 if (layer->layerMaterialProperties()){
124 // take it from the global position
125 const Trk::MaterialProperties* mprop = layer->layerMaterialProperties()->fullMaterial(lCandidate.intersection.position);
126 if (mprop){
127 double stepLength = mprop->thickness()*fabs(layer->surfaceRepresentation().pathCorrection(lCandidate.intersection.position,direction));
128 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lCandidate.intersection.position, mprop, stepLength, &tvol, layer);
129 }
130 }
131 }
132 // B : collect all boundary layers, start from last hit layer
133 Amg::Vector3D lastPosition = !collectedMaterial.empty() ? collectedMaterial.rbegin()->second.materialPosition() : (position + direction.unit());
134 Trk::NeutralCurvilinearParameters lcp(lastPosition,direction,0.);
135 // boundary surfaces
137 if (!boundaryIntersections.empty()){
138 // by definition is the first one
139 lastPosition = boundaryIntersections.begin()->intersection.position;
140 const Trk::BoundarySurface<Trk::TrackingVolume>* bSurfaceTV = boundaryIntersections.begin()->object;
141 const Trk::Surface& bSurface = bSurfaceTV->surfaceRepresentation();
142 // get the path lenght to it
143 if (bSurface.materialLayer() && bSurface.materialLayer()->layerMaterialProperties()){
144 const Trk::MaterialProperties* mprop = bSurface.materialLayer()->layerMaterialProperties()->fullMaterial(lastPosition);
145 double pathLength = (lastPosition-position).mag();
146 if (mprop){
147 double stepLength = mprop->thickness()*fabs(bSurface.pathCorrection(lastPosition,direction));
148 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lastPosition, mprop, stepLength, &tvol, bSurface.materialLayer());
149 } else
150 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lastPosition, &tvol, bSurface.materialLayer());
151 }
152 // set the new volume
153 const Trk::TrackingVolume* naVolume = bSurfaceTV->attachedVolume(lastPosition, direction, Trk::alongMomentum);
154 pab = Trk::PositionAtBoundary(lastPosition,naVolume);
155 } else
156 pab = Trk::PositionAtBoundary(lastPosition,0);
157 } else {
158 std::map<double, std::pair<const Trk::Layer*, Amg::Vector3D> > intersectedLayers;
159
160 // Process the contained layers if they exist
161 const Trk::LayerArray* layerArray = tvol.confinedLayers();
162 if (layerArray) {
163 // display output
164 std::span<Trk::Layer const * const> layers = layerArray->arrayObjects();
165 auto layIter = layers.begin();
166 auto layIterE = layers.end();
167 for ( ; layIter != layIterE; ++layIter){
168 if ( (*layIter)->layerMaterialProperties() ){
169 Trk::Intersection lsIntersection = (*layIter)->surfaceRepresentation().straightLineIntersection(position, direction, true, true);
170 if (lsIntersection.valid){
171 intersectedLayers[lsIntersection.pathLength] = std::pair<const Trk::Layer*, Amg::Vector3D>(*layIter,lsIntersection.position);
172 // get & record the material
173 // - the position on the surface
174 Amg::Vector3D mposition = (*layIter)->surfaceRepresentation().transform().inverse()*lsIntersection.position;
175 const Trk::MaterialProperties* mprop = (*layIter)->layerMaterialProperties()->fullMaterial(mposition);
176 if (mprop) {
177 double stepLength = mprop->thickness()*fabs((*layIter)->surfaceRepresentation().pathCorrection(lsIntersection.position,direction));
178 collectedMaterial[lsIntersection.pathLength] = Trk::AssociatedMaterial(lsIntersection.position, mprop, stepLength, &tvol, (*layIter));
179 } else
180 collectedMaterial[lsIntersection.pathLength] = Trk::AssociatedMaterial(lsIntersection.position, &tvol, (*layIter));
181
182 ATH_MSG_VERBOSE("[>>>>] record material hit at layer with index " << (*layIter)->layerIndex().value() << " - at " << Amg::toString(lsIntersection.position) );
183 if (mprop)
184 ATH_MSG_VERBOSE("[>>>>] MaterialProperties are " << (*mprop) );
185 else
186 ATH_MSG_VERBOSE("[>>>>] No MaterialProperties found." );
187 }
188 }
189 }
190 }
191
192 // material for confined layers collected, now go to boundary
193
194 // update the position to the last one
195 Amg::Vector3D lastPosition = !intersectedLayers.empty() ? (*(--(intersectedLayers.end()))).second.second : position;
196
197 std::map<double, Trk::VolumeExit > volumeExits;
198 // now find the exit point
199 const auto & bSurfaces = tvol.boundarySurfaces();
200 for (size_t ib = 0; ib < bSurfaces.size(); ++ib){
201 // omit positions on the surface
202 if ( !bSurfaces[ib]->surfaceRepresentation().isOnSurface(lastPosition, true, 0.1, 0.1) ){
203 Trk::Intersection evIntersection = bSurfaces[ib]->surfaceRepresentation().straightLineIntersection(lastPosition, direction, true, true);
204 ATH_MSG_VERBOSE("[>>>>] boundary surface intersection / validity :" << Amg::toString(evIntersection.position) << " / " << evIntersection.valid);
205 ATH_MSG_VERBOSE("[>>>>] with path length = " << evIntersection.pathLength );
206 if (evIntersection.valid){
207 // next attached Tracking Volume
208 const Trk::TrackingVolume* naVolume = bSurfaces[ib]->attachedVolume(evIntersection.position, direction, Trk::alongMomentum);
209 // put it into the map
210 volumeExits[evIntersection.pathLength] = Trk::VolumeExit(naVolume, &(bSurfaces[ib]->surfaceRepresentation()), evIntersection.position);
211 // volume exit
212 ATH_MSG_VERBOSE("[>>>>] found volume exit - at " << Amg::toString(evIntersection.position) );
213 }
214 } else
215 ATH_MSG_VERBOSE("[>>>>] starting position is on surface ! " );
216 }
217 // prepare the boundary
218 if (!volumeExits.empty()){
219 // get the first entry in the map: closest next volume
220 VolumeExit closestVolumeExit = (*volumeExits.begin()).second;
221 // check if the volume exit boundary has material attached
222 const Trk::Surface* bSurface = closestVolumeExit.bSurface;
223 if ( bSurface && bSurface->materialLayer() && bSurface->materialLayer()->layerMaterialProperties()){
224 ATH_MSG_VERBOSE("[>>>>] The boundary surface has an associated layer, collect material from there");
225 const Trk::MaterialProperties* mprop = bSurface->materialLayer()->layerMaterialProperties()->fullMaterial(closestVolumeExit.vExit);
226 double pathToExit = (closestVolumeExit.vExit-lastPosition).mag();
227 if (mprop){
228 double stepLength = mprop->thickness()*fabs(bSurface->pathCorrection(closestVolumeExit.vExit,direction));
229 collectedMaterial[pathToExit] = Trk::AssociatedMaterial(closestVolumeExit.vExit, mprop, stepLength, &tvol, bSurface->materialLayer());
230 } else
231 collectedMaterial[pathToExit] = Trk::AssociatedMaterial(closestVolumeExit.vExit, &tvol, bSurface->materialLayer());
232 }
233 //
234 if (closestVolumeExit.nVolume != &tvol && closestVolumeExit.nVolume) {
235 ATH_MSG_VERBOSE("[>>>>] Next Volume: " << closestVolumeExit.nVolume->volumeName() << " - at " << Amg::toString(closestVolumeExit.vExit) );
236 // return for further navigation
237 pab = Trk::PositionAtBoundary(closestVolumeExit.vExit,closestVolumeExit.nVolume);
238 }
239 } else {
240 ATH_MSG_VERBOSE( "[>>>>] No exit found from Volume '" << tvol.volumeName() << "' - starting radius = " << lastPosition.perp() );
241 const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(tvol.volumeBounds()));
242 if (cvb)
243 ATH_MSG_VERBOSE( "[>>>>] Volume outer radius = " << cvb->outerRadius() );
244 }
245
246 }
247 // finally collect the material
248 ATH_MSG_DEBUG("[>>>] Collecting materials from "<< collectedMaterial.size() << " layers");
249 // provide the material to the material mapper
250 auto cmIter = collectedMaterial.begin();
251 auto cmIterE = collectedMaterial.end();
252 for ( ; cmIter != cmIterE; ++cmIter ){
253 m_materialMapper->recordMaterialHit(cmIter->second, cmIter->second.materialPosition());
254 m_accTinX0 += cmIter->second.steplengthInX0();
255 int layerIndex = cmIter->second.associatedLayer() ? cmIter->second.associatedLayer()->layerIndex().value() : 0;
256 ATH_MSG_DEBUG("[>>>] Accumulate pathLength/X0 on layer with index " << layerIndex << " - t/X0 (total so far) = " << cmIter->second.steplengthInX0() << " (" << m_accTinX0 << ")");
257 if (layerIndex){
258 std::string surfaceType =
259 cmIter->second.associatedLayer()->surfaceRepresentation().type() ==
261 ? "Cylinder at radius = "
262 : "Disc at z-position = ";
263 std::string layerType =
264 cmIter->second.associatedLayer()->surfaceArray() ? "Active "
265 : "Passive ";
266 double rz =
267 cmIter->second.associatedLayer()->surfaceRepresentation().type() ==
269 ? cmIter->second.associatedLayer()
270 ->surfaceRepresentation()
271 .bounds()
272 .r()
273 : cmIter->second.associatedLayer()
274 ->surfaceRepresentation()
275 .center()
276 .z();
277 ATH_MSG_DEBUG(" " << layerType << surfaceType << rz);
278 }
279 ATH_MSG_DEBUG(" Distance to origin is " << cmIter->second.materialPosition().mag() );
280 }
281
282 // return what you have
283 return pab;
284
285}
Scalar mag() const
mag method
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
static Double_t rz
virtual std::span< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
virtual const Tvol * attachedVolume(const TrackParameters &parms, PropDirection dir) const =0
Get the next Volume depending on the TrackParameters and the requested direction.
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
double outerRadius() const
This method returns the outer radius.
virtual const MaterialProperties * fullMaterial(const Amg::Vector3D &gp) const =0
Return method for full material description of the Layer.
const LayerMaterialProperties * layerMaterialProperties() const
getting the LayerMaterialProperties including full/pre/post update
float thickness() const
Return the thickness in mm.
virtual double pathCorrection(const Amg::Vector3D &pos, const Amg::Vector3D &mom) const
the pathCorrection for derived classes with thickness - it reflects if the direction projection is po...
const Trk::MaterialLayer * materialLayer() const
return the material Layer
const LayerArray * confinedLayers() const
Return the subLayer array.
std::vector< LayerIntersection< T > > materialLayersOrdered(const Layer *sLayer, const Layer *eLayer, const T &parameters, PropDirection pDir=alongMomentum, const BoundaryCheck &bchk=true, bool resolveSubSurfaces=false) const
Return the material layers ordered based on straight line intersections:
std::vector< std::shared_ptr< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
std::vector< BoundaryIntersection< T > > boundarySurfacesOrdered(const T &parameters, PropDirection pDir=alongMomentum, bool startOffBoundary=false) const
Returns the boundary surfaces ordered in probability to hit them based on straight line intersection.
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition Volume.h:96
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 3, 1 > Vector3D
layers(flags, cells_name, *args, **kw)
Here we define wrapper functions to set up all of the standard corrections.
@ layer
Definition HitInfo.h:79
@ alongMomentum
BinnedArray< Layer > LayerArray
simply for the eye
std::pair< Amg::Vector3D, const Trk::TrackingVolume * > PositionAtBoundary
CurvilinearParametersT< NeutralParametersDim, Neutral, PlaneSurface > NeutralCurvilinearParameters
Amg::Vector3D position

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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::MaterialValidation::execute ( )

standard Athena-Algorithm method

Definition at line 72 of file MaterialValidation.cxx.

73{
74 ATH_MSG_VERBOSE( "MaterialValidation execute() start ================================================" );
75
76 // create the random direction - flat in eta
77 double eta = m_etaMin + (m_etaMax-m_etaMin)*m_flatDist->shoot();
78 double theta = 2.*atan(exp(-eta));
79 double phi = M_PI * ( 2*m_flatDist->shoot() - 1.);
80 m_accTinX0 = 0;
81
82 // get the position and riection from the random numbers
83 Amg::Vector3D position(0.,0.,0.);
85
86 ATH_MSG_DEBUG("[>] Start mapping event with phi | eta = " << phi << " | " << direction.eta());
87
88 // find the start TrackingVolume
89 const Trk::TrackingVolume* sVolume = trackingGeometry().lowestTrackingVolume(position);
90 const Trk::TrackingVolume* nVolume = sVolume;
91 while (nVolume ) {
92 Trk::PositionAtBoundary paB = collectMaterialAndExit(*nVolume, position, direction);
93 position = paB.first;
94 nVolume = paB.second;
95 }
96 ATH_MSG_DEBUG("[<] Finishing event with collected path [X0] = " << m_accTinX0);
97 return StatusCode::SUCCESS;
98}
#define M_PI
Scalar eta() const
pseudorapidity method
const TrackingGeometry & trackingGeometry() const
PositionAtBoundary collectMaterialAndExit(const Trk::TrackingVolume &tvol, const Amg::Vector3D &position, const Amg::Vector3D &direction)
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
@ theta
Definition ParamDefs.h:66
@ phi
Definition ParamDefs.h:75

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode Trk::MaterialValidation::finalize ( )

standard Athena-Algorithm method

Definition at line 289 of file MaterialValidation.cxx.

290{
291 ATH_MSG_INFO( "MaterialValidation finalize()" );
292 return StatusCode::SUCCESS;
293}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode Trk::MaterialValidation::initialize ( )

standard Athena-Algorithm method

Definition at line 57 of file MaterialValidation.cxx.

58{
59
60 // Get the TrackingGeometry from StoreGate
62
63 if ( (m_materialMapper.retrieve()).isFailure() )
64 ATH_MSG_WARNING("Could not retrieve MaterialMapper");
65
66 // initialize the random generators
67 m_flatDist = new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
68 return StatusCode::SUCCESS;
69}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ retrieveTrackingGeometry()

const TrackingGeometry * Trk::MaterialValidation::retrieveTrackingGeometry ( const EventContext & ctx) const
inlineprivate

Definition at line 78 of file MaterialValidation.h.

80 {
81 SG::ReadCondHandle<TrackingGeometry> handle(m_trackingGeometryReadKey,
82 ctx);
83 if (!handle.isValid()) {
84 ATH_MSG_FATAL("Could not load TrackingGeometry with name '"
85 << m_trackingGeometryReadKey.key() << "'. Aborting.");
87 }
88 return handle.cptr();
89 }
#define ATH_MSG_FATAL(x)
void throwFailedToGetTrackingGeometry() const

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_ERROR(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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.

◆ throwFailedToGetTrackingGeometry()

void Trk::MaterialValidation::throwFailedToGetTrackingGeometry ( ) const
private

Definition at line 295 of file MaterialValidation.cxx.

295 {
296 std::stringstream msg;
297 msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
298 throw std::runtime_error(msg.str());
299}
MsgStream & msg() const

◆ trackingGeometry()

const Trk::TrackingGeometry & Trk::MaterialValidation::trackingGeometry ( ) const
inlineprivate

Definition at line 108 of file MaterialValidation.h.

108 {
109 const Trk::TrackingGeometry *tracking_geometry = retrieveTrackingGeometry(Gaudi::Hive::currentContext());
110 if (!tracking_geometry){
111 ATH_MSG_FATAL("Did not get valid TrackingGeometry. Aborting." );
112 throw GaudiException("MaterialValidation", "Problem with TrackingGeometry loading.", StatusCode::FAILURE);
113 }
114 return *tracking_geometry;
115 }
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_accTinX0

double Trk::MaterialValidation::m_accTinX0
private

accumulated t in X0

Definition at line 104 of file MaterialValidation.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etaMax

double Trk::MaterialValidation::m_etaMax
private

eta boundary

Definition at line 101 of file MaterialValidation.h.

◆ m_etaMin

double Trk::MaterialValidation::m_etaMin
private

eta boundary

Definition at line 100 of file MaterialValidation.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_flatDist

Rndm::Numbers* Trk::MaterialValidation::m_flatDist
private

Random generator for flat distribution.

Definition at line 99 of file MaterialValidation.h.

◆ m_materialMapper

ToolHandle<IMaterialMapper> Trk::MaterialValidation::m_materialMapper
private

Mapper and Inspector.

Pointer to an IMaterialMapper algTool

Definition at line 95 of file MaterialValidation.h.

◆ m_maxMaterialValidationEvents

int Trk::MaterialValidation::m_maxMaterialValidationEvents
private

limit the number of validation records to avoid 2G files

Definition at line 96 of file MaterialValidation.h.

◆ m_runNativeNavigation

bool Trk::MaterialValidation::m_runNativeNavigation
private

validate the native TG navigation

Definition at line 102 of file MaterialValidation.h.

◆ m_trackingGeometryReadKey

SG::ReadCondHandleKey<TrackingGeometry> Trk::MaterialValidation::m_trackingGeometryReadKey {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."}
private

Definition at line 91 of file MaterialValidation.h.

92{this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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