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
LayeredSubdetector.h
Go to the documentation of this file.
1 /*
2  * LayeredSubdetector.h
3  *
4  * Basic reconstruction interface for layered subdetectors
5  *
6  * Created on: Dec 11, 2013
7  * Author: Christian Grefe, CERN
8  */
9 
10 #ifndef DDRec_LAYEREDSUBDETECTOR_H_
11 #define DDRec_LAYEREDSUBDETECTOR_H_
12 
13 #include "DDRec/API/Exceptions.h"
15 
16 #include "DD4hep/Detector.h"
17 
18 namespace DD4hep {
19 namespace DDRec {
20 
22 public:
25  Geometry::DetElement(det) {
27  }
28 
30  virtual ~LayeredSubdetector() {
31  // does not own the extension!
32  }
33 
34  int numberOfLayers() const {
35  return _layering->numberOfLayers();
36  }
37 
38  int numberOfSensors(int layerIndex = 0) const {
39  return _layering->numberOfSensors(layerIndex);
40  }
41 
42  Geometry::DetElement layer(int layerIndex) const {
43  return _layering->layer(layerIndex);
44  }
45 
46  const std::vector<Geometry::DetElement>& sensors(int layerIndex = 0) const {
47  return _layering->sensors(layerIndex);
48  }
49 
50  const std::vector<Geometry::DetElement>& absorbers(int layerIndex = 0) const {
51  return _layering->absorbers(layerIndex);
52  }
53 
54  double totalThickness() const {
55  return _layering->totalThickness();
56  }
57 
58  double totalRadiationLength() const {
60  }
61 
62  double totalInteractionLength() const {
64  }
65 
66  double thickness(int layerIndex = 0) const {
67  return _layering->thickness(layerIndex);
68  }
69 
70  double radiationLength(int layerIndex = 0) const {
71  return _layering->radiationLength(layerIndex);
72  }
73 
74  double interactionLength(int layerIndex = 0) const {
75  return _layering->interactionLength(layerIndex);
76  }
77 
79  double absorberThickness(int layerIndex) const {
80  return _layering->absorberThickness(layerIndex);
81  }
82 
84  double absorberRadiationLength(int layerIndex) const {
85  return _layering->absorberRadiationLength(layerIndex);
86  }
87 
89  double absorberInteractionLength(int layerIndex) const {
90  return _layering->absorberInteractionLength(layerIndex);
91  }
92 
94  virtual double sensorThickness(int layerIndex) const {
95  return _layering->sensorThickness(layerIndex);
96  }
97 
99  double sensorRadiationLength(int layerIndex) const {
100  return _layering->sensorRadiationLength(layerIndex);
101  }
102 
104  double sensorInteractionLength(int layerIndex) const {
105  return _layering->sensorInteractionLength(layerIndex);
106  }
107 
108 
109 protected:
111 
112 private:
115  _layering = this->isValid() ? this->extension<LayeringExtension>() : 0;
116  if (not _layering) {
117  throw invalid_detector_element("Found no extension of type \"LayeringExtension\"", Geometry::DetElement(*this));
118  }
119  }
120 };
121 
122 } /* namespace DDRec */
123 } /* namespace DD4hep */
124 #endif /* DDReconstruction_LAYEREDSUBDETECTOR_H_ */
virtual const std::vector< Geometry::DetElement > & absorbers(int layerIndex) const =0
Access to the non-sensitive DetElements of a given layer index.
virtual double absorberThickness(int layerIndex) const =0
Access the total thickness of all non-sensitive elements of the layer with the given index...
virtual double interactionLength(int layerIndex) const =0
Access the total nuclear interaction length of the layer with the given index.
double totalThickness() const
Access the total thickness of the sub detector.
int numberOfSensors(int layerIndex=0) const
Access to the total number of sensors in a given layer index.
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
double absorberThickness(int layerIndex) const
Access the total thickness of all non-sensitive elements of the layer with the given index...
double sensorInteractionLength(int layerIndex) const
Access the total nuclear interaction length of all sensitive elements of the layer with the given ind...
const std::vector< Geometry::DetElement > & sensors(int layerIndex=0) const
Access to the sensitive DetElements of a given layer index.
double interactionLength(int layerIndex=0) const
Access the total nuclear interaction length 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.
virtual double radiationLength(int layerIndex) const =0
Access the total radiation length of the layer with the given index.
double absorberInteractionLength(int layerIndex) const
Access the total nuclear interaction length of all non-sensitive elements of the layer with the given...
virtual double absorberInteractionLength(int layerIndex) const =0
Access the total nuclear interaction length of all non-sensitive elements of the layer with the given...
virtual double thickness(int layerIndex) const =0
Access the total thickness of the layer with the given index.
Geometry::DetElement layer(int layerIndex) const
Access to the layer DetElement for the given index.
virtual Geometry::DetElement layer(int layerIndex) const =0
Access to the layer DetElement for the given index.
double totalRadiationLength() const
Access the total radiation length of the sub detector.
double radiationLength(int layerIndex=0) const
Access the total radiation length of the layer with the given index.
virtual double sensorRadiationLength(int layerIndex) const =0
Access the total radiation length of all sensitive elements of the layer with the given index...
virtual double totalRadiationLength() const =0
Access the total radiation length of the sub detector.
virtual int numberOfLayers() const =0
Access to the total number of layers.
double totalInteractionLength() const
Access the total nuclear interaction length of the sub detector.
double thickness(int layerIndex=0) const
Access the total thickness of the layer with the given index.
virtual int numberOfSensors(int layerIndex) const =0
Access to the total number of sensors in a given layer index.
void getLayeringExtension()
Helper method to retrieve the extension.
virtual const std::vector< Geometry::DetElement > & sensors(int layerIndex) const =0
Access to the sensitive DetElements of a given layer index.
virtual double totalInteractionLength() const =0
Access the total nuclear interaction length of the sub detector.
double sensorRadiationLength(int layerIndex) const
Access the total radiation length of all sensitive elements of the layer with the given index...
Handle class describing a detector element.
Definition: Detector.h:172
virtual double absorberRadiationLength(int layerIndex) const =0
Access the total radiation length of all non-sensitive elements of the layer with the given index...
double absorberRadiationLength(int layerIndex) const
Access the total radiation length of all non-sensitive elements of the layer with the given index...
virtual double sensorInteractionLength(int layerIndex) const =0
Access the total nuclear interaction length of all sensitive elements of the layer with the given ind...
virtual double totalThickness() const =0
Access the total thickness of the sub detector.
const std::vector< Geometry::DetElement > & absorbers(int layerIndex=0) const
Access to the non-sensitive DetElements of a given layer index.
LayeredSubdetector(const Geometry::DetElement &det)
Default constructor.
int numberOfLayers() const
Access to the total number of layers.
virtual double sensorThickness(int layerIndex) const =0
Access the total thickness of all sensitive elements of the layer with the given index.
virtual ~LayeredSubdetector()
Destructor.