KaliVeda
Toolkit for HIC analysis
KVIonRangeTable.h
1 
4 #ifndef KVIONRANGETABLE_H
5 #define KVIONRANGETABLE_H
6 
7 #include "KVBase.h"
8 #include "KVUnits.h"
9 
16 class TGeoMaterial;
18 class TGeoManager;
19 class TVector3;
20 
21 class KVIonRangeTable : public KVBase {
22 
23 protected:
24  virtual KVIonRangeTableMaterial* GetMaterialWithPointer(TGeoMaterial*) const;
25  virtual KVIonRangeTableMaterial* GetMaterialWithNameOrType(const Char_t* material) const = 0;
26 
27 public:
28  enum SolType {
30  kEmin
31  };
32  std::optional<double> get_element_density(int z) const;
33  bool is_gas(int z) const;
34  std::string get_element_name(int z) const;
35  std::string get_element_symbol(int z) const;
36 
37 
38  KVIonRangeTable(const Char_t* name = "", const Char_t* title = "");
39  virtual ~KVIonRangeTable();
40 
41  static KVIonRangeTable* GetRangeTable(const Char_t* name);
42 
44  {
54 
55  IGNORE_UNUSED(z);
56  IGNORE_UNUSED(a);
57  return nullptr;
58  }
67  };
68 
70  const Char_t* name, const Char_t* symbol,
71  const std::vector<CompoundFormulaElement>& elements, Double_t density = -1.0) const
72  {
87 
88  IGNORE_UNUSED(name);
89  IGNORE_UNUSED(symbol);
90  IGNORE_UNUSED(elements);
91  IGNORE_UNUSED(density);
92  return nullptr;
93  }
100  };
102  const Char_t* name, const Char_t* symbol,
103  const std::vector<MixtureFormulaElement>& elements,
104  Double_t density = -1.0) const
105  {
119  IGNORE_UNUSED(name);
120  IGNORE_UNUSED(symbol);
121  IGNORE_UNUSED(elements);
122  IGNORE_UNUSED(density);
123  return nullptr;
124  }
125 
129 
131  virtual TGeoMaterial* GetTGeoMaterial(const Char_t* material);
132 
135  virtual Double_t GetEmaxValid(const Char_t* material, Int_t Z, Int_t A);
136 
138  virtual Double_t GetDensity(const Char_t*);
139 
141  virtual void SetDensity(const Char_t*, Double_t);
142 
145  virtual void SetTemperatureAndPressure(const Char_t*, Double_t temperature, Double_t pressure);
146 
148  virtual Double_t GetZ(const Char_t*);
149 
151  virtual Double_t GetAtomicMass(const Char_t*);
152 
154  KVIonRangeTableMaterial* GetMaterial(const Char_t* material) const;
156 
158  virtual Bool_t IsMaterialKnown(const Char_t*);
159 
161 
163  virtual Bool_t IsMaterialGas(const Char_t*);
164 
166  const Char_t* GetMaterialName(const Char_t*);
167 
169  const Char_t* GetMaterialType(const Char_t*);
170 
174  virtual Double_t GetRangeOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E,
175  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
176 
180  virtual Double_t GetLinearRangeOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E,
181  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
182 
186  virtual Double_t GetDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E, Double_t r,
187  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
188 
192  virtual Double_t GetLinearDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E, Double_t d,
193  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
194 
195  virtual Double_t GetEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E, Double_t r,
196  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
197  virtual Double_t GetLinearEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t E, Double_t d,
198  Double_t Amat = 0., Double_t T = -1., Double_t P = -1.);
199 
200  virtual Double_t GetEIncFromEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
201  virtual Double_t GetLinearEIncFromEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t Eres, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
202 
203  virtual Double_t GetEIncFromDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum SolType type = kEmax, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
204  virtual Double_t GetLinearEIncFromDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum SolType type = kEmax, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
205 
206  virtual Double_t GetDeltaEFromEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t ERes, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
207  virtual Double_t GetLinearDeltaEFromEResOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t ERes, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
208 
209  virtual Double_t GetPunchThroughEnergy(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
210  virtual Double_t GetLinearPunchThroughEnergy(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
211 
212  virtual Double_t GetMaxDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
213  virtual Double_t GetEIncOfMaxDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
214  virtual Double_t GetLinearMaxDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
215  virtual Double_t GetLinearEIncOfMaxDeltaEOfIon(const Char_t* mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat = 0., Double_t T = -1., Double_t P = -1.);
216 
217  void Print(Option_t* = "") const override;
218 
219  virtual Bool_t CheckIon(Int_t, Int_t) const
220  {
221  AbstractMethod("CheckIon");
222  return kTRUE;
223  }
224  virtual Bool_t ReadMaterials(const Char_t*) const = 0;
225 
226  ClassDefOverride(KVIonRangeTable, 1) //Abstract base class for calculation of range & energy loss of charged particles in matter
227 };
228 
229 #endif
int Int_t
bool Bool_t
char Char_t
double Double_t
constexpr Bool_t kTRUE
const char Option_t
#define ClassDefOverride(name, id)
char name[80]
Base class for KaliVeda framework.
Definition: KVBase.h:140
Material for use in energy loss & range calculations.
Abstract base class for calculation of range & energy loss of charged particles in matter.
KVIonRangeTableMaterial * GetMaterial(const Char_t *material) const
Returns pointer to material of given name or type.
virtual Bool_t IsMaterialGas(const Char_t *)
Return kTRUE if material is gaseous.
virtual Double_t GetLinearEIncFromDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum SolType type=kEmax, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetEIncFromEResOfIon(const Char_t *mat, 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 Print(Option_t *="") const override
std::string get_element_name(int z) const
virtual KVIonRangeTableMaterial * AddCompoundMaterial(const Char_t *name, const Char_t *symbol, const std::vector< CompoundFormulaElement > &elements, Double_t density=-1.0) const
virtual Bool_t CheckIon(Int_t, Int_t) const
const Char_t * GetMaterialName(const Char_t *)
Return name of material of given type or name if it is in range tables.
virtual KVIonRangeTableMaterial * AddMixedMaterial(const Char_t *name, const Char_t *symbol, const std::vector< MixtureFormulaElement > &elements, Double_t density=-1.0) const
bool is_gas(int z) const
virtual Bool_t ReadMaterials(const Char_t *) const =0
virtual Double_t GetAtomicMass(const Char_t *)
Returns atomic mass of a material in the range tables.
const Char_t * GetMaterialType(const Char_t *)
Return type of material of given type or name if it is in range tables.
std::string get_element_symbol(int z) const
virtual Double_t GetLinearMaxDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
std::optional< double > get_element_density(int z) const
virtual Double_t GetRangeOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetEResOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t r, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
static KVIonRangeTable * GetRangeTable(const Char_t *name)
Generates an instance of the KVIonRangeTable plugin class corresponding to given name.
virtual Double_t GetMaxDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual TObjArray * GetListOfMaterials()=0
KVIonRangeTable(const Char_t *name="", const Char_t *title="")
Default constructor.
virtual Double_t GetLinearEIncFromEResOfIon(const Char_t *mat, 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 TGeoMaterial * GetTGeoMaterial(const Char_t *material)
Create and return pointer to TGeoMaterial/Mixture corresponding to material.
virtual KVIonRangeTableMaterial * AddElementalMaterial(Int_t z, Int_t a=0) const
virtual Double_t GetZ(const Char_t *)
Returns atomic number of a material in the range tables.
virtual Double_t GetLinearEResOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t d, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetEIncFromDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t DeltaE, Double_t e, enum SolType type=kEmax, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual void SetDensity(const Char_t *, Double_t)
Changes the density (g/cm**3) of a material in the range tables.
virtual Double_t GetPunchThroughEnergy(const Char_t *mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetEmaxValid(const Char_t *material, Int_t Z, Int_t A)
virtual Double_t GetLinearEIncOfMaxDeltaEOfIon(const Char_t *mat, 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(const Char_t *mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetLinearDeltaEFromEResOfIon(const Char_t *mat, 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 Bool_t IsMaterialKnown(const Char_t *)
Return kTRUE if material is in range tables.
virtual Double_t GetLinearDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t d, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetDeltaEFromEResOfIon(const Char_t *mat, 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 ~KVIonRangeTable()
Destructor.
virtual Double_t GetEIncOfMaxDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t e, Double_t isoAmat=0., Double_t T=-1., Double_t P=-1.)
virtual Double_t GetDeltaEOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t r, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
virtual void SetTemperatureAndPressure(const Char_t *, Double_t temperature, Double_t pressure)
virtual Double_t GetDensity(const Char_t *)
Returns density (g/cm**3) of a material in the range tables.
virtual Double_t GetLinearRangeOfIon(const Char_t *mat, Int_t Z, Int_t A, Double_t E, Double_t Amat=0., Double_t T=-1., Double_t P=-1.)
void AbstractMethod(const char *method) const
Specifies the contribution of each element to a compound.
Specifies the contribution of each element to a mixture.
TArc a