|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
34 xml_h x_pos, x_rot, x_tr;
38 builder.debug = x_dbg != 0;
39 builder.load(x_det,
"include");
40 builder.buildShapes(x_det);
41 builder.buildShapes(x_env);
42 builder.buildVolumes(x_det);
43 builder.buildVolumes(x_env);
46 if ( !x_shp ) x_shp = x_env;
47 if ( x_shp.typeStr() ==
"Assembly" ) {
48 assembly =
Assembly(
"lv"+builder.name);
53 assembly =
Volume(
"lv"+builder.name, solid, mat);
56 assembly.
setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
58 if ( x_env.hasAttr(
_U(vis)) )
61 if ( x_env.hasAttr(
_U(region)) )
62 assembly.
setRegion(description, x_env.regionStr());
64 if ( x_env.hasAttr(
_U(limits)) )
65 assembly.
setLimitSet(description, x_env.limitsStr());
67 if ( x_det.hasAttr(
_U(sensitive)) )
68 sens.
setType(x_det.attr<
string>(
_U(sensitive)));
70 builder.detector.
setType(
"compound");
72 if ( x_env.hasAttr(
_U(name)) )
73 assembly->SetName(x_env.nameStr().c_str());
75 builder.placeDaughters(builder.detector, assembly, x_env);
76 builder.placeDaughters(builder.detector, assembly, x_det);
77 x_pos = x_env.
child(
_U(position),
false);
78 x_rot = x_env.
child(
_U(rotation),
false);
79 x_tr = x_env.
child(
_U(transformation),
false);
80 builder.placeDetector(assembly, (x_pos || x_rot || x_tr) ? x_env : x_det);
81 printout(builder.debug ? ALWAYS : DEBUG,
"VolumeBuilder",
82 "+++ Created subdetector instance %s vis:",
83 builder.name.c_str(), x_det.visStr().c_str());
84 return builder.detector;
const Volume & setLimitSet(const Detector &description, const std::string &name) const
Set the limits to the volume. Note: If the name string is empty, the action is ignored.
Handle class to hold the information of a sensitive detector.
#define DECLARE_DETELEMENT(name, func)
std::size_t debug(const std::string &src, const std::string &msg)
const Volume & setRegion(const Detector &description, const std::string &name) const
Set the regional attributes to the volume. Note: If the name string is empty, the action is ignored.
Class to easily access the properties of single XmlElements.
Implementation class extending the ROOT assembly volumes (TGeoVolumeAssembly)
dd4hep::xml::Component xml_comp_t
Handle class describing a material.
virtual Material material(const std::string &name) const =0
Retrieve a matrial by its name from the detector description.
Handle class holding a placed volume (also called physical volume)
DD4hep internal namespace.
Solid createShape(Detector &description, const std::string &shape_type, xml::Element element)
Create a solid shape using the plugin mechanism from the attributes of the XML element.
Handle_t child(const XmlChar *tag, bool throw_exception=true) const
Access a single child by its tag name (unicode)
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
Namespace for the AIDA detector description toolkit.
The main interface to the dd4hep detector description package.
const Volume & setAttributes(const Detector &description, const std::string ®ion, const std::string &limits, const std::string &vis) const
Attach attributes to the volume.
SensitiveDetector & setType(const std::string &typ)
Set detector type (structure, tracker, calorimeter, etc.).