ATLAS Offline Software
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 
22 namespace Trk {
23 
24  class IMaterialMapper;
25  class TrackingVolume;
26  class Surface;
27 
28  typedef std::pair<Amg::Vector3D, const Trk::TrackingVolume*> PositionAtBoundary;
29 
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 
63 
66 
69 
70  private:
72  const Amg::Vector3D& position,
73  const Amg::Vector3D& direction);
74 
75  const TrackingGeometry& trackingGeometry() const;
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
Trk::MaterialValidation::m_maxMaterialValidationEvents
int m_maxMaterialValidationEvents
limit the number of validation records to avoid 2G files
Definition: MaterialValidation.h:96
Trk::VolumeExit
Definition: MaterialValidation.h:37
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::MaterialValidation::m_runNativeNavigation
bool m_runNativeNavigation
validate the native TG navigation
Definition: MaterialValidation.h:102
Trk::MaterialValidation::trackingGeometry
const TrackingGeometry & trackingGeometry() const
Definition: MaterialValidation.h:108
Trk::VolumeExit::bSurface
const Trk::Surface * bSurface
Definition: MaterialValidation.h:40
Trk::MaterialValidation::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: MaterialValidation.cxx:288
Trk::VolumeExit::VolumeExit
VolumeExit(const Trk::TrackingVolume *itv=0, const Trk::Surface *ibs=0, Amg::Vector3D iexit=Amg::Vector3D(0., 0., 0.))
Definition: MaterialValidation.h:43
Trk::MaterialValidation::~MaterialValidation
~MaterialValidation()
Default Destructor.
Definition: MaterialValidation.cxx:50
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
Trk::MaterialValidation::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: MaterialValidation.cxx:56
Trk::MaterialValidation::retrieveTrackingGeometry
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Definition: MaterialValidation.h:78
Trk::MaterialValidation::m_etaMin
double m_etaMin
eta boundary
Definition: MaterialValidation.h:100
AthAlgorithm.h
GeoPrimitives.h
Trk::MaterialValidation::throwFailedToGetTrackingGeometry
void throwFailedToGetTrackingGeometry() const
Definition: MaterialValidation.cxx:294
Trk::VolumeExit::nVolume
const Trk::TrackingVolume * nVolume
Definition: MaterialValidation.h:39
Trk::MaterialValidation::m_materialMapper
ToolHandle< IMaterialMapper > m_materialMapper
Mapper and Inspector.
Definition: MaterialValidation.h:95
Trk::MaterialValidation::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: MaterialValidation.cxx:71
Trk::MaterialValidation::collectMaterialAndExit
PositionAtBoundary collectMaterialAndExit(const Trk::TrackingVolume &tvol, const Amg::Vector3D &position, const Amg::Vector3D &direction)
Definition: MaterialValidation.cxx:99
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::MaterialValidation::m_flatDist
Rndm::Numbers * m_flatDist
Random generator for flat distribution.
Definition: MaterialValidation.h:99
Trk::MaterialValidation::m_etaMax
double m_etaMax
eta boundary
Definition: MaterialValidation.h:101
AthAlgorithm
Definition: AthAlgorithm.h:47
Trk::MaterialValidation::m_trackingGeometryReadKey
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
Definition: MaterialValidation.h:92
MaterialValidation
Definition: MaterialValidation.py:1
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::MaterialValidation::m_accTinX0
double m_accTinX0
accumulated t in X0
Definition: MaterialValidation.h:104
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
Trk::VolumeExit::vExit
Amg::Vector3D vExit
Definition: MaterialValidation.h:41
TrackingGeometry.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::TrackingVolume
Definition: TrackingVolume.h:121
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
Trk::PositionAtBoundary
std::pair< Amg::Vector3D, const Trk::TrackingVolume * > PositionAtBoundary
Definition: MaterialValidation.h:26
Trk::MaterialValidation::MaterialValidation
MaterialValidation(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: MaterialValidation.cxx:28