DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Utilities.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DD4HEP_NONE
14 
15 // Framework include files
16 #include <XML/Utilities.h>
17 #include <DD4hep/Plugins.h>
18 #include <DD4hep/Detector.h>
19 #include <DD4hep/Printout.h>
21 #include <Math/Polar2D.h>
22 
23 // Forward declarations
24 class TObject;
25 
26 using namespace dd4hep::xml::tools;
27 using dd4hep::printout;
28 
29 namespace {
30  static constexpr const char* TAG_LIMITSETREF = "limitsetref";
31  static constexpr const char* TAG_REGIONREF = "regionref";
32  static constexpr const char* TAG_VISREF = "visref";
33 
34  static constexpr const char* TAG_COMBINE_HITS = "combine_hits";
35  static constexpr const char* TAG_VERBOSE = "verbose";
36  static constexpr const char* TAG_TYPE = "type";
37  static constexpr const char* TAG_ECUT = "ecut";
38  static constexpr const char* TAG_HITS_COLLECTION = "hits_collection";
39 }
40 
43  int flag = 0;
44  Transform3D position, rotation, result;
45  for( xml_coll_t c(e,_U(star)); c; ++c ) {
46  std::string tag = c.tag();
47  xml_dim_t x_elt = c;
48  if ( tag == "positionRPhiZ" ) {
49  if ( flag == 1 ) result = position * result;
50  else if ( flag == 2 ) result = (position * rotation) * result;
51  PositionRhoZPhi pos(x_elt.r(0), x_elt.z(0), x_elt.phi(0));
52  position = Transform3D(pos);
53  rotation = Transform3D();
54  flag = 1;
55  }
56  else if ( tag == "position" ) {
57  if ( flag == 1 ) result = position * result;
58  else if ( flag == 2 ) result = (position * rotation) * result;
59  Position pos(x_elt.x(0), x_elt.y(0), x_elt.z(0));
60  position = Transform3D(pos);
61  rotation = Transform3D();
62  flag = 1;
63  }
64  else if ( tag == "transformation" ) {
65  if ( flag == 1 ) result = position * result;
66  else if ( flag == 2 ) result = (position * rotation) * result;
68  result = trafo * result;
69  position = Transform3D();
70  rotation = Transform3D();
71  flag = 0;
72  }
73  else if ( tag == "rotation" ) {
74  rotation = Transform3D(RotationZYX(x_elt.z(0), x_elt.y(0), x_elt.x(0)));
75  flag = 2;
76  }
77  }
78  if ( flag == 1 ) result = position * result;
79  else if ( flag == 2 ) result = (position * rotation) * result;
80  return result;
81 }
82 
85  const std::string& shape_type,
86  xml::Element element) {
87  std::string fac = shape_type + "__shape_constructor";
88  xml::Handle_t solid_elt = element;
89  Solid solid = Solid(PluginService::Create<TObject*>(fac, &description, &solid_elt));
90  if ( !solid.isValid() ) {
91  PluginDebug dbg;
92  PluginService::Create<TObject*>(fac, &description, &solid_elt);
93  dd4hep::except("xml::createShape","Failed to create solid of type %s [%s]",
94  shape_type.c_str(),dbg.missingFactory(shape_type).c_str());
95  }
96  return solid;
97 }
98 
101  Volume vol;
102  xml_dim_t elt(element);
103  std::string typ, tag = elt.tag();
104  PrintLevel lvl = ALWAYS;
105  //PrintLevel lvl = DEBUG;
106 
107  printout(lvl, "xml::createStdVolume", "++ Processing tag: %-12s", tag.c_str());
108  if ( elt.hasAttr(_U(material)) ) {
109  xml_dim_t x_s = elt.child(_U(shape));
110  Solid sol = createShape(description, x_s.typeStr(), x_s);
111  Material mat = description.material(elt.attr<std::string>(_U(material)));
112  vol = Volume("volume", sol, mat);
113  if ( elt.hasAttr(_U(name)) ) vol->SetName(elt.nameStr().c_str());
114  vol.setAttributes(description,elt.regionStr(),elt.limitsStr(),elt.visStr());
115  printout(lvl, "xml::createStdVolume", "++ --> name: %s vis: %s region: %s limits: %s",
116  vol.name(),
117  elt.visStr("").c_str(),
118  elt.regionStr("").c_str(),
119  elt.limitsStr("").c_str());
120  elt = std::move(x_s);
121  }
122  else if ( elt.hasAttr(_U(type)) ) {
123  typ = elt.typeStr();
124  if ( typ == "CAD_Assembly" || typ == "CAD_MultiVolume" || typ == "GenVolume" )
125  vol = xml::createVolume(description, typ, elt);
126  else if ( typ.substr(1) == "ssembly" )
127  vol = Assembly("assembly");
128  if ( elt.hasAttr(_U(name)) ) vol->SetName(elt.nameStr().c_str());
129  vol.setAttributes(description,elt.regionStr(),elt.limitsStr(),elt.visStr());
130  printout(lvl, "xml::createStdVolume", "++ --> name: %s vis: %s region: %s limits: %s",
131  vol.name(),
132  elt.visStr("").c_str(),
133  elt.regionStr("").c_str(),
134  elt.limitsStr("").c_str());
135  }
136  if ( vol.isValid() ) {
137  for( xml_coll_t xv(elt, _U(volume)); xv; ++xv ) {
138  xml_dim_t xvol = xv;
139  xml_dim_t xshap = xv.child(_U(shape), false);
155  if ( xvol && ((xvol.hasAttr(_U(material)) && xshap) || xvol.hasAttr(_U(type))) ) {
156  RotationZYX rot;
157  Position pos;
158  xml_comp_t x_rot = xvol.child( _U(rotation), false );
159  xml_comp_t x_pos = xvol.child( _U(position), false );
160  Volume child = xml::createStdVolume( description, xvol );
161  if ( x_rot ) rot = RotationZYX( x_rot.z(0),x_rot.y(0),x_rot.x(0) );
162  if ( x_pos ) pos = Position( x_pos.x(0),x_pos.y(0),x_pos.z(0) );
163  Transform3D trafo(Rotation3D(rot), pos);
164  vol.placeVolume( child, trafo );
165  }
166  }
167  for( xml_coll_t xs(elt, _U(shape)); xs; ++xs ) {
168  xml_dim_t xshap = xs;
178  if ( xshap && xshap.hasAttr(_U(type)) ) {
179  RotationZYX rot;
180  Position pos;
181  xml_comp_t x_rot = xshap.child( _U(rotation), false );
182  xml_comp_t x_pos = xshap.child( _U(position), false );
183  Volume child = xml::createStdVolume( description, xshap );
184  if ( x_rot ) rot = RotationZYX( x_rot.z(0),x_rot.y(0),x_rot.x(0) );
185  if ( x_pos ) pos = Position( x_pos.x(0),x_pos.y(0),x_pos.z(0) );
186  Transform3D trafo(Rotation3D(rot), pos);
187  vol.placeVolume( child, trafo );
188  }
189  }
190  return vol;
191  }
192  dd4hep::except("xml::createStdVolume","Failed to create volume. No material specified!");
193  return Volume();
194 }
195 
198  const std::string& typ,
199  xml::Element element) {
200  if ( !typ.empty() ) {
201  xml_dim_t e(element);
202  std::string fac = typ + "__volume_constructor";
203  xml::Handle_t elt = element;
204  TObject* obj = PluginService::Create<TObject*>(fac, &description, &elt);
205  Volume vol = Volume(dynamic_cast<TGeoVolume*>(obj));
206  if ( !vol.isValid() ) {
207  PluginDebug dbg;
208  PluginService::Create<TObject*>(fac, &description, &elt);
209  except("xml::createShape","Failed to create volume of type %s [%s]",
210  typ.c_str(),dbg.missingFactory(typ).c_str());
211  }
212  if ( e.hasAttr(_U(name)) ) vol->SetName(e.attr<std::string>(_U(name)).c_str());
213  vol.setAttributes(description,e.regionStr(),e.limitsStr(),e.visStr());
214  return vol;
215  }
216  dd4hep::except("xml::createVolume","Failed to create volume. No materiaWNo type specified!");
217  return Volume();
218 }
219 
222  dd4hep::DetElement sdet)
223 {
224  xml_det_t x_det = e;
225  std::string det_name = x_det.nameStr();
226 
227  xml_comp_t x_env = x_det.child( dd4hep::xml::Strng_t("envelope") );
228  xml_comp_t x_shape = x_env.child( _U(shape) );
229 
230  bool useRot = false;
231  bool usePos = false;
232  Position pos;
233  RotationZYX rot;
234 
235  if( x_env.hasChild( _U(position) ) ) {
236  usePos = true;
237  xml_comp_t env_pos = x_env.position();
238  pos = Position( env_pos.x(),env_pos.y(),env_pos.z() );
239  }
240  if( x_env.hasChild( _U(rotation) ) ) {
241  useRot = true;
242  xml_comp_t env_rot = x_env.rotation();
243  rot = RotationZYX( env_rot.z(),env_rot.y(),env_rot.x() );
244  }
245 
246  Volume envelope;
247  if( x_shape.typeStr() == "Assembly" ){
248  envelope = Assembly( det_name+"_assembly" );
249  } else {
250  // ---- create a shape from the specified xml element --------
251  Box env_solid = xml_comp_t( x_shape ).createShape();
252 
253  if( !env_solid.isValid() ){
254  dd4hep::except("createPlacedEnvelope",
255  "Cannot create envelope volume : %s for detector %s.",
256  x_shape.typeStr().c_str(), det_name.c_str());
257  }
258  Material env_mat = description.material( x_shape.materialStr() );
259  envelope = Volume( det_name+"_envelope", env_solid, env_mat );
260  }
261  PlacedVolume env_pv;
262  Volume mother = description.pickMotherVolume(sdet);
263  // ---- place the envelope into the mother volume
264  // only specify transformations given in xml
265  // to allow for optimization
266 
267  if( useRot && usePos ){
268  env_pv = mother.placeVolume( envelope , Transform3D( rot, pos ) );
269  } else if( useRot ){
270  env_pv = mother.placeVolume( envelope , rot );
271  } else if( usePos ){
272  env_pv = mother.placeVolume( envelope , pos );
273  } else {
274  env_pv = mother.placeVolume( envelope );
275  }
276 
277  // ----------------------------------------------
278  env_pv.addPhysVolID("system", sdet.id());
279  sdet.setPlacement( env_pv );
280  envelope.setAttributes( description,x_det.regionStr(),x_det.limitsStr(),x_env.visStr());
281  return envelope;
282 }
283 
285  xml_det_t x_det = e;
286  std::string det_name = x_det.nameStr();
287 
288  try{
289  xml_comp_t x_dettype = x_det.child( dd4hep::xml::Strng_t("type_flags") );
290  unsigned int typeFlag = x_dettype.type();
291  printout(DEBUG,"Utilities","+++ setDetectorTypeFlags for detector: %s set to 0x%x", det_name.c_str(), typeFlag );
292  sdet.setTypeFlag( typeFlag );
293  }
294  catch(const std::runtime_error& err) {
295  printout(INFO,"Utilities",
296  "+++ setDetectorTypeFlags for detector: %s not set.",
297  det_name.c_str() );
298  printout(DEBUG, "Utilities",
299  "+++ setDetectorTypeFlags encountered an error:\n%s", err.what());
300  }
301 }
302 
303 namespace {
304  template <typename TYPE>
305  std::size_t _propagate(bool debug,
306  bool apply_to_children,
307  dd4hep::Volume vol,
308  TYPE item,
309  const dd4hep::Volume& (dd4hep::Volume::*apply)(const TYPE&) const) {
310  std::size_t count = 0;
311  if ( !vol->IsAssembly() ) {
312  printout(debug ? dd4hep::ALWAYS : dd4hep::DEBUG,"VolumeConfig", "++ Volume: %s apply setting %s", vol.name(), item.name());
313  (vol.*apply)(item);
314  ++count;
315  }
316  if ( apply_to_children ) {
317  std::set<dd4hep::Volume> handled;
318  for (Int_t idau = 0, ndau = vol->GetNdaughters(); idau < ndau; ++idau) {
319  dd4hep::Volume v = vol->GetNode(idau)->GetVolume();
320  if ( handled.find(v) == handled.end() ) {
321  handled.insert(v);
322  count += _propagate(debug, apply_to_children, v, item, apply);
323  }
324  }
325  }
326  return count;
327  }
328 }
329 
332  dd4hep::xml::Handle_t element,
333  dd4hep::Volume vol,
334  bool propagate,
335  bool ignore_unknown)
336 {
337  std::size_t count = 0;
338  if ( element ) {
339  xml::Attribute x_dbg = element.attr_nothrow(_U(debug));
340  bool debug = x_dbg ? element.attr<bool>(x_dbg) : false;
341  PrintLevel lvl = debug ? ALWAYS : DEBUG;
342  for( xml_coll_t coll(element, "*"); coll; coll++ ) {
343  xml_dim_t itm = coll;
344  std::string nam = itm.nameStr("UN-NAMED");
345 
346  if ( itm.tag() == TAG_REGIONREF ) {
347  Region region = detector.region(nam);
348  count += _propagate(debug, propagate, vol.ptr(), region, &Volume::setRegion);
349  printout(lvl, "VolumeConfig", "++ %-12s: %-10s REGIONs named '%s'",
350  vol.name(), region.isValid() ? "Set" : "Invalidate", nam.c_str());
351  }
352  else if ( itm.tag() == TAG_LIMITSETREF ) {
353  LimitSet limitset = detector.limitSet(nam);
354  count += _propagate(debug, propagate, vol.ptr(), limitset, &Volume::setLimitSet);
355  printout(lvl, "VolumeConfig", "++ %-12s: %-10s LIMITSETs named '%s'",
356  vol.name(), limitset.isValid() ? "Set" : "Invalidate", nam.c_str());
357  }
358  else if ( itm.tag() == TAG_VISREF ) {
359  VisAttr attrs = detector.visAttributes(nam);
360  count += _propagate(debug, propagate, vol.ptr(), attrs, &Volume::setVisAttributes);
361  printout(lvl, "VolumeConfig", "++ %-12s: %-10s VISATTRs named '%s'",
362  vol.name(), attrs.isValid() ? "Set" : "Invalidate", nam.c_str());
363  }
364  else if ( !ignore_unknown ) {
365  except("VolumeConfig", "++ Unknown Volume property: %s [Ignored]", itm.tag().c_str());
366  }
367  else {
368  printout(DEBUG, "VolumeConfig", "++ Unknown Volume property: %s [Ignored]", itm.tag().c_str());
369  }
370  }
371  return count;
372  }
373  except("VolumeConfig","++ Invalid XML handle to configure DetElement!");
374  return count;
375 }
376 
379  dd4hep::SensitiveDetector sensitive,
380  dd4hep::xml::Handle_t element)
381 {
382  std::size_t count = 0;
383  if ( sensitive.isValid() && element ) {
384  xml::Attribute x_dbg = element.attr_nothrow(_U(debug));
385  bool debug = x_dbg ? element.attr<bool>(x_dbg) : false;
386  PrintLevel lvl = debug ? ALWAYS : DEBUG;
387 
388  for( xml_coll_t coll(element, "*"); coll; coll++ ) {
389  xml_dim_t itm = coll;
390  if ( itm.tag() == TAG_COMBINE_HITS ) {
391  bool value = itm.attr<bool>(_U(value));
392  sensitive.setCombineHits(value);
393  ++count;
394  printout(lvl, "SensDetConfig", "++ %s Set property 'combine_hits' to %s",
395  sensitive.name(), true_false(value));
396  }
397  else if ( itm.tag() == TAG_VERBOSE ) {
398  bool value = itm.attr<bool>(_U(value));
399  sensitive.setVerbose(value);
400  ++count;
401  printout(lvl, "SensDetConfig", "++ %s Set property 'verbose' to %s",
402  sensitive.name(), true_false(value));
403  }
404  else if ( itm.tag() == TAG_TYPE ) {
405  std::string value = itm.valueStr();
406  sensitive.setType(value);
407  ++count;
408  printout(lvl, "SensDetConfig", "++ %s Set property 'type' to %s",
409  sensitive.name(), value.c_str());
410  }
411  else if ( itm.tag() == TAG_ECUT ) {
412  double value = itm.attr<double>(_U(value));
413  sensitive.setEnergyCutoff(value);
414  ++count;
415  printout(lvl, "SensDetConfig", "++ %s Set property 'ecut' to %f",
416  sensitive.name(), value);
417  }
418  else if ( itm.tag() == TAG_HITS_COLLECTION ) {
419  sensitive.setHitsCollection(itm.valueStr());
420  ++count;
421  printout(lvl, "SensDetConfig", "++ %s Set property 'hits_collection' to %s",
422  sensitive.name(), itm.valueStr().c_str());
423  }
424  else {
425  except("SensDetConfig",
426  "++ Unknown Sensitive Detector property: %s [Failure]",
427  itm.tag().c_str());
428  }
429  }
430  return count;
431  }
432  except("SensDetConfig",
433  "FAILED: No valid sensitive detector. Configuration could not be applied!");
434  return count;
435 }
436 
437 #endif
dd4hep::xml::configVolume
std::size_t configVolume(dd4hep::Detector &detector, dd4hep::xml::Handle_t element, dd4hep::Volume volume, bool propagate, bool ignore_unknown_attr=false)
Configure volume properties from XML element.
Definition: Utilities.cpp:331
dd4hep::xml::Collection_t
Class to support the access to collections of XmlNodes (or XmlElements)
Definition: XMLElements.h:636
dd4hep::Volume::setLimitSet
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.
Definition: Volumes.cpp:1290
dd4hep::SensitiveDetector::setEnergyCutoff
SensitiveDetector & setEnergyCutoff(double value)
Set energy cut off.
Definition: DetElement.cpp:430
dd4hep::xml::tools
Declaration of the XML tools namespace.
Definition: VolumeBuilder.h:33
v
View * v
Definition: MultiView.cpp:28
dd4hep::SensitiveDetector
Handle class to hold the information of a sensitive detector.
Definition: DetElement.h:44
Detector.h
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:163
dd4hep::VisAttr
Handle class describing visualization attributes.
Definition: Objects.h:324
dd4hep::xml::Attribute
const XmlAttr * Attribute
Definition: XMLElements.h:38
dd4hep::SensitiveDetector::setHitsCollection
SensitiveDetector & setHitsCollection(const std::string &spec)
Assign the name of the hits collection.
Definition: DetElement.cpp:441
dd4hep::SensitiveDetector::setVerbose
SensitiveDetector & setVerbose(bool value)
Set flag to handle hits collection.
Definition: DetElement.cpp:452
dd4hep::PlacedVolume::addPhysVolID
PlacedVolume & addPhysVolID(const std::string &name, int value)
Add identifier.
Definition: Volumes.cpp:501
dd4hep::debug
std::size_t debug(const std::string &src, const std::string &msg)
Definition: RootDictionary.h:64
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
dd4hep::Detector::region
virtual Region region(const std::string &name) const =0
Retrieve a region object by its name from the detector description.
dd4hep::Volume::setRegion
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.
Definition: Volumes.cpp:1271
dd4hep::Rotation3D
ROOT::Math::Rotation3D Rotation3D
Definition: Objects.h:113
dd4hep::Detector::pickMotherVolume
virtual Volume pickMotherVolume(const DetElement &sd) const =0
Access mother volume by detector element.
dd4hep::Solid_type< TGeoShape >
dd4hep::xml::Handle_t
Class to easily access the properties of single XmlElements.
Definition: XMLElements.h:380
dd4hep::Handle::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::Assembly
Implementation class extending the ROOT assembly volumes (TGeoVolumeAssembly)
Definition: Volumes.h:761
dd4hep::Volume::placeVolume
PlacedVolume placeVolume(const Volume &volume) const
Place daughter volume. The position and rotation are the identity.
Definition: Volumes.cpp:859
xml_comp_t
dd4hep::xml::Component xml_comp_t
Definition: XML.h:33
dd4hep::Material
Handle class describing a material.
Definition: Objects.h:272
dd4hep::DetElement::setTypeFlag
DetElement & setTypeFlag(unsigned int types)
Set the flag word encoding detector types ( ideally use dd4hep::DetType for encoding )
Definition: DetElement.cpp:113
dd4hep::Detector::material
virtual Material material(const std::string &name) const =0
Retrieve a matrial by its name from the detector description.
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:188
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:370
dd4hep::LimitSet
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:425
dd4hep::xml::createShape
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.
Definition: Utilities.cpp:84
xml_det_t
dd4hep::xml::DetElement xml_det_t
Definition: XML.h:32
_U
#define _U(a)
Definition: Tags.h:23
Plugins.h
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
dd4hep::PluginDebug
Helper to debug plugin manager calls.
Definition: Plugins.h:74
dd4hep::PositionRhoZPhi
ROOT::Math::RhoZPhiVector PositionRhoZPhi
Definition: Objects.h:77
dd4hep::xml::Strng_t
Helper class to encapsulate a unicode string.
Definition: XMLElements.h:170
dd4hep::Detector::limitSet
virtual LimitSet limitSet(const std::string &name) const =0
Retrieve a limitset by its name from the detector description.
dd4hep::PluginDebug::missingFactory
std::string missingFactory(const std::string &name) const
Helper to check factory existence.
Definition: Plugins.cpp:147
dd4hep::xml::setDetectorTypeFlag
void setDetectorTypeFlag(dd4hep::xml::Handle_t e, dd4hep::DetElement sdet)
Definition: Utilities.cpp:284
dd4hep::xml::Handle_t::child
Handle_t child(const XmlChar *tag, bool throw_exception=true) const
Access a single child by its tag name (unicode)
Definition: XMLElements.cpp:710
dd4hep::DetElement::setPlacement
DetElement & setPlacement(const PlacedVolume &volume)
Set the physical volumes of the detector element.
Definition: DetElement.cpp:330
dd4hep::Detector::visAttributes
virtual const HandleMap & visAttributes() const =0
Accessor to the map of visualisation attributes.
dd4hep::Transform3D
ROOT::Math::Transform3D Transform3D
Definition: Objects.h:117
dd4hep::Position
ROOT::Math::XYZVector Position
Definition: Objects.h:81
DetFactoryHelper.h
dd4hep::xml::createPlacedEnvelope
Volume createPlacedEnvelope(dd4hep::Detector &description, dd4hep::xml::Handle_t e, dd4hep::DetElement sdet)
Definition: Utilities.cpp:220
dd4hep::xml::createVolume
Volume createVolume(Detector &description, const std::string &type, xml::Element element)
Create a volume using the plugin mechanism from the attributes of the XML element.
Definition: Utilities.cpp:197
dd4hep::Box
Class describing a box shape.
Definition: Shapes.h:294
dd4hep::Handle::ptr
T * ptr() const
Access to the held object.
Definition: Handle.h:153
dd4hep::xml::Element
User abstraction class to manipulate XML elements within a document.
Definition: XMLElements.h:769
TObject
Class of the ROOT toolkit. See http://root.cern.ch/root/htmldoc/ClassIndex.html.
Definition: ROOTClasses.h:41
dd4hep::Volume::setVisAttributes
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
Definition: Volumes.cpp:1156
dd4hep::Solid
Solid_type< TGeoShape > Solid
Definition: Shapes.h:197
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::DetElement::id
int id() const
Get the detector identifier.
Definition: DetElement.cpp:169
dd4hep::xml::createTransformation
Transform3D createTransformation(xml::Element element)
Create layered transformation from xml information.
Definition: Utilities.cpp:42
dd4hep::SensitiveDetector::setCombineHits
SensitiveDetector & setCombineHits(bool value)
Set flag to handle hits collection.
Definition: DetElement.cpp:464
dd4hep::RotationZYX
ROOT::Math::RotationZYX RotationZYX
Definition: Objects.h:105
dd4hep::Volume::setAttributes
const Volume & setAttributes(const Detector &description, const std::string &region, const std::string &limits, const std::string &vis) const
Attach attributes to the volume.
Definition: Volumes.cpp:1229
dd4hep::xml::createStdVolume
Volume createStdVolume(Detector &description, xml::Element element)
Create a simple volume using the shape plugin mechanism from the attributes of the XML element.
Definition: Utilities.cpp:100
dd4hep::xml::Handle_t::attr
T attr(const Attribute a) const
Access typed attribute value by the XmlAttr.
Definition: XMLElements.h:454
Printout.h
xml_dim_t
dd4hep::xml::Dimension xml_dim_t
Definition: XML.h:31
Utilities.h
dd4hep::SensitiveDetector::setType
SensitiveDetector & setType(const std::string &typ)
Set detector type (structure, tracker, calorimeter, etc.).
Definition: DetElement.cpp:403
dd4hep::xml::configSensitiveDetector
std::size_t configSensitiveDetector(dd4hep::Detector &detector, dd4hep::SensitiveDetector sensitive, dd4hep::xml::Handle_t element)
Configure sensitive detector from XML element.
Definition: Utilities.cpp:378
dd4hep::xml::Handle_t::attr_nothrow
Attribute attr_nothrow(const XmlChar *tag) const
Access attribute pointer by the attribute's unicode name (no exception thrown if not present)
Definition: XMLElements.cpp:668