KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVMaterial.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  kvmaterial.cpp - description
3  -------------------
4  begin : Thu May 16 2002
5  copyright : (C) 2002 by J.D. Frankland
6  email : frankland@ganil.fr
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "Riostream.h"
19 #include "KVMaterial.h"
20 #include "KVNucleus.h"
21 #include "TMath.h"
22 #include "TSystem.h"
23 #include "TROOT.h"
24 #include "TEnv.h"
25 #include "TGeoMaterial.h"
26 #include "TGeoMedium.h"
27 #include "TGeoManager.h"
28 #include "KVIonRangeTable.h"
29 
30 using namespace std;
31 
33 
35 
36 //___________________________________________________________________________________
37 
44 
46 {
47  // Default initialisations.
48  // No properties are set for the material (except standard temperature (19°C) and pressure (1 atm))
49  // Default range table is generated if not already done.
50  // By default it is the VEDALOSS table implemented in KVedaLoss.
51  // You can change this by changing the value of environment variable KVMaterial.IonRangeTable.
52 
53  fELoss = 0;
54  SetName("");
55  SetTitle("");
56  fAmasr = 0;
57  fPressure = 1. * KVUnits::atm;
58  fTemp = 19.0;
59  // create default range table singleton if not already done
60  GetRangeTable();
61  fAbsorberVolume = nullptr;
62 }
63 
64 
65 //
66 
69 
71 {
72  //default ctor
73  init();
74 }
75 
76 
77 
80 
81 KVMaterial::KVMaterial(const Char_t* type, const Double_t thick)
82 {
83  // Create material with given type and linear thickness in cm.
84 
85  init();
86  SetMaterial(type);
87  SetThickness(thick);
88 }
89 
90 
91 
94 
95 KVMaterial::KVMaterial(Double_t area_density, const Char_t* type)
96 {
97  // Create material with given area density in g/cm**2 and given type
98 
99  init();
100  SetMaterial(type);
101  SetAreaDensity(area_density);
102 }
103 
104 
105 
113 
114 KVMaterial::KVMaterial(const Char_t* gas, const Double_t thick, const Double_t pressure, const Double_t temperature)
115 {
116  // Create gaseous material with given type, linear thickness in cm, pressure in Torr,
117  // and temperature in degrees C (default value 19°C).
118  //
119  // Examples
120  // 15 cm of CF4 gas at 1 atm and 19°C : KVMaterial("CF4", 15., 1.*KVUnits::atm)
121  // 50 mm of C3F8 at 30 mbar and 25°C : KVMaterial("C3F8", 50.*KVUnits::mm, 30.*KVUnits::mbar, 25.)
122 
123  init();
124  SetMaterial(gas);
125  fPressure = pressure;
126  fTemp = temperature;
127  SetThickness(thick);
128 }
129 
130 
131 //
132 
135 
137 {
138  //Copy ctor
139  init();
140 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
141  obj.Copy(*this);
142 #else
143  ((KVMaterial&) obj).Copy(*this);
144 #endif
145 }
146 
147 
148 
152 
154 {
155  // Static method
156  // Return pointer to current default range table
157  if (!fIonRangeTable) {
158  fIonRangeTable = KVIonRangeTable::GetRangeTable(gEnv->GetValue("KVMaterial.IonRangeTable", "VEDALOSS"));
159  }
160  return fIonRangeTable;
161 }
162 
163 
164 
169 
171 {
172  // Static method
173  // Changes the default range table used for energy loss calculations
174  // The name must correspond to a Plugin defined for class KVIonRangeTable
175 
176  if (fIonRangeTable) delete fIonRangeTable;
178  if (!fIonRangeTable)
179  ::Error("KVMaterial::ChangeRangeTable", "No plugin %s defined for KVIonRangeTable", name);
180  return fIonRangeTable;
181 }
182 
183 
184 
190 
191 void KVMaterial::SetMaterial(const Char_t* mat_type)
192 {
193  // Intialise material of a given type.
194  // The material must exist in the currently used range tables (fIonRangeTable).
195  // For materials which are elements of the periodic table you can specify
196  // the isotope such as "64Ni", "13C", "natSn", etc. etc.
197 
198  init();
199  //are we dealing with an isotope ?
200  Char_t type[10];
201  Int_t iso_mass = 0;
202  if (sscanf(mat_type, "nat%s", type) != 1) {
203  if (sscanf(mat_type, "%d%s", &iso_mass, type) != 2) {
204  strcpy(type, mat_type);
205  }
206  }
207  if (iso_mass) SetMass(iso_mass);
208  SetType(type);
210  Warning("SetMaterial",
211  "Called for material %s which is unknown in current range table %s. Energy loss & range calculations impossible.",
213  else {
215  SetName(type);
216  }
217 }
218 
219 
220 
223 
224 KVMaterial::~KVMaterial()
225 {
226  //Destructor
227 }
228 
229 
230 
234 
236 {
237  //Set the atomic mass of the material - use if you want to change the default naturally
238  //occuring mass for some rarer isotope.
239 
240  if (GetActiveLayer()) {
242  return;
243  }
244  fAmasr = a;
245 }
246 
247 
248 
251 
253 {
254  //Returns atomic mass of material. Will be isotopic mass if set.
255 
256  if (GetActiveLayer())
257  return GetActiveLayer()->GetMass();
259 }
260 
261 
262 
268 
270 {
271  //Returns kTRUE if a specific isotope has been chosen for the material
272  //using SetMass().
273  //e.g. for "119Sn" this method returns kTRUE
274  //e.g. for "natSn" this method returns kFALSE
275  if (GetActiveLayer())
276  return GetActiveLayer()->IsIsotopic();
277  return (fAmasr != 0);
278 }
279 
280 
281 
287 
289 {
290  //Returns kFALSE if a specific isotope has been chosen for the material
291  //using SetMass().
292  //e.g. for "119Sn" this method returns kFALSE
293  //e.g. for "natSn" this method returns kTRUE
294  if (GetActiveLayer())
295  return GetActiveLayer()->IsNat();
296  return (!IsIsotopic());
297 }
298 
299 
300 
301 
304 
306 {
307  // Returns kTRUE for gaseous materials/detectors.
308 
309  if (GetActiveLayer())
310  return GetActiveLayer()->IsGas();
312 }
313 
314 
315 
316 
319 
321 {
322  //Returns atomic number of material.
323  if (GetActiveLayer())
324  return GetActiveLayer()->GetZ();
325  return fIonRangeTable->GetZ(GetType());
326 }
327 
328 
329 
330 
334 
336 {
337  // Returns density of material in g/cm**3.
338  // For a gas, density is calculated from current pressure & temperature according to ideal gas law
339 
340  if (GetActiveLayer())
341  return GetActiveLayer()->GetDensity();
343  return fIonRangeTable->GetDensity(GetType());
344 }
345 
346 
347 
348 
353 
355 {
356  // Set the linear thickness of the material in cm or use one of the
357  // Units constants:
358  // SetThickness( 30.*KVUnits::um ); set thickness to 30 microns
359 
360  if (GetActiveLayer()) {
362  return;
363  }
364  // recalculate area density
365  if (GetDensity() != 0)
366  fThick = t * GetDensity();
367  else
368  fThick = t;
369 
370 }
371 
372 
373 
374 
379 
381 {
382  // Returns the linear thickness of the material in cm.
383  // Use Units to change units:
384  // mat.GetThickness()/KVUnits::um ; in microns
385 
386  if (GetActiveLayer())
387  return GetActiveLayer()->GetThickness();
388  if (GetDensity() != 0)
389  return fThick / GetDensity();
390  else
391  return fThick;
392 }
393 
394 
395 
396 
405 
406 void KVMaterial::SetAreaDensity(Double_t dens /* g/cm**2 */)
407 {
408  // Set area density in g/cm**2.
409  //
410  // For solids, area density can only changed by changing linear dimension
411  // (fixed density).
412  // For gases, the density depends on temperature and pressure. This method
413  // leaves temperature and pressure unchanged, therefore for gases also this
414  // method will effectively modify the linear dimension of the gas cell.
415 
416  if (GetActiveLayer())
418  fThick = dens;
419 }
420 
421 
422 
423 
426 
428 {
429  // Return area density of material in g/cm**2
430 
431  if (GetActiveLayer()) return GetActiveLayer()->GetAreaDensity();
432  return fThick;
433 }
434 
435 
436 
437 
442 
444 {
445  // Set the pressure of a gaseous material (in torr)
446  // As this changes the density of the gas, it also changes
447  // the area density of the absorber (for fixed linear dimension)
448 
449  if (!IsGas()) return;
450  if (GetActiveLayer()) {
452  return;
453  }
454  // get current linear dimension of absorber
455  Double_t e = GetThickness();
456  fPressure = p;
457  // change area density to keep linear dimension constant
458  SetThickness(e);
459 }
460 
461 
462 
463 
464 
468 
470 {
471  // Returns the pressure of a gas (in torr).
472  // If the material is not a gas, value is zero.
473 
474  if (!IsGas()) return 0.0;
475  if (GetActiveLayer())
476  return GetActiveLayer()->GetPressure();
477  return fPressure;
478 }
479 
480 
481 
482 
488 
490 {
491  // Set temperature of material.
492  // The units are: degrees celsius
493  // As this changes the density of the gas, it also changes
494  // the area density of the absorber (for fixed linear dimension)
495 
496  if (!IsGas()) return;
497  if (GetActiveLayer()) {
499  return;
500  }
501  // get current linear dimension of absorber
502  Double_t e = GetThickness();
503  fTemp = t;
504  // change area density to keep linear dimension constant
505  SetThickness(e);
506 }
507 
508 
509 
510 
511 
515 
517 {
518  //Returns temperature of material.
519  //The units are: degrees celsius
520 
521  if (GetActiveLayer())
522  return GetActiveLayer()->GetTemperature();
523  return fTemp;
524 }
525 
526 
527 
528 
532 
534  TVector3& direction)
535 {
536  // Calculate effective linear thickness of absorber (in cm) as 'seen' in 'direction', taking into
537  // account the arbitrary orientation of the 'norm' normal to the material's surface
538 
539  TVector3 n = norm.Unit();
540  TVector3 d = direction.Unit();
541  //absolute value of scalar product, in case direction is opposite to normal
542  Double_t prod = TMath::Abs(n * d);
543  return GetThickness() / TMath::Max(prod, 1.e-03);
544 }
545 
546 
547 
548 
552 
554  TVector3& direction)
555 {
556  // Calculate effective area density of absorber (in g/cm**2) as 'seen' in 'direction', taking into
557  // account the arbitrary orientation of the 'norm' normal to the material's surface
558 
559  TVector3 n = norm.Unit();
560  TVector3 d = direction.Unit();
561  //absolute value of scalar product, in case direction is opposite to normal
562  Double_t prod = TMath::Abs(n * d);
563  return GetAreaDensity() / TMath::Max(prod, 1.e-03);
564 }
565 
566 
567 
570 
572 {
573  //Show information on this material
574  cout << "KVMaterial: " << GetName() << " (" << GetType() << ")" << endl;
576  cout << " Pressure " << GetPressure() << " torr" << endl;
577  cout << " Thickness " << KVMaterial::GetThickness() << " cm" << endl;
578  cout << " Area density " << KVMaterial::GetAreaDensity() << " g/cm**2" << endl;
579  cout << "-----------------------------------------------" << endl;
580  cout << " Z = " << GetZ() << " atomic mass = " << GetMass() << endl;
581  cout << " Density = " << GetDensity() << " g/cm**3" << endl;
582  cout << "-----------------------------------------------" << endl;
583 }
584 
585 
586 
587 
596 
598 {
599  // Method to simulate passage of an ion through a given thickness of material.
600  // The energy loss of the particle (in MeV) in the material is returned by the method.
601  //
602  // If the optional argument 'norm' is given, it is supposed to be a vector
603  // normal to the material, oriented from the origin towards the material.
604  // In this case the effective thickness of the material 'seen' by the particle
605  // depending on its direction of motion is used for the calculation.
606 
607  Double_t thickness;
608  if (norm) {
609  TVector3 p = kvn->GetMomentum();
610  thickness = GetEffectiveThickness((*norm), p);
611  }
612  else
613  thickness = GetThickness();
614  Double_t E_loss =
615  fIonRangeTable->GetLinearDeltaEOfIon(GetType(), kvn->GetZ(), kvn->GetA(), kvn->GetKE(),
616  thickness, fAmasr, fTemp, fPressure);
617  return E_loss;
618 }
619 
620 
621 
622 
631 
633 {
634  //Calculate the energy of particle 'kvn' before its passage through the absorber,
635  //based on the current kinetic energy, Z & A of nucleus 'kvn'.
636  //
637  //If the optional argument 'norm' is given, it is supposed to be a vector
638  //normal to the material, oriented from the origin towards the material.
639  //In this case the effective thickness of the material 'seen' by the particle
640  //depending on its direction of motion is used for the calculation.
641 
642  Double_t thickness;
643  if (norm) {
644  TVector3 p = kvn->GetMomentum();
645  thickness = GetEffectiveThickness((*norm), p);
646  }
647  else
648  thickness = GetThickness();
649  Double_t E_inc = fIonRangeTable->
650  GetLinearEIncFromEResOfIon(GetType(), kvn->GetZ(), kvn->GetA(), kvn->GetKE(),
651  thickness, fAmasr, fTemp, fPressure);
652  return E_inc;
653 }
654 
655 
656 
657 
661 
663 {
664  // Calculate energy loss in absorber for incident nucleus (Z,A)
665  // with kinetic energy Einc (MeV)
666 
667  if (Z < 1) return 0.;
668  Double_t E_loss =
670 
671  return TMath::Max(E_loss, 0.);
672 }
673 
674 
675 
676 
680 
682 {
683  // Calculate range in absorber (in g/cm**2) for incident nucleus (Z,A)
684  // with kinetic energy Einc (MeV)
685 
686  if (Z < 1) return 0.;
687  Double_t R =
689  return R;
690 }
691 
692 
693 
694 
698 
700 {
701  // Calculate linear range in absorber (in centimetres) for incident nucleus (Z,A)
702  // with kinetic energy Einc (MeV)
703 
704  if (Z < 1) return 0.;
705  Double_t R =
707  return R;
708 }
709 
710 
711 
712 
716 
718 {
719  // Calculate energy loss in absorber for nucleus (Z,A)
720  // having a residual kinetic energy Eres (MeV) after the absorber
721 
722  if (Z < 1) return 0.;
723  Double_t E_loss = fIonRangeTable->
724  GetLinearDeltaEFromEResOfIon(
725  GetType(), Z, A, Eres, GetThickness(), fAmasr, fTemp, fPressure);
726  return E_loss;
727 }
728 
729 
730 
731 
749 
751 {
752  // Calculate residual kinetic energy Eres (MeV) after the absorber from
753  // energy loss in absorber for nucleus (Z,A). If dE is not given, the energy
754  // loss in this absorber is used.
755  // For a KVDetector, dE = energy loss in the ACTIVE layer, not the total
756  // energy lost in crossing the detector (i.e. the incident energy of the
757  // particle is NOT given by dE + Eres: due to losses in the inactive layers
758  // of the detector, Einc > dE + Eres).
759  //
760  //By default the solution corresponding to the highest incident energy is returned
761  //This is the solution found for Einc greater than the maximum of the dE(Einc) curve.
762  //If you want the low energy solution (i.e. below Bragg peak for gas detector)
763  //set SolType = KVMaterial::kEmin.
764  //
765  //If the given energy loss in the absorber is greater than the maximum theoretical dE
766  //(dE > GetBraggDE) then we return the residual energy corresponding to the
767  //maximum dE.
768 
769  Double_t EINC = GetIncidentEnergy(Z, A, dE, type);
770  return GetERes(Z, A, EINC);
771 }
772 
773 
774 
775 
787 
789 {
790  //Calculate incident energy of nucleus (Z,A) corresponding to the energy loss
791  //in this absorber. If delta_e is not given, the energy loss in this absorber is used.
792  //
793  //By default the solution corresponding to the highest incident energy is returned
794  //This is the solution found for Einc greater than the maximum of the dE(Einc) curve.
795  //If you want the low energy solution set SolType = KVIonRangeTable::kEmin.
796  //
797  //If the given energy loss in the absorber is greater than the maximum theoretical dE
798  //(dE > GetMaxDeltaE(Z,A)) then we return the incident energy corresponding to the maximum,
799  //GetEIncOfMaxDeltaE(Z,A)
800 
801  if (Z < 1) return 0.;
802 
803  Double_t DE = (delta_e > 0 ? delta_e : GetEnergyLoss());
804 
807 }
808 
809 
810 
811 
815 
817 {
818  // Calculate residual energy after absorber for incident nucleus (Z,A)
819  // with kinetic energy Einc (MeV)
820 
821  if (Z < 1) return 0.;
822  if (IsGas() && GetPressure() == 0)
823  return Einc;
824 
825  Double_t E_res =
827 
828  return E_res;
829 }
830 
831 
832 
833 
843 
845 {
846  //The energy loss of a charged particle traversing the absorber is calculated,
847  //and the particle is slowed down.
848  //
849  //If the optional argument 'norm' is given, it is supposed to be a unit vector
850  //normal to the material, oriented from the origin towards the material.
851  //In this case the effective thickness of the material 'seen' by the particle
852  //depending on its direction of motion is used for the calculation.
853 
854  //set flag to say that particle has been slowed down
855  kvp->SetIsDetected();
856  //If this is the first absorber that the particle crosses, we set a "reminder" of its
857  //initial energy
858  if (!kvp->GetPInitial())
859  kvp->SetE0();
860 
861 #ifdef DBG_TRGT
862  cout << "detectparticle in material " << GetType() << " of thickness "
863  << GetThickness() << endl;
864 #endif
865  Double_t el = GetELostByParticle(kvp, norm);
866  // set particle residual energy
867  Double_t Eres = kvp->GetKE() - el;
868  kvp->SetKE(Eres);
869  // add to total of energy losses in absorber
870  fELoss += el;
871 }
872 
873 
874 
875 
878 
880 {
881  //Reset absorber - set energy lost by particles to zero
882  fELoss = 0.0;
883 }
884 
885 
886 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
887 
890 
891 void KVMaterial::Copy(TObject& obj) const
892 #else
893 void KVMaterial::Copy(TObject& obj)
894 #endif
895 {
896  //Copy this to obj
897  KVBase::Copy(obj);
898  ((KVMaterial&) obj).SetMaterial(GetType());
899  ((KVMaterial&) obj).SetMass(GetMass());
900  ((KVMaterial&) obj).SetPressure(GetPressure());
901  ((KVMaterial&) obj).SetTemperature(GetTemperature());
902  ((KVMaterial&) obj).SetThickness(GetThickness());
903 }
904 
905 
906 
907 
910 
912  Double_t Eres)
913 {
914  //Get incident energy from residual energy
915  if (Z < 1) return 0.;
916 
917  return fIonRangeTable->
918  GetLinearEIncFromEResOfIon(GetType(), Z, A, Eres, GetThickness(), fAmasr, fTemp, fPressure);
919 }
920 
921 
922 
923 
926 
928 {
929  //Incident energy for which the DE(E) curve has a maximum
930  if (Z < 1) return 0.;
931 
932  return fIonRangeTable->
933  GetLinearEIncOfMaxDeltaEOfIon(GetType(), Z, A, GetThickness(), fAmasr, fTemp, fPressure);
934 }
935 
936 
937 
938 
942 
944 {
945  // The maximum energy loss of this particle (corresponding to incident energy GetEIncOfMaxDeltaE(Z,A))
946  // For detectors, this is the maximum energy loss in the active layer.
947 
948  if (GetActiveLayer()) return GetActiveLayer()->GetMaxDeltaE(Z, A);
949 
950  if (Z < 1) return 0.;
951 
952  return fIonRangeTable->
953  GetLinearMaxDeltaEOfIon(GetType(), Z, A, GetThickness(), fAmasr, fTemp, fPressure);
954 }
955 
956 
957 
958 
970 
972 {
973  // By default, return pointer to TGeoMedium corresponding to this KVMaterial.
974  // If argument "med_name" is given and corresponds to the name of an already existing
975  // medium, we return a pointer to this medium, or 0x0 if it does not exist.
976  // med_name = "Vacuum" is a special case: if the "Vacuum" does not exist, we create it.
977  //
978  // Instance of geometry manager class TGeoManager must be created before calling this
979  // method, otherwise 0x0 will be returned.
980  // If the required TGeoMedium is not already available in the TGeoManager, we create
981  // a new TGeoMedium corresponding to the properties of this KVMaterial.
982  // The name of the TGeoMedium (and associated TGeoMaterial) is the name of the KVMaterial.
983 
984  if (!gGeoManager) return NULL;
985 
986  if (strcmp(med_name, "")) {
987  TGeoMedium* gmed = gGeoManager->GetMedium(med_name);
988  if (gmed) return gmed;
989  else if (!strcmp(med_name, "Vacuum")) {
990  // create material
991  TGeoMaterial* gmat = new TGeoMaterial("Vacuum", 0, 0, 0);
992  gmat->SetTitle("Vacuum");
993  gmed = new TGeoMedium("Vacuum", 0, gmat);
994  gmed->SetTitle("Vacuum");
995  return gmed;
996  }
997  return NULL;
998  }
999 
1000  // if object is a KVDetector, we return medium corresponding to the active layer
1001  if (GetActiveLayer()) return GetActiveLayer()->GetGeoMedium();
1002 
1003  // for gaseous materials, the TGeoMedium/Material name is of the form
1004  // gasname_pressure
1005  // e.g. C3F8_37.5 for C3F8 gas at 37.5 torr
1006  // each gas with different pressure has to have a separate TGeoMaterial/Medium
1007  TString medName;
1008  if (IsGas()) medName.Form("%s_%f", GetName(), GetPressure());
1009  else medName = GetName();
1010 
1011  TGeoMedium* gmed = gGeoManager->GetMedium(medName);
1012 
1013  if (gmed) return gmed;
1014 
1015  TGeoMaterial* gmat = gGeoManager->GetMaterial(medName);
1016 
1017  if (!gmat) {
1018  // create material
1019  gmat = GetRangeTable()->GetTGeoMaterial(GetName());
1020  gmat->SetPressure(GetPressure());
1021  gmat->SetTemperature(GetTemperature());
1022  gmat->SetTransparency(0);
1023  gmat->SetName(medName);
1024  gmat->SetTitle(GetName());
1025  }
1026 
1027  // create medium
1028  static Int_t numed = 1; // static counter variable used to number media
1029  gmed = new TGeoMedium(medName, numed, gmat);
1030  numed += 1;
1031 
1032  return gmed;
1033 }
1034 
1035 
1036 
1041 
1043 {
1044  // Return maximum incident energy for which range tables are valid
1045  // for this material and ion (Z,A).
1046  // For detectors, return max energy for active layer.
1047  if (GetActiveLayer()) return GetActiveLayer()->GetEmaxValid(Z, A);
1048  return fIonRangeTable->GetEmaxValid(GetType(), Z, A);
1049 }
1050 
1051 
1052 
1056 
1058 {
1059  // Returns energy (in MeV) for which ion (Z,A) has a range equal to the
1060  // thickness of this absorber
1061 
1063 }
1064 
1065 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define d(i)
#define e(i)
char Char_t
bool Bool_t
double Double_t
const char Option_t
R__EXTERN TEnv * gEnv
int type
R__EXTERN TGeoManager * gGeoManager
Base class for KaliVeda framework.
Definition: KVBase.h:135
const Char_t * GetType() const
Definition: KVBase.h:170
virtual void SetType(const Char_t *str)
Definition: KVBase.h:166
virtual void Copy(TObject &) const
Make a copy of this object.
Definition: KVBase.cpp:397
Abstract base class for calculation of range & energy loss of charged particles in matter.
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 const Char_t * GetMaterialName(const Char_t *)
Return name of material of given type or name if it is in range tables.
virtual Double_t GetAtomicMass(const Char_t *)
Returns atomic mass of a material in the range tables.
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 TGeoMaterial * GetTGeoMaterial(const Char_t *material)
Create and return pointer to TGeoMaterial/Mixture corresponding to material.
virtual Double_t GetZ(const Char_t *)
Returns atomic number of a material in the range tables.
virtual Double_t GetEmaxValid(const Char_t *material, Int_t Z, Int_t A)
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 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 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.)
Description of physical materials used to construct detectors; interface to range tables.
Definition: KVMaterial.h:41
Double_t GetZ() const
Returns atomic number of material.
Definition: KVMaterial.cpp:320
virtual Double_t GetPressure() const
Definition: KVMaterial.cpp:469
virtual void SetPressure(Double_t)
Definition: KVMaterial.cpp:443
virtual void Copy(TObject &obj) const
Copy this to obj.
Definition: KVMaterial.cpp:891
virtual void SetTemperature(Double_t)
Definition: KVMaterial.cpp:489
Double_t GetEffectiveAreaDensity(TVector3 &norm, TVector3 &direction)
Definition: KVMaterial.cpp:553
virtual void SetThickness(Double_t thick)
Definition: KVMaterial.cpp:354
virtual Double_t GetThickness() const
Definition: KVMaterial.cpp:380
Double_t GetDensity() const
Definition: KVMaterial.cpp:335
Double_t fThick
area density of absorber in g/cm**2
Definition: KVMaterial.h:52
Bool_t IsGas() const
Returns kTRUE for gaseous materials/detectors.
Definition: KVMaterial.cpp:305
virtual TGeoMedium * GetGeoMedium(const Char_t *="")
Definition: KVMaterial.cpp:971
static KVIonRangeTable * GetRangeTable()
Definition: KVMaterial.cpp:153
virtual Double_t GetEnergyLoss() const
Definition: KVMaterial.h:91
virtual void Print(Option_t *option="") const
Show information on this material.
Definition: KVMaterial.cpp:571
Int_t fAmasr
isotopic mass of element
Definition: KVMaterial.h:51
void SetMass(Double_t a)
Definition: KVMaterial.cpp:235
virtual Double_t GetEmaxValid(Int_t Z, Int_t A)
virtual Double_t GetIncidentEnergy(Int_t Z, Int_t A, Double_t delta_e=-1.0, enum SolType type=kEmax)
Definition: KVMaterial.cpp:788
Double_t fELoss
total of energy lost by all particles traversing absorber
Definition: KVMaterial.h:55
virtual Double_t GetEIncOfMaxDeltaE(Int_t Z, Int_t A)
Incident energy for which the DE(E) curve has a maximum.
Definition: KVMaterial.cpp:927
virtual Double_t GetPunchThroughEnergy(Int_t Z, Int_t A)
Bool_t IsNat() const
Definition: KVMaterial.cpp:288
void init()
Definition: KVMaterial.cpp:45
virtual Double_t GetEResFromDeltaE(Int_t Z, Int_t A, Double_t dE=-1.0, enum SolType type=kEmax)
Definition: KVMaterial.cpp:750
virtual Double_t GetMaxDeltaE(Int_t Z, Int_t A)
Definition: KVMaterial.cpp:943
static KVIonRangeTable * ChangeRangeTable(const Char_t *name)
Definition: KVMaterial.cpp:170
void SetAreaDensity(Double_t dens)
Definition: KVMaterial.cpp:406
Double_t GetAreaDensity() const
Return area density of material in g/cm**2.
Definition: KVMaterial.cpp:427
Double_t fTemp
gas temperature in degrees celsius
Definition: KVMaterial.h:54
Double_t fPressure
gas pressure in torr
Definition: KVMaterial.h:53
virtual Double_t GetTemperature() const
Definition: KVMaterial.cpp:516
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres)
Get incident energy from residual energy.
Definition: KVMaterial.cpp:911
virtual void SetMaterial(const Char_t *type)
Definition: KVMaterial.cpp:191
virtual Double_t GetDeltaEFromERes(Int_t Z, Int_t A, Double_t Eres)
Definition: KVMaterial.cpp:717
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVMaterial.cpp:597
static KVIonRangeTable * fIonRangeTable
pointer to class used to calculate charged particle ranges & energy losses
Definition: KVMaterial.h:44
virtual Double_t GetERes(Int_t Z, Int_t A, Double_t Einc)
Definition: KVMaterial.cpp:816
virtual Double_t GetDeltaE(Int_t Z, Int_t A, Double_t Einc)
Definition: KVMaterial.cpp:662
virtual void Clear(Option_t *opt="")
Reset absorber - set energy lost by particles to zero.
Definition: KVMaterial.cpp:879
KVMaterial()
default ctor
Definition: KVMaterial.cpp:70
virtual Double_t GetRange(Int_t Z, Int_t A, Double_t Einc)
Definition: KVMaterial.cpp:681
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVMaterial.cpp:844
Bool_t IsIsotopic() const
Definition: KVMaterial.cpp:269
Double_t GetEffectiveThickness(TVector3 &norm, TVector3 &direction)
Definition: KVMaterial.cpp:533
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
Definition: KVMaterial.cpp:632
virtual Double_t GetLinearRange(Int_t Z, Int_t A, Double_t Einc)
Definition: KVMaterial.cpp:699
virtual KVMaterial * GetActiveLayer() const
Definition: KVMaterial.h:124
Double_t GetMass() const
Returns atomic mass of material. Will be isotopic mass if set.
Definition: KVMaterial.cpp:252
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Int_t GetA() const
Definition: KVNucleus.cpp:799
Int_t GetZ() const
Return the number of proton / atomic number.
Definition: KVNucleus.cpp:770
TVector3 * GetPInitial() const
Definition: KVParticle.h:687
TVector3 GetMomentum() const
Definition: KVParticle.h:565
void SetKE(Double_t ecin)
Definition: KVParticle.cpp:230
void SetE0(TVector3 *e=0)
Definition: KVParticle.h:676
void SetIsDetected()
Definition: KVParticle.h:691
Double_t GetKE() const
Definition: KVParticle.h:575
virtual const char * GetValue(const char *name, const char *dflt) const
TGeoMedium * GetMedium(const char *medium) const
TGeoMaterial * GetMaterial(const char *matname) const
void SetPressure(Double_t pressure)
void SetTransparency(Char_t transparency=0)
void SetTemperature(Double_t temperature)
virtual const char * GetName() const
virtual void SetTitle(const char *title="")
virtual void SetName(const char *name)
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
void Form(const char *fmt,...)
TVector3 Unit() const
const Int_t n
gr SetName("gr")
const long double atm
Definition: KVUnits.h:79
Type GetType(const std::string &Name)
constexpr Double_t R()
Double_t Abs(Double_t d)
Double_t Max(Double_t a, Double_t b)
auto * a