DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
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 #include <iomanip>
33 
34 using namespace dd4hep;
35 
37 Author::Author(Detector& /* description */) {
38  m_element = new NamedObject("", "author");
39 }
40 
42 std::string Author::authorName() const {
43  return m_element->GetName();
44 }
45 
47 void Author::setAuthorName(const std::string& nam) {
48  m_element->SetName(nam.c_str());
49 }
50 
52 std::string Author::authorEmail() const {
53  return m_element->GetTitle();
54 }
55 
57 void Author::setAuthorEmail(const std::string& addr) {
58  m_element->SetTitle(addr.c_str());
59 }
60 
62 Header::Header(const std::string& author_name, const std::string& descr_url) {
63  Object* obj_ptr = new Object();
64  assign(obj_ptr, author_name, descr_url);
65 }
66 
68 const std::string Header::name() const {
69  return m_element->GetName();
70 }
71 
73 void Header::setName(const std::string& new_name) {
74  m_element->SetName(new_name.c_str());
75 }
76 
78 const std::string Header::title() const {
79  return m_element->GetTitle();
80 }
81 
83 void Header::setTitle(const std::string& new_title) {
84  m_element->SetTitle(new_title.c_str());
85 }
86 
88 const std::string& Header::url() const {
89  return data<Object>()->url;
90 }
91 
93 void Header::setUrl(const std::string& new_url) {
94  data<Object>()->url = new_url;
95 }
96 
98 const std::string& Header::author() const {
99  return data<Object>()->author;
100 }
101 
103 void Header::setAuthor(const std::string& new_author) {
104  data<Object>()->author = new_author;
105 }
106 
108 const std::string& Header::status() const {
109  return data<Object>()->status;
110 }
111 
113 void Header::setStatus(const std::string& new_status) {
114  data<Object>()->status = new_status;
115 }
116 
118 const std::string& Header::version() const {
119  return data<Object>()->version;
120 }
121 
123 void Header::setVersion(const std::string& new_version) {
124  data<Object>()->version = new_version;
125 }
126 
128 const std::string& Header::comment() const {
129  return data<Object>()->comment;
130 }
131 
133 void Header::setComment(const std::string& new_comment) {
134  data<Object>()->comment = new_comment;
135 }
136 
138 Constant::Constant(const std::string& nam, const std::string& val, const std::string& typ) {
139  m_element = new Object(nam, val, typ);
140 }
141 
143 Constant::Constant(const std::string& nam) {
144  m_element = new Object(nam.c_str(), "", "number");
145 }
146 
148 std::string Constant::dataType() const {
149  if ( isValid() ) {
150  return m_element->dataType;
151  }
152  throw std::runtime_error("dd4hep: Attempt to access internals from invalid Constant handle!");
153 }
154 
156 std::string Constant::toString() const {
157  std::stringstream os;
158  os << m_element->GetName() << " \"" << m_element->GetTitle() << "\" ";
159  if ( m_element->dataType == "string" ) os << "Value:" << m_element->GetTitle();
160  else os << "Value:" << _toDouble(m_element->GetTitle());
161  return os.str();
162 }
163 
165 Atom::Atom(const std::string& nam, const std::string& formula, int Z, int N, double density) {
166  TGeoElementTable* t = TGeoElement::GetElementTable();
167  TGeoElement* e = t->FindElement(nam.c_str());
168  if (!e) {
169  t->AddElement(nam.c_str(), formula.c_str(), Z, N, density);
170  e = t->FindElement(nam.c_str());
171  }
172  m_element = e;
173 }
174 
176 double Material::Z() const {
177  Handle < TGeoMedium > val(*this);
178  if (val.isValid()) {
179  TGeoMaterial* mat = val->GetMaterial();
180  if ( mat )
181  return mat->GetZ();
182  throw std::runtime_error("dd4hep: The medium " + std::string(val->GetName()) + " has an invalid material reference!");
183  }
184  throw std::runtime_error("dd4hep: Attempt to access proton number from invalid material handle!");
185 }
186 
188 double Material::A() const {
189  if ( isValid() ) {
190  TGeoMaterial* mat = ptr()->GetMaterial();
191  if ( mat )
192  return mat->GetA();
193  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
194  }
195  throw std::runtime_error("dd4hep: Attempt to access atomic number from invalid material handle!");
196 }
197 
199 double Material::density() const {
200  if ( isValid() ) {
201  TGeoMaterial* mat = ptr()->GetMaterial();
202  if ( mat )
203  return mat->GetDensity();
204  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
205  }
206  throw std::runtime_error("dd4hep: Attempt to access density from invalid material handle!");
207 }
208 
210 double Material::radLength() const {
211  if ( isValid() ) {
212  TGeoMaterial* mat = ptr()->GetMaterial();
213  if ( mat )
214  return mat->GetRadLen();
215  throw std::runtime_error("dd4hep: The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
216  }
217  throw std::runtime_error("dd4hep: Attempt to access radiation length from invalid material handle!");
218 }
219 
221 double Material::intLength() const {
222  if ( isValid() ) {
223  TGeoMaterial* mat = ptr()->GetMaterial();
224  if ( mat )
225  return mat->GetIntLen();
226  throw std::runtime_error("The medium " + std::string(ptr()->GetName()) + " has an invalid material reference!");
227  }
228  throw std::runtime_error("Attempt to access interaction length from invalid material handle!");
229 }
230 
232 double Material::fraction(Atom atom) const {
233  double frac = 0e0, tot = 0e0;
234  TGeoElement* elt = atom.access();
235  TGeoMaterial* mat = access()->GetMaterial();
236  for ( int i=0, n=mat->GetNelements(); i<n; ++i ) {
237  TGeoElement* e = mat->GetElement(i);
238  if ( mat->IsMixture() ) {
239  TGeoMixture* mix = (TGeoMixture*)mat;
240  tot += mix->GetWmixt()[i];
241  }
242  else {
243  tot = 1e0;
244  }
245  if ( e == elt ) {
246  if ( mat->IsMixture() ) {
247  TGeoMixture* mix = (TGeoMixture*)mat;
248  frac += mix->GetWmixt()[i];
249  }
250  else {
251  frac = 1e0;
252  }
253  }
254  }
255  return tot>1e-20 ? frac/tot : 0.0;
256 }
257 
259 Material::Property Material::property(const char* nam) const {
260  return access()->GetMaterial()->GetProperty(nam);
261 }
262 
264 Material::Property Material::property(const std::string& nam) const {
265  return access()->GetMaterial()->GetProperty(nam.c_str());
266 }
267 
269 std::string Material::propertyRef(const std::string& name, const std::string& default_value) {
270  auto* o = access()->GetMaterial();
271  const char* p = o->GetPropertyRef(name.c_str());
272  if ( p ) return p;
273  return default_value;
274 }
275 
277 double Material::constProperty(const std::string& nam) const {
278  Bool_t err = kFALSE;
279  auto* o = access()->GetMaterial();
280  double value = o->GetConstProperty(nam.c_str(), &err);
281  if ( err != kTRUE ) return value;
282  throw std::runtime_error("Attempt to access non existing material const property: "+nam);
283 }
284 
286 std::string Material::constPropertyRef(const std::string& name, const std::string& default_value) {
287  auto* o = access()->GetMaterial();
288  const char* p = o->GetConstPropertyRef(name.c_str());
289  if ( p ) return p;
290  return default_value;
291 }
292 
294 std::string Material::toString() const {
295  if ( isValid() ) {
296  TGeoMedium* val = ptr();
297  std::stringstream out;
298  out << val->GetName() << " " << val->GetTitle()
299  << " id:" << std::hex << val->GetId()
300  << " Pointer:" << val->GetPointerName();
301  return out.str();
302  }
303  throw std::runtime_error("Attempt to convert invalid material handle to string!");
304 }
305 
307 VisAttr::VisAttr(const std::string& nam) {
308  Object* obj = new Object();
309  assign(obj, nam, "vis");
310  obj->color = gROOT->GetColor(kWhite);
311  obj->alpha = 0.9f;
314  setShowDaughters(true);
315  setColor(1e0, 1e0, 1e0, 1e0);
316 }
317 
319 VisAttr::VisAttr(const char* nam) {
320  Object* obj = new Object();
321  assign(obj, nam, "vis");
322  obj->color = gROOT->GetColor(kWhite);
323  obj->alpha = 0.9f;
326  setShowDaughters(true);
327  setColor(1e0, 1e0, 1e0, 1e0);
328 }
329 
332  return object<Object>().showDaughters;
333 }
334 
336 void VisAttr::setShowDaughters(bool value) {
337  object<Object>().showDaughters = value;
338 }
339 
341 bool VisAttr::visible() const {
342  return object<Object>().visible;
343 }
344 
346 void VisAttr::setVisible(bool value) {
347  object<Object>().visible = value;
348 }
349 
351 int VisAttr::lineStyle() const {
352  return object<Object>().lineStyle;
353 }
354 
356 void VisAttr::setLineStyle(int value) {
357  object<Object>().lineStyle = value;
358 }
359 
362  return object<Object>().drawingStyle;
363 }
364 
366 void VisAttr::setDrawingStyle(int value) {
367  object<Object>().drawingStyle = value;
368 }
369 
371 float VisAttr::alpha() const {
372  return object<Object>().alpha;
373 }
374 
376 int VisAttr::color() const {
377  return object<Object>().color->GetNumber();
378 }
379 
381 void VisAttr::setColor(float alpha, float red, float green, float blue) {
382  Object& o = object<Object>();
383  Int_t col = TColor::GetColor(red, green, blue);
384  o.alpha = alpha;
385  o.color = gROOT->GetColor(col);
386  if ( !o.color ) {
387  except("VisAttr","+++ %s Failed to allocate Color: r:%02X g:%02X b:%02X",
388  this->name(), int(red*255.), int(green*255.), int(blue*255));
389  }
390  o.colortr = new TColor(gROOT->GetListOfColors()->GetLast()+1,
391  o.color->GetRed(), o.color->GetGreen(), o.color->GetBlue());
392  o.colortr->SetAlpha(alpha);
393 }
394 
396 bool VisAttr::rgb(float& red, float& green, float& blue) const {
397  Object& o = object<Object>();
398  if ( o.color ) {
399  o.color->GetRGB(red, green, blue);
400  return true;
401  }
402  return false;
403 }
404 
406 bool VisAttr::argb(float& alpha, float& red, float& green, float& blue) const {
407  Object& o = object<Object>();
408  if ( o.color ) {
409  alpha = o.alpha;
410  o.color->GetRGB(red, green, blue);
411  return true;
412  }
413  return false;
414 }
415 
417 std::string VisAttr::toString() const {
418  const VisAttr::Object* obj = &object<Object>();
419  TColor* c = obj->color;
420  char text[256];
421  std::snprintf(text, sizeof(text), "%-20s RGB:%-8s [%d] %7.2f Style:%d %d ShowDaughters:%3s Visible:%3s", ptr()->GetName(),
422  c->AsHexString(), c->GetNumber(), c->GetAlpha(), int(obj->drawingStyle), int(obj->lineStyle),
423  yes_no(obj->showDaughters), yes_no(obj->visible));
424  return text;
425 }
426 
428 bool Limit::operator==(const Limit& c) const {
429  return value == c.value && name == c.name && particles == c.particles;
430 }
431 
433 bool Limit::operator<(const Limit& c) const {
434  if (name < c.name)
435  return true;
436  if (value < c.value)
437  return true;
438  if (particles < c.particles)
439  return true;
440  return false;
441 }
442 
444 std::string Limit::toString() const {
445  std::string res = name + " = " + content;
446  if (!unit.empty())
447  res += unit + " ";
448  res += " (" + particles + ")";
449  return res;
450 }
451 
453 LimitSet::LimitSet(const std::string& nam) {
454  assign(new Object(), nam, "limitset");
455 }
456 
458 bool LimitSet::addLimit(const Limit& limit) {
459  std::pair<Object::iterator, bool> ret = data<Object>()->limits.insert(limit);
460  return ret.second;
461 }
462 
464 const std::set<Limit>& LimitSet::limits() const {
465  const Object* o = data<Object>();
466  return o->limits;
467 }
468 
470 bool LimitSet::addCut(const Limit& cut_obj) {
471  std::pair<Object::iterator, bool> ret = data<Object>()->cuts.insert(cut_obj);
472  return ret.second;
473 }
474 
476 const std::set<Limit>& LimitSet::cuts() const {
477  return data<Object>()->cuts;
478 }
479 
481 Region::Region(const std::string& nam) {
482  Object* p = new Object();
483  assign(p, nam, "region");
484  p->magic = magic_word();
485  p->store_secondaries = false;
486  p->threshold = 10.0;
487  p->cut = 10.0;
488  p->use_default_cut = true;
489  p->was_threshold_set = false;
490 }
491 
493  object<Object>().store_secondaries = value;
494  return *this;
495 }
496 
497 Region& Region::setThreshold(double value) {
498  object<Object>().threshold = value;
499  object<Object>().was_threshold_set = true;
500  return *this;
501 }
502 
503 Region& Region::setCut(double value) {
504  object<Object>().cut = value;
505  object<Object>().use_default_cut = false;
506  return *this;
507 }
508 
510 std::vector<std::string>& Region::limits() const {
511  return object<Object>().user_limits;
512 }
513 
515 double Region::cut() const {
516  return object<Object>().cut;
517 }
518 
520 double Region::threshold() const {
521  return object<Object>().threshold;
522 }
523 
526  return object<Object>().store_secondaries;
527 }
528 
529 bool Region::useDefaultCut() const {
530  return object<Object>().use_default_cut;
531 }
532 
534  return object<Object>().was_threshold_set;
535 }
536 
537 #undef setAttr
538 
539 #if 0
540 
546 struct IDSpec : public Ref_t {
548  template <typename Q>
549  IDSpec(const Handle<Q>& e) : Ref_t(e) {}
551  IDSpec(Detector& doc, const std::string& name, const IDDescriptor& dsc);
552  void addField(const std::string& name, const std::pair<int,int>& field);
553 };
554 
555 IDSpec::IDSpec(Detector& description, const std::string& name, const IDDescriptor& dsc)
556  : RefElement(doc,Tag_idspec,name)
557 {
558  const IDDescriptor::FieldIDs& f = dsc.ids();
559  const IDDescriptor::FieldMap& m = dsc.fields();
560  object<Object>().Attr_length = dsc.maxBit();
561  for(const auto& i : f ) {
562  const std::string& nam = i.second;
563  const pair<int,int>& fld = m.find(nam)->second;
564  addField(nam,fld);
565  }
566 }
567 
568 void IDSpec::addField(const std::string& name, const pair<int,int>& field) {
569  addField(Strng_t(name),field);
570 }
571 
572 void IDSpec::addField(const std::string& name, const pair<int,int>& field) {
573  Element e(document(),Tag_idfield);
574  e.object<Object>().Attr_signed = field.second<0;
575  e.object<Object>().Attr_label = name;
576  e.object<Object>().Attr_start = field.first;
577  e.object<Object>().Attr_length = abs(field.second);
578  m_element.append(e);
579 }
580 #endif
dd4hep::Header::setAuthor
void setAuthor(const std::string &new_author)
Accessor: set object author.
Definition: Objects.cpp:103
dd4hep::Author::setAuthorEmail
void setAuthorEmail(const std::string &addr)
Set the author's email address.
Definition: Objects.cpp:57
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:428
dd4hep::VisAttr::color
int color() const
Get object color.
Definition: Objects.cpp:376
dd4hep::Header::comment
const std::string & comment() const
Accessor to object comment.
Definition: Objects.cpp:128
dd4hep::LimitSet::cuts
const std::set< Limit > & cuts() const
Accessor to limits container.
Definition: Objects.cpp:476
dd4hep::Atom
Handle class describing an element in the periodic table.
Definition: Objects.h:242
dd4hep::Material::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:294
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:406
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:113
dd4hep::Region::wasThresholdSet
bool wasThresholdSet() const
Access was_threshold_set flag.
Definition: Objects.cpp:533
dd4hep::IDDescriptor::FieldMap
std::vector< std::pair< std::string, const Field * > > FieldMap
Definition: IDDescriptor.h:40
dd4hep::Handle< HeaderObject >::Object
HeaderObject Object
Extern accessible definition of the contained element type.
Definition: Handle.h:88
dd4hep::Header::title
const std::string title() const
Accessor to object title.
Definition: Objects.cpp:78
Detector.h
dd4hep::Limit::particles
std::string particles
Particle the limit should be applied to.
Definition: Objects.h:392
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:259
dd4hep::Author::Author
Author()=default
Default constructor.
dd4hep::Material::Property
const TGDMLMatrix * Property
Definition: Objects.h:274
dd4hep::VisAttr::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:417
dd4hep::Region::setStoreSecondaries
Region & setStoreSecondaries(bool value)
Set flag to store secondaries.
Definition: Objects.cpp:492
dd4hep::Region::storeSecondaries
bool storeSecondaries() const
Access secondaries flag.
Definition: Objects.cpp:525
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:503
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:464
dd4hep::Header::setComment
void setComment(const std::string &new_comment)
Accessor: set object comment.
Definition: Objects.cpp:133
dd4hep::Limit
Small object describing a limit structure acting on a particle type.
Definition: Objects.h:389
dd4hep::IDDescriptor
Class implementing the ID encoding of the detector response.
Definition: IDDescriptor.h:37
dd4hep::Limit::toString
std::string toString() const
Conversion to a string representation.
Definition: Objects.cpp:444
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:336
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:286
dd4hep::Handle< ConstantObject >::isValid
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:128
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:53
dd4hep::VisAttr::setLineStyle
void setLineStyle(int style)
Set line style.
Definition: Objects.cpp:356
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:269
dd4hep::Header::url
const std::string & url() const
Accessor to object url.
Definition: Objects.cpp:88
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:93
dd4hep::Region::limits
std::vector< std::string > & limits() const
Access references to user limits.
Definition: Objects.cpp:510
dd4hep::Material::intLength
double intLength() const
Access the interaction length of the underlying material.
Definition: Objects.cpp:221
dd4hep::Material::A
double A() const
atomic number of the underlying material
Definition: Objects.cpp:188
dd4hep::Material::fraction
double fraction(Atom atom) const
Access the fraction of an element within the material.
Definition: Objects.cpp:232
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:371
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:199
dd4hep::Constant::dataType
std::string dataType() const
Access the constant.
Definition: Objects.cpp:148
dd4hep::Header::name
const std::string name() const
Accessor to object name.
Definition: Objects.cpp:68
dd4hep::VisAttr::lineStyle
int lineStyle() const
Get line style.
Definition: Objects.cpp:351
dd4hep::VisAttr::drawingStyle
int drawingStyle() const
Get drawing style.
Definition: Objects.cpp:361
dd4hep::VisAttr::showDaughters
bool showDaughters() const
Get Flag to show/hide daughter elements.
Definition: Objects.cpp:331
dd4hep::VisAttr::setDrawingStyle
void setDrawingStyle(int style)
Set drawing style.
Definition: Objects.cpp:366
dd4hep::Region::threshold
double threshold() const
Access production threshold.
Definition: Objects.cpp:520
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:83
dd4hep::VisAttr::setVisible
void setVisible(bool value)
Set visibility flag.
Definition: Objects.cpp:346
dd4hep::Limit::name
std::string name
Limit name.
Definition: Objects.h:394
dd4hep::Author::setAuthorName
void setAuthorName(const std::string &nam)
Set the author's name.
Definition: Objects.cpp:47
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:277
dd4hep::Material::Z
double Z() const
proton number of the underlying material
Definition: Objects.cpp:176
dd4hep::IDDescriptor::FieldIDs
std::vector< std::pair< size_t, std::string > > FieldIDs
Definition: IDDescriptor.h:41
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:98
dd4hep::Region
Handle class describing a region as used in simulation.
Definition: Objects.h:462
dd4hep::VisAttr::rgb
bool rgb(float &red, float &green, float &blue) const
Get RGB values of the color (if valid)
Definition: Objects.cpp:396
dd4hep::Header::setName
void setName(const std::string &new_name)
Accessor: set object name.
Definition: Objects.cpp:73
dd4hep::Handle< NamedObject >::m_element
NamedObject * m_element
Single and only data member: Reference to the actual element.
Definition: Handle.h:93
dd4hep::Limit::content
std::string content
Content.
Definition: Objects.h:398
dd4hep::Limit::unit
std::string unit
Units.
Definition: Objects.h:396
dd4hep::Author::authorName
std::string authorName() const
Access the auhor's name.
Definition: Objects.cpp:42
dd4hep::Limit::value
double value
Double value.
Definition: Objects.h:400
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:515
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:470
dd4hep::Constant::toString
std::string toString() const
String representation of this object.
Definition: Objects.cpp:156
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:341
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:433
dd4hep::VisAttr::SOLID
@ SOLID
Definition: Objects.h:327
dd4hep::Handle< TGeoMedium >::ptr
TGeoMedium * ptr() const
Access to the held object.
Definition: Handle.h:153
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:529
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:210
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:108
InstanceCount.h
dd4hep::VisAttr::setColor
void setColor(float alpha, float red, float green, float blue)
Set object color.
Definition: Objects.cpp:381
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:458
dd4hep::Header::setVersion
void setVersion(const std::string &new_version)
Accessor: set object version.
Definition: Objects.cpp:123
Printout.h
dd4hep::VisAttr::VisAttr
VisAttr()=default
Default constructor.
dd4hep::Header::version
const std::string & version() const
Accessor to object version.
Definition: Objects.cpp:118
dd4hep::Author::authorEmail
std::string authorEmail() const
Access the auhor's email address.
Definition: Objects.cpp:52
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:497