DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LayeringExtensionImpl.h
Go to the documentation of this file.
1 /*
2  * LayeringExtensionImpl.h
3  *
4  * Simple implementation of the LayeringExtension interface.
5  *
6  * Created on: Mar 6, 2014
7  * Author: Christian Grefe, CERN
8  */
9 
10 #ifndef DDRec_LAYERINGEXTENSIONIMPL_H_
11 #define DDRec_LAYERINGEXTENSIONIMPL_H_
12 
13 // DDRec
15 
16 // DD4hep
17 #include "DD4hep/Detector.h"
18 
19 // C++
20 #include <map>
21 #include <vector>
22 
23 class TGeoManager;
24 
25 namespace DD4hep {
26 namespace DDRec {
27 
29 public:
32 
35 
38 
40  virtual ~LayeringExtensionImpl();
41 
43  virtual int numberOfLayers() const;
44 
46  virtual int numberOfSensors(int layerIndex) const;
47 
49  virtual Geometry::DetElement layer(int layerIndex) const;
50 
52  virtual const std::vector<Geometry::DetElement>& sensors(int layerIndex) const;
53 
55  virtual const std::vector<Geometry::DetElement>& absorbers(int layerIndex) const;
56 
58  virtual double totalThickness() const;
59 
61  virtual double totalRadiationLength() const;
62 
64  virtual double totalInteractionLength() const;
65 
67  virtual double thickness(int layerIndex) const;
68 
70  virtual double radiationLength(int layerIndex) const;
71 
73  virtual double interactionLength(int layerIndex) const;
74 
76  virtual double absorberThickness(int layerIndex) const;
77 
79  virtual double absorberRadiationLength(int layerIndex) const;
80 
82  virtual double absorberInteractionLength(int layerIndex) const;
83 
85  virtual double sensorThickness(int layerIndex) const;
86 
88  virtual double sensorRadiationLength(int layerIndex) const;
89 
91  virtual double sensorInteractionLength(int layerIndex) const;
92 
94  void setLayer(int layerIndex, Geometry::DetElement layer, const Position& normal);
95 
96 protected:
98  struct LayerAttributes {
102  std::vector<Geometry::DetElement> sensors;
103  std::vector<Geometry::DetElement> absorbers;
104  double thickness;
115  void calculate();
116  private:
117  double addElement(const Geometry::DetElement& det);
118  TGeoManager* _tgeoManager;
119  };
120 
121  mutable std::map<int, LayerAttributes> _layerMap;
122 
124  void checkMap(int layerIndex) const;
125 };
126 
127 } /* namespace DDRec */
128 } /* namespace DD4hep */
129 
130 #endif /* DDReconstruction_LAYERINGEXTENSIONIMPL_H_ */
virtual double totalThickness() const
Access the total thickness of the sub detector.
std::map< int, LayerAttributes > _layerMap
virtual const std::vector< Geometry::DetElement > & absorbers(int layerIndex) const
Access to the non-sensitive DetElements of a given layer index.
virtual double totalRadiationLength() const
Access the total radiation length of the sub detector.
virtual double thickness(int layerIndex) const
Access the total thickness of the layer with the given index.
virtual double sensorThickness(int layerIndex) const
Access the total thickness of all sensitive elements of the layer with the given index.
LayeringExtensionImpl(const LayeringExtensionImpl &, const Geometry::DetElement &)
Copy constructor.
virtual double absorberRadiationLength(int layerIndex) const
Access the total radiation length of all non-sensitive elements of the layer with the given index...
virtual int numberOfSensors(int layerIndex) const
Access to the total number of sensors in a given layer index.
void checkMap(int layerIndex) const
Map to store layer attributes.
ROOT::Math::XYZVector Position
Definition: Objects.h:75
virtual double radiationLength(int layerIndex) const
Access the total radiation length of the layer with the given index.
virtual double absorberThickness(int layerIndex) const
Access the total thickness of all non-sensitive elements of the layer with the given index...
virtual const std::vector< Geometry::DetElement > & sensors(int layerIndex) const
Access to the sensitive DetElements of a given layer index.
virtual int numberOfLayers() const
Access to the total number of layers.
virtual double absorberInteractionLength(int layerIndex) const
Access the total nuclear interaction length of all non-sensitive elements of the layer with the given...
Handle class describing a detector element.
Definition: Detector.h:172
Geometry::Position Position
Shortcut to use geometrical positions.
virtual double sensorRadiationLength(int layerIndex) const
Access the total radiation length of all sensitive elements of the layer with the given index...
virtual Geometry::DetElement layer(int layerIndex) const
Access to the layer DetElement for the given index.
void setLayer(int layerIndex, Geometry::DetElement layer, const Position &normal)
Stores the layer information for the given layer index.
void calculate()
Helper method to calculate attributes from layer.
virtual double totalInteractionLength() const
Access the total nuclear interaction length of the sub detector.
virtual double interactionLength(int layerIndex) const
Access the total nuclear interaction length of the layer with the given index.
virtual double sensorInteractionLength(int layerIndex) const
Access the total nuclear interaction length of all sensitive elements of the layer with the given ind...