43 {
44
45 double time_spent = 0.;
46 clock_t begin = clock();
47 m_geomSvc = geomSvc;
48 m_magConfig = magConfig;
49
50
51 string filePath = getenv("CGEMDIGITIZERSVCROOT");
52 string fileName;
53
54 fileName = filePath + "/dat/par_settings_GTS.txt";
55 ifstream fin(fileName.c_str(), ios::in);
56
57 string strline;
58 string strpar;
59 if( ! fin.is_open() ){
60 std::cout << "SamplingGTS::init ERROR: can not open file " << filePath << endl;
61 }
62 else std::cout << "SamplingGTS::init: open file " << fileName << endl;
63
64
65 while(fin >> strpar){
66
67 if(strpar[0] == '#'){
68 getline(fin, strline);
69 }
70 else if(strpar == "high_voltage") {
71 fin >> m_hv;
72 }
73 else if(strpar == "magnetic_field") {
74 fin >> m_field;
75 }
76 else if(strpar == "tuning_factor_gain") {
77 fin >> m_tuning_factor_gain;
78 }
79 else if(strpar == "tuning_factor_diff_perp") {
80 fin >> m_tuning_factor_diff_perp;
81 }
82 else if(strpar == "tuning_factor_diff_paral") {
83 fin >> m_tuning_factor_diff_paral;
84 }
85 }
86
87 cout << "SamplingGTS::init: drift and avalanche parameters" << endl;
88 cout << "high voltage " << m_hv << "V" << endl;
89 cout << "field " << m_field <<endl;
90 cout << "tuning factors:" << endl;
91 cout << "1) for gain " << m_tuning_factor_gain << endl;
92 cout << "2) for diffusion " << m_tuning_factor_diff_perp << " (for orthogonal) " << m_tuning_factor_diff_paral << " (for parallel)" << endl;
93
94
95
97 if(!gempar) return;
98
99
101 if(!gaspar) return;
102
103 m_nMulElec = 0;
104
106 output = new TFile("gem.root", "RECREATE");
107 tree = new TNtuple("tree", "tree", "dphi:darc:dx:dy:dz:z_local");
108 }
109
110
111 clock_t end = clock();
112 time_spent += (double)(end - begin) / CLOCKS_PER_SEC;
113 cout << "Sampling::init " << time_spent << " seconds" << endl;
114
115
116}