ATLAS Offline Software
Loading...
Searching...
No Matches
TrkDetDescr/TrkDetDescrAlgs/src/MaterialValidation.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MaterialValidation.h, (c) ATLAS Detector software
8
9#ifndef TRKDETDESCRALGS_MATERIALVALIDATION_H
10#define TRKDETDESCRALGS_MATERIALVALIDATION_H
11
12// Gaudi includes
14#include "GaudiKernel/IRndmGenSvc.h"
15#include "GaudiKernel/RndmGenerators.h"
16#include "GaudiKernel/ToolHandle.h"
17//Eigen
19// TrkGeometry
21
22namespace Trk {
23
24 class IMaterialMapper;
25 class TrackingVolume;
26 class Surface;
27
28 typedef std::pair<Amg::Vector3D, const Trk::TrackingVolume*> PositionAtBoundary;
29
34
35
36 // exit the volume
37 struct VolumeExit {
38 // the triple struct
42
44 const Trk::Surface* ibs = 0,
45 Amg::Vector3D iexit = Amg::Vector3D(0.,0.,0.)) :
46 nVolume(itv),
47 bSurface(ibs),
48 vExit(iexit){}
49
50 };
51
53
54 public:
55
57 MaterialValidation(const std::string& name, ISvcLocator* pSvcLocator);
60
62 StatusCode initialize();
63
65 StatusCode execute();
66
68 StatusCode finalize();
69
70 private:
72 const Amg::Vector3D& position,
74
76
79 const EventContext& ctx) const
80 {
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 }
90
92 {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};
93
95 ToolHandle<IMaterialMapper> m_materialMapper;
97
98
99 Rndm::Numbers* m_flatDist;
100 double m_etaMin;
101 double m_etaMax;
103
104 double m_accTinX0;
105
106 };
107
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 }
116}
117
118#endif
#define ATH_MSG_FATAL(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Interface class IMaterialMapper.
int m_maxMaterialValidationEvents
limit the number of validation records to avoid 2G files
StatusCode finalize()
standard Athena-Algorithm method
StatusCode execute()
standard Athena-Algorithm method
PositionAtBoundary collectMaterialAndExit(const Trk::TrackingVolume &tvol, const Amg::Vector3D &position, const Amg::Vector3D &direction)
ToolHandle< IMaterialMapper > m_materialMapper
Mapper and Inspector.
Rndm::Numbers * m_flatDist
Random generator for flat distribution.
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
StatusCode initialize()
standard Athena-Algorithm method
bool m_runNativeNavigation
validate the native TG navigation
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Abstract Base Class for tracking surfaces.
Definition Surface.h:79
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
std::pair< Amg::Vector3D, const Trk::TrackingVolume * > PositionAtBoundary
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
VolumeExit(const Trk::TrackingVolume *itv=0, const Trk::Surface *ibs=0, Amg::Vector3D iexit=Amg::Vector3D(0., 0., 0.))