21 using namespace DD4hep;
22 using namespace DD4hep::Geometry;
27 string det_name = x_det.
nameStr();
36 string l_nam = det_name+
_toString(l_num,
"_layer%d");
37 double zmin = x_layer.
inner_z();
38 double rmin = x_layer.
inner_r();
39 double rmax = x_layer.
outer_r();
40 double z = zmin, layerWidth = 0.;
45 layerWidth += thickness;
47 Tube l_tub(rmin,rmax,layerWidth,2*
M_PI);
48 Volume l_vol(l_nam,l_tub,air);
54 string s_nam = l_nam+
_toString(s_num,
"_slice%d");
55 Volume s_vol(s_nam,
Tube(rmin,rmax,thick), mat);
67 pv = assembly.placeVolume(l_vol,
Position(0,0,zmin+layerWidth/2.));
84 sdet.setPlacement(pv);
Handle class to hold the information of a sensitive detector.
Handle class holding a placed volume (also called physical volume)
static Ref_t create_detector(LCDD &lcdd, xml_h e, SensitiveDetector sens)
virtual Volume pickMotherVolume(const DetElement &sd) const =0
Access mother volume by detector element.
Handle class describing a material.
Implementation class extending the ROOT assembly volumes (TGeoVolumeAsembly)
std::string regionStr() const
Access region attribute as STL string. If not present empty return empty string.
Class to support the access to collections of XmlNodes (or XmlElements)
XML Handle class extending the XML handle Dimension.
ROOT::Math::RotationY RotationY
SensitiveDetector & setType(const std::string &typ)
Set detector type (structure, tracker, calorimeter, etc.).
double thickness() const
Access attribute values: thickness.
double inner_r() const
Access attribute values: inner_r.
Handle class holding a placed volume (also called physical volume)
std::string visStr() const
Access vis attribute as STL string. If not present empty return empty string.
bool isSensitive() const
Check if component is sensitive.
std::string limitsStr() const
Access limits attribute as STL string. If not present empty return empty string.
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
DetElement & add(DetElement sub_element)
Add new child to the detector structure.
int id() const
Access parameters: id.
double inner_z() const
Access attribute values: inner_z.
double outer_r() const
Access attribute values: outer_r.
bool hasAttr(const XmlChar *name) const
Check for the existence of a named attribute.
#define DECLARE_DETELEMENT(name, func)
XML Handle class extending the XML handle Dimension.
bool reflect() const
Access attribute values: reflect.
DetElement & setPlacement(const PlacedVolume &volume)
Set the physical volumes of the detector element.
DetElement & setCombineHits(bool value, SensitiveDetector &sens)
Setter: Combine hits attribute.
DetElement clone(const std::string &new_name) const
Clone (Deep copy) the DetElement structure with a new name.
const Volume & setAttributes(const LCDD &lcdd, const std::string ®ion, const std::string &limits, const std::string &vis) const
Attach attributes to the volume.
ROOT::Math::XYZVector Position
#define DECLARE_DEPRECATED_DETELEMENT(name, func)
virtual Material air() const =0
Return handle to material describing air.
std::string materialStr() const
Access material attribute as STL string.
Handle class describing a detector element.
PlacedVolume & addPhysVolID(const std::string &name, int value)
Add identifier.
The main interface to the DD4hep detector description package.
Class to easily access the properties of single XmlElements.
virtual Material material(const std::string &name) const =0
Retrieve a matrial by it's name from the detector description.
const Volume & setSensitiveDetector(const SensitiveDetector &obj) const
Assign the sensitive detector structure.
std::string nameStr() const
Access "name" attribute as STL string.
ROOT::Math::Transform3D Transform3D
PlacedVolume placeVolume(const Volume &vol) const
Place daughter volume. The position and rotation are the identity.
T attr(const XmlChar *tag_value) const
Access attribute by type.
static std::string _toString(const DD4hep::XML::XmlChar *value)
std::string conversion of XML strings (e.g. Unicode for Xerces-C)
DD4hep::XML::Component xml_comp_t
Class describing a tube shape of a section of a tube.