BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnGemGas.h
Go to the documentation of this file.
1#ifndef BMNGEMGAS_HH
2#define BMNGEMGAS_HH
3
4#include <assert.h>
5#include <ostream>
6#include <string>
7#include <vector>
8
16
18{
19 public:
20 // constructors
21 BmnGemGas();
22 ~BmnGemGas();
23
24 BmnGemGas(double const E,
25 double const B,
26 double const T,
27 double const p,
28 double const VDrift,
29 double const Dl,
30 double const Dt,
31 double const k,
32 double const W,
33 const std::vector<double>& CSD,
34 double const CSDEpol);
35
36 BmnGemGas(const std::string& Filename, double const E);
37
38 // accessors
39 double VDrift() const { return _VDrift; }
40 double Dl() const { return _Dl; }
41 double Dt() const { return _Dt; }
42 double VDrift(double const dE, double const dB) const { return _VDrift; }
43 double Dl(double const dE, double const dB) const { return _Dl; }
44 double Dt(double const dE, double const dB) const { return _Dt; }
45 double k() const { return _k; }
46 double W() const { return _W; }
47 double CSD(int i) const { return _CSD.at(i); }
48 const std::vector<double>& CSD() const { return _CSD; }
49 int nCSD() const { return _CSD.size(); }
50 double CSDNorm() const { return _CSDNorm; }
51 double CSDEpol() const { return _CSDEpol; }
52
53 double E() const { return _E; }
54 double B() const { return _B; }
55 double T() const { return _T; }
56 double p() const { return _p; }
57
58 int GetRandomCS(double const r) const; // has problem with not normalized table
59 int GetRandomCSUniform() const;
60
61 void PrintAll(std::ostream& s) const { s << *this; }
62
63 void operator=(const BmnGemGas& GasToCopy);
64 friend std::ostream& operator<<(std::ostream&, const BmnGemGas&);
65
66 // modifiers
67 void SetE(double const dE)
68 {
69 _E = dE;
70 } // later this method should also retrieve
71 // updated gas values for the new field!
72 void SetB(double const dB) { _B = dB; }
73 void SetT(double const dT) { _T = dT; }
74 void Setp(double const dp) { _p = dp; }
75 void SetCSD(const std::vector<double>& CSD);
76 void SetCSDEpol(double const dCSDEpol) { _CSDEpol = dCSDEpol; }
77
78 private:
79 double _E; // electric field [V/cm](some gas parameters depend on it)
80 double _B; // B field [T] assumption: B || E !!!
81 double _T; // Temperature [K]
82 double _p; // pressure [mbar]
83
84 double _VDrift; // electron Drift velocity [cm/ns]
85 double _Dl; // longitudinal diffusion coefficient [sqrt(cm)]
86 double _Dt; // transversal diffusion coefficient [sqrt(cm)]
87 double _k; // attachment coefficient[1/cm]
88 double _W; // effective ionisation energy [eV]
89 std::vector<double> _CSD; // Cluster size distribution
90 double _CSDNorm; // Intergral of CSD must be 1 but actually not. Used for correction.
91 double _CSDEpol; // Constant used for the inverse quadratic extrapolation
92 // of Cluster Sizes bigger than _nCSD
93
94 const double LinExpolation(double const inTable, const double* const table, int const nTable);
95 int ReadGasBegin(std::ifstream* const pinfile);
96 int ReadGasArrays(std::ifstream* const pinfile,
97 int const noent,
98 double* const e,
99 double* const vdrift,
100 double* const dt,
101 double* const dl,
102 double* const k);
103 const double GetPositionOfE(int const noent, const double* const e);
104};
105
106#endif
gascomponents
Definition BmnGemGas.h:10
@ Ne
Definition BmnGemGas.h:11
@ Ar
Definition BmnGemGas.h:12
@ CO2
Definition BmnGemGas.h:13
@ CH4
Definition BmnGemGas.h:14
int i
Definition P4_F32vec4.h:22
double CSDEpol() const
Definition BmnGemGas.h:51
std::vector< double > _CSD
Definition BmnGemGas.h:89
double Dl(double const dE, double const dB) const
Definition BmnGemGas.h:43
double k() const
Definition BmnGemGas.h:45
double _Dt
Definition BmnGemGas.h:86
double Dt(double const dE, double const dB) const
Definition BmnGemGas.h:44
double W() const
Definition BmnGemGas.h:46
void PrintAll(std::ostream &s) const
Definition BmnGemGas.h:61
int ReadGasArrays(std::ifstream *const pinfile, int const noent, double *const e, double *const vdrift, double *const dt, double *const dl, double *const k)
double _B
Definition BmnGemGas.h:80
void SetB(double const dB)
Definition BmnGemGas.h:72
double _Dl
Definition BmnGemGas.h:85
double B() const
Definition BmnGemGas.h:54
void Setp(double const dp)
Definition BmnGemGas.h:74
int GetRandomCS(double const r) const
double _E
Definition BmnGemGas.h:79
double _CSDEpol
Definition BmnGemGas.h:91
double _W
Definition BmnGemGas.h:88
friend std::ostream & operator<<(std::ostream &, const BmnGemGas &)
double CSDNorm() const
Definition BmnGemGas.h:50
int ReadGasBegin(std::ifstream *const pinfile)
double Dt() const
Definition BmnGemGas.h:41
void SetCSDEpol(double const dCSDEpol)
Definition BmnGemGas.h:76
void SetT(double const dT)
Definition BmnGemGas.h:73
void operator=(const BmnGemGas &GasToCopy)
double _T
Definition BmnGemGas.h:81
double _CSDNorm
Definition BmnGemGas.h:90
const std::vector< double > & CSD() const
Definition BmnGemGas.h:48
const double LinExpolation(double const inTable, const double *const table, int const nTable)
void SetE(double const dE)
Definition BmnGemGas.h:67
int nCSD() const
Definition BmnGemGas.h:49
double _k
Definition BmnGemGas.h:87
int GetRandomCSUniform() const
double VDrift() const
Definition BmnGemGas.h:39
double p() const
Definition BmnGemGas.h:56
double _p
Definition BmnGemGas.h:82
const double GetPositionOfE(int const noent, const double *const e)
double T() const
Definition BmnGemGas.h:55
double VDrift(double const dE, double const dB) const
Definition BmnGemGas.h:42
double CSD(int i) const
Definition BmnGemGas.h:47
void SetCSD(const std::vector< double > &CSD)
double E() const
Definition BmnGemGas.h:53
double _VDrift
Definition BmnGemGas.h:84
double Dl() const
Definition BmnGemGas.h:40