27 using namespace DD4hep;
28 using namespace DD4hep::XML;
40 : _thickness(c._thickness), _preOffset(c._preOffset), _slices(c._slices) {
54 for (vector<LayerSlice>::const_iterator i =
_slices.begin(); i !=
_slices.end(); ++i)
62 "LayerStack::sectionThickness: First index (" +
_toString(is) +
") must be <= second index (" +
_toString(ie) +
")!");
71 for (
size_t i = is; i <= ie; ++i)
72 thick +=
_layers[i]->thicknessWithPreOffset();
90 void LayeringCnv::fromCompact(
Layering& layering)
const {
91 vector<Layer*>& layers = layering.
layers();
93 for_each(layers.begin(), layers.end(), deletePtr<Layer>);
107 for (
int k = 0; k < repeat; ++k)
108 layers.push_back(
new Layer(lay));
111 throw runtime_error(
"LayeringCnv::fromCompact: No layer children to be build!");
117 double thickness = 0e0;
127 double thickness = 0e0;
145 sens_pos.push_back(pos - slice.
thickness()/2.);
std::vector< Layer * > _layers
std::vector< Layer * > & layers()
void sensitivePositionsInLayer(XML::Element e, std::vector< double > &sens_pos) const
Class to convert a layering object from the compact notation.
void fromCompact(Layering &layering) const
Invoke converter.
std::string _toString(bool value)
String conversions: boolean value to string.
Class to support the access to collections of XmlNodes (or XmlElements)
double sectionThickness(size_t is, size_t ie) const
const Layer * layer(size_t which) const
User abstraction class to manipulate XML elements within a document.
void add(const LayerSlice &s)
double thickness() const
Access attribute values: thickness.
std::vector< LayerSlice > _slices
double singleLayerThickness(XML::Element e) const
bool isSensitive() const
Check if component is sensitive.
Class to describe one layer in a layering stack.
virtual ~Layering()
Default destructor.
double absorberThicknessInLayer(XML::Element e) const
bool hasAttr(const XmlChar *name) const
Check for the existence of a named attribute.
bool isRadiator() const
Check if component is a radiator (absorber)
XML Handle class extending the XML handle Dimension.
Class to describe the slice of one layer in a layering stack.
Layering()
Default constructor.
std::vector< Layer * > & layers()
std::string materialStr() const
Access material attribute as STL string.
XML converter for layering objects.
Layer & operator=(const Layer &c)
Assignment operator.
int repeat() const
Access attribute values: repeat.