DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
MaterialScan.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DDREC_MATERIALSCAN_H
14 #define DDREC_MATERIALSCAN_H
15 
16 // Framework include files
17 #include "DDRec/MaterialManager.h"
18 
19 #include <memory>
20 
22 namespace dd4hep {
23 
25  class Detector;
26 
28  namespace rec {
29 
31 
52  class MaterialScan {
53  private:
54 
58  std::unique_ptr<MaterialManager> m_materialMgr;
59  std::set<const TGeoNode*> m_placements;
62  MaterialScan();
63 
64  public:
65 
67  MaterialScan(Detector& description);
68 
70  virtual ~MaterialScan();
71 
73  void setDetector(DetElement detector);
75  void setDetector(const char* detector);
76 
78  void setMaterial(const char* material);
80  void setMaterial(Material material);
81 
83  void setRegion(const char* region);
85  void setRegion(Region region);
86 
88  const MaterialVec& scan(double x0, double y0, double z0, double x1, double y1, double z1, double epsilon=1e-4) const;
89 
91  void print(const Vector3D& start, const Vector3D& end, double epsilon=1e-4) const;
92 
94  void print(double x0, double y0, double z0,
95  double x1, double y1, double z1,
96  double epsilon=1e-4) const;
97  };
98  } // End namespace rec
99 } // End namespace dd4hep
100 #endif // DDREC_MATERIALSCAN_H
dd4hep::rec::MaterialScan::setDetector
void setDetector(DetElement detector)
Set a specific detector volume to limit the scan (resets other selection criteria)
Definition: MaterialScan.cpp:104
dd4hep::rec::MaterialScan::setRegion
void setRegion(const char *region)
Set a specific region to limit the scan (resets other selection criteria)
Definition: MaterialScan.cpp:52
dd4hep::rec::MaterialScan::scan
const MaterialVec & scan(double x0, double y0, double z0, double x1, double y1, double z1, double epsilon=1e-4) const
Scan along a line and store the matrials internally.
Definition: MaterialScan.cpp:170
dd4hep::rec::Vector3D
Definition: Vector3D.h:32
dd4hep::rec::MaterialVec
std::vector< std::pair< Material, double > > MaterialVec
Definition: MaterialManager.h:30
dd4hep::rec::MaterialScan::MaterialScan
MaterialScan()
Default constructor.
Definition: MaterialScan.cpp:33
dd4hep::rec::MaterialScan::~MaterialScan
virtual ~MaterialScan()
Default destructor.
Definition: MaterialScan.cpp:47
epsilon
const double epsilon
Definition: test_cellid_position_converter.cpp:42
dd4hep::Material
Handle class describing a material.
Definition: Objects.h:272
dd4hep::rec::MaterialScan::m_placements
std::set< const TGeoNode * > m_placements
Local cache: subdetector placements.
Definition: MaterialScan.h:60
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::rec::MaterialScan::m_materialMgr
std::unique_ptr< MaterialManager > m_materialMgr
Material manager.
Definition: MaterialScan.h:58
dd4hep::rec::MaterialScan::setMaterial
void setMaterial(const char *material)
Set a specific volume material to limit the scan (resets other selection criteria)
Definition: MaterialScan.cpp:133
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
dd4hep::rec::MaterialScan::print
void print(const Vector3D &start, const Vector3D &end, double epsilon=1e-4) const
Scan along a line and print the materials traversed.
Definition: MaterialScan.cpp:176
MaterialManager.h
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::rec::MaterialScan::m_detector
Detector & m_detector
Reference to detector setup.
Definition: MaterialScan.h:56
dd4hep::rec::MaterialScan
Class to perform material scans along a straight line.
Definition: MaterialScan.h:52