5#include "KVedaLossMaterial.h"
6#include "KVedaLossRangeFitter.h"
10#include <KVSystemDirectory.h>
11#include <KVSystemFile.h>
71 "Calculation of range and energy loss of charged particles in matter using VEDALOSS range tables")
77 Error(
"KVedaLoss",
"Problem reading range tables. Do not use.");
110 auto read_files_in_dir = [ = ](
const TString & dir) {
149 if (!(fp = fopen(DataFilePath,
"r"))) {
150 Error(
"init_materials()",
"Range tables file %s cannot be opened", DataFilePath);
155 while (fgets(
line, 132, fp)) {
164 if (sscanf(
line,
"+ %s %s %s %f %f %f %f %f",
165 gtype,
name, state, &Dens, &Zmat, &Amat,
168 Error(
"init_materials()",
"Problem reading file %s", DataFilePath);
232 if (yanez->GetMaterial(
name)) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
static const Char_t * GetDATADIRFilePath(const Char_t *namefile="")
static const Char_t * GetWORKDIRFilePath(const Char_t *namefile="")
virtual const Char_t * GetType() const
Extended version of ROOT THashList.
Material for use in energy loss & range calculations.
virtual void Initialize()
void SetTemperatureAndPressure(Double_t T, Double_t P)
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.
static KVIonRangeTable * GetRangeTable(const Char_t *name)
Generates an instance of the KVIonRangeTable plugin class corresponding to given name.
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual TObject * FindObjectByType(const Char_t *) const
virtual void Add(TObject *obj)
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
Description of material in the KVedaLoss range table.
static void SetNoLimits(Bool_t on=kTRUE)
Bool_t ReadRangeTable(FILE *fp)
static Bool_t CheckIon(Int_t Z)
Fit a range table using the VEDALOSS functional.
void SetMaterial(KVIonRangeTableMaterial *m)
Sets range table to fit. Also finds material with closest Z in VEDALOSS library.
void DoFits(TString output_file, Int_t Zmin=1, Int_t Zmax=100)
Perform fits to range tables for elements from Zmin to Zmax.
C++ implementation of VEDALOSS stopping power calculation.
KVIonRangeTableMaterial * AddCompoundMaterial(const Char_t *, const Char_t *, Int_t, Int_t *, Int_t *, Int_t *, Double_t=-1.0) const
TObjArray * GetListOfMaterials()
Bool_t init_materials() const
KVIonRangeTableMaterial * GetMaterialWithNameOrType(const Char_t *material) const
Returns pointer to material of given name or type.
KVedaLoss()
Default constructor.
virtual ~KVedaLoss()
Destructor.
static KVHashList * fMaterials
static list of all known materials
KVIonRangeTableMaterial * AddElementalMaterial(Int_t Z, Int_t A=0) const
TString fLocalMaterialsDirectory
void AddMaterial(KVIonRangeTableMaterial *) const
Bool_t ReadMaterials(const Char_t *path) const
Read and add range tables for materials in file.
Bool_t CheckIon(Int_t Z, Int_t A) const
KVIonRangeTableMaterial * AddMixedMaterial(const Char_t *, const Char_t *, Int_t, Int_t *, Int_t *, Int_t *, Double_t *, Double_t=-1.0) const
Bool_t AddRANGEMaterial(const Char_t *name) const
If the given material is defined in the RANGE tables, import it into VEDALOSS.
static Bool_t fgNewRangeInversion
static flag for using new KVedaLossInverseRangeFunction
static void SetIgnoreEnergyLimits(Bool_t yes=kTRUE)
void Print(Option_t *="") const
Bool_t CheckMaterialsList() const
void ls(Option_t *option="") const override
void SetName(const char *name)
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
const char * GetName() const override
const char * GetTitle() const override
void Add(TObject *obj) override
virtual void Error(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)