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 ()
 Destructor.
StatusCode initialize ()
 standard Athena-Algorithm method
StatusCode execute (const EventContext &ctx)
 standard Athena-Algorithm method
StatusCode finalize ()
 standard Athena-Algorithm method
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
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< 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 {this, "MaterialMapper", "Trk::MaterialMapper/MappingMaterialMapper"}
 Mapper and Inspector.
Rndm::Numbers * m_flatDist = nullptr
 Random generator for flat distribution.
Gaudi::Property< double > m_etaMin {this, "MinEta", -3.}
 eta boundary
Gaudi::Property< double > m_etaMax {this, "MaxEta", 3.}
 eta boundary
Gaudi::Property< bool > m_runNativeNavigation {this, "NativeNavigation", true}
 validate the native TG navigation
double m_accTinX0 = 0.
 accumulated t in X0
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

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~MaterialValidation()

Trk::MaterialValidation::~MaterialValidation ( )

Destructor.

Definition at line 28 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

29{
30 delete m_flatDist;
31}
Rndm::Numbers * m_flatDist
Random generator for flat distribution.

Member Function Documentation

◆ AthAlgorithm()

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

Standard Athena-Algorithm Constructor.

Definition at line 31 of file AthAlgorithm.cxx.

11 :
12 AthCommonAlgorithm<Gaudi::Algorithm>( name, pSvcLocator )
13{
14 // default cardinality for non-reentrant algorithms
15 setProperty( "Cardinality", 1 ).orThrow("Unable to set property 'Cardinality'", name);
16}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
AthCommonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

◆ collectMaterialAndExit()

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

Definition at line 77 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

80{
81 // get the entry layers -----------------------------------------------------------
82 std::map<double, Trk::AssociatedMaterial> collectedMaterial;
83
84 // all boundaries found --- proceed
86
87 ATH_MSG_DEBUG("[>>] Entering Volume: " << tvol.volumeName() << "- at " << Amg::toString(position));
88
90
92 // A : collect all hit layers
93 auto layerIntersections = tvol.materialLayersOrdered<Trk::NeutralCurvilinearParameters>(nullptr,nullptr,cvp,Trk::alongMomentum);
94 // loop over the layers
95 for (auto& lCandidate : layerIntersections ) {
96 // get the layer
97 const Trk::Layer* layer = lCandidate.object;
98 double pathLength = lCandidate.intersection.pathLength;
99 // get the associate material
100 if (layer->layerMaterialProperties()){
101 // take it from the global position
102 const Trk::MaterialProperties* mprop = layer->layerMaterialProperties()->fullMaterial(lCandidate.intersection.position);
103 if (mprop){
104 double stepLength = mprop->thickness()*fabs(layer->surfaceRepresentation().pathCorrection(lCandidate.intersection.position,direction));
105 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lCandidate.intersection.position, mprop, stepLength, &tvol, layer);
106 }
107 }
108 }
109 // B : collect all boundary layers, start from last hit layer
110 Amg::Vector3D lastPosition = !collectedMaterial.empty() ? collectedMaterial.rbegin()->second.materialPosition() : (position + direction.unit());
111 Trk::NeutralCurvilinearParameters lcp(lastPosition,direction,0.);
112 // boundary surfaces
114 if (!boundaryIntersections.empty()){
115 // by definition is the first one
116 lastPosition = boundaryIntersections.begin()->intersection.position;
117 const Trk::BoundarySurface<Trk::TrackingVolume>* bSurfaceTV = boundaryIntersections.begin()->object;
118 const Trk::Surface& bSurface = bSurfaceTV->surfaceRepresentation();
119 // get the path lenght to it
120 if (bSurface.materialLayer() && bSurface.materialLayer()->layerMaterialProperties()){
121 const Trk::MaterialProperties* mprop = bSurface.materialLayer()->layerMaterialProperties()->fullMaterial(lastPosition);
122 double pathLength = (lastPosition-position).mag();
123 if (mprop){
124 double stepLength = mprop->thickness()*fabs(bSurface.pathCorrection(lastPosition,direction));
125 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lastPosition, mprop, stepLength, &tvol, bSurface.materialLayer());
126 } else
127 collectedMaterial[pathLength] = Trk::AssociatedMaterial(lastPosition, &tvol, bSurface.materialLayer());
128 }
129 // set the new volume
130 const Trk::TrackingVolume* naVolume = bSurfaceTV->attachedVolume(lastPosition, direction, Trk::alongMomentum);
131 pab = Trk::PositionAtBoundary(lastPosition,naVolume);
132 } else
133 pab = Trk::PositionAtBoundary(lastPosition,0);
134 } else {
135 std::map<double, std::pair<const Trk::Layer*, Amg::Vector3D> > intersectedLayers;
136
137 // Process the contained layers if they exist
138 const Trk::LayerArray* layerArray = tvol.confinedLayers();
139 if (layerArray) {
140 // display output
141 std::span<Trk::Layer const * const> layers = layerArray->arrayObjects();
142 auto layIter = layers.begin();
143 auto layIterE = layers.end();
144 for ( ; layIter != layIterE; ++layIter){
145 if ( (*layIter)->layerMaterialProperties() ){
146 Trk::Intersection lsIntersection = (*layIter)->surfaceRepresentation().straightLineIntersection(position, direction, true, true);
147 if (lsIntersection.valid){
148 intersectedLayers[lsIntersection.pathLength] = std::pair<const Trk::Layer*, Amg::Vector3D>(*layIter,lsIntersection.position);
149 // get & record the material
150 // - the position on the surface
151 Amg::Vector3D mposition = (*layIter)->surfaceRepresentation().transform().inverse()*lsIntersection.position;
152 const Trk::MaterialProperties* mprop = (*layIter)->layerMaterialProperties()->fullMaterial(mposition);
153 if (mprop) {
154 double stepLength = mprop->thickness()*fabs((*layIter)->surfaceRepresentation().pathCorrection(lsIntersection.position,direction));
155 collectedMaterial[lsIntersection.pathLength] = Trk::AssociatedMaterial(lsIntersection.position, mprop, stepLength, &tvol, (*layIter));
156 } else
157 collectedMaterial[lsIntersection.pathLength] = Trk::AssociatedMaterial(lsIntersection.position, &tvol, (*layIter));
158
159 ATH_MSG_VERBOSE("[>>>>] record material hit at layer with index " << (*layIter)->layerIndex().value() << " - at " << Amg::toString(lsIntersection.position) );
160 if (mprop)
161 ATH_MSG_VERBOSE("[>>>>] MaterialProperties are " << (*mprop) );
162 else
163 ATH_MSG_VERBOSE("[>>>>] No MaterialProperties found." );
164 }
165 }
166 }
167 }
168
169 // material for confined layers collected, now go to boundary
170
171 // update the position to the last one
172 Amg::Vector3D lastPosition = !intersectedLayers.empty() ? (*(--(intersectedLayers.end()))).second.second : position;
173
174 std::map<double, Trk::VolumeExit > volumeExits;
175 // now find the exit point
176 const auto & bSurfaces = tvol.boundarySurfaces();
177 for (size_t ib = 0; ib < bSurfaces.size(); ++ib){
178 // omit positions on the surface
179 if ( !bSurfaces[ib]->surfaceRepresentation().isOnSurface(lastPosition, true, 0.1, 0.1) ){
180 Trk::Intersection evIntersection = bSurfaces[ib]->surfaceRepresentation().straightLineIntersection(lastPosition, direction, true, true);
181 ATH_MSG_VERBOSE("[>>>>] boundary surface intersection / validity :" << Amg::toString(evIntersection.position) << " / " << evIntersection.valid);
182 ATH_MSG_VERBOSE("[>>>>] with path length = " << evIntersection.pathLength );
183 if (evIntersection.valid){
184 // next attached Tracking Volume
185 const Trk::TrackingVolume* naVolume = bSurfaces[ib]->attachedVolume(evIntersection.position, direction, Trk::alongMomentum);
186 // put it into the map
187 volumeExits[evIntersection.pathLength] = Trk::VolumeExit(naVolume, &(bSurfaces[ib]->surfaceRepresentation()), evIntersection.position);
188 // volume exit
189 ATH_MSG_VERBOSE("[>>>>] found volume exit - at " << Amg::toString(evIntersection.position) );
190 }
191 } else
192 ATH_MSG_VERBOSE("[>>>>] starting position is on surface ! " );
193 }
194 // prepare the boundary
195 if (!volumeExits.empty()){
196 // get the first entry in the map: closest next volume
197 VolumeExit closestVolumeExit = (*volumeExits.begin()).second;
198 // check if the volume exit boundary has material attached
199 const Trk::Surface* bSurface = closestVolumeExit.bSurface;
200 if ( bSurface && bSurface->materialLayer() && bSurface->materialLayer()->layerMaterialProperties()){
201 ATH_MSG_VERBOSE("[>>>>] The boundary surface has an associated layer, collect material from there");
202 const Trk::MaterialProperties* mprop = bSurface->materialLayer()->layerMaterialProperties()->fullMaterial(closestVolumeExit.vExit);
203 double pathToExit = (closestVolumeExit.vExit-lastPosition).mag();
204 if (mprop){
205 double stepLength = mprop->thickness()*fabs(bSurface->pathCorrection(closestVolumeExit.vExit,direction));
206 collectedMaterial[pathToExit] = Trk::AssociatedMaterial(closestVolumeExit.vExit, mprop, stepLength, &tvol, bSurface->materialLayer());
207 } else
208 collectedMaterial[pathToExit] = Trk::AssociatedMaterial(closestVolumeExit.vExit, &tvol, bSurface->materialLayer());
209 }
210 //
211 if (closestVolumeExit.nVolume != &tvol && closestVolumeExit.nVolume) {
212 ATH_MSG_VERBOSE("[>>>>] Next Volume: " << closestVolumeExit.nVolume->volumeName() << " - at " << Amg::toString(closestVolumeExit.vExit) );
213 // return for further navigation
214 pab = Trk::PositionAtBoundary(closestVolumeExit.vExit,closestVolumeExit.nVolume);
215 }
216 } else {
217 ATH_MSG_VERBOSE( "[>>>>] No exit found from Volume '" << tvol.volumeName() << "' - starting radius = " << lastPosition.perp() );
218 const Trk::CylinderVolumeBounds* cvb = dynamic_cast<const Trk::CylinderVolumeBounds*>(&(tvol.volumeBounds()));
219 if (cvb)
220 ATH_MSG_VERBOSE( "[>>>>] Volume outer radius = " << cvb->outerRadius() );
221 }
222
223 }
224 // finally collect the material
225 ATH_MSG_DEBUG("[>>>] Collecting materials from "<< collectedMaterial.size() << " layers");
226 // provide the material to the material mapper
227 auto cmIter = collectedMaterial.begin();
228 auto cmIterE = collectedMaterial.end();
229 for ( ; cmIter != cmIterE; ++cmIter ){
230 m_materialMapper->recordMaterialHit(cmIter->second, cmIter->second.materialPosition());
231 m_accTinX0 += cmIter->second.steplengthInX0();
232 int layerIndex = cmIter->second.associatedLayer() ? cmIter->second.associatedLayer()->layerIndex().value() : 0;
233 ATH_MSG_DEBUG("[>>>] Accumulate pathLength/X0 on layer with index " << layerIndex << " - t/X0 (total so far) = " << cmIter->second.steplengthInX0() << " (" << m_accTinX0 << ")");
234 if (layerIndex){
235 std::string surfaceType =
236 cmIter->second.associatedLayer()->surfaceRepresentation().type() ==
238 ? "Cylinder at radius = "
239 : "Disc at z-position = ";
240 std::string layerType =
241 cmIter->second.associatedLayer()->surfaceArray() ? "Active "
242 : "Passive ";
243 double rz =
244 cmIter->second.associatedLayer()->surfaceRepresentation().type() ==
246 ? cmIter->second.associatedLayer()
247 ->surfaceRepresentation()
248 .bounds()
249 .r()
250 : cmIter->second.associatedLayer()
251 ->surfaceRepresentation()
252 .center()
253 .z();
254 ATH_MSG_DEBUG(" " << layerType << surfaceType << rz);
255 }
256 ATH_MSG_DEBUG(" Distance to origin is " << cmIter->second.materialPosition().mag() );
257 }
258
259 // return what you have
260 return pab;
261
262}
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.
Gaudi::Property< bool > m_runNativeNavigation
validate the native TG navigation
ToolHandle< IMaterialMapper > m_materialMapper
Mapper and Inspector.
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
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
CurvilinearParametersT< NeutralParametersDim, Neutral, PlaneSurface > NeutralCurvilinearParameters
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
Amg::Vector3D position

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

standard Athena-Algorithm method

Implements AthAlgorithm.

Definition at line 49 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

50{
51 ATH_MSG_VERBOSE( "MaterialValidation execute() start ================================================" );
52
53 // create the random direction - flat in eta
54 double eta = m_etaMin + (m_etaMax-m_etaMin)*m_flatDist->shoot();
55 double theta = 2.*atan(exp(-eta));
56 double phi = M_PI * ( 2*m_flatDist->shoot() - 1.);
57 m_accTinX0 = 0;
58
59 // get the position and riection from the random numbers
60 Amg::Vector3D position(0.,0.,0.);
62
63 ATH_MSG_DEBUG("[>] Start mapping event with phi | eta = " << phi << " | " << direction.eta());
64
65 // find the start TrackingVolume
66 const Trk::TrackingVolume* sVolume = trackingGeometry().lowestTrackingVolume(position);
67 const Trk::TrackingVolume* nVolume = sVolume;
68 while (nVolume ) {
70 position = paB.first;
71 nVolume = paB.second;
72 }
73 ATH_MSG_DEBUG("[<] Finishing event with collected path [X0] = " << m_accTinX0);
74 return StatusCode::SUCCESS;
75}
#define M_PI
Scalar eta() const
pseudorapidity method
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< 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::MaterialValidation::finalize ( )

standard Athena-Algorithm method

Definition at line 266 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

267{
268 ATH_MSG_INFO( "MaterialValidation finalize()" );
269 return StatusCode::SUCCESS;
270}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode Trk::MaterialValidation::initialize ( )

standard Athena-Algorithm method

Definition at line 34 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

35{
36
37 // Get the TrackingGeometry from StoreGate
39
40 if ( (m_materialMapper.retrieve()).isFailure() )
41 ATH_MSG_WARNING("Could not retrieve MaterialMapper");
42
43 // initialize the random generators
44 m_flatDist = new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
45 return StatusCode::SUCCESS;
46}
#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< 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.

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

◆ retrieveTrackingGeometry()

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

Definition at line 81 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

83 {
84 SG::ReadCondHandle<TrackingGeometry> handle(m_trackingGeometryReadKey,
85 ctx);
86 if (!handle.isValid()) {
87 ATH_MSG_FATAL("Could not load TrackingGeometry with name '"
88 << m_trackingGeometryReadKey.key() << "'. Aborting.");
90 }
91 return handle.cptr();
92 }
#define ATH_MSG_FATAL(x)
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

◆ 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_ERROR(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ throwFailedToGetTrackingGeometry()

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

Definition at line 272 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.cxx.

272 {
273 std::stringstream msg;
274 msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
275 throw std::runtime_error(msg.str());
276}

◆ trackingGeometry()

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

Definition at line 110 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

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

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

double Trk::MaterialValidation::m_accTinX0 = 0.
private

accumulated t in X0

Definition at line 106 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.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_etaMax

Gaudi::Property<double> Trk::MaterialValidation::m_etaMax {this, "MaxEta", 3.}
private

eta boundary

Definition at line 103 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

103{this, "MaxEta", 3.};

◆ m_etaMin

Gaudi::Property<double> Trk::MaterialValidation::m_etaMin {this, "MinEta", -3.}
private

eta boundary

Definition at line 102 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

102{this, "MinEta", -3.};

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

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

Random generator for flat distribution.

Definition at line 101 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

◆ m_materialMapper

ToolHandle<IMaterialMapper> Trk::MaterialValidation::m_materialMapper {this, "MaterialMapper", "Trk::MaterialMapper/MappingMaterialMapper"}
private

Mapper and Inspector.

Definition at line 98 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

99{this, "MaterialMapper", "Trk::MaterialMapper/MappingMaterialMapper"};

◆ m_runNativeNavigation

Gaudi::Property<bool> Trk::MaterialValidation::m_runNativeNavigation {this, "NativeNavigation", true}
private

validate the native TG navigation

Definition at line 104 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

104{this, "NativeNavigation", true};

◆ m_trackingGeometryReadKey

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

Definition at line 94 of file TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h.

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

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