DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
DetElement.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 
14 // Framework include files
18 #include <DD4hep/AlignmentTools.h>
19 #include <DD4hep/DetectorTools.h>
20 #include <DD4hep/Printout.h>
21 #include <DD4hep/Detector.h>
22 #include <DD4hep/World.h>
23 
24 using namespace dd4hep;
25 
26 namespace {
27  static std::string s_empty_string;
28 }
29 
32 }
33 
36 }
37 
39 DetElement::DetElement(Object* det_data, const std::string& det_name, const std::string& det_type)
40  : Handle<DetElementObject>(det_data)
41 {
42  this->assign(det_data, det_name, det_type);
43 }
44 
46 DetElement::DetElement(const std::string& det_name, const std::string& det_type, int det_id) {
47  assign(new Object(det_name,det_id), det_name, det_type);
48  ptr()->id = det_id;
49 }
50 
52 DetElement::DetElement(const std::string& det_name, int det_id) {
53  assign(new Object(det_name,det_id), det_name, "");
54  ptr()->id = det_id;
55 }
56 
58 DetElement::DetElement(DetElement det_parent, const std::string& det_name, int det_id) {
59  assign(new Object(det_name,det_id), det_name, det_parent.type());
60  ptr()->id = det_id;
61  det_parent.add(*this);
62 }
63 
66  return access()->addExtension(e->hash64(), e);
67 }
68 
70 void* DetElement::extension(unsigned long long int k, bool alert) const {
71  return access()->extension(k, alert);
72 }
73 
75 void DetElement::i_addUpdateCall(unsigned int callback_type, const Callback& callback) const {
76  access()->updateCalls.emplace_back(callback,callback_type);
77 }
78 
80 void DetElement::removeAtUpdate(unsigned int typ, void* pointer) const {
81  access()->removeAtUpdate(typ,pointer);
82 }
83 
85 const std::string& DetElement::placementPath() const {
86  Object* o = ptr();
87  if ( o ) {
88  if (o->placementPath.empty()) {
89  o->placementPath = detail::tools::placementPath(*this);
90  }
91  return o->placementPath;
92  }
93  return s_empty_string;
94 }
95 
97 std::string DetElement::type() const {
98  return m_element ? m_element->GetTitle() : "";
99 }
100 
102 DetElement& DetElement::setType(const std::string& typ) {
103  access()->SetTitle(typ.c_str());
104  return *this;
105 }
106 
108 unsigned int DetElement::typeFlag() const {
109  return m_element ? m_element->typeFlag : 0 ;
110 }
111 
113 DetElement& DetElement::setTypeFlag(unsigned int types) {
114  access()->typeFlag = types ;
115  return *this;
116 }
117 
118 namespace {
119  static void make_path(DetElement::Object* o) {
120  DetElement par = o->parent;
121  if ( par.isValid() ) {
122  o->path = par.path() + "/" + o->name;
123  if ( o->level < 0 ) o->level = par.level() + 1;
124  }
125  else {
126  o->path = "/" + o->name;
127  o->level = 0;
128  }
129  o->key = dd4hep::detail::hash32(o->path);
130  }
131 }
132 
134 unsigned int DetElement::key() const {
135  Object* o = ptr();
136  if ( o ) {
137  if ( o->key != 0 )
138  return o->key;
139  make_path(o);
140  return o->key;
141  }
142  return 0;
143 }
144 
146 int DetElement::level() const {
147  Object* o = ptr();
148  if ( o ) {
149  if ( o->level >= 0 )
150  return o->level;
151  make_path(o);
152  return o->level;
153  }
154  return -1;
155 }
156 
158 const std::string& DetElement::path() const {
159  Object* o = ptr();
160  if ( o ) {
161  if ( !o->path.empty() )
162  return o->path;
163  make_path(o);
164  return o->path;
165  }
166  return s_empty_string;
167 }
168 
169 int DetElement::id() const {
170  return access()->id;
171 }
172 
174  return access()->combineHits != 0;
175 }
176 
178  access()->combineHits = value;
179  if (sens.isValid())
180  sens.setCombineHits(value);
181  return *this;
182 }
183 
186  Object* o = access();
187  if ( !o->nominal.isValid() ) {
188  o->nominal = AlignmentCondition("nominal");
189  o->nominal->values().detector = *this;
190  //o->flag |= Object::HAVE_WORLD_TRAFO;
191  //o->flag |= Object::HAVE_PARENT_TRAFO;
193  }
194  return o->nominal;
195 }
196 
199  Object* o = access();
200  if ( !o->survey.isValid() ) {
201  o->survey = AlignmentCondition("survey");
202  dd4hep::detail::tools::copy(nominal(), o->survey);
203  }
204  return o->survey;
205 }
206 
208  return access()->children;
209 }
210 
212 DetElement DetElement::child(const std::string& child_name) const {
213  if (isValid()) {
214  const Children& c = ptr()->children;
215  Children::const_iterator i = c.find(child_name);
216  if ( i != c.end() ) return (*i).second;
217  throw std::runtime_error("dd4hep: DetElement::child Unknown child with name: "+child_name);
218  }
219  throw std::runtime_error("dd4hep: DetElement::child: Self is not defined [Invalid Handle]");
220 }
221 
223 DetElement DetElement::child(const std::string& child_name, bool throw_if_not_found) const {
224  if (isValid()) {
225  const Children& c = ptr()->children;
226  Children::const_iterator i = c.find(child_name);
227  if ( i != c.end() ) return (*i).second;
228  if ( throw_if_not_found ) {
229  throw std::runtime_error("dd4hep: DetElement::child Unknown child with name: "+child_name);
230  }
231  }
232  if ( throw_if_not_found ) {
233  throw std::runtime_error("dd4hep: DetElement::child: Self is not defined [Invalid Handle]");
234  }
235  return DetElement();
236 }
237 
240  Object* o = ptr();
241  return (o) ? o->parent : DetElement();
242 }
243 
246  Object* o = ptr();
247  return (o) ? o->world() : World();
248 }
249 
251 void DetElement::check(bool cond, const std::string& msg) const {
252  if (cond) {
253  throw std::runtime_error("dd4hep: " + msg);
254  }
255 }
256 
259  if (isValid()) {
260  auto r = object<Object>().children.emplace(sdet.name(), sdet);
261  if (r.second) {
262  sdet.access()->parent = *this;
263  return *this;
264  }
265  except("dd4hep",
266  "DetElement::add: Element %s is already present in path %s [Double-Insert]",
267  sdet.name(), this->path().c_str());
268  }
269  except("dd4hep", "DetElement::add: Self is not defined [Invalid Handle]");
270  throw std::runtime_error("dd4hep: DetElement::add");
271 }
272 
275  Object* o = access();
276  Object* n = o->clone(o->id, flg);
277  n->SetName(o->GetName());
278  n->SetTitle(o->GetTitle());
279  return n;
280 }
281 
282 DetElement DetElement::clone(const std::string& new_name) const {
283  return clone(new_name, access()->id);
284 }
285 
286 DetElement DetElement::clone(const std::string& new_name, int new_id) const {
287  Object* o = access();
288  Object* n = o->clone(new_id, COPY_PLACEMENT);
289  n->SetName(new_name.c_str());
290  n->SetTitle(o->GetTitle());
291  return n;
292 }
293 
294 std::pair<DetElement,Volume> DetElement::reflect(const std::string& new_name) const {
295  return reflect(new_name, access()->id);
296 }
297 
298 std::pair<DetElement,Volume> DetElement::reflect(const std::string& new_name, int new_id) const {
299  return reflect(new_name, new_id, SensitiveDetector(0));
300 }
301 
302 std::pair<DetElement,Volume> DetElement::reflect(const std::string& new_name, int new_id, SensitiveDetector sd) const {
303  if ( placement().isValid() ) {
304  return m_element->reflect(new_name, new_id, sd);
305  }
306  except("DetElement","reflect: Only placed DetElement objects can be reflected: %s",
307  path().c_str());
308  return std::make_pair(DetElement(),Volume());
309 }
310 
313  if (isValid()) {
314  Object& o = object<Object>();
315  return o.idealPlace;
316  }
317  return PlacedVolume();
318 }
319 
322  if (isValid()) {
323  Object& o = object<Object>();
324  return o.placement;
325  }
326  return PlacedVolume();
327 }
328 
331  if (pv.isValid()) {
332  Object* o = access();
333  o->placement = pv;
334  if ( !o->idealPlace.isValid() ) {
335  o->idealPlace = pv;
336  }
337  return *this;
338  }
339  except("dd4hep", "DetElement::setPlacement: Placement is not defined [Invalid Handle]");
340  throw std::runtime_error("dd4hep: DetElement::add");
341 }
342 
345  if (isValid()) {
346  return object<Object>().volumeID;
347  }
348  return 0;
349 }
350 
353  return access()->placement.volume();
354 }
355 
358  return volume()->GetShape();
359 }
360 
361 DetElement& DetElement::setVisAttributes(const Detector& description, const std::string& nam, const Volume& vol) {
362  vol.setVisAttributes(description, nam);
363  return *this;
364 }
365 
366 DetElement& DetElement::setRegion(const Detector& description, const std::string& nam, const Volume& vol) {
367  if (!nam.empty()) {
368  vol.setRegion(description.region(nam));
369  }
370  return *this;
371 }
372 
373 DetElement& DetElement::setLimitSet(const Detector& description, const std::string& nam, const Volume& vol) {
374  if (!nam.empty()) {
375  vol.setLimitSet(description.limitSet(nam));
376  }
377  return *this;
378 }
379 
381  const Volume& vol,
382  const std::string& region,
383  const std::string& limits,
384  const std::string& vis)
385 {
386  return setRegion(description, region, vol).setLimitSet(description, limits, vol).setVisAttributes(description, vis, vol);
387 }
388 
390 SensitiveDetector::SensitiveDetector(const std::string& nam, const std::string& typ) {
391  /*
392  <calorimeter ecut="0" eunit="MeV" hits_collection="EcalEndcapHits" name="EcalEndcap" verbose="0">
393  <global_grid_xy grid_size_x="3.5" grid_size_y="3.5"/>
394  <idspecref ref="EcalEndcapHits"/>
395  </calorimeter>
396  */
397  assign(new Object(nam), nam, typ);
398  object<Object>().ecut = 0e0;
399  object<Object>().verbose = 0;
400 }
401 
404  access()->SetTitle(typ.c_str());
405  return *this;
406 }
407 
409 std::string SensitiveDetector::type() const {
410  return m_element ? m_element->GetTitle() : s_empty_string;
411 }
412 
415  access()->readout = ro;
416  return *this;
417 }
418 
421  return access()->readout;
422 }
423 
426  return readout().idSpec();
427 }
428 
431  access()->ecut = value;
432  return *this;
433 }
434 
437  return access()->ecut;
438 }
439 
442  access()->hitsCollection = collection;
443  return *this;
444 }
445 
447 const std::string& SensitiveDetector::hitsCollection() const {
448  return access()->hitsCollection;
449 }
450 
453  int v = value ? 1 : 0;
454  access()->verbose = v;
455  return *this;
456 }
457 
460  return access()->verbose == 1;
461 }
462 
465  int v = value ? 1 : 0;
466  access()->combineHits = v;
467  return *this;
468 }
469 
472  return access()->combineHits == 1;
473 }
474 
477  access()->region = reg;
478  return *this;
479 }
480 
483  return access()->region;
484 }
485 
488  access()->limits = ls;
489  return *this;
490 }
491 
494  return access()->limits;
495 }
496 
498 void* SensitiveDetector::addExtension(unsigned long long int k,ExtensionEntry* e) const
499 {
500  return access()->addExtension(k,e);
501 }
502 
504 void* SensitiveDetector::extension(unsigned long long int k) const {
505  return access()->extension(k);
506 }
507 
509 void* SensitiveDetector::extension(unsigned long long int k, bool alert) const {
510  return access()->extension(k, alert);
511 }
dd4hep::World
Handle class to hold the information of the top DetElement object 'world'.
Definition: World.h:31
dd4hep::DetElement::children
const Children & children() const
Access to the list of children.
Definition: DetElement.cpp:207
dd4hep::DetElement::path
const std::string & path() const
Path of the detector element (not necessarily identical to placement path!)
Definition: DetElement.cpp:158
dd4hep::SensitiveDetector::idSpec
IDDescriptor idSpec() const
Access IDDescription structure.
Definition: DetElement.cpp:425
dd4hep::ExtensionEntry
Definition of the extension entry interface class.
Definition: ExtensionEntry.h:40
dd4hep::DetElementObject::children
DetElement::Children children
The array of children.
Definition: DetectorInterna.h:131
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
cond
AlignmentCondition::Object * cond
Definition: AlignmentsCalculator.cpp:68
dd4hep::SensitiveDetector::setEnergyCutoff
SensitiveDetector & setEnergyCutoff(double value)
Set energy cut off.
Definition: DetElement.cpp:430
dd4hep::SensitiveDetectorObject::ecut
double ecut
Definition: DetectorInterna.h:59
dd4hep::DetElement::setRegion
DetElement & setRegion(const Detector &description, const std::string &name, const Volume &volume)
Set the regional attributes to the detector element.
Definition: DetElement.cpp:366
dd4hep::DetElement::key
unsigned int key() const
Access hash key of this detector element (Only valid once geometry is closed!)
Definition: DetElement.cpp:134
dd4hep::DetElement::COPY_PLACEMENT
@ COPY_PLACEMENT
Definition: DetElement.h:210
v
View * v
Definition: MultiView.cpp:28
dd4hep::SensitiveDetector
Handle class to hold the information of a sensitive detector.
Definition: DetElement.h:44
dd4hep::DetElement::setLimitSet
DetElement & setLimitSet(const Detector &description, const std::string &name, const Volume &volume)
Set the limits to the detector element.
Definition: DetElement.cpp:373
dd4hep::DetElement::parent
DetElement parent() const
Access to the detector elements's parent.
Definition: DetElement.cpp:239
dd4hep::Handle< DetElementObject >::Object
DetElementObject Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
ConditionsInterna.h
dd4hep::DetElementObject::typeFlag
unsigned int typeFlag
Flag to encode detector types.
Definition: DetectorInterna.h:106
Detector.h
dd4hep::AlignmentCondition
Main handle class to hold an alignment conditions object.
Definition: Alignments.h:68
dd4hep::DetElement::type
std::string type() const
Access detector type (structure, tracker, calorimeter, etc.).
Definition: DetElement.cpp:97
dd4hep::PlacedVolume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:163
dd4hep::DetElement::clone
DetElement clone(int flag) const
Clone (Deep copy) the DetElement structure.
Definition: DetElement.cpp:274
dd4hep::SensitiveDetectorObject::readout
Readout readout
Definition: DetectorInterna.h:60
dd4hep::SensitiveDetector::setHitsCollection
SensitiveDetector & setHitsCollection(const std::string &spec)
Assign the name of the hits collection.
Definition: DetElement.cpp:441
dd4hep::DetElement::placement
PlacedVolume placement() const
Access to the physical volume of this detector element.
Definition: DetElement.cpp:321
dd4hep::SensitiveDetector::setVerbose
SensitiveDetector & setVerbose(bool value)
Set flag to handle hits collection.
Definition: DetElement.cpp:452
dd4hep::detail::tools::placementPath
std::string placementPath(DetElement element)
Assemble the placement path from a given detector element to the world volume.
Definition: DetectorTools.cpp:276
dd4hep::DetElement::Processor::~Processor
virtual ~Processor()
Default destructor.
Definition: DetElement.cpp:35
World.h
dd4hep::IDDescriptor
Class implementing the ID encoding of the detector response.
Definition: IDDescriptor.h:37
dd4hep::Handle::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
dd4hep::Handle
Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects...
Definition: Handle.h:84
DetectorInterna.h
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::Solid_type< TGeoShape >
dd4hep::DetElementObject::removeAtUpdate
void removeAtUpdate(unsigned int type, void *pointer)
Remove callback from object.
Definition: DetectorInterna.cpp:227
dd4hep::DetElement::add
DetElement & add(DetElement sub_element)
Add new child to the detector structure.
Definition: DetElement.cpp:258
dd4hep::DetElement::setCombineHits
DetElement & setCombineHits(bool value, SensitiveDetector &sens)
Setter: Combine hits attribute.
Definition: DetElement.cpp:177
dd4hep::DetElement::DetElement
DetElement()=default
Default constructor.
dd4hep::DetElement::volumeID
VolumeID volumeID() const
The cached VolumeID of this subdetector element.
Definition: DetElement.cpp:344
dd4hep::DetElement::setType
DetElement & setType(const std::string &typ)
Set detector type (structure, tracker, calorimeter, etc.).
Definition: DetElement.cpp:102
dd4hep::Handle::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::DetElementObject
Data class with properties of a detector element.
Definition: DetectorInterna.h:81
dd4hep::NamedObject::SetName
void SetName(const char *nam)
Set name (used by Handle)
Definition: NamedObject.h:62
dd4hep::DetElement::reflect
std::pair< DetElement, Volume > reflect(const std::string &new_name) const
Reflect (Deep copy) the DetElement structure with a new name.
Definition: DetElement.cpp:294
dd4hep::SensitiveDetectorObject::limits
LimitSet limits
Definition: DetectorInterna.h:62
dd4hep::DetElement::check
void check(bool condition, const std::string &msg) const
Internal assert function to check conditions.
Definition: DetElement.cpp:251
AlignmentTools.h
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::DetElementObject::parent
DetElement parent
Reference to the parent element.
Definition: DetectorInterna.h:129
dd4hep::DetElement::typeFlag
unsigned int typeFlag() const
Access the type of the sensitive detector.
Definition: DetElement.cpp:108
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::Handle< DetElementObject >::assign
void assign(Object *n, const std::string &nam, const std::string &title)
Assign a new named object. Note: object references must be managed by the user.
dd4hep::DetElement::volume
Volume volume() const
Access to the logical volume of the detector element's placement.
Definition: DetElement.cpp:352
dd4hep::DetElement::extension
IFACE * extension() const
Access extension element by the type.
Definition: DetElement.h:363
dd4hep::SensitiveDetectorObject::combineHits
int combineHits
Definition: DetectorInterna.h:58
dd4hep::LimitSet
Handle class describing a set of limits as they are used for simulation.
Definition: Objects.h:425
dd4hep::SensitiveDetector::hitsCollection
const std::string & hitsCollection() const
Access the hits collection name.
Definition: DetElement.cpp:447
DetectorTools.h
dd4hep::DetElement::setAttributes
DetElement & setAttributes(const Detector &description, const Volume &volume, const std::string &region, const std::string &limits, const std::string &vis)
Set all attributes in one go.
Definition: DetElement.cpp:380
dd4hep::Callback
Definition of the generic callback structure for member functions.
Definition: Callback.h:38
dd4hep::DetElementObject::level
int level
Hierarchical level within the detector description.
Definition: DetectorInterna.h:108
dd4hep::DetElement::i_addUpdateCall
void i_addUpdateCall(unsigned int callback_type, const Callback &callback) const
Internal call to extend the detector element with an arbitrary structure accessible by the type.
Definition: DetElement.cpp:75
dd4hep::SensitiveDetector::combineHits
bool combineHits() const
Access flag to combine hist.
Definition: DetElement.cpp:471
dd4hep::NamedObject::SetTitle
void SetTitle(const char *tit)
Set Title (used by Handle)
Definition: NamedObject.h:66
dd4hep::DetElement::placementPath
const std::string & placementPath() const
Access to the full path to the placed object.
Definition: DetElement.cpp:85
dd4hep::DetElement::removeAtUpdate
void removeAtUpdate(unsigned int type, void *pointer) const
Remove callback from object.
Definition: DetElement.cpp:80
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
dd4hep::Alignment
Main handle class to hold an alignment object.
Definition: Alignments.h:115
dd4hep::DetElement::nominal
Alignment nominal() const
Access to the constant ideal (nominal) alignment information.
Definition: DetElement.cpp:185
dd4hep::Handle< DetElementObject >::m_element
DetElementObject * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:93
dd4hep::SensitiveDetector::setReadout
SensitiveDetector & setReadout(Readout readout)
Assign the IDDescriptor reference.
Definition: DetElement.cpp:414
dd4hep::Detector::limitSet
virtual LimitSet limitSet(const std::string &name) const =0
Retrieve a limitset by its name from the detector description.
dd4hep::DetElementObject::placement
PlacedVolume placement
The subdetector placement corresponding to the actual detector element's volume.
Definition: DetectorInterna.h:119
dd4hep::DetElement::level
int level() const
Access the hierarchical level of the detector element (Only valid once geometry is closed!...
Definition: DetElement.cpp:146
dd4hep::DetElement::combineHits
bool combineHits() const
Getter: Combine hits attribute.
Definition: DetElement.cpp:173
dd4hep::SensitiveDetector::SensitiveDetector
SensitiveDetector()
Default constructor.
Definition: DetElement.h:48
dd4hep::DetElement::setPlacement
DetElement & setPlacement(const PlacedVolume &volume)
Set the physical volumes of the detector element.
Definition: DetElement.cpp:330
dd4hep::NamedObject::GetTitle
const char * GetTitle() const
Get name (used by Handle)
Definition: NamedObject.h:70
dd4hep::SensitiveDetector::limits
LimitSet limits() const
Access to the limit set of the sensitive detector (not mandatory).
Definition: DetElement.cpp:493
dd4hep::SensitiveDetector::addExtension
void * addExtension(unsigned long long int key, ExtensionEntry *entry) const
Add an extension object to the detector element.
Definition: DetElement.cpp:498
dd4hep::SensitiveDetector::type
std::string type() const
Access the type of the sensitive detector.
Definition: DetElement.cpp:409
dd4hep::DetElementObject::id
int id
Unique integer identifier of the detector instance.
Definition: DetectorInterna.h:102
dd4hep::DetElementObject::reflect
std::pair< DetElement, Volume > reflect(const std::string &new_name, int new_id, SensitiveDetector sd)
Reflect all volumes in a DetElement sub-tree and re-attach the placements.
Definition: DetectorInterna.cpp:138
dd4hep::SensitiveDetector::region
Region region() const
Access to the region setting of the sensitive detector (not mandatory)
Definition: DetElement.cpp:482
dd4hep::SensitiveDetector::verbose
bool verbose() const
Access flag to combine hist.
Definition: DetElement.cpp:459
dd4hep::DetElement::solid
Solid solid() const
Access to the shape of the detector element's placement.
Definition: DetElement.cpp:357
dd4hep::DetElementObject::updateCalls
UpdateCallbacks updateCalls
Placeholder for structure with update callbacks.
Definition: DetectorInterna.h:133
VolumeID
dd4hep::DDSegmentation::VolumeID VolumeID
Definition: SegmentationDictionary.h:50
dd4hep::DetElement::Children
std::map< std::string, DetElement > Children
Definition: DetElement.h:206
dd4hep::detail::tools::computeIdeal
void computeIdeal(Alignment alignment)
Compute the ideal/nominal to-world transformation from the detector element placement.
Definition: AlignmentTools.cpp:60
dd4hep::Handle< DetElementObject >::access
DetElementObject * access() const
Checked object access. Throws invalid handle runtime exception if invalid handle.
dd4hep::Handle< DetElementObject >::ptr
DetElementObject * ptr() const
Access to the held object.
Definition: Handle.h:153
dd4hep::DetElement::idealPlacement
PlacedVolume idealPlacement() const
Access to the ideal physical volume of this detector element.
Definition: DetElement.cpp:312
dd4hep::DetElement::addExtension
void * addExtension(ExtensionEntry *entry) const
Add an extension object to the detector element.
Definition: DetElement.cpp:65
dd4hep::DetElement::setVisAttributes
DetElement & setVisAttributes(const Detector &description, const std::string &name, const Volume &volume)
Set Visualization attributes to the detector element.
Definition: DetElement.cpp:361
dd4hep::SensitiveDetector::energyCutoff
double energyCutoff() const
Access energy cut off.
Definition: DetElement.cpp:436
dd4hep::Volume::setVisAttributes
const Volume & setVisAttributes(const VisAttr &obj) const
Set Visualization attributes to the volume.
Definition: Volumes.cpp:1156
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::DetElement::child
DetElement child(const std::string &name) const
Access to individual children by name.
Definition: DetElement.cpp:212
dd4hep::SensitiveDetectorObject::region
Region region
Definition: DetectorInterna.h:61
dd4hep::SensitiveDetector::readout
Readout readout() const
Access readout structure of the sensitive detector.
Definition: DetElement.cpp:420
dd4hep::PlacedVolume::volume
Volume volume() const
Logical volume of this placement.
Definition: Volumes.cpp:468
dd4hep::DetElementObject::combineHits
int combineHits
Flag to process hits.
Definition: DetectorInterna.h:104
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::Readout
Handle to the implementation of the readout structure of a subdetector.
Definition: Readout.h:38
dd4hep::NamedObject::name
std::string name
The object name.
Definition: NamedObject.h:33
dd4hep::DetElement::id
int id() const
Get the detector identifier.
Definition: DetElement.cpp:169
dd4hep::Readout::idSpec
IDDescriptor idSpec() const
Access IDDescription structure.
Definition: Readout.cpp:112
dd4hep::detail::tools::copy
void copy(Alignment from, Alignment to)
Copy alignment object from source object.
Definition: AlignmentTools.cpp:43
dd4hep::SensitiveDetector::setRegion
SensitiveDetector & setRegion(Region reg)
Set the regional attributes to the sensitive detector.
Definition: DetElement.cpp:476
dd4hep::SensitiveDetector::setCombineHits
SensitiveDetector & setCombineHits(bool value)
Set flag to handle hits collection.
Definition: DetElement.cpp:464
AlignmentsInterna.h
dd4hep::DetElementObject::clone
virtual DetElementObject * clone(int new_id, int flag) const
Deep object copy to replicate DetElement trees e.g. for reflection.
Definition: DetectorInterna.cpp:98
dd4hep::SensitiveDetector::setLimitSet
SensitiveDetector & setLimitSet(LimitSet limits)
Set the limits to the sensitive detector.
Definition: DetElement.cpp:487
dd4hep::DetElement::world
DetElement world() const
Access to the world object. Only possible once the geometry is closed.
Definition: DetElement.cpp:245
dd4hep::DetElement::survey
Alignment survey() const
Access to the constant survey alignment information.
Definition: DetElement.cpp:198
dd4hep::DetElementObject::key
unsigned int key
Access hash key of this detector element (Only valid once geometry is closed!)
Definition: DetectorInterna.h:110
dd4hep::SensitiveDetectorObject::verbose
int verbose
Definition: DetectorInterna.h:57
Printout.h
dd4hep::SensitiveDetector::extension
IFACE * extension() const
Access extension element by the type.
Definition: DetElement.h:157
dd4hep::DetElement::Processor::Processor
Processor()
Default constructor.
Definition: DetElement.cpp:31
dd4hep::ObjectExtensions::addExtension
void * addExtension(unsigned long long int key, ExtensionEntry *entry)
Add an extension object to the detector element.
Definition: ObjectExtensions.cpp:67
dd4hep::SensitiveDetector::setType
SensitiveDetector & setType(const std::string &typ)
Set detector type (structure, tracker, calorimeter, etc.).
Definition: DetElement.cpp:403
dd4hep::ObjectExtensions::extension
void * extension(unsigned long long int key, bool alert) const
Access an existing extension object from the detector element.
Definition: ObjectExtensions.cpp:119
dd4hep::ExtensionEntry::hash64
virtual unsigned long long int hash64() const =0
Hash value.
dd4hep::DetElementObject::path
std::string path
Full path to this detector element. May be invalid.
Definition: DetectorInterna.h:112
dd4hep::SensitiveDetectorObject::hitsCollection
std::string hitsCollection
Definition: DetectorInterna.h:63