KaliVeda
Toolkit for HIC analysis
KVIonRangeTableMaterial.h
1 
4 #ifndef __KVIONRANGETABLEMATERIAL_H
5 #define __KVIONRANGETABLEMATERIAL_H
6 
7 #include "KVBase.h"
8 #include <TString.h>
9 #include <KVList.h>
10 #include "KVIonRangeTable.h"
11 
12 class TGeoMaterial;
13 class TF1;
14 
15 #define RTT 62.36367e+03 // cm^3.Torr.K^-1.mol^-1
16 #define ZERO_KELVIN 273.15
17 
28 protected:
38 
40 
45 
46 public:
48  KVIonRangeTableMaterial(const KVIonRangeTable*, const Char_t* name, const Char_t* symbol, const Char_t* state,
49  Double_t density = -1, Double_t Z = -1, Double_t A = -1);
51  virtual ~KVIonRangeTableMaterial();
52 
53  virtual void Initialize();
54  const KVIonRangeTable* GetTable() const
55  {
56  return fTable;
57  }
58 
59  void ls(Option_t* = "") const override;
60  void Print(Option_t* = "") const override;
61  virtual Float_t GetEmaxValid(Int_t /* Z */, Int_t /* A */) const
62  {
63  return 1.e+4;
64  };
65  virtual Float_t GetEminValid(Int_t /* Z */, Int_t /* A */) const
66  {
67  return 0.0;
68  };
69 
70  void Copy(TObject&) const override;
71  const Char_t* GetSymbol() const
72  {
73  return GetTitle();
74  };
75  Double_t GetMass() const
76  {
77  return fAmat;
78  };
79  Double_t GetZ() const
80  {
81  return fZmat;
82  };
84  {
86  return fMoleWt;
87  };
89  {
93  return fDens;
94  };
96  {
99  if(!IsGas())
100  fDens = d;
101  };
103  {
106  if (IsGas() && P == 0) fDens = 0;
107  if (IsGas() && T > 0 && P > 0) fDens = (fMoleWt * P) / ((T + ZERO_KELVIN) * RTT);
108  };
109  void SetState(const Char_t* st)
110  {
112  fState = st;
113  };
114  Bool_t IsGas() const
115  {
117  return (fState == "gas");
118  };
119 
121  {
123  return (fCompound);
124  };
126  {
128  return (fMixture);
129  };
130 
132  {
134  return fComposition;
135  };
136 
137  void AddCompoundElement(Int_t Z, Int_t A, Int_t Natoms);
138  void AddMixtureElement(Int_t Z, Int_t A, Int_t Natoms, Double_t Proportion);
139 
140  TGeoMaterial* GetTGeoMaterial() const;
141 
142  virtual TF1* GetRangeFunction(Int_t Z, Int_t A, Double_t isoAmat = 0) = 0;
143  virtual TF1* GetDeltaEFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat = 0) = 0;
144  virtual TF1* GetEResFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat = 0) = 0;
145  virtual TF1* GetStoppingFunction(Int_t Z, Int_t A, Double_t isoAmat = 0) = 0;
146 
147  void PrintRangeTable(Int_t Z, Int_t A, Double_t isoAmat = 0, Double_t units = KVUnits::cm, Double_t T = -1, Double_t P = -1);
148  void PrintComposition(std::ostream&) const;
149 
150  virtual Double_t GetRangeOfIon(Int_t Z, Int_t A, Double_t E, Double_t isoAmat = 0.);
151  virtual Double_t GetLinearRangeOfIon(Int_t Z, Int_t A, Double_t E, Double_t isoAmat = 0, Double_t T = -1., Double_t P = -1.);
152 
153  virtual Double_t GetDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat = 0.);
154  virtual Double_t GetLinearDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
155 
156  virtual Double_t GetEResOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat = 0.);
157  virtual Double_t GetLinearEResOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
158 
159  virtual Double_t GetEIncFromEResOfIon(Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat = 0.);
160  virtual Double_t GetLinearEIncFromEResOfIon(Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
161 
163  virtual Double_t GetLinearEIncFromDeltaEOfIon(Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum KVIonRangeTable::SolType type = KVIonRangeTable::kEmax, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
164 
166  {
169  return GetEIncFromEResOfIon(Z, A, ERes, e, isoAmat) - ERes;
170  }
171 
173  Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.)
174  {
178  return GetLinearEIncFromEResOfIon(Z, A, ERes, e, isoAmat, T, P) - ERes;
179  }
180 
181  virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0.) ;
182  virtual Double_t GetLinearPunchThroughEnergy(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.) ;
183 
184  virtual Double_t GetMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0.);
185  virtual Double_t GetEIncOfMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0.);
186  virtual Double_t GetLinearMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
187  virtual Double_t GetLinearEIncOfMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
188 
190  {
193  return fRangeOfLastDE;
194  }
195 
196  ClassDefOverride(KVIonRangeTableMaterial, 1) //Material for use in energy loss & range calculations
197 };
198 
199 #endif
int Int_t
#define d(i)
#define e(i)
bool Bool_t
char Char_t
float Float_t
double Double_t
const char Option_t
#define ClassDefOverride(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:140
Material for use in energy loss & range calculations.
virtual Double_t GetLinearEIncOfMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetLinearPunchThroughEnergy(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
void Print(Option_t *="") const override
virtual Double_t GetDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0.)
Double_t GetDeltaEFromEResOfIon(Int_t Z, Int_t A, Double_t ERes, Double_t e, Double_t isoAmat=0.)
void AddCompoundElement(Int_t Z, Int_t A, Int_t Natoms)
virtual Double_t GetLinearMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetLinearEIncFromDeltaEOfIon(Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum KVIonRangeTable::SolType type=KVIonRangeTable::kEmax, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
TF1 * fDeltaE
function parameterising energy loss in material
virtual Double_t GetEResOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0.)
virtual Double_t GetLinearRangeOfIon(Int_t Z, Int_t A, Double_t E, Double_t isoAmat=0, Double_t T=-1., Double_t P=-1.)
Double_t fZmat
effective atomic number of material
TGeoMaterial * GetTGeoMaterial() const
const KVIonRangeTable * GetTable() const
virtual TF1 * GetEResFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat=0)=0
const Char_t * GetSymbol() const
virtual TF1 * GetStoppingFunction(Int_t Z, Int_t A, Double_t isoAmat=0)=0
virtual Float_t GetEmaxValid(Int_t, Int_t) const
virtual TF1 * GetDeltaEFunction(Double_t e, Int_t Z, Int_t A, Double_t isoAmat=0)=0
void AddMixtureElement(Int_t Z, Int_t A, Int_t Natoms, Double_t Proportion)
void SetState(const Char_t *st)
Double_t fDens
density of material in g/cm**3
KVIonRangeTableMaterial()
Default constructor.
TString fState
state of material = "solid", "liquid", "gas", "unknown"
virtual Double_t GetEIncFromDeltaEOfIon(Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum KVIonRangeTable::SolType type=KVIonRangeTable::kEmax, Double_t isoAmat=0.)
virtual Double_t GetLinearDeltaEOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual TF1 * GetRangeFunction(Int_t Z, Int_t A, Double_t isoAmat=0)=0
virtual ~KVIonRangeTableMaterial()
Destructor.
void PrintComposition(std::ostream &) const
Print to stream the composition of this material, in a format compatible with the VEDALOSS parameter ...
Double_t fAmat
effective mass number of material
TF1 * fEres
function parameterising residual energy after crossing material
virtual Float_t GetEminValid(Int_t, Int_t) const
virtual Double_t GetEIncFromEResOfIon(Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat=0.)
TF1 * fRange
function parameterising range of charged particles in material
TF1 * fStopping
function parameterising stopping power of charged particles in material
void Copy(TObject &) const override
virtual Double_t GetLinearEResOfIon(Int_t Z, Int_t A, Double_t E, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
Double_t fRangeOfLastDE
range corresponding to last calculated DE
void ls(Option_t *="") const override
const KVIonRangeTable * fTable
parent range table
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0.)
KVList * fComposition
composition of compound/mixture
virtual Double_t GetLinearEIncFromEResOfIon(Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
void SetTemperatureAndPressure(Double_t T, Double_t P)
void PrintRangeTable(Int_t Z, Int_t A, Double_t isoAmat=0, Double_t units=KVUnits::cm, Double_t T=-1, Double_t P=-1)
virtual Double_t GetEIncOfMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0.)
Double_t GetLinearDeltaEFromEResOfIon(Int_t Z, Int_t A, Double_t ERes, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetMaxDeltaEOfIon(Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0.)
Double_t fMoleWt
mass of one mole of substance in grammes
virtual Double_t GetRangeOfIon(Int_t Z, Int_t A, Double_t E, Double_t isoAmat=0.)
Abstract base class for calculation of range & energy loss of charged particles in matter.
Extended TList class which owns its objects by default.
Definition: KVList.h:22
const char * GetTitle() const override
double T(double x)