21 ifstream fin(fileName.c_str(), ios::in);
25 if( ! fin.is_open() ){
26 std::cout <<
"DiffusionGTS::readGasPerpParameters ERROR: can not open file " << fileName.c_str() << endl;
30 getline(fin, strline);
32 else if(strpar ==
"n_shift_x_drift"){
33 fin >> n_shift_x_drift;
35 else if(strpar ==
"shift_x_drift_par"){
36 for(
int i=0; i<n_shift_x_drift; i++) fin >> m_shift_x_drift_par[i];
38 else if(strpar ==
"n_sigma_x_drift"){
39 fin >> n_sigma_x_drift;
41 else if(strpar ==
"sigma_x_drift_par"){
42 for(
int i=0; i<n_sigma_x_drift; i++) fin >> m_sigma_x_drift_par[i];
44 else if(strpar ==
"shift_x_transf_par"){
45 fin >> m_shift_x_transf_par;
47 else if(strpar ==
"sigma_x_transf_par"){
48 fin >> m_sigma_x_transf_par;
50 else if(strpar ==
"shift_x_induct_par"){
51 fin >> m_shift_x_induct_par;
53 else if(strpar ==
"sigma_x_induct_par"){
54 fin >> m_sigma_x_induct_par;
56 else if(strpar ==
"n_shift_t_drift"){
57 fin >> n_shift_t_drift;
59 else if(strpar ==
"shift_t_drift_par"){
60 for(
int i=0; i<n_shift_t_drift; i++) fin >> m_shift_t_drift_par[i];
62 else if(strpar ==
"n_sigma_t_drift"){
63 fin >> n_sigma_t_drift;
65 else if(strpar ==
"sigma_t_drift_par"){
66 for(
int i=0; i<n_sigma_t_drift; i++) fin >> m_sigma_t_drift_par[i];
68 else if(strpar ==
"shift_t_transf_par"){
69 fin >> m_shift_t_transf_par;
71 else if(strpar ==
"sigma_t_transf_par"){
72 fin >> m_sigma_t_transf_par;
74 else if(strpar ==
"shift_t_induct_par"){
75 fin >> m_shift_t_induct_par;
77 else if(strpar ==
"sigma_t_induct_par"){
78 fin >> m_sigma_t_induct_par;
82 std::cout <<
"DiffusionGTS::readGasPerpParameters: open file " << fileName.c_str() << endl;
85 cout <<
"shift x in drift";
86 for(
int i=0; i<n_shift_x_drift; i++) cout <<
" " << m_shift_x_drift_par[i];
89 cout <<
"sigma x in drift";
90 for(
int i=0; i<n_sigma_x_drift; i++) cout <<
" " << m_sigma_x_drift_par[i];
92 cout <<
"shift x in transf " << m_shift_x_transf_par << endl;
93 cout <<
"sigma x in transf " << m_sigma_x_transf_par << endl;
94 cout <<
"shift x in induct " << m_shift_x_induct_par << endl;
95 cout <<
"sigma x in induct " << m_sigma_x_induct_par << endl;
97 cout <<
"shift t in drift";
99 for(
int i=0; i<n_shift_t_drift; i++) cout <<
" " << m_shift_t_drift_par[i];
102 cout <<
"sigma t in drift";
103 for(
int i=0; i<n_sigma_t_drift; i++) cout <<
" " << m_sigma_t_drift_par[i];
105 cout <<
"shift t in transf " << m_shift_t_transf_par << endl;
106 cout <<
"sigma t in transf " << m_sigma_t_transf_par << endl;
107 cout <<
"shift t in induct " << m_shift_t_induct_par << endl;
108 cout <<
"sigma t in induct " << m_sigma_t_induct_par << endl;
114 ifstream fin(fileName.c_str(), ios::in);
118 if( ! fin.is_open() ){
119 std::cout <<
"DiffusionGTS::readGasParalParameters ERROR: can not open file " << fileName.c_str() << endl;
121 while(fin >> strpar){
122 if(strpar[0] ==
'#'){
123 getline(fin, strline);
125 else if(strpar ==
"n_shift_x_drift"){
126 fin >> n_shift_y_drift;
128 else if(strpar ==
"shift_x_drift_par"){
129 for(
int i=0; i<n_shift_y_drift; i++) fin >> m_shift_y_drift_par[i];
131 else if(strpar ==
"n_sigma_x_drift"){
132 fin >> n_sigma_y_drift;
134 else if(strpar ==
"sigma_x_drift_par"){
135 for(
int i=0; i<n_sigma_y_drift; i++) fin >> m_sigma_y_drift_par[i];
137 else if(strpar ==
"shift_x_transf_par"){
138 fin >> m_shift_y_transf_par;
140 else if(strpar ==
"sigma_x_transf_par"){
141 fin >> m_sigma_y_transf_par;
143 else if(strpar ==
"shift_x_induct_par"){
144 fin >> m_shift_y_induct_par;
146 else if(strpar ==
"sigma_x_induct_par"){
147 fin >> m_sigma_y_induct_par;
153 std::cout <<
"DiffusionGTS::readGasParalParameters: open file " << fileName.c_str() << endl;
155 cout <<
"shift y in drift";
156 for(
int i=0; i<n_shift_y_drift; i++) cout <<
" " << m_shift_y_drift_par[i];
158 cout <<
"sigma y in drift";
159 for(
int i=0; i<n_sigma_y_drift; i++) cout <<
" " << m_sigma_y_drift_par[i];
161 cout <<
"shift y in transf " << m_shift_y_transf_par << endl;
162 cout <<
"sigma y in transf " << m_sigma_y_transf_par << endl;
163 cout <<
"shift y in induct " << m_shift_y_induct_par << endl;
164 cout <<
"sigma y in induct " << m_sigma_y_induct_par << endl;
166 cout <<
"shift t in drift";
168 for(
int i=0; i<n_shift_t_drift; i++) cout <<
" " << m_shift_t_drift_par[i];
182 for(
int i=0; i<n_shift_x_drift; i++) dx += pow(z, i) * m_shift_x_drift_par[i];
186 double dx = m_shift_x_transf_par;
190 double dx = m_shift_x_induct_par;
203 for(
int i=0; i<n_sigma_x_drift; i++) dx += pow(z, i) * m_sigma_x_drift_par[i];
207 double dx = m_sigma_x_transf_par;
211 double dx = m_sigma_x_induct_par;
225 for(
int i=0; i<n_shift_y_drift; i++) dy += pow(z, i) * m_shift_y_drift_par[i];
229 double dy = m_shift_y_transf_par;
233 double dy = m_shift_y_induct_par;
245 for(
int i=0; i<n_sigma_y_drift; i++) dy += pow(z, i) * m_sigma_y_drift_par[i];
249 double dy = m_sigma_y_transf_par;
253 double dy = m_sigma_y_induct_par;
266 for(
int i=0; i<n_shift_t_drift; i++)
dt += pow(z, i) * m_shift_t_drift_par[i];
271 double dx = m_shift_t_transf_par;
275 double dx = m_shift_t_induct_par;
287 for(
int i=0; i<n_sigma_t_drift; i++)
dt += pow(z, i) * m_sigma_t_drift_par[i];
291 double dx = m_sigma_t_transf_par;
295 double dx = m_sigma_t_induct_par;
307 xf = xi + gRandom->Gaus(dx, sx);
312 yf = yi + gRandom->Gaus(dy, sy);
317 tf = ti + gRandom->Gaus(
dt, st);
325 xf = xi + gRandom->Gaus(dx, sx);
330 yf = yi + gRandom->Gaus(dy, sy);
335 tf = ti + gRandom->Gaus(
dt, st);
344 xf = xi + gRandom->Gaus(dx, sx);
349 yf = yi + gRandom->Gaus(dy, sy);
354 tf = ti + gRandom->Gaus(
dt, st);
double sigma_t_drift(double z)
void diffusion_transf(double xi, double yi, double zi, double ti, double &xf, double &yf, double &zf, double &tf)
double sigma_x_drift(double z)
DiffusionGTS(ICgemGeomSvc *geomSvc)
void readGasPerpParameters(std::string fileName)
void readGasParalParameters(std::string fileName)
double shift_t_drift(double z)
double shift_y_drift(double z)
double sigma_y_drift(double z)
void diffusion_induct(double xi, double yi, double zi, double ti, double &xf, double &yf, double &zf, double &tf)
void diffusion_drift(double xi, double yi, double zi, double ti, double &xf, double &yf, double &zf, double &tf)
double shift_x_drift(double z)