DD4hep  1.31.0
Detector Description Toolkit for High Energy Physics
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Objects.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
15 #include <DD4hep/Detector.h>
16 #include <DD4hep/Printout.h>
17 #include <DD4hep/IDDescriptor.h>
18 #include <DD4hep/InstanceCount.h>
20 
21 #include <TMap.h>
22 #include <TROOT.h>
23 #include <TColor.h>
24 #include <TGeoMatrix.h>
25 #include <TGeoManager.h>
26 #include <TGeoElement.h>
27 #include <TGeoMaterial.h>
28 
29 // C/C++ include files
30 #include <cmath>
31 #include <sstream>
32 
33 using namespace dd4hep;
34 
36 Author::Author(Detector& /* description */) {
37  m_element = new NamedObject("", "author");
38 }
39 
41 std::string Author::authorName() const {
42  return m_element->GetName();
43 }
44 
46 void Author::setAuthorName(const std::string& nam) {
47  m_element->SetName(nam.c_str());
48 }
49 
51 std::string Author::authorEmail() const {
52  return m_element->GetTitle();
53 }
54 
56 void Author::setAuthorEmail(const std::string& addr) {
57  m_element->SetTitle(addr.c_str());
58 }
59 
61 Header::Header(const std::string& author_name, const std::string& descr_url) {
62  Object* obj_ptr = new Object();
63  assign(obj_ptr, author_name, descr_url);
64 }
65 
67 const std::string Header::name() const {
68  return m_element->GetName();
69 }
70 
72 void Header::setName(const std::string& new_name) {
73  m_element->SetName(new_name.c_str());
74 }
75 
77 const std::string Header::title() const {
78  return m_element->GetTitle();
79 }
80 
82 void Header::setTitle(const std::string& new_title) {
83  m_element->SetTitle(new_title.c_str());
84 }
85 
87 const std::string& Header::url() const {
88  return data<Object>()->url;
89 }
90 
92 void Header::setUrl(const std::string& new_url) {
93  data<Object>()->url = new_url;
94 }
95 
97 const std::string& Header::author() const {
98  return data<Object>()->author;
99 }
100 
102 void Header::setAuthor(const std::string& new_author) {
103  data<Object>()->author = new_author;
104 }
105 
107 const std::string& Header::status() const {
108  return data<Object>()->status;
109 }
110 
112 void Header::setStatus(const std::string& new_status) {
113  data<Object>()->status = new_status;
114 }
115 
117 const std::string& Header::version() const {
118  return data<Object>()->version;
119 }
120 
122 void Header::setVersion(const std::string& new_version) {
123  data<Object>()->version = new_version;
124 }
125 
127 const std::string& Header::comment() const {
128  return data<Object>()->comment;
129 }
130 
132 void Header::setComment(const std::string& new_comment) {
133  data<Object>()->comment = new_comment;
134 }
135 
137 Constant::Constant(const std::string& nam, const std::string& val, const std::string& typ) {
138  m_element = new Object(nam, val, typ);
139 }
140 
142 Constant::Constant(const std::string& nam) {
143  m_element = new Object(nam.c_str(), "", "number");
144 }
145 
147 std::string Constant::dataType() const {
148  if ( isValid() ) {
149  return m_element->dataType;
150  }
151  throw std::runtime_error("dd4hep: Attempt to access internals from invalid Constant handle!");
152 }
153 
155 std::string Constant::toString() const {
156  std::stringstream os;
157  os << m_element->GetName() << " \"" << m_element->GetTitle() << "\" ";
158  if ( m_element->dataType == "string" ) os << "Value:" << m_element->GetTitle();
159  else os << "Value:" << _toDouble(m_element->GetTitle());
160  return os.str();
161 }
162 
164 Atom::Atom(const std::string& nam, const std::string& formula, int Z, int N, double density) {
165  TGeoElementTable* t = TGeoElement::GetElementTable();
166  TGeoElement* e = t->FindElement(nam.c_str());
167  if (!e) {
168  t->AddElement(nam.c_str(), formula.c_str(), Z, N, density);
169  e = t->FindElement(nam.c_str());
170  }
171  m_element = e;
172 }
173 
175 double Material::Z() const {
176  Handle < TGeoMedium > val(*this);
177  if (val.isValid()) {
178  TGeoMaterial* mat = val->GetMaterial();
179  if ( mat )
180  return mat->GetZ();
181  throw std::runtime_error("dd4hep: The medium " + std::string(val->GetName()) + " has an invalid material reference!");
182  }
183  throw std::runtime_error("dd4hep: Attempt to access proton number from invalid material handle!");
184 }
185 
187 double Material::A() const {
188  if ( isValid() ) {
189  TGeoMaterial* mat = ptr()->GetMaterial();
190  if ( mat )
191  return mat->GetA();
192  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
193  }
194  throw std::runtime_error("dd4hep: Attempt to access atomic number from invalid material handle!");
195 }
196 
198 double Material::density() const {
199  if ( isValid() ) {
200  TGeoMaterial* mat = ptr()->GetMaterial();
201  if ( mat )
202  return mat->GetDensity();
203  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
204  }
205  throw std::runtime_error("dd4hep: Attempt to access density from invalid material handle!");
206 }
207 
209 double Material::radLength() const {
210  if ( isValid() ) {
211  TGeoMaterial* mat = ptr()->GetMaterial();
212  if ( mat )
213  return mat->GetRadLen();
214  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
215  }
216  throw std::runtime_error("dd4hep: Attempt to access radiation length from invalid material handle!");
217 }
218 
220 double Material::intLength() const {
221  if ( isValid() ) {
222  TGeoMaterial* mat = ptr()->GetMaterial();
223  if ( mat )
224  return mat->GetIntLen();
225  throw std::runtime_error("The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
226  }
227  throw std::runtime_error("Attempt to access interaction length from invalid material handle!");
228 }
229 
231 double Material::fraction(Atom atom) const {
232  double frac = 0e0, tot = 0e0;
233  TGeoElement* elt = atom.access();
234  TGeoMaterial* mat = access()->GetMaterial();
235  for ( int i=0, n=mat->GetNelements(); i<n; ++i ) {
236  TGeoElement* e = mat->GetElement(i);
237  if ( mat->IsMixture() ) {
238  TGeoMixture* mix = (TGeoMixture*)mat;
239  tot += mix->GetWmixt()[i];
240  }
241  else {
242  tot = 1e0;
243  }
244  if ( e == elt ) {
245  if ( mat->IsMixture() ) {
246  TGeoMixture* mix = (TGeoMixture*)mat;
247  frac += mix->GetWmixt()[i];
248  }
249  else {
250  frac = 1e0;
251  }
252  }
253  }
254  return tot>1e-20 ? frac/tot : 0.0;
255 }
256 
258 Material::Property Material::property(const char* nam) const {
259  return access()->GetMaterial()->GetProperty(nam);
260 }
261 
263 Material::Property Material::property(const std::string& nam) const {
264  return access()->GetMaterial()->GetProperty(nam.c_str());
265 }
266 
268 std::string Material::propertyRef(const std::string& name, const std::string& default_value) {
269  auto* o = access()->GetMaterial();
270  const char* p = o->GetPropertyRef(name.c_str());
271  if ( p ) return p;
272  return default_value;
273 }
274 
276 double Material::constProperty(const std::string& nam) const {
277  Bool_t err = kFALSE;
278  auto* o = access()->GetMaterial();
279  double value = o->GetConstProperty(nam.c_str(), &err);
280  if ( err != kTRUE ) return value;
281  throw std::runtime_error("Attempt to access non existing material const property: "+nam);
282 }
283 
285 std::string Material::constPropertyRef(const std::string& name, const std::string& default_value) {
286  auto* o = access()->GetMaterial();
287  const char* p = o->GetConstPropertyRef(name.c_str());
288  if ( p ) return p;
289  return default_value;
290 }
291 
293 std::string Material::toString() const {
294  if ( isValid() ) {
295  TGeoMedium* val = ptr();
296  std::stringstream out;
297  out << val->GetName() << " " << val->GetTitle()
298  << " id:" << std::hex << val->GetId()
299  << " Pointer:" << val->GetPointerName();
300  return out.str();
301  }
302  throw std::runtime_error("Attempt to convert invalid material handle to string!");
303 }
304 
306 VisAttr::VisAttr(const std::string& nam) {
307  Object* obj = new Object();
308  assign(obj, nam, "vis");
309  obj->color = gROOT->GetColor(kWhite);
310  obj->alpha = 0.9f;
313  setShowDaughters(true);
314  setColor(1e0, 1e0, 1e0, 1e0);
315 }
316 
318 VisAttr::VisAttr(const char* nam) {
319  Object* obj = new Object();
320  assign(obj, nam, "vis");
321  obj->color = gROOT->GetColor(kWhite);
322  obj->alpha = 0.9f;
325  setShowDaughters(true);
326  setColor(1e0, 1e0, 1e0, 1e0);
327 }
328 
331  return object<Object>().showDaughters;
332 }
333 
335 void VisAttr::setShowDaughters(bool value) {
336  object<Object>().showDaughters = value;
337 }
338 
340 bool VisAttr::visible() const {
341  return object<Object>().visible;
342 }
343 
345 void VisAttr::setVisible(bool value) {
346  object<Object>().visible = value;
347 }
348 
350 int VisAttr::lineStyle() const {
351  return object<Object>().lineStyle;
352 }
353 
355 void VisAttr::setLineStyle(int value) {
356  object<Object>().lineStyle = value;
357 }
358 
361  return object<Object>().drawingStyle;
362 }
363 
365 void VisAttr::setDrawingStyle(int value) {
366  object<Object>().drawingStyle = value;
367 }
368 
370 float VisAttr::alpha() const {
371  return object<Object>().alpha;
372 }
373 
375 int VisAttr::color() const {
376  return object<Object>().color->GetNumber();
377 }
378 
380 void VisAttr::setColor(float alpha, float red, float green, float blue) {
381  Object& o = object<Object>();
382  Int_t col = TColor::GetColor(red, green, blue);
383  o.alpha = alpha;
384  o.color = gROOT->GetColor(col);
385  if ( !o.color ) {
386  except("VisAttr","+++ %s Failed to allocate Color: r:%02X g:%02X b:%02X",
387  this->name(), int(red*255.), int(green*255.), int(blue*255));
388  }
389  o.colortr = new TColor(gROOT->GetListOfColors()->GetLast()+1,
390  o.color->GetRed(), o.color->GetGreen(), o.color->GetBlue());
391  o.colortr->SetAlpha(alpha);
392 }
393 
395 bool VisAttr::rgb(float& red, float& green, float& blue) const {
396  Object& o = object<Object>();
397  if ( o.color ) {
398  o.color->GetRGB(red, green, blue);
399  return true;
400  }
401  return false;
402 }
403 
405 bool VisAttr::argb(float& alpha, float& red, float& green, float& blue) const {
406  Object& o = object<Object>();
407  if ( o.color ) {
408  alpha = o.alpha;
409  o.color->GetRGB(red, green, blue);
410  return true;
411  }
412  return false;
413 }
414 
416 std::string VisAttr::toString() const {
417  const VisAttr::Object* obj = &object<Object>();
418  TColor* c = obj->color;
419  char text[256];
420  std::snprintf(text, sizeof(text), "%-20s RGB:%-8s [%d] %7.2f Style:%d %d ShowDaughters:%3s Visible:%3s", ptr()->GetName(),
421  c->AsHexString(), c->GetNumber(), c->GetAlpha(), int(obj->drawingStyle), int(obj->lineStyle),
422  yes_no(obj->showDaughters), yes_no(obj->visible));
423  return text;
424 }
425 
427 bool Limit::operator==(const Limit& c) const {
428  return value == c.value && name == c.name && particles == c.particles;
429 }
430 
432 bool Limit::operator<(const Limit& c) const {
433  if (name < c.name)
434  return true;
435  if (value < c.value)
436  return true;
437  if (particles < c.particles)
438  return true;
439  return false;
440 }
441 
443 std::string Limit::toString() const {
444  std::string res = name + " = " + content;
445  if (!unit.empty())
446  res += unit + " ";
447  res += " (" + particles + ")";
448  return res;
449 }
450 
452 LimitSet::LimitSet(const std::string& nam) {
453  assign(new Object(), nam, "limitset");
454 }
455 
457 bool LimitSet::addLimit(const Limit& limit) {
458  std::pair<Object::iterator, bool> ret = data<Object>()->limits.insert(limit);
459  return ret.second;
460 }
461 
463 const std::set<Limit>& LimitSet::limits() const {
464  const Object* o = data<Object>();
465  return o->limits;
466 }
467 
469 bool LimitSet::addCut(const Limit& cut_obj) {
470  std::pair<Object::iterator, bool> ret = data<Object>()->cuts.insert(cut_obj);
471  return ret.second;
472 }
473 
475 const std::set<Limit>& LimitSet::cuts() const {
476  return data<Object>()->cuts;
477 }
478 
480 Region::Region(const std::string& nam) {
481  Object* p = new Object();
482  assign(p, nam, "region");
483  p->magic = magic_word();
484  p->store_secondaries = false;
485  p->threshold = 10.0;
486  p->cut = 10.0;
487  p->use_default_cut = true;
488  p->was_threshold_set = false;
489 }
490 
492  object<Object>().store_secondaries = value;
493  return *this;
494 }
495 
496 Region& Region::setThreshold(double value) {
497  object<Object>().threshold = value;
498  object<Object>().was_threshold_set = true;
499  return *this;
500 }
501 
502 Region& Region::setCut(double value) {
503  object<Object>().cut = value;
504  object<Object>().use_default_cut = false;
505  return *this;
506 }
507 
509 std::vector<std::string>& Region::limits() const {
510  return object<Object>().user_limits;
511 }
512 
514 double Region::cut() const {
515  return object<Object>().cut;
516 }
517 
519 double Region::threshold() const {
520  return object<Object>().threshold;
521 }
522 
525  return object<Object>().store_secondaries;
526 }
527 
528 bool Region::useDefaultCut() const {
529  return object<Object>().use_default_cut;
530 }
531 
533  return object<Object>().was_threshold_set;
534 }
535 
536 #undef setAttr
537 
538 #if 0
539 
545 struct IDSpec : public Ref_t {
547  template <typename Q>
548  IDSpec(const Handle<Q>& e) : Ref_t(e) {}
550  IDSpec(Detector& doc, const std::string& name, const IDDescriptor& dsc);
551  void addField(const std::string& name, const std::pair<int,int>& field);
552 };
553 
554 IDSpec::IDSpec(Detector& description, const std::string& name, const IDDescriptor& dsc)
555  : RefElement(doc,Tag_idspec,name)
556 {
557  const IDDescriptor::FieldIDs& f = dsc.ids();
558  const IDDescriptor::FieldMap& m = dsc.fields();
559  object<Object>().Attr_length = dsc.maxBit();
560  for(const auto& i : f ) {
561  const std::string& nam = i.second;
562  const pair<int,int>& fld = m.find(nam)->second;
563  addField(nam,fld);
564  }
565 }
566 
567 void IDSpec::addField(const std::string& name, const pair<int,int>& field) {
568  addField(Strng_t(name),field);
569 }
570 
571 void IDSpec::addField(const std::string& name, const pair<int,int>& field) {
572  Element e(document(),Tag_idfield);
573  e.object<Object>().Attr_signed = field.second<0;
574  e.object<Object>().Attr_label = name;
575  e.object<Object>().Attr_start = field.first;
576  e.object<Object>().Attr_length = abs(field.second);
577  m_element.append(e);
578 }
579 #endif
dd4hep::Header::setAuthor
void setAuthor(const std::string &new_author)
Accessor: set object author.
Definition: Objects.cpp:102
dd4hep::Author::setAuthorEmail
void setAuthorEmail(const std::string &addr)
Set the author's email address.
Definition: Objects.cpp:56
dd4hep::RegionObject::was_threshold_set
bool was_threshold_set
Definition: ObjectsInterna.h:118
dd4hep::Limit::operator==
bool operator==(const Limit &c) const
Equality operator.
Definition: Objects.cpp:427
dd4hep::VisAttr::color
int color() const
Get object color.
Definition: Objects.cpp:375
dd4hep::Header::comment
const std::string & comment() const
Accessor to object comment.
Definition: Objects.cpp:127
dd4hep::LimitSet::cuts
const std::set< Limit > & cuts() const
Accessor to limits container.
Definition: Objects.cpp:475
dd4hep::Atom
Handle class describing an element in the periodic table.
Definition: Objects.h:241
dd4hep::Material::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:293
dd4hep::VisAttr::argb
bool argb(float &alpha, float &red, float &green, float &blue) const
Get alpha and RGB values of the color (if valid)
Definition: Objects.cpp:405
dd4hep::VisAttrObject::colortr
TColor * colortr
Definition: ObjectsInterna.h:92
dd4hep::HeaderObject
Concrete object implementation for the Header handle.
Definition: ObjectsInterna.h:39
dd4hep::Header::setStatus
void setStatus(const std::string &new_status)
Accessor: set object status.
Definition: Objects.cpp:112
dd4hep::Region::wasThresholdSet
bool wasThresholdSet() const
Access was_threshold_set flag.
Definition: Objects.cpp:532
dd4hep::IDDescriptor::FieldMap
std::vector< std::pair< std::string, const Field * > > FieldMap
Definition: IDDescriptor.h:39
dd4hep::Handle< HeaderObject >::Object
HeaderObject Object
Extern accessible definition of the contained element type.
Definition: Handle.h:86
dd4hep::Header::title
const std::string title() const
Accessor to object title.
Definition: Objects.cpp:77
Detector.h
dd4hep::Limit::particles
std::string particles
Particle the limit should be applied to.
Definition: Objects.h:391
dd4hep::RegionObject::use_default_cut
bool use_default_cut
Definition: ObjectsInterna.h:117
dd4hep::Material::property
Property property(const char *name) const
Access to tabular properties of the material.
Definition: Objects.cpp:258
dd4hep::Author::Author
Author()=default
Default constructor.
dd4hep::Material::Property
const TGDMLMatrix * Property
Definition: Objects.h:273
dd4hep::VisAttr::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:416
dd4hep::Region::setStoreSecondaries
Region & setStoreSecondaries(bool value)
Set flag to store secondaries.
Definition: Objects.cpp:491
dd4hep::Region::storeSecondaries
bool storeSecondaries() const
Access secondaries flag.
Definition: Objects.cpp:524
dd4hep::IDDescriptor::maxBit
unsigned maxBit() const
The total number of encoding bits for this descriptor.
Definition: IDDescriptor.cpp:73
dd4hep::Region::setCut
Region & setCut(double value)
Set default production cut.
Definition: Objects.cpp:502
dd4hep::NamedObject::GetName
const char * GetName() const
Access name.
Definition: NamedObject.h:58
dd4hep::Region::Region
Region()=default
Default constructor.
dd4hep::LimitSet::limits
const std::set< Limit > & limits() const
Accessor to limits container.
Definition: Objects.cpp:463
dd4hep::Header::setComment
void setComment(const std::string &new_comment)
Accessor: set object comment.
Definition: Objects.cpp:132
dd4hep::Limit
Small object describing a limit structure acting on a particle type.
Definition: Objects.h:388
dd4hep::IDDescriptor
Class implementing the ID encoding of the detector response.
Definition: IDDescriptor.h:36
dd4hep::Limit::toString
std::string toString() const
Conversion to a string representation.
Definition: Objects.cpp:443
dd4hep::RegionObject::cut
double cut
Definition: ObjectsInterna.h:115
dd4hep::VisAttr::setShowDaughters
void setShowDaughters(bool value)
Set Flag to show/hide daughter elements.
Definition: Objects.cpp:335
dd4hep::Material::constPropertyRef
std::string constPropertyRef(const std::string &name, const std::string &default_value="")
Access string property value from the material table.
Definition: Objects.cpp:285
dd4hep::Handle< ConstantObject >::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:126
dd4hep::Handle< TGeoMedium >
dd4hep::magic_word
unsigned long long int magic_word()
Access to the magic word, which is protecting some objects against memory corruptions.
Definition: Handle.h:51
dd4hep::VisAttr::setLineStyle
void setLineStyle(int style)
Set line style.
Definition: Objects.cpp:355
dd4hep::Material::propertyRef
std::string propertyRef(const std::string &name, const std::string &default_value="")
Access string property value from the material table.
Definition: Objects.cpp:268
dd4hep::Header::url
const std::string & url() const
Accessor to object url.
Definition: Objects.cpp:87
dd4hep::Handle< TGeoMedium >::name
const char * name() const
Access the object name (or "" if not supported by the object)
dd4hep::Header::setUrl
void setUrl(const std::string &new_url)
Accessor: set object url.
Definition: Objects.cpp:92
dd4hep::Region::limits
std::vector< std::string > & limits() const
Access references to user limits.
Definition: Objects.cpp:509
dd4hep::Material::intLength
double intLength() const
Access the interaction length of the underlying material.
Definition: Objects.cpp:220
dd4hep::Material::A
double A() const
atomic number of the underlying material
Definition: Objects.cpp:187
dd4hep::Material::fraction
double fraction(Atom atom) const
Access the fraction of an element within the material.
Definition: Objects.cpp:231
dd4hep::NamedObject::SetName
void SetName(const char *nam)
Set name (used by Handle)
Definition: NamedObject.h:62
dd4hep::VisAttr::alpha
float alpha() const
Get alpha value.
Definition: Objects.cpp:370
dd4hep::RegionObject::store_secondaries
bool store_secondaries
Definition: ObjectsInterna.h:116
dd4hep::Material::density
double density() const
density of the underlying material
Definition: Objects.cpp:198
dd4hep::Constant::dataType
std::string dataType() const
Access the constant.
Definition: Objects.cpp:147
dd4hep::Header::name
const std::string name() const
Accessor to object name.
Definition: Objects.cpp:67
dd4hep::VisAttr::lineStyle
int lineStyle() const
Get line style.
Definition: Objects.cpp:350
dd4hep::VisAttr::drawingStyle
int drawingStyle() const
Get drawing style.
Definition: Objects.cpp:360
dd4hep::VisAttr::showDaughters
bool showDaughters() const
Get Flag to show/hide daughter elements.
Definition: Objects.cpp:330
dd4hep::VisAttr::setDrawingStyle
void setDrawingStyle(int style)
Set drawing style.
Definition: Objects.cpp:365
dd4hep::Region::threshold
double threshold() const
Access production threshold.
Definition: Objects.cpp:519
dd4hep::Utilities::GetName
const char * GetName(T *p)
Definition: Utilities.h:45
dd4hep::VisAttrObject::showDaughters
unsigned char showDaughters
Definition: ObjectsInterna.h:96
dd4hep::VisAttrObject::lineStyle
unsigned char lineStyle
Definition: ObjectsInterna.h:95
dd4hep::Handle< HeaderObject >::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.
mix
#define mix(a, b, c)
Definition: Geant4EventSeed.h:113
dd4hep::Header::setTitle
void setTitle(const std::string &new_title)
Accessor: set object title.
Definition: Objects.cpp:82
dd4hep::VisAttr::setVisible
void setVisible(bool value)
Set visibility flag.
Definition: Objects.cpp:345
dd4hep::Limit::name
std::string name
Limit name.
Definition: Objects.h:393
dd4hep::Author::setAuthorName
void setAuthorName(const std::string &nam)
Set the author's name.
Definition: Objects.cpp:46
dd4hep::RegionObject
Concrete object implementation of the Region Handle.
Definition: ObjectsInterna.h:111
dd4hep::Material::constProperty
double constProperty(const std::string &name) const
Access to tabular properties of the material.
Definition: Objects.cpp:276
dd4hep::Material::Z
double Z() const
proton number of the underlying material
Definition: Objects.cpp:175
dd4hep::IDDescriptor::FieldIDs
std::vector< std::pair< size_t, std::string > > FieldIDs
Definition: IDDescriptor.h:40
dd4hep::VisAttrObject::color
TColor * color
Definition: ObjectsInterna.h:91
dd4hep::VisAttrObject::drawingStyle
unsigned char drawingStyle
Definition: ObjectsInterna.h:94
dd4hep::NamedObject::SetTitle
void SetTitle(const char *tit)
Set Title (used by Handle)
Definition: NamedObject.h:66
dd4hep::ConstantObject::dataType
std::string dataType
Constant type.
Definition: ObjectsInterna.h:67
dd4hep::Header::author
const std::string & author() const
Accessor to object author.
Definition: Objects.cpp:97
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:461
dd4hep::VisAttr::rgb
bool rgb(float &red, float &green, float &blue) const
Get RGB values of the color (if valid)
Definition: Objects.cpp:395
dd4hep::Header::setName
void setName(const std::string &new_name)
Accessor: set object name.
Definition: Objects.cpp:72
dd4hep::Handle::m_element
T * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:91
dd4hep::Limit::content
std::string content
Content.
Definition: Objects.h:397
dd4hep::Limit::unit
std::string unit
Units.
Definition: Objects.h:395
dd4hep::Author::authorName
std::string authorName() const
Access the auhor's name.
Definition: Objects.cpp:41
dd4hep::Limit::value
double value
Double value.
Definition: Objects.h:399
dd4hep::Atom::Atom
Atom()=default
Default constructor.
dd4hep::NamedObject::GetTitle
const char * GetTitle() const
Get name (used by Handle)
Definition: NamedObject.h:70
dd4hep::Region::cut
double cut() const
Access cut value.
Definition: Objects.cpp:514
dd4hep::LimitSet::addCut
bool addCut(const Limit &limit)
Add new limit. Returns true if the new limit was added, false if it already existed.
Definition: Objects.cpp:469
dd4hep::Constant::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:155
dd4hep::IDDescriptor::fields
const FieldMap & fields() const
Access the fieldmap container.
Definition: IDDescriptor.cpp:87
dd4hep::_toDouble
double _toDouble(const std::string &value)
String conversions: string to double value.
Definition: Handle.cpp:116
dd4hep::VisAttr::visible
bool visible() const
Get visibility flag.
Definition: Objects.cpp:340
dd4hep::Header::Header
Header()=default
Default constructor.
IDDescriptor.h
dd4hep::Handle::access
T * access() const
Checked object access. Throws invalid handle runtime exception if invalid handle.
dd4hep::Limit::operator<
bool operator<(const Limit &c) const
operator less
Definition: Objects.cpp:432
dd4hep::VisAttr::SOLID
@ SOLID
Definition: Objects.h:326
dd4hep::Handle< TGeoMedium >::ptr
TGeoMedium * ptr() const
Access to the held object.
Definition: Handle.h:151
ObjectsInterna.h
dd4hep::RegionObject::threshold
double threshold
Definition: ObjectsInterna.h:114
dd4hep::Region::useDefaultCut
bool useDefaultCut() const
Access use_default_cut flag.
Definition: Objects.cpp:528
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::NamedObject
Implementation of a named object.
Definition: NamedObject.h:30
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::LimitSetObject
Concrete object implementation of the LimitSet Handle.
Definition: ObjectsInterna.h:134
dd4hep::Material::radLength
double radLength() const
Access the radiation length of the underlying material.
Definition: Objects.cpp:209
dd4hep::LimitSetObject::limits
std::set< Limit > limits
Particle specific limits.
Definition: ObjectsInterna.h:141
dd4hep::Header::status
const std::string & status() const
Accessor to object status.
Definition: Objects.cpp:107
InstanceCount.h
dd4hep::VisAttr::setColor
void setColor(float alpha, float red, float green, float blue)
Set object color.
Definition: Objects.cpp:380
dd4hep::Constant::Constant
Constant()=default
Default constructor.
dd4hep::RegionObject::magic
unsigned long magic
Definition: ObjectsInterna.h:113
dd4hep::VisAttrObject::alpha
float alpha
Definition: ObjectsInterna.h:93
dd4hep::LimitSet::addLimit
bool addLimit(const Limit &limit)
Add new limit. Returns true if the new limit was added, false if it already existed.
Definition: Objects.cpp:457
dd4hep::Header::setVersion
void setVersion(const std::string &new_version)
Accessor: set object version.
Definition: Objects.cpp:122
Printout.h
dd4hep::VisAttr::VisAttr
VisAttr()=default
Default constructor.
dd4hep::Header::version
const std::string & version() const
Accessor to object version.
Definition: Objects.cpp:117
dd4hep::Author::authorEmail
std::string authorEmail() const
Access the auhor's email address.
Definition: Objects.cpp:51
dd4hep::VisAttrObject::visible
unsigned char visible
Definition: ObjectsInterna.h:97
dd4hep::IDDescriptor::ids
const FieldIDs & ids() const
Access the field-id container.
Definition: IDDescriptor.cpp:78
dd4hep::VisAttrObject
Concrete object implementation of the VisAttr Handle.
Definition: ObjectsInterna.h:88
dd4hep::LimitSet::LimitSet
LimitSet()=default
Constructor to be used when reading the already parsed DOM tree.
dd4hep::Region::setThreshold
Region & setThreshold(double value)
Set threshold in MeV.
Definition: Objects.cpp:496