Logo ROOT   6.12/07
Reference Guide
TGeoMaterial.cxx
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 25/10/01
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TGeoMaterial
13 \ingroup Geometry_classes
14 
15 Base class describing materials.
16 
17 \image html geom_material.jpg
18 */
19 
20 #include "Riostream.h"
21 #include "TMath.h"
22 #include "TObjArray.h"
23 #include "TStyle.h"
24 #include "TList.h"
25 #include "TGeoManager.h"
26 #include "TGeoExtension.h"
27 #include "TGeoMaterial.h"
28 #include "TGeoPhysicalConstants.h"
29 
30 // statics and globals
31 
33 
34 ////////////////////////////////////////////////////////////////////////////////
35 /// Default constructor
36 
38  :TNamed(), TAttFill(),
39  fIndex(0),
40  fA(0.),
41  fZ(0.),
42  fDensity(0.),
43  fRadLen(0.),
44  fIntLen(0.),
45  fTemperature(0.),
46  fPressure(0.),
47  fState(kMatStateUndefined),
48  fShader(NULL),
49  fCerenkov(NULL),
50  fElement(NULL),
51  fUserExtension(0),
52  fFWExtension(0)
53 {
54  SetUsed(kFALSE);
55  fIndex = -1;
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// constructor
63 
65  :TNamed(name, ""), TAttFill(),
66  fIndex(0),
67  fA(0.),
68  fZ(0.),
69  fDensity(0.),
70  fRadLen(0.),
71  fIntLen(0.),
72  fTemperature(0.),
73  fPressure(0.),
75  fShader(NULL),
76  fCerenkov(NULL),
77  fElement(NULL),
78  fUserExtension(0),
79  fFWExtension(0)
80 {
81  fName = fName.Strip();
82  SetUsed(kFALSE);
83  fIndex = -1;
87 
88  if (!gGeoManager) {
89  gGeoManager = new TGeoManager("Geometry", "default geometry");
90  }
91  gGeoManager->AddMaterial(this);
92 }
93 
94 ////////////////////////////////////////////////////////////////////////////////
95 /// constructor
96 
98  Double_t rho, Double_t radlen, Double_t intlen)
99  :TNamed(name, ""), TAttFill(),
100  fIndex(0),
101  fA(a),
102  fZ(z),
103  fDensity(rho),
104  fRadLen(0.),
105  fIntLen(0.),
106  fTemperature(0.),
107  fPressure(0.),
109  fShader(NULL),
110  fCerenkov(NULL),
111  fElement(NULL),
112  fUserExtension(0),
113  fFWExtension(0)
114 {
115  fName = fName.Strip();
116  SetUsed(kFALSE);
117  fIndex = -1;
118  fA = a;
119  fZ = z;
120  fDensity = rho;
124  SetRadLen(radlen, intlen);
125  if (!gGeoManager) {
126  gGeoManager = new TGeoManager("Geometry", "default geometry");
127  }
128  if (fZ - Int_t(fZ) > 1E-3)
129  Warning("ctor", "Material %s defined with fractional Z=%f", GetName(), fZ);
130  if (GetElement()) GetElement()->SetUsed();
131  gGeoManager->AddMaterial(this);
132 }
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Constructor with state, temperature and pressure.
136 
138  EGeoMaterialState state, Double_t temperature, Double_t pressure)
139  :TNamed(name, ""), TAttFill(),
140  fIndex(0),
141  fA(a),
142  fZ(z),
143  fDensity(rho),
144  fRadLen(0.),
145  fIntLen(0.),
146  fTemperature(temperature),
147  fPressure(pressure),
148  fState(state),
149  fShader(NULL),
150  fCerenkov(NULL),
151  fElement(NULL),
152  fUserExtension(0),
153  fFWExtension(0)
154 {
155  fName = fName.Strip();
156  SetUsed(kFALSE);
157  fIndex = -1;
158  SetRadLen(0,0);
159  if (!gGeoManager) {
160  gGeoManager = new TGeoManager("Geometry", "default geometry");
161  }
162  if (fZ - Int_t(fZ) > 1E-3)
163  Warning("ctor", "Material %s defined with fractional Z=%f", GetName(), fZ);
164  if (GetElement()) GetElement()->SetUsed();
165  gGeoManager->AddMaterial(this);
166 }
167 
168 ////////////////////////////////////////////////////////////////////////////////
169 /// constructor
170 
172  :TNamed(name, ""), TAttFill(),
173  fIndex(0),
174  fA(0.),
175  fZ(0.),
176  fDensity(rho),
177  fRadLen(0.),
178  fIntLen(0.),
179  fTemperature(0.),
180  fPressure(0.),
182  fShader(NULL),
183  fCerenkov(NULL),
184  fElement(elem),
185  fUserExtension(0),
186  fFWExtension(0)
187 {
188  fName = fName.Strip();
189  SetUsed(kFALSE);
190  fIndex = -1;
191  fA = elem->A();
192  fZ = elem->Z();
193  SetRadLen(0,0);
197  if (!gGeoManager) {
198  gGeoManager = new TGeoManager("Geometry", "default geometry");
199  }
200  if (fZ - Int_t(fZ) > 1E-3)
201  Warning("ctor", "Material %s defined with fractional Z=%f", GetName(), fZ);
202  if (GetElement()) GetElement()->SetUsed();
203  gGeoManager->AddMaterial(this);
204 }
205 
206 ////////////////////////////////////////////////////////////////////////////////
207 
209  TNamed(gm),
210  TAttFill(gm),
211  fIndex(gm.fIndex),
212  fA(gm.fA),
213  fZ(gm.fZ),
214  fDensity(gm.fDensity),
215  fRadLen(gm.fRadLen),
216  fIntLen(gm.fIntLen),
218  fPressure(gm.fPressure),
219  fState(gm.fState),
220  fShader(gm.fShader),
221  fCerenkov(gm.fCerenkov),
222  fElement(gm.fElement),
223  fUserExtension(gm.fUserExtension->Grab()),
224  fFWExtension(gm.fFWExtension->Grab())
225 
226 {
227  //copy constructor
228 }
229 
230 ////////////////////////////////////////////////////////////////////////////////
231 ///assignment operator
232 
234 {
235  if(this!=&gm) {
236  TNamed::operator=(gm);
238  fIndex=gm.fIndex;
239  fA=gm.fA;
240  fZ=gm.fZ;
241  fDensity=gm.fDensity;
242  fRadLen=gm.fRadLen;
243  fIntLen=gm.fIntLen;
245  fPressure=gm.fPressure;
246  fState=gm.fState;
247  fShader=gm.fShader;
248  fCerenkov=gm.fCerenkov;
249  fElement=gm.fElement;
252  }
253  return *this;
254 }
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// Destructor
258 
260 {
263 }
264 
265 ////////////////////////////////////////////////////////////////////////////////
266 /// Connect user-defined extension to the material. The material "grabs" a copy, so
267 /// the original object can be released by the producer. Release the previously
268 /// connected extension if any.
269 ///
270 /// NOTE: This interface is intended for user extensions and is guaranteed not
271 /// to be used by TGeo
272 
274 {
276  fUserExtension = 0;
277  if (ext) fUserExtension = ext->Grab();
278 }
279 
280 ////////////////////////////////////////////////////////////////////////////////
281 /// Connect framework defined extension to the material. The material "grabs" a copy,
282 /// so the original object can be released by the producer. Release the previously
283 /// connected extension if any.
284 ///
285 /// NOTE: This interface is intended for the use by TGeo and the users should
286 /// NOT connect extensions using this method
287 
289 {
291  fFWExtension = 0;
292  if (ext) fFWExtension = ext->Grab();
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Get a copy of the user extension pointer. The user must call Release() on
297 /// the copy pointer once this pointer is not needed anymore (equivalent to
298 /// delete() after calling new())
299 
301 {
302  if (fUserExtension) return fUserExtension->Grab();
303  return 0;
304 }
305 
306 ////////////////////////////////////////////////////////////////////////////////
307 /// Get a copy of the framework extension pointer. The user must call Release() on
308 /// the copy pointer once this pointer is not needed anymore (equivalent to
309 /// delete() after calling new())
310 
312 {
313  if (fFWExtension) return fFWExtension->Grab();
314  return 0;
315 }
316 
317 ////////////////////////////////////////////////////////////////////////////////
318 /// Provide a pointer name containing uid.
319 
321 {
322  static TString name;
323  name = TString::Format("pMat%d", GetUniqueID());
324  return (char*)name.Data();
325 }
326 
327 ////////////////////////////////////////////////////////////////////////////////
328 /// Set radiation/absorption lengths. If the values are negative, their absolute value
329 /// is taken, otherwise radlen is recomputed using G3 formula.
330 
332 {
333  fRadLen = TMath::Abs(radlen);
334  fIntLen = TMath::Abs(intlen);
335  // Check for vacuum
336  if (fA<0.9 || fZ<0.9) {
337  if (radlen<-1e5 || intlen<-1e-5) {
338  Error("SetRadLen","Material %s: user values taken for vacuum: radlen=%g or intlen=%g - too small", GetName(),fRadLen, fIntLen);
339  return;
340  }
341  // Ignore positive values and take big numbers
342  if (radlen>=0) fRadLen = 1.E30;
343  if (intlen>=0) fIntLen = 1.E30;
344  return;
345  }
346  // compute radlen systematically with G3 formula for a valid material
347  if (radlen>=0) {
348  //taken grom Geant3 routine GSMATE
349  const Double_t alr2av=1.39621E-03, al183=5.20948;
351  (al183-TMath::Log(fZ)/3-TGeoMaterial::Coulomb(fZ)));
352  }
353  // Compute interaction length using the same formula as in GEANT4
354  if (intlen>=0) {
355  const Double_t cm = 1.;
356  const Double_t g = 6.2415e21; // [gram = 1E-3*joule*s*s/(m*m)]
357  const Double_t amu = 1.03642688246781065e-02; // [MeV/c^2]
358  const Double_t lambda0 = 35.*g/(cm*cm); // [g/cm^2]
359  Double_t nilinv = 0.0;
360  TGeoElement *elem = GetElement();
361  if (!elem) {
362  Fatal("SetRadLen", "Element not found for material %s", GetName());
363  return;
364  }
365  Double_t nbAtomsPerVolume = TMath::Na()*fDensity/elem->A();
366  nilinv += nbAtomsPerVolume*TMath::Power(elem->Neff(), 0.6666667);
367  nilinv *= amu/lambda0;
368  fIntLen = (nilinv<=0) ? TGeoShape::Big() : (1./nilinv);
369  }
370 }
371 
372 ////////////////////////////////////////////////////////////////////////////////
373 /// static function
374 /// Compute Coulomb correction for pair production and Brem
375 /// REFERENCE : EGS MANUAL SLAC 210 - UC32 - JUNE 78
376 /// FORMULA 2.7.17
377 
379 {
380  const Double_t alpha = 7.29927E-03;
381 
382  Double_t az = alpha*z;
383  Double_t az2 = az*az;
384  Double_t az4 = az2 * az2;
385  Double_t fp = ( 0.0083*az4 + 0.20206 + 1./(1.+az2) ) * az2;
386  Double_t fm = ( 0.0020*az4 + 0.0369 ) * az4;
387  return fp - fm;
388 }
389 
390 ////////////////////////////////////////////////////////////////////////////////
391 /// return true if the other material has the same physical properties
392 
394 {
395  if (other==this) return kTRUE;
396  if (other->IsMixture()) return kFALSE;
397  if (TMath::Abs(fA-other->GetA())>1E-3) return kFALSE;
398  if (TMath::Abs(fZ-other->GetZ())>1E-3) return kFALSE;
399  if (TMath::Abs(fDensity-other->GetDensity())>1E-6) return kFALSE;
400  if (GetCerenkovProperties() != other->GetCerenkovProperties()) return kFALSE;
401 // if (fRadLen != other->GetRadLen()) return kFALSE;
402 // if (fIntLen != other->GetIntLen()) return kFALSE;
403  return kTRUE;
404 }
405 
406 ////////////////////////////////////////////////////////////////////////////////
407 /// print characteristics of this material
408 
409 void TGeoMaterial::Print(const Option_t * /*option*/) const
410 {
411  printf("Material %s %s A=%g Z=%g rho=%g radlen=%g intlen=%g index=%i\n", GetName(), GetTitle(),
413 }
414 
415 ////////////////////////////////////////////////////////////////////////////////
416 /// Save a primitive as a C++ statement(s) on output stream "out".
417 
418 void TGeoMaterial::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
419 {
421  char *name = GetPointerName();
422  out << "// Material: " << GetName() << std::endl;
423  out << " a = " << fA << ";" << std::endl;
424  out << " z = " << fZ << ";" << std::endl;
425  out << " density = " << fDensity << ";" << std::endl;
426  out << " radl = " << fRadLen << ";" << std::endl;
427  out << " absl = " << fIntLen << ";" << std::endl;
428 
429  out << " " << name << " = new TGeoMaterial(\"" << GetName() << "\", a,z,density,radl,absl);" << std::endl;
430  out << " " << name << "->SetIndex(" << GetIndex() << ");" << std::endl;
432 }
433 
434 ////////////////////////////////////////////////////////////////////////////////
435 /// Get some default color related to this material.
436 
438 {
439  Int_t id = 1+ gGeoManager->GetListOfMaterials()->IndexOf(this);
440  return (2+id%6);
441 }
442 
443 ////////////////////////////////////////////////////////////////////////////////
444 /// Get a pointer to the element this material is made of.
445 
447 {
448  if (fElement) return fElement;
450  return table->GetElement(Int_t(fZ));
451 }
452 ////////////////////////////////////////////////////////////////////////////////
453 /// Single interface to get element properties.
454 
456 {
457  a = fA;
458  z = fZ;
459  w = 1.;
460 }
461 
462 ////////////////////////////////////////////////////////////////////////////////
463 /// Retrieve material index in the list of materials
464 
466 {
467  if (fIndex>=0) return fIndex;
468  TList *matlist = gGeoManager->GetListOfMaterials();
469  fIndex = matlist->IndexOf(this);
470  return fIndex;
471 }
472 
473 ////////////////////////////////////////////////////////////////////////////////
474 /// Create the material representing the decay product of this material at a
475 /// given time. The precision represent the minimum cumulative branching ratio for
476 /// which decay products are still taken into account.
477 
479 {
480  TObjArray *pop = new TObjArray();
481  if (!fElement || !fElement->IsRadioNuclide()) return this;
482  FillMaterialEvolution(pop, precision);
483  Int_t ncomp = pop->GetEntriesFast();
484  if (!ncomp) return this;
485  TGeoElementRN *el;
486  Double_t *weight = new Double_t[ncomp];
487  Double_t amed = 0.;
488  Int_t i;
489  for (i=0; i<ncomp; i++) {
490  el = (TGeoElementRN *)pop->At(i);
491  weight[i] = el->Ratio()->Concentration(time) * el->A();
492  amed += weight[i];
493  }
494  Double_t rho = fDensity*amed/fA;
495  TGeoMixture *mix = 0;
496  Int_t ncomp1 = ncomp;
497  for (i=0; i<ncomp; i++) {
498  if ((weight[i]/amed)<precision) {
499  amed -= weight[i];
500  ncomp1--;
501  }
502  }
503  if (ncomp1<2) {
504  el = (TGeoElementRN *)pop->At(0);
505  delete [] weight;
506  delete pop;
507  if (ncomp1==1) return new TGeoMaterial(TString::Format("%s-evol",GetName()), el, rho);
508  return NULL;
509  }
510  mix = new TGeoMixture(TString::Format("%s-evol",GetName()), ncomp, rho);
511  for (i=0; i<ncomp; i++) {
512  weight[i] /= amed;
513  if (weight[i]<precision) continue;
514  el = (TGeoElementRN *)pop->At(i);
515  mix->AddElement(el, weight[i]);
516  }
517  delete [] weight;
518  delete pop;
519  return mix;
520 }
521 
522 ////////////////////////////////////////////////////////////////////////////////
523 /// Fills a user array with all the elements deriving from the possible
524 /// decay of the top element composing the mixture. Each element contained
525 /// by <population> may be a radionuclide having a Bateman solution attached.
526 /// The precision represent the minimum cumulative branching ratio for
527 /// which decay products are still taken into account.
528 /// To visualize the time evolution of each decay product one can use:
529 /// ~~~ {.cpp}
530 /// TGeoElement *elem = population->At(index);
531 /// TGeoElementRN *elemrn = 0;
532 /// if (elem->IsRadioNuclide()) elemrn = (TGeoElementRN*)elem;
533 /// ~~~
534 /// One can get Ni/N1(t=0) at any moment of time. Ni is the number of atoms
535 /// of one of the decay products, N1(0) is the number of atoms of the top
536 /// element at t=0.
537 /// ~~~ {.cpp}
538 /// Double_t fraction_weight = elemrn->Ratio()->Concentration(time);
539 /// ~~~
540 /// One can also display the time evolution of the fractional weight:
541 /// ~~~ {.cpp}
542 /// elemrn->Ratio()->Draw(option);
543 /// ~~~
544 
546 {
547  if (population->GetEntriesFast()) {
548  Error("FillMaterialEvolution", "Provide an empty array !");
549  return;
550  }
552  TGeoElement *elem;
553  TGeoElementRN *elemrn;
554  TIter next(table->GetElementsRN());
555  while ((elemrn=(TGeoElementRN*)next())) elemrn->ResetRatio();
556  elem = GetElement();
557  if (!elem) {
558  Fatal("FillMaterialEvolution", "Element not found for material %s", GetName());
559  return;
560  }
561  if (!elem->IsRadioNuclide()) {
562  population->Add(elem);
563  return;
564  }
565  elemrn = (TGeoElementRN*)elem;
566  elemrn->FillPopulation(population, precision);
567 }
568 
569 /** \class TGeoMixture
570 \ingroup Geometry_classes
571 
572 Mixtures of elements.
573 
574 */
575 
577 
578 ////////////////////////////////////////////////////////////////////////////////
579 /// Default constructor
580 
582 {
583  fNelements = 0;
584  fZmixture = 0;
585  fAmixture = 0;
586  fWeights = 0;
587  fNatoms = 0;
588  fVecNbOfAtomsPerVolume = 0;
589  fElements = 0;
590 }
591 
592 ////////////////////////////////////////////////////////////////////////////////
593 /// constructor
594 
595 TGeoMixture::TGeoMixture(const char *name, Int_t /*nel*/, Double_t rho)
596  :TGeoMaterial(name)
597 {
598  fZmixture = 0;
599  fAmixture = 0;
600  fWeights = 0;
601  fNelements = 0;
602  fNatoms = 0;
604  fDensity = rho;
605  fElements = 0;
606  if (fDensity < 0) fDensity = 0.001;
607 }
608 
609 ////////////////////////////////////////////////////////////////////////////////
610 ///copy constructor
611 
613  TGeoMaterial(gm),
615  fZmixture(gm.fZmixture),
616  fAmixture(gm.fAmixture),
617  fWeights(gm.fWeights),
618  fNatoms(gm.fNatoms),
620  fElements(gm.fElements)
621 {
622 }
623 
624 ////////////////////////////////////////////////////////////////////////////////
625 ///assignment operator
626 
628 {
629  if(this!=&gm) {
632  fZmixture=gm.fZmixture;
633  fAmixture=gm.fAmixture;
634  fWeights=gm.fWeights;
635  fNatoms = gm.fNatoms;
637  fElements = gm.fElements;
638  }
639  return *this;
640 }
641 
642 ////////////////////////////////////////////////////////////////////////////////
643 /// Destructor
644 
646 {
647  if (fZmixture) delete[] fZmixture;
648  if (fAmixture) delete[] fAmixture;
649  if (fWeights) delete[] fWeights;
650  if (fNatoms) delete[] fNatoms;
652  if (fElements) delete fElements;
653 }
654 
655 ////////////////////////////////////////////////////////////////////////////////
656 /// Compute effective A/Z and radiation length
657 
659 {
660  const Double_t alr2av = 1.39621E-03 , al183 =5.20948;
661  const Double_t cm = 1.;
662  const Double_t g = 6.2415e21; // [gram = 1E-3*joule*s*s/(m*m)]
663  const Double_t amu = 1.03642688246781065e-02; // [MeV/c^2]
664  const Double_t lambda0 = 35.*g/(cm*cm); // [g/cm^2]
665  Double_t radinv = 0.0;
666  Double_t nilinv = 0.0;
667  Double_t nbAtomsPerVolume;
668  fA = 0;
669  fZ = 0;
670  for (Int_t j=0;j<fNelements;j++) {
671  if (fWeights[j] <= 0) continue;
672  fA += fWeights[j]*fAmixture[j];
673  fZ += fWeights[j]*fZmixture[j];
674  nbAtomsPerVolume = TMath::Na()*fDensity*fWeights[j]/GetElement(j)->A();
675  nilinv += nbAtomsPerVolume*TMath::Power(GetElement(j)->Neff(), 0.6666667);
676  Double_t zc = fZmixture[j];
677  Double_t alz = TMath::Log(zc)/3.;
678  Double_t xinv = zc*(zc+TGeoMaterial::ScreenFactor(zc))*
679  (al183-alz-TGeoMaterial::Coulomb(zc))/fAmixture[j];
680  radinv += xinv*fWeights[j];
681  }
682  radinv *= alr2av*fDensity;
683  if (radinv > 0) fRadLen = 1/radinv;
684  // Compute interaction length
685  nilinv *= amu/lambda0;
686  fIntLen = (nilinv<=0) ? TGeoShape::Big() : (1./nilinv);
687 }
688 
689 ////////////////////////////////////////////////////////////////////////////////
690 /// add an element to the mixture using fraction by weight
691 /// Check if the element is already defined
692 
694 {
696  if (z<1 || z>table->GetNelements()-1)
697  Fatal("AddElement", "Cannot add element having Z=%d to mixture %s", (Int_t)z, GetName());
698  Int_t i;
699  for (i=0; i<fNelements; i++) {
700  if (TMath::Abs(z-fZmixture[i])<1.e-6 && TMath::Abs(a-fAmixture[i])<1.e-6) {
701  fWeights[i] += weight;
703  return;
704  }
705  }
706  if (!fNelements) {
707  fZmixture = new Double_t[1];
708  fAmixture = new Double_t[1];
709  fWeights = new Double_t[1];
710  } else {
711  Int_t nelements = fNelements+1;
712  Double_t *zmixture = new Double_t[nelements];
713  Double_t *amixture = new Double_t[nelements];
714  Double_t *weights = new Double_t[nelements];
715  for (Int_t j=0; j<fNelements; j++) {
716  zmixture[j] = fZmixture[j];
717  amixture[j] = fAmixture[j];
718  weights[j] = fWeights[j];
719  }
720  delete [] fZmixture;
721  delete [] fAmixture;
722  delete [] fWeights;
723  fZmixture = zmixture;
724  fAmixture = amixture;
725  fWeights = weights;
726  }
727 
728  fNelements++;
729  i = fNelements - 1;
730  fZmixture[i] = z;
731  fAmixture[i] = a;
732  fWeights[i] = weight;
733  if (z - Int_t(z) > 1E-3)
734  Warning("DefineElement", "Mixture %s has element defined with fractional Z=%f", GetName(), z);
735  GetElement(i)->SetDefined();
736  table->GetElement((Int_t)z)->SetDefined();
737 
738  //compute equivalent radiation length (taken from Geant3/GSMIXT)
740 }
741 
742 ////////////////////////////////////////////////////////////////////////////////
743 /// Define one component of the mixture as an existing material/mixture.
744 
746 {
747  TGeoElement *elnew, *elem;
748  Double_t a,z;
749  if (!mat->IsMixture()) {
750  elem = mat->GetBaseElement();
751  if (elem) {
752  AddElement(elem, weight);
753  } else {
754  a = mat->GetA();
755  z = mat->GetZ();
756  AddElement(a, z, weight);
757  }
758  return;
759  }
760  // The material is a mixture.
761  TGeoMixture *mix = (TGeoMixture*)mat;
762  Double_t wnew;
763  Int_t nelem = mix->GetNelements();
764  Bool_t elfound;
765  Int_t i,j;
766  // loop the elements of the daughter mixture
767  for (i=0; i<nelem; i++) {
768  elfound = kFALSE;
769  elnew = mix->GetElement(i);
770  if (!elnew) continue;
771  // check if we have the element already defined in the parent mixture
772  for (j=0; j<fNelements; j++) {
773  if (fWeights[j]<=0) continue;
774  elem = GetElement(j);
775  if (elem == elnew) {
776  // element found, compute new weight
777  fWeights[j] += weight * (mix->GetWmixt())[i];
778  elfound = kTRUE;
779  break;
780  }
781  }
782  if (elfound) continue;
783  // element not found, define it
784  wnew = weight * (mix->GetWmixt())[i];
785  AddElement(elnew, wnew);
786  }
787 }
788 
789 ////////////////////////////////////////////////////////////////////////////////
790 /// add an element to the mixture using fraction by weight
791 
793 {
794  TGeoElement *elemold;
796  if (!fElements) fElements = new TObjArray(128);
797  Bool_t exist = kFALSE;
798  // If previous elements were defined by A/Z, add corresponding TGeoElements
799  for (Int_t i=0; i<fNelements; i++) {
800  elemold = (TGeoElement*)fElements->At(i);
801  if (!elemold) fElements->AddAt(elemold = table->GetElement((Int_t)fZmixture[i]), i);
802  if (elemold == elem) exist = kTRUE;
803  }
804  if (!exist) fElements->AddAtAndExpand(elem, fNelements);
805  AddElement(elem->A(), elem->Z(), weight);
806 }
807 
808 ////////////////////////////////////////////////////////////////////////////////
809 /// Add a mixture element by number of atoms in the chemical formula.
810 
812 {
813  Int_t i,j;
814  Double_t amol;
815  TGeoElement *elemold;
817  if (!fElements) fElements = new TObjArray(128);
818  // Check if the element is already defined
819  for (i=0; i<fNelements; i++) {
820  elemold = (TGeoElement*)fElements->At(i);
821  if (!elemold) fElements->AddAt(table->GetElement((Int_t)fZmixture[i]), i);
822  else if (elemold != elem) continue;
823  if ((elem==elemold) ||
824  (TMath::Abs(elem->Z()-fZmixture[i])<1.e-6 && TMath::Abs(elem->A()-fAmixture[i])<1.e-6)) {
825  fNatoms[i] += natoms;
826  amol = 0.;
827  for (j=0; j<fNelements; j++) amol += fAmixture[j]*fNatoms[j];
828  for (j=0; j<fNelements; j++) fWeights[j] = fNatoms[j]*fAmixture[j]/amol;
830  return;
831  }
832  }
833  // New element
834  if (!fNelements) {
835  fZmixture = new Double_t[1];
836  fAmixture = new Double_t[1];
837  fWeights = new Double_t[1];
838  fNatoms = new Int_t[1];
839  } else {
840  if (!fNatoms) {
841  Fatal("AddElement", "Cannot add element by natoms in mixture %s after defining elements by weight",
842  GetName());
843  return;
844  }
845  Int_t nelements = fNelements+1;
846  Double_t *zmixture = new Double_t[nelements];
847  Double_t *amixture = new Double_t[nelements];
848  Double_t *weights = new Double_t[nelements];
849  Int_t *nnatoms = new Int_t[nelements];
850  for (j=0; j<fNelements; j++) {
851  zmixture[j] = fZmixture[j];
852  amixture[j] = fAmixture[j];
853  weights[j] = fWeights[j];
854  nnatoms[j] = fNatoms[j];
855  }
856  delete [] fZmixture;
857  delete [] fAmixture;
858  delete [] fWeights;
859  delete [] fNatoms;
860  fZmixture = zmixture;
861  fAmixture = amixture;
862  fWeights = weights;
863  fNatoms = nnatoms;
864  }
865  fNelements++;
866  Int_t iel = fNelements-1;
867  fZmixture[iel] = elem->Z();
868  fAmixture[iel] = elem->A();
869  fNatoms[iel] = natoms;
870  fElements->AddAtAndExpand(elem, iel);
871  amol = 0.;
872  for (i=0; i<fNelements; i++) {
873  if (fNatoms[i]<=0) return;
874  amol += fAmixture[i]*fNatoms[i];
875  }
876  for (i=0; i<fNelements; i++) fWeights[i] = fNatoms[i]*fAmixture[i]/amol;
877  table->GetElement(elem->Z())->SetDefined();
879 }
880 
881 ////////////////////////////////////////////////////////////////////////////////
882 /// Define the mixture element at index iel by number of atoms in the chemical formula.
883 
885 {
887  TGeoElement *elem = table->GetElement(z);
888  if (!elem) {
889  Fatal("DefineElement", "In mixture %s, element with Z=%i not found",GetName(),z);
890  return;
891  }
892  AddElement(elem, natoms);
893 }
894 
895 ////////////////////////////////////////////////////////////////////////////////
896 /// Retrieve the pointer to the element corresponding to component I.
897 
899 {
900  if (i<0 || i>=fNelements) {
901  Error("GetElement", "Mixture %s has only %d elements", GetName(), fNelements);
902  return 0;
903  }
904  TGeoElement *elem = 0;
905  if (fElements) elem = (TGeoElement*)fElements->At(i);
906  if (elem) return elem;
908  return table->GetElement(Int_t(fZmixture[i]));
909 }
910 
911 ////////////////////////////////////////////////////////////////////////////////
912 /// Get specific activity (in Bq/gram) for the whole mixture (no argument) or
913 /// for a given component.
914 
916 {
917  if (i>=0 && i<fNelements) return fWeights[i]*GetElement(i)->GetSpecificActivity();
918  Double_t sa = 0;
919  for (Int_t iel=0; iel<fNelements; iel++) {
920  sa += fWeights[iel]*GetElement(iel)->GetSpecificActivity();
921  }
922  return sa;
923 }
924 
925 ////////////////////////////////////////////////////////////////////////////////
926 /// Return true if the other material has the same physical properties
927 
929 {
930  if (other->IsEqual(this)) return kTRUE;
931  if (!other->IsMixture()) return kFALSE;
932  TGeoMixture *mix = (TGeoMixture*)other;
933  if (!mix) return kFALSE;
934  if (fNelements != mix->GetNelements()) return kFALSE;
935  if (TMath::Abs(fA-other->GetA())>1E-3) return kFALSE;
936  if (TMath::Abs(fZ-other->GetZ())>1E-3) return kFALSE;
937  if (TMath::Abs(fDensity-other->GetDensity())>1E-6) return kFALSE;
938  if (GetCerenkovProperties() != other->GetCerenkovProperties()) return kFALSE;
939 // if (fRadLen != other->GetRadLen()) return kFALSE;
940 // if (fIntLen != other->GetIntLen()) return kFALSE;
941  for (Int_t i=0; i<fNelements; i++) {
942  if (TMath::Abs(fZmixture[i]-(mix->GetZmixt())[i])>1E-3) return kFALSE;
943  if (TMath::Abs(fAmixture[i]-(mix->GetAmixt())[i])>1E-3) return kFALSE;
944  if (TMath::Abs(fWeights[i]-(mix->GetWmixt())[i])>1E-3) return kFALSE;
945  }
946  return kTRUE;
947 }
948 
949 ////////////////////////////////////////////////////////////////////////////////
950 /// print characteristics of this material
951 
952 void TGeoMixture::Print(const Option_t * /*option*/) const
953 {
954  printf("Mixture %s %s Aeff=%g Zeff=%g rho=%g radlen=%g intlen=%g index=%i\n", GetName(), GetTitle(),
956  for (Int_t i=0; i<fNelements; i++) {
957  if (fNatoms) printf(" Element #%i : %s Z=%6.2f A=%6.2f w=%6.3f natoms=%d\n", i, GetElement(i)->GetName(),fZmixture[i],
958  fAmixture[i], fWeights[i], fNatoms[i]);
959  else printf(" Element #%i : %s Z=%6.2f A=%6.2f w=%6.3f\n", i, GetElement(i)->GetName(),fZmixture[i],
960  fAmixture[i], fWeights[i]);
961  }
962 }
963 
964 ////////////////////////////////////////////////////////////////////////////////
965 /// Save a primitive as a C++ statement(s) on output stream "out".
966 
967 void TGeoMixture::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
968 {
970  char *name = GetPointerName();
971  out << "// Mixture: " << GetName() << std::endl;
972  out << " nel = " << fNelements << ";" << std::endl;
973  out << " density = " << fDensity << ";" << std::endl;
974  out << " " << name << " = new TGeoMixture(\"" << GetName() << "\", nel,density);" << std::endl;
975  for (Int_t i=0; i<fNelements; i++) {
976  TGeoElement *el = GetElement(i);
977  out << " a = " << fAmixture[i] << "; z = "<< fZmixture[i] << "; w = " << fWeights[i] << "; // " << el->GetName() << std::endl;
978  out << " " << name << "->DefineElement(" << i << ",a,z,w);" << std::endl;
979  }
980  out << " " << name << "->SetIndex(" << GetIndex() << ");" << std::endl;
982 }
983 
984 ////////////////////////////////////////////////////////////////////////////////
985 /// Create the mixture representing the decay product of this material at a
986 /// given time. The precision represent the minimum cumulative branching ratio for
987 /// which decay products are still taken into account.
988 
990 {
991  TObjArray *pop = new TObjArray();
992  FillMaterialEvolution(pop, precision);
993  Int_t ncomp = pop->GetEntriesFast();
994  if (!ncomp) return this;
995  TGeoElement *elem;
996  TGeoElementRN *el;
997  Double_t *weight = new Double_t[ncomp];
998  Double_t amed = 0.;
999  Int_t i, j;
1000  for (i=0; i<ncomp; i++) {
1001  elem = (TGeoElement *)pop->At(i);
1002  if (!elem->IsRadioNuclide()) {
1003  j = fElements->IndexOf(elem);
1004  weight[i] = fWeights[j]*fAmixture[0]/fWeights[0];
1005  } else {
1006  el = (TGeoElementRN*)elem;
1007  weight[i] = el->Ratio()->Concentration(time) * el->A();
1008  }
1009  amed += weight[i];
1010  }
1011  Double_t rho = fDensity * fWeights[0] * amed/fAmixture[0];
1012  TGeoMixture *mix = 0;
1013  Int_t ncomp1 = ncomp;
1014  for (i=0; i<ncomp; i++) {
1015  if ((weight[i]/amed)<precision) {
1016  amed -= weight[i];
1017  ncomp1--;
1018  }
1019  }
1020  if (ncomp1<2) {
1021  el = (TGeoElementRN *)pop->At(0);
1022  delete [] weight;
1023  delete pop;
1024  if (ncomp1==1) return new TGeoMaterial(TString::Format("%s-evol",GetName()), el, rho);
1025  return NULL;
1026  }
1027  mix = new TGeoMixture(TString::Format("%s-evol",GetName()), ncomp, rho);
1028  for (i=0; i<ncomp; i++) {
1029  weight[i] /= amed;
1030  if (weight[i]<precision) continue;
1031  el = (TGeoElementRN *)pop->At(i);
1032  mix->AddElement(el, weight[i]);
1033  }
1034  delete [] weight;
1035  delete pop;
1036  return mix;
1037 }
1038 
1039 ////////////////////////////////////////////////////////////////////////////////
1040 /// Fills a user array with all the elements deriving from the possible
1041 /// decay of the top elements composing the mixture. Each element contained
1042 /// by <population> may be a radionuclide having a Bateman solution attached.
1043 /// The precision represent the minimum cumulative branching ratio for
1044 /// which decay products are still taken into account.
1045 /// To visualize the time evolution of each decay product one can use:
1046 /// ~~~ {.cpp}
1047 /// TGeoElement *elem = population->At(index);
1048 /// TGeoElementRN *elemrn = 0;
1049 /// if (elem->IsRadioNuclide()) elemrn = (TGeoElementRN*)elem;
1050 /// ~~~
1051 /// One can get Ni/N1(t=0) at any moment of time. Ni is the number of atoms
1052 /// of one of the decay products, N1(0) is the number of atoms of the first top
1053 /// element at t=0.
1054 /// ~~~ {.cpp}
1055 /// Double_t fraction_weight = elemrn->Ratio()->Concentration(time);
1056 /// ~~~
1057 /// One can also display the time evolution of the fractional weight:
1058 /// ~~~ {.cpp}
1059 /// elemrn->Ratio()->Draw(option);
1060 /// ~~~
1061 
1063 {
1064  if (population->GetEntriesFast()) {
1065  Error("FillMaterialEvolution", "Provide an empty array !");
1066  return;
1067  }
1069  TGeoElement *elem;
1070  TGeoElementRN *elemrn;
1071  TIter next(table->GetElementsRN());
1072  while ((elemrn=(TGeoElementRN*)next())) elemrn->ResetRatio();
1073  Double_t factor;
1074  for (Int_t i=0; i<fNelements; i++) {
1075  elem = GetElement(i);
1076  if (!elem->IsRadioNuclide()) {
1077  population->Add(elem);
1078  continue;
1079  }
1080  elemrn = (TGeoElementRN*)elem;
1081  factor = fWeights[i]*fAmixture[0]/(fWeights[0]*fAmixture[i]);
1082  elemrn->FillPopulation(population, precision, factor);
1083  }
1084 }
1085 
1086 ////////////////////////////////////////////////////////////////////////////////
1087 /// static function
1088 /// Compute screening factor for pair production and Bremsstrahlung
1089 /// REFERENCE : EGS MANUAL SLAC 210 - UC32 - JUNE 78
1090 /// FORMULA 2.7.22
1091 
1093 {
1094  const Double_t al183= 5.20948 , al1440 = 7.27239;
1095  Double_t alz = TMath::Log(z)/3.;
1096  Double_t factor = (al1440 - 2*alz) / (al183 - alz - TGeoMaterial::Coulomb(z));
1097  return factor;
1098 }
1099 
1100 ////////////////////////////////////////////////////////////////////////////////
1101 /// Compute Derived Quantities as in Geant4
1102 
1104 {
1106 
1107  // Formula taken from G4Material.cxx L312
1108  for (Int_t i=0; i<fNelements; ++i) {
1110  }
1113 }
1114 
1115 
1116 ////////////////////////////////////////////////////////////////////////////////
1117 /// Compute Radiation Length based on Geant4 formula
1118 
1120 {
1121  // Formula taken from G4Material.cxx L556
1122  Double_t radinv = 0.0 ;
1123  for (Int_t i=0;i<fNelements;++i) {
1124  radinv += fVecNbOfAtomsPerVolume[i]*((TGeoElement*)fElements->At(i))->GetfRadTsai();
1125  }
1126  fRadLen = (radinv <= 0.0 ? DBL_MAX : 1./radinv);
1127 }
1128 
1129 ////////////////////////////////////////////////////////////////////////////////
1130 /// Compute Nuclear Interaction Length based on Geant4 formula
1132 {
1133 
1134  // Formula taken from G4Material.cxx L567
1135  constexpr Double_t lambda0 = 35*TGeoUnit::g/TGeoUnit::cm2;
1136  constexpr Double_t twothird = 2.0/3.0;
1137  Double_t NILinv = 0.0;
1138  for (Int_t i=0; i<fNelements; ++i) {
1139  Int_t Z = static_cast<Int_t>(((TGeoElement*)fElements->At(i))->Z()+0.5);
1140  Double_t A = ((TGeoElement*)fElements->At(i))->Neff();
1141  if(1 == Z) {
1142  NILinv += fVecNbOfAtomsPerVolume[i]*A;
1143  } else {
1144  NILinv += fVecNbOfAtomsPerVolume[i]*TMath::Exp(twothird*TMath::Log(A));
1145  }
1146  }
1147  NILinv *= TGeoUnit::amu/lambda0;
1148  fIntLen = (NILinv <= 0.0 ? DBL_MAX : 1./NILinv);
1149 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Int_t * fNatoms
Definition: TGeoMaterial.h:142
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:375
void FillPopulation(TObjArray *population, Double_t precision=0.001, Double_t factor=1.)
Fills the input array with the set of RN elements resulting from the decay of this one...
virtual Bool_t IsEq(const TGeoMaterial *other) const
Return true if the other material has the same physical properties.
Mixtures of elements.
Definition: TGeoMaterial.h:134
An array of TObjects.
Definition: TObjArray.h:37
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
Double_t * fVecNbOfAtomsPerVolume
Definition: TGeoMaterial.h:143
void DefineElement(Int_t iel, Double_t a, Double_t z, Double_t weight)
Definition: TGeoMaterial.h:193
Table of elements.
Definition: TGeoElement.h:369
Double_t * fWeights
Definition: TGeoMaterial.h:141
Double_t Log(Double_t x)
Definition: TMath.h:648
TGeoExtension * fFWExtension
Transient user-defined extension to materials.
Definition: TGeoMaterial.h:58
TObject * fCerenkov
Definition: TGeoMaterial.h:55
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:87
const char Option_t
Definition: RtypesCore.h:62
Int_t Z() const
Definition: TGeoElement.h:73
void ComputeNuclearInterLength()
Compute Nuclear Interaction Length based on Geant4 formula.
Int_t fNelements
Definition: TGeoMaterial.h:138
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
Double_t * GetWmixt() const
Definition: TGeoMaterial.h:175
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
static constexpr double amu
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
static constexpr double cm
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
Basic string class.
Definition: TString.h:125
Base class describing materials.
Definition: TGeoMaterial.h:29
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TGeoMaterial()
Destructor.
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
void AverageProperties()
Compute effective A/Z and radiation length.
static const Double_t STP_pressure
Definition: TGeoMaterial.h:27
static double A[]
Short_t Abs(Short_t d)
Definition: TMathBase.h:108
TGeoElement * GetBaseElement() const
Definition: TGeoMaterial.h:91
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Definition: TMath.h:627
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
TList * GetListOfMaterials() const
Definition: TGeoManager.h:463
virtual void FillMaterialEvolution(TObjArray *population, Double_t precision=0.001)
Fills a user array with all the elements deriving from the possible decay of the top elements composi...
virtual Bool_t IsRadioNuclide() const
Definition: TGeoElement.h:87
EGeoMaterialState fState
Definition: TGeoMaterial.h:53
Fill Area Attributes class.
Definition: TAttFill.h:19
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2365
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
Double_t Neff() const
Returns effective number of nucleons.
void ComputeRadiationLength()
Compute Radiation Length based on Geant4 formula.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void Print(const Option_t *option="") const
print characteristics of this material
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the material.
Double_t Concentration(Double_t time) const
Find concentration of the element at a given time.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Base class for chemical elements.
Definition: TGeoElement.h:36
virtual Double_t GetA() const
Definition: TGeoMaterial.h:84
virtual void FillMaterialEvolution(TObjArray *population, Double_t precision=0.001)
Fills a user array with all the elements deriving from the possible decay of the top element composin...
static Double_t Coulomb(Double_t z)
static function Compute Coulomb correction for pair production and Brem REFERENCE : EGS MANUAL SLAC 2...
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
Definition: TObject.cxx:483
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:85
A doubly linked list.
Definition: TList.h:44
Int_t GetIndex()
Retrieve material index in the list of materials.
void AddElement(Double_t a, Double_t z, Double_t weight)
add an element to the mixture using fraction by weight Check if the element is already defined ...
Double_t fIntLen
Definition: TGeoMaterial.h:50
static constexpr double Avogadro
virtual void Release() const =0
TGeoMaterial()
Default constructor.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition: TNamed.cxx:51
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Definition: TObjArray.cxx:234
TGeoMixture()
Default constructor.
virtual TGeoMaterial * DecayMaterial(Double_t time, Double_t precision=0.001)
Create the material representing the decay product of this material at a given time.
Double_t fDensity
Definition: TGeoMaterial.h:48
virtual TObject * GetCerenkovProperties() const
Definition: TGeoMaterial.h:96
TGeoMixture & operator=(const TGeoMixture &)
assignment operator
TGeoBatemanSol * Ratio() const
Definition: TGeoElement.h:197
auto * a
Definition: textangle.C:12
ABC for user objects attached to TGeoVolume or TGeoNode.
Definition: TGeoExtension.h:19
TObjArray * GetElementsRN() const
Definition: TGeoElement.h:413
char * GetPointerName() const
Provide a pointer name containing uid.
virtual Int_t GetNelements() const
Definition: TGeoMaterial.h:172
Double_t fTemperature
Definition: TGeoMaterial.h:51
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
TGeoElement * fElement
Definition: TGeoMaterial.h:56
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the material.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1080
Int_t GetNelements() const
Definition: TGeoElement.h:417
TString fName
Definition: TNamed.h:32
constexpr Double_t Na()
Definition: TMath.h:202
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
Definition: TObjArray.cxx:253
constexpr Double_t E()
Definition: TMath.h:74
static const Double_t STP_temperature
Definition: TGeoMaterial.h:26
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual TGeoElement * GetElement(Int_t i=0) const
Get a pointer to the element this material is made of.
Double_t * fZmixture
Definition: TGeoMaterial.h:139
Double_t Exp(Double_t x)
Definition: TMath.h:621
void ComputeDerivedQuantities()
Compute Derived Quantities as in Geant4.
Double_t fZ
Definition: TGeoMaterial.h:47
static Double_t ScreenFactor(Double_t z)
static function Compute screening factor for pair production and Bremsstrahlung REFERENCE : EGS MANUA...
void SetUsed(Bool_t flag=kTRUE)
Definition: TGeoElement.h:91
virtual ~TGeoMixture()
Destructor.
#define ClassImp(name)
Definition: Rtypes.h:359
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:559
Double_t * GetAmixt() const
Definition: TGeoMaterial.h:174
virtual Bool_t IsMixture() const
Definition: TGeoMaterial.h:108
double Double_t
Definition: RtypesCore.h:55
Int_t IndexOf(const TObject *obj) const
Definition: TObjArray.cxx:589
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
virtual void GetElementProp(Double_t &a, Double_t &z, Double_t &w, Int_t i=0)
Single interface to get element properties.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetDefined(Bool_t flag=kTRUE)
Definition: TGeoElement.h:90
static Double_t Big()
Definition: TGeoShape.h:88
virtual Int_t GetDefaultColor() const
Get some default color related to this material.
Binding & operator=(OUT(*fun)(void))
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
Double_t fPressure
Definition: TGeoMaterial.h:52
TObjArray * fElements
Definition: TGeoMaterial.h:144
Double_t fRadLen
Definition: TGeoMaterial.h:49
virtual TGeoExtension * Grab()=0
void SetUsed(Bool_t flag=kTRUE)
Definition: TGeoMaterial.h:117
TGeoExtension * fUserExtension
Definition: TGeoMaterial.h:57
static constexpr double cm2
Class representing a radionuclide.
Definition: TGeoElement.h:138
Double_t fA
Definition: TGeoMaterial.h:46
virtual Double_t GetSpecificActivity() const
Definition: TGeoElement.h:84
Double_t * GetZmixt() const
Definition: TGeoMaterial.h:173
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TGeoMaterial & operator=(const TGeoMaterial &)
assignment operator
void Add(TObject *obj)
Definition: TObjArray.h:73
Double_t A() const
Definition: TGeoElement.h:76
virtual TGeoMaterial * DecayMaterial(Double_t time, Double_t precision=0.001)
Create the mixture representing the decay product of this material at a given time.
virtual Double_t GetSpecificActivity(Int_t i=-1) const
Get specific activity (in Bq/gram) for the whole mixture (no argument) or for a given component...
TGeoElement * GetElement(Int_t z)
Definition: TGeoElement.h:410
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:908
Double_t * fAmixture
Definition: TGeoMaterial.h:140
TObject * fShader
Definition: TGeoMaterial.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:87
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
char name[80]
Definition: TGX11.cxx:109
virtual void Print(const Option_t *option="") const
print characteristics of this material
void ResetRatio()
Clears the existing ratio.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual Bool_t IsEq(const TGeoMaterial *other) const
return true if the other material has the same physical properties
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
const char * Data() const
Definition: TString.h:345
static constexpr double g