43 "Interface to Range dE/dx and range library (Ricardo Yanez)")
64 DataFilePaths.
Begin(
" ");
67 while (!DataFilePaths.
End()) {
68 nextPath = DataFilePaths.
Next();
69 if (nextPath == lastPath)
break;
145 printf(
"\nEnergy loss & range tables loaded for 0 materials.\n");
227 Error(
"AddElementalMaterial",
228 "Nuclear data tables have not been initialised");
233 Error(
"AddElementalMaterial",
234 "No element found in ElementDensity NDT-table with Z=%d", z);
238 if (ed->
IsGas()) state =
"gas";
278 if (density > 0) state =
"solid";
281 for (
int i = 0; i <
nelem; i++) {
321 if (density > 0) state =
"solid";
324 for (
int i = 0; i <
nelem; i++) {
358 Error(
"MakeNaturallyOccuringElementMixture",
359 "Nuclear data tables have not been initialised");
364 Error(
"AddElementalMaterial",
365 "No element found in ElementDensity NDT-table with Z=%d", z);
372 while (!isotopes.
End()) {
381 if (ed->
IsGas()) state =
"gas";
388 while (!isotopes.
End()) {
406 TString DataFilePath = filename;
410 Error(
"ReadPredefinedMaterials",
"Cannot open %s for reading", DataFilePath.
Data());
413 Info(
"ReadPredefinedMaterials",
"Reading materials in file : %s", filename);
421 while (filestream.good()) {
422 line.ReadLine(filestream);
423 if (filestream.good()) {
424 if (
line.BeginsWith(
"//"))
continue;
425 if (
line.BeginsWith(
"COMPOUND")) {
429 else if (
line.BeginsWith(
"MIXTURE")) {
433 else if (
line.BeginsWith(
"ELEMENT")) {
445 line.ReadLine(filestream);
446 while (filestream.good() && !
line.IsWhitespace() &&
line !=
"\n") {
449 if (next ==
"name") name =
line.Next();
450 else if (next ==
"symbol") symbol =
line.Next();
451 else if (next ==
"state") state =
line.Next();
452 else if (next ==
"density") density =
line.Next().Atof();
453 else if (next ==
"nelem") {
455 for (
int i = 0; i <
nelem; i++) {
456 line.ReadLine(filestream);
458 element[i] =
line.Next();
463 natoms[i] =
line.Next().Atoi();
464 if (mixture) proportion[i] =
line.Next().Atof();
476 line.ReadLine(filestream);
477 while (filestream.good() && !
line.IsWhitespace() &&
line !=
"\n") {
480 if (next ==
"name") name =
line.Next();
481 else if (next ==
"symbol") symbol =
line.Next();
482 else if (next ==
"state") state =
line.Next();
519 matfilename +=
".dat";
KVIonRangeTableMaterial * M
KVNDTManager * gNDTManager
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
static const Char_t * GetWORKDIRFilePath(const Char_t *namefile="")
const Char_t * GetType() const
static Bool_t SearchAndOpenKVFile(const Char_t *name, std::ifstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0)
virtual void Copy(TObject &) const
Make a copy of this object.
Atomic element with name, symbol and density.
const Char_t * GetElementName() const
const Char_t * GetElementSymbol() const
Extended version of ROOT THashList.
Material for use in energy loss & range calculations.
void AddCompoundElement(Int_t Z, Int_t A, Int_t Natoms)
void AddMixtureElement(Int_t Z, Int_t A, Int_t Natoms, Double_t Proportion)
virtual void Initialize()
Abstract base class for calculation of range & energy loss of charged particles in matter.
KVNuclData * GetData(Int_t zz, Int_t aa, const Char_t *name) const
Double_t GetValue() const
Description of properties and kinematics of atomic nuclei.
static Int_t IsMassGiven(const Char_t *)
KVNumberList GetKnownARange(Int_t z=-1, Double_t tmin=0) const
Double_t GetAbundance(Int_t z=-1, Int_t a=-1) const
Int_t GetZ() const
Return the number of proton / atomic number.
Strings used to represent a set of ranges of values.
Description of absorber for the Range dE/dx and range library.
Interface to Range dE/dx and range library.
virtual KVIonRangeTableMaterial * AddMixedMaterial(const Char_t *name, const Char_t *symbol, Int_t nelem, Int_t *z, Int_t *a, Int_t *natoms, Double_t *weight, Double_t density=-1.0) const
Bool_t fDoNotSaveMaterials
TString fLocalMaterialsDirectory
static KVHashList * fMaterials
static list of all currently defined materials
void SaveMaterial(KVIonRangeTableMaterial *mat) const
TObjArray * GetListOfMaterials()
KVIonRangeTableMaterial * GetMaterialWithNameOrType(const Char_t *material) const
void Print(Option_t *="") const
void Copy(TObject &) const
Make a copy of this object.
Bool_t ReadMaterials(const Char_t *filename) const
Read materials from file whose name is given.
virtual KVIonRangeTableMaterial * AddCompoundMaterial(const Char_t *name, const Char_t *symbol, Int_t nelem, Int_t *z, Int_t *a, Int_t *natoms, Double_t density=-1.0) const
KVIonRangeTableMaterial * MakeNaturallyOccuringElementMixture(Int_t z, Int_t &a) const
virtual KVIonRangeTableMaterial * AddElementalMaterial(Int_t z, Int_t a=0) const
void CheckMaterialsList() const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual TObject * FindObjectByType(const Char_t *) const
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
Extension of ROOT TSystemDirectory class, handling browsing directories on disk.
virtual TList * GetListOfFiles() const
Extended ROOT TSystemFile with added info on file size etc.
const Char_t * GetFullPath() const
virtual void Print(Option_t *option, const char *wildcard, Int_t recurse=1) const
void SetName(const char *name)
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual const char * GetName() const
virtual const char * GetTitle() const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
TString & ReplaceAll(const char *s1, const char *s2)
virtual int Chmod(const char *file, UInt_t mode)
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)