12 #include "TGeoManager.h"
41 return _layerMap.at(layerIndex).sensors.size();
59 return _layerMap.at(layerIndex).absorbers;
64 map<int, LayerAttributes>::iterator it =
_layerMap.begin();
65 double thick_ness = 0.;
79 map<int, LayerAttributes>::iterator it =
_layerMap.begin();
80 double radiation_length = 0.;
89 return radiation_length;
94 map<int, LayerAttributes>::iterator it =
_layerMap.begin();
95 double interaction_length = 0.;
104 return interaction_length;
110 return _layerMap.at(layerIndex).thickness;
116 return _layerMap.at(layerIndex).radiationLength;
122 return _layerMap.at(layerIndex).interactionLength;
128 return _layerMap.at(layerIndex).absorberThickness;
134 return _layerMap.at(layerIndex).absorberRadiationLength;
140 return _layerMap.at(layerIndex).absorberInteractionLength;
146 return _layerMap.at(layerIndex).sensorThickness;
152 return _layerMap.at(layerIndex).sensorRadiationLength;
158 return _layerMap.at(layerIndex).sensorInteractionLength;
164 layerAttributes.
layer = layer_elt;
165 layerAttributes.
normal = normal.Unit();
171 map<int, LayerAttributes>::iterator it;
176 if (not it->second.isCalculated) {
177 it->second.calculate();
182 thickness(0.), radiationLength(0.), interactionLength(0.), absorberThickness(0.), absorberRadiationLength(0.), absorberInteractionLength(
183 0.), sensorThickness(0.), sensorRadiationLength(0.), sensorInteractionLength(0.), isCalculated(false) {
201 addElement(this->
layer);
206 double daughterThickness = 0.;
207 double thisThickness = 0.;
210 DetElement::Children::const_iterator it = children.begin();
211 while (it != children.end()) {
212 daughterThickness += addElement(it->second);
220 double origin[3] = { 0., 0., 0. };
221 double direction[3] = { normal.x(), normal.y(), normal.z() };
222 double reverse_direction[3] = { -normal.x(), -normal.y(), -normal.z() };
223 thisThickness = solid->DistFromInside(origin, direction) + solid->DistFromInside(origin, reverse_direction);
225 double effectiveThickness = thisThickness - daughterThickness;
226 double radLength = effectiveThickness / material.
radLength();
227 double intLength = effectiveThickness / material.
intLength();
243 return thisThickness;
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.
Solid solid() const
Access to Solid (Shape)
virtual DetElement world() const =0
Return reference to the top-most (world) detector element.
Volume volume() const
Access to the logical volume of the detector element's placement.
Handle class describing a material.
bool isValid() const
Check the validity of the object held by the handle.
double intLength() const
Access the interaction length of the underlying material.
virtual double totalRadiationLength() const
Access the total radiation length of the sub detector.
const Children & children() const
Access to the list of children.
static LCDD & getInstance(void)
—Factory method----—
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.
virtual double absorberRadiationLength(int layerIndex) const
Access the total radiation length of all non-sensitive elements of the layer with the given index...
DD4hep::Geometry::DetElement DetElement
Handle class holding a placed volume (also called physical volume)
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.
TGeoManager * _tgeoManager
double addElement(const Geometry::DetElement &det)
double radLength() const
Access the radiation length of the underlying material.
Helper class to store layer attributes.
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.
virtual ~LayeringExtensionImpl()
Destructor.
LayeringExtensionImpl()
Default constructor.
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.
Geometry::DetElement layer
std::map< std::string, DetElement > Children
Material material() const
Access to the Volume material.
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.
bool isSensitive() const
Accessor if volume is sensitive (ie. is attached to a sensitive 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...