70 fState(kMatStateUndefined),
100 fState(kMatStateUndefined),
142 fState(kMatStateUndefined),
190 fTemperature(temperature),
230 fState(kMatStateUndefined),
264 fDensity(gm.fDensity),
267 fTemperature(gm.fTemperature),
268 fPressure(gm.fPressure),
271 fCerenkov(gm.fCerenkov),
272 fElement(gm.fElement),
273 fUserExtension(gm.fUserExtension->Grab()),
274 fFWExtension(gm.fFWExtension->Grab())
292 TAttFill::operator=(gm);
344 return (prop) ? prop->
GetTitle() :
nullptr;
352 if ( !prop )
return nullptr;
361 if ( !prop )
return nullptr;
370 return (prop) ? prop->
GetTitle() :
nullptr;
379 if (err) *err =
kTRUE;
391 if (err) *err =
kTRUE;
402 Error(
"AddProperty",
"Property %s already added to material %s",
415 Error(
"AddConstProperty",
"Constant property %s already added to material %s",
467 return (
char*)
name.Data();
479 if (
fA<0.9 ||
fZ<0.9) {
480 if (radlen<-1e5 || intlen<-1
e-5) {
481 Error(
"SetRadLen",
"Material %s: user values taken for vacuum: radlen=%g or intlen=%g - too small",
GetName(),
fRadLen,
fIntLen);
485 if (radlen>=0)
fRadLen = 1.E30;
486 if (intlen>=0)
fIntLen = 1.E30;
493 constexpr Double_t alr2av = 1.39621E-03;
506 Fatal(
"SetRadLen",
"Element not found for material %s",
GetName());
530 Double_t fp = ( 0.0083*az4 + 0.20206 + 1./(1.+az2) ) * az2;
531 Double_t fm = ( 0.0020*az4 + 0.0369 ) * az4;
540 if (other==
this)
return kTRUE;
556 printf(
"Material %s %s A=%g Z=%g rho=%g radlen=%g intlen=%g index=%i\n",
GetName(),
GetTitle(),
567 out <<
"// Material: " <<
GetName() << std::endl;
568 out <<
" a = " <<
fA <<
";" << std::endl;
569 out <<
" z = " <<
fZ <<
";" << std::endl;
570 out <<
" density = " <<
fDensity <<
";" << std::endl;
571 out <<
" radl = " <<
fRadLen <<
";" << std::endl;
572 out <<
" absl = " <<
fIntLen <<
";" << std::endl;
574 out <<
" " <<
name <<
" = new TGeoMaterial(\"" <<
GetName() <<
"\", a,z,density,radl,absl);" << std::endl;
575 out <<
" " <<
name <<
"->SetIndex(" <<
GetIndex() <<
");" << std::endl;
642 if (!ncomp)
return this;
647 for (i=0; i<ncomp; i++) {
654 Int_t ncomp1 = ncomp;
655 for (i=0; i<ncomp; i++) {
656 if ((weight[i]/amed)<precision) {
669 for (i=0; i<ncomp; i++) {
671 if (weight[i]<precision)
continue;
706 Error(
"FillMaterialEvolution",
"Provide an empty array !");
716 Fatal(
"FillMaterialEvolution",
"Element not found for material %s",
GetName());
720 population->
Add(elem);
786 constexpr const Double_t alr2av = 1.39621E-03;
787 constexpr const Double_t al183 = 5.20948;
828 Fatal(
"AddElement",
"Cannot add element with negative weight %g to mixture %s", weight,
GetName());
830 else if ( weight < std::numeric_limits<Double_t>::epsilon() ) {
834 Fatal(
"AddElement",
"Cannot add element having Z=%d to mixture %s", (
Int_t)z,
GetName());
871 if (z -
Int_t(z) > 1E-3)
872 Warning(
"DefineElement",
"Mixture %s has element defined with fractional Z=%f",
GetName(), z);
890 Fatal(
"AddElement",
"Cannot add INVALID material to mixture %s",
GetName());
892 else if (weight < 0e0) {
893 Fatal(
"AddElement",
"Cannot add material %s with negative weight %g to mixture %s",
896 else if ( weight < std::numeric_limits<Double_t>::epsilon() ) {
917 for (i=0; i<nelem; i++) {
920 if (!elnew)
continue;
932 if (elfound)
continue;
934 wnew = weight * (mix->
GetWmixt())[i];
951 Fatal(
"AddElement",
"Cannot add INVALID element to mixture %s",
GetName());
953 else if (weight < 0e0) {
954 Fatal(
"AddElement",
"Cannot add element %s with negative weight %g to mixture %s",
957 else if ( weight < std::numeric_limits<Double_t>::epsilon() ) {
968 if (elemold == elem) {
995 else if (elemold != elem)
continue;
996 if ((elem==elemold) ||
1014 Fatal(
"AddElement",
"Cannot add element by natoms in mixture %s after defining elements by weight",
1062 Fatal(
"DefineElement",
"In mixture %s, element with Z=%i not found",
GetName(),z);
1079 if (elem)
return elem;
1127 printf(
"Mixture %s %s Aeff=%g Zeff=%g rho=%g radlen=%g intlen=%g index=%i\n",
GetName(),
GetTitle(),
1149 out <<
"// Mixture: " <<
GetName() << std::endl;
1150 out <<
" nel = " <<
fNelements <<
";" << std::endl;
1151 out <<
" density = " <<
fDensity <<
";" << std::endl;
1152 out <<
" " <<
name <<
" = new TGeoMixture(\"" <<
GetName() <<
"\", nel,density);" << std::endl;
1156 out <<
" " <<
name <<
"->DefineElement(" << i <<
",a,z,w);" << std::endl;
1158 out <<
" " <<
name <<
"->SetIndex(" <<
GetIndex() <<
");" << std::endl;
1172 if (!ncomp)
return this;
1178 for (i=0; i<ncomp; i++) {
1191 Int_t ncomp1 = ncomp;
1192 for (i=0; i<ncomp; i++) {
1193 if ((weight[i]/amed)<precision) {
1206 for (i=0; i<ncomp; i++) {
1208 if (weight[i]<precision)
continue;
1243 Error(
"FillMaterialEvolution",
"Provide an empty array !");
1255 population->
Add(elem);
1272 const Double_t al183= 5.20948 , al1440 = 7.27239;
1291 double sumweights = 0;
1297 Warning(
"ComputeDerivedQuantities",
"Mixture %s: sum of weights is: %g",
GetName(), sumweights);
1315 fRadLen = (radinv <= 0.0 ? DBL_MAX : 1.0 / radinv);
1338 fIntLen = (NILinv <= 0.0 ? DBL_MAX : 1.0 / NILinv);
R__EXTERN TGeoManager * gGeoManager
static const Double_t STP_temperature
static const Double_t STP_pressure
Fill Area Attributes class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
This class is used in the process of reading and writing the GDML "matrix" tag.
Double_t Concentration(Double_t time) const
Find concentration of the element at a given time.
Class representing a radionuclidevoid TGeoManager::SetDefaultRootUnits() { if ( fgDefaultUnits == kRo...
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.
TGeoBatemanSol * Ratio() const
void ResetRatio()
Clears the existing ratio.
TGeoElement * GetElement(Int_t z)
TObjArray * GetElementsRN() const
Int_t GetNelements() const
Base class for chemical elements.
virtual Double_t GetSpecificActivity() const
void SetDefined(Bool_t flag=kTRUE)
virtual Bool_t IsRadioNuclide() const
Double_t Neff() const
Returns effective number of nucleons.
void SetUsed(Bool_t flag=kTRUE)
ABC for user objects attached to TGeoVolume or TGeoNode.
virtual TGeoExtension * Grab()=0
virtual void Release() const =0
The manager class for any TGeo geometry.
static EDefaultUnits GetDefaultUnits()
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
static void SetDefaultUnits(EDefaultUnits new_value)
Int_t AddMaterial(const TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
Double_t GetProperty(const char *name, Bool_t *error=nullptr) const
Get a user-defined property.
TGDMLMatrix * GetGDMLMatrix(const char *name) const
Get GDML matrix with a given name;.
TList * GetListOfMaterials() const
Base class describing materials.
virtual ~TGeoMaterial()
Destructor.
Double_t GetConstProperty(const char *property, Bool_t *error=nullptr) const
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the material.
char * GetPointerName() const
Provide a pointer name containing uid.
virtual TObject * GetCerenkovProperties() const
static Double_t ScreenFactor(Double_t z)
static function Compute screening factor for pair production and Bremsstrahlung REFERENCE : EGS MANUA...
const char * GetConstPropertyRef(const char *property) const
virtual Bool_t IsMixture() const
void SetFWExtension(TGeoExtension *ext)
Connect framework defined extension to the material.
bool AddConstProperty(const char *property, const char *ref)
virtual void GetElementProp(Double_t &a, Double_t &z, Double_t &w, Int_t i=0)
Single interface to get element properties.
virtual void Print(const Option_t *option="") const
print characteristics of this material
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.
bool AddProperty(const char *property, const char *ref)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetRadLen(Double_t radlen, Double_t intlen=0.)
Set radiation/absorption lengths.
TGeoElement * GetElement() const
Get a pointer to the element this material is made of.
virtual Bool_t IsEq(const TGeoMaterial *other) const
return true if the other material has the same physical properties
TGeoElement * GetBaseElement() const
const char * GetPropertyRef(const char *property) const
TGDMLMatrix * GetProperty(const char *name) const
void SetUsed(Bool_t flag=kTRUE)
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...
Int_t GetIndex()
Retrieve material index in the list of materials.
TGeoExtension * fUserExtension
TGeoMaterial & operator=(const TGeoMaterial &)
assignment operator
TGeoExtension * GrabUserExtension() const
Get a copy of the user extension pointer.
TGeoExtension * GrabFWExtension() const
Get a copy of the framework extension pointer.
virtual Int_t GetDefaultColor() const
Get some default color related to this material.
TGeoMaterial()
Default constructor.
static Double_t Coulomb(Double_t z)
static function Compute Coulomb correction for pair production and Brem REFERENCE : EGS MANUAL SLAC 2...
virtual Double_t GetA() const
TGeoExtension * fFWExtension
Transient user-defined extension to materials.
virtual Double_t GetDensity() const
virtual Double_t GetZ() const
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
void ComputeNuclearInterLength()
Compute Nuclear Interaction Length based on Geant4 formula.
Double_t * GetZmixt() const
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
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.
TGeoMixture()
Default constructor.
virtual ~TGeoMixture()
Destructor.
void ComputeDerivedQuantities()
Compute Derived Quantities as in Geant4.
virtual void Print(const Option_t *option="") const
print characteristics of this material
void ComputeRadiationLength()
Compute Radiation Length based on Geant4 formula.
Double_t * fVecNbOfAtomsPerVolume
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...
void AverageProperties()
Compute effective A/Z and radiation length.
Double_t * GetWmixt() const
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 void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Int_t GetNelements() const
virtual Bool_t IsEq(const TGeoMaterial *other) const
Return true if the other material has the same physical properties.
void DefineElement(Int_t iel, Double_t a, Double_t z, Double_t weight)
Double_t * GetAmixt() const
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual const char * GetName() const
Returns name of object.
Int_t IndexOf(const TObject *obj) const
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
TObject * At(Int_t idx) const
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
static constexpr double fine_structure_const
static constexpr double cm2
static constexpr double Avogadro
static constexpr double cm
static constexpr double amu
static constexpr double cm
static constexpr double fine_structure_const
static constexpr double cm2
static constexpr double Avogadro
static constexpr double g
LongDouble_t Power(LongDouble_t x, LongDouble_t y)