3 struct DateTime_t {Int_t date, time, run; Double_t DriftVel;};
6 {20050112, 50534, 6012001, 5.51158},
7 {20050112, 50758, 6012002, 5.51569},
8 {20050112, 95303, 6012016, 5.5132},
9 {20050112, 133813, 6012033, 5.51618},
10 {20050112, 135406, 6012035, 5.51455},
11 {20050113, 101622, 6013045, 5.52229},
12 {20050113, 141843, 6013065, 5.52361},
13 {20050115, 41638, 6014101, 5.53022},
14 {20050115, 141755, 6015033, 5.53198},
15 {20050116, 1145, 6015048, 5.53351},
16 {20050116, 152429, 6016016, 5.5368},
17 {20050116, 214621, 6016052, 5.53951},
18 {20050117, 65455, 6017010, 5.54057},
19 {20050117, 175657, 6017059, 5.54217},
20 {20050118, 100541, 6018008, 5.54382},
21 {20050118, 124710, 6018013, 5.54412},
22 {20050119, 2831, 6018043, 5.54583},
23 {20050120, 203341, 6020026, 5.55259},
24 {20050121, 34208, 6020063, 5.55251},
25 {20050121, 95757, 6021008, 5.55296},
26 {20050122, 12419, 6021046, 5.5529},
27 {20050122, 91552, 6022008, 5.55378},
28 {20050122, 181854, 6022047, 5.55532},
29 {20050123, 12353, 6022091, 5.55527},
30 {20050123, 75912, 6023010, 5.55453},
31 {20050125, 90829, 6025039, 5.55641},
32 {20050125, 123652, 6025051, 5.5545},
33 {20050126, 64957, 6026019, 5.55327},
34 {20050126, 132839, 6026047, 5.55412},
35 {20050126, 160050, 6026062, 5.55436},
36 {20050126, 160545, 6026063, 5.55412},
37 {20050126, 161052, 6026064, 5.55373},
38 {20050126, 161611, 6026065, 5.55393},
39 {20050126, 211937, 6026080, 5.55416},
40 {20050127, 25328, 6026099, 5.55333},
41 {20050127, 105558, 6027019, 5.55268},
42 {20050128, 11529, 6027068, 5.55317},
43 {20050128, 103114, 6028005, 5.55379},
44 {20050129, 12044, 6028079, 5.55317},
45 {20050129, 65330, 6029006, 5.55541},
46 {20050129, 123942, 6029020, 5.55685},
47 {20050130, 191841, 6030063, 5.55509},
48 {20050204, 234609, 6035110, 5.53933},
49 {20050205, 65947, 6036015, 5.53788},
50 {20050206, 14944, 6036099, 5.53647},
51 {20050206, 80215, 6037012, 5.53488},
52 {20050206, 202739, 6037051, 5.53423},
53 {20050207, 33312, 6037072, 5.53359},
54 {20050207, 82020, 6038010, 5.53304},
55 {20050208, 5610, 6039030, 5.53217},
56 {20050208, 231639, 6039137, 5.53247},
57 {20050209, 62924, 6040002, 5.53152},
58 {20050210, 3726, 6040046, 5.53055},
59 {20050210, 5835, 6040047, 5.53017},
60 {20050210, 73740, 6041019, 5.52913},
61 {20050210, 135549, 6041052, 5.52792},
62 {20050210, 235401, 6041094, 5.52832},
63 {20050211, 51902, 6042002, 5.52798},
64 {20050212, 212458, 6043088, 5.52926},
65 {20050213, 94115, 6044023, 5.52825},
66 {20050213, 185950, 6044052, 5.52902},
67 {20050214, 80622, 6045032, 5.52836},
68 {20050215, 81343, 6046021, 5.52719},
69 {20050215, 121651, 6046036, 5.52685},
70 {20050216, 85004, 6047024, 5.52791},
71 {20050216, 120550, 6047041, 5.52746},
72 {20050217, 105839, 6048015, 5.52682},
73 {20050218, 32216, 6048078, 5.52986},
74 {20050218, 100313, 6049035, 5.52971},
75 {20050219, 74124, 6050014, 5.53347},
76 {20050220, 44905, 6050133, 5.5351},
77 {20050220, 102253, 6051019, 5.53449},
78 {20050220, 144158, 6051039, 5.53475},
79 {20050221, 53352, 6052002, 5.53392},
80 {20050221, 162646, 6052060, 5.53456},
81 {20050222, 114907, 6053023, 5.53526},
82 {20050223, 61531, 6054012, 5.53338},
83 {20050223, 110532, 6054033, 5.53299},
84 {20050224, 21836, 6054065, 5.532},
85 {20050224, 84010, 6055010, 5.53268},
86 {20050224, 163733, 6055029, 5.53269},
87 {20050225, 23504, 6055087, 5.53288},
88 {20050226, 30130, 6056064, 5.53429},
89 {20050226, 120455, 6057044, 5.53361},
90 {20050226, 213328, 6057061, 5.53604},
91 {20050227, 31649, 6057089, 5.53715},
92 {20050227, 151947, 6058034, 5.53684},
93 {20050227, 213739, 6058060, 5.5374},
94 {20050228, 31937, 6058083, 5.53682},
95 {20050228, 101606, 6059017, 5.53681},
96 {20050301, 23343, 6059060, 5.53771},
97 {20050301, 102410, 6060015, 5.53725},
98 {20050301, 103609, 6060017, 5.53668},
99 {20050301, 151134, 6060032, 5.53748},
100 {20050305, 15503, 6063050, 5.53586},
101 {20050305, 120235, 6064038, 5.53513},
102 {20050305, 151405, 6064055, 5.53589},
104 {20050306, 144726, 6065020, 5.53568},
105 {20050306, 211045, 6065040, 5.54223},
106 {20050307, 3049, 6065057, 5.53381},
107 {20050310, 83948, 6069011, 5.53228},
108 {20050311, 4050, 6069096, 5.53175},
109 {20050311, 83919, 6070008, 5.53267},
110 {20050312, 5732, 6070082, 5.53184},
111 {20050312, 73517, 6071009, 5.5311},
112 {20050313, 30411, 6071090, 5.53233},
113 {20050313, 101722, 6072016, 5.53222},
114 {20050314, 93720, 6073011, 5.53181},
115 {20050315, 52118, 6074001, 5.53001},
116 {20050315, 131634, 6074022, 5.53014},
117 {20050316, 65929, 6075017, 5.53025},
118 {20050316, 124811, 6075039, 5.52925},
119 {20050317, 10452, 6075129, 5.52944},
120 {20050317, 93921, 6076026, 5.52962},
121 {20050317, 94346, 6076028, 5.52994},
122 {20050318, 711, 6076096, 5.53064},
123 {20050318, 50016, 6076120, 5.53024},
124 {20050318, 110515, 6077035, 5.5301},
125 {20050319, 62423, 6078010, 5.5303},
126 {20050319, 122635, 6078040, 5.53046},
127 {20050319, 185246, 6078069, 5.52945},
128 {20050319, 220211, 6078081, 5.52949},
129 {20050320, 62136, 6079006, 5.52902},
130 {20050320, 142834, 6079050, 5.52904},
131 {20050321, 63242, 6080008, 5.52811},
132 {20050321, 102111, 6080022, 5.52798},
133 {20050322, 75613, 6081015, 5.52662},
134 {20050323, 73716, 6082013, 5.5255},
135 {20050324, 90321, 6083016, 5.52539}
138 {20050112, 50758, 6012002, 5.51157},
139 {20050112, 95303, 6012016, 5.5132},
141 {20050113, 101622, 6013045, 5.5223},
142 {20050113, 141843, 6013065, 5.52435},
143 {20050115, 41638, 6014101, 5.54366},
144 {20050115, 141755, 6015033, 5.53199},
145 {20050116, 1145, 6015048, 5.53364},
146 {20050116, 25914, 6015060, 5.534},
147 {20050116, 152429, 6016016, 5.53679},
148 {20050116, 214621, 6016052, 5.53725},
149 {20050117, 65455, 6017010, 5.54066},
150 {20050117, 175657, 6017059, 5.54225},
151 {20050118, 100541, 6018008, 5.54283},
152 {20050120, 203341, 6020026, 5.55234},
153 {20050121, 34208, 6020063, 5.54418},
154 {20050121, 95757, 6021008, 5.54934},
155 {20050122, 12419, 6021046, 5.55269},
156 {20050122, 91552, 6022008, 5.55323},
157 {20050122, 181854, 6022047, 5.54593},
158 {20050123, 12353, 6022091, 5.55532},
159 {20050123, 75912, 6023010, 5.54408},
160 {20050125, 90829, 6025039, 5.54859},
161 {20050125, 123652, 6025051, 5.55462},
162 {20050126, 3421, 6025113, 5.55414},
163 {20050126, 4111, 6025114, 5.55299},
164 {20050126, 64957, 6026019, 5.5437},
165 {20050126, 132839, 6026047, 5.54863},
167 {20050126, 211641, 6026079, 5.5407},
168 {20050127, 25328, 6026099, 5.54604},
169 {20050127, 105558, 6027019, 5.54545},
170 {20050128, 11529, 6027068, 5.53774},
171 {20050128, 103114, 6028005, 5.54783},
172 {20050129, 12044, 6028079, 5.53631},
173 {20050129, 65330, 6029006, 5.5554},
174 {20050129, 123942, 6029020, 5.55688},
175 {20050130, 40833, 6029065, 5.55695},
176 {20050130, 81847, 6030014, 5.56481},
177 {20050130, 191841, 6030063, 5.56136},
178 {20050131, 11315, 6030095, 5.54455},
179 {20050131, 81832, 6031007, 5.55291},
180 {20050131, 142745, 6031035, 5.54009},
181 {20050201, 40502, 6031112, 5.55085},
182 {20050201, 91018, 6032012, 5.53852},
183 {20050201, 194502, 6032033, 5.50951},
184 {20050203, 113858, 6034011, 5.53663},
185 {20050203, 141730, 6034018, 5.53663},
186 {20050204, 5142, 6034110, 5.53823},
187 {20050204, 61742, 6035008, 5.51409},
188 {20050204, 123111, 6035029, 5.51517},
189 {20050204, 234609, 6035110, 5.53393},
190 {20050205, 65947, 6036015, 5.53794},
191 {20050205, 140613, 6036041, 5.53763},
192 {20050206, 14944, 6036099, 5.53648},
193 {20050206, 80215, 6037012, 5.52662},
194 {20050206, 141515, 6037032, 5.51939},
195 {20050206, 202739, 6037051, 5.53042},
196 {20050207, 33312, 6037072, 5.52101},
197 {20050207, 82020, 6038010, 5.53307},
198 {20050208, 41502, 6038086, 5.53247},
199 {20050208, 105610, 6039030, 5.53212},
200 {20050208, 135930, 6039047, 5.52078},
201 {20050208, 231639, 6039137, 5.53248},
202 {20050209, 62924, 6040002, 5.52961},
203 {20050210, 3726, 6040046, 5.52311},
204 {20050210, 73740, 6041019, 5.52911},
205 {20050210, 135549, 6041052, 5.52823},
206 {20050210, 235401, 6041094, 5.52823},
207 {20050211, 51902, 6042002, 5.52801},
208 {20050211, 123421, 6042056, 5.5291},
209 {20050212, 11513, 6042106, 5.52945},
211 {20050212, 141340, 6043053, 5.52952},
212 {20050212, 212458, 6043088, 5.52887},
213 {20050213, 24905, 6043116, 5.52894},
214 {20050213, 94115, 6044023, 5.52421},
215 {20050213, 185950, 6044052, 5.52766},
216 {20050214, 10251, 6044082, 5.52581},
217 {20050214, 80622, 6045032, 5.52645},
218 {20050215, 24515, 6045074, 5.523},
219 {20050215, 81343, 6046021, 5.52722},
220 {20050215, 121651, 6046036, 5.527},
221 {20050216, 85004, 6047024, 5.52791},
222 {20050216, 120550, 6047041, 5.5275},
223 {20050217, 105839, 6048015, 5.52684},
224 {20050218, 32216, 6048078, 5.52786},
225 {20050218, 100313, 6049035, 5.52804},
226 {20050218, 192936, 6049093, 5.52867},
227 {20050219, 30018, 6049121, 5.52961},
228 {20050219, 74124, 6050014, 5.52577},
229 {20050219, 140650, 6050038, 5.52763},
230 {20050220, 1609, 6050118, 5.52805},
231 {20050220, 44905, 6050133, 5.52617},
232 {20050220, 102253, 6051019, 5.53095},
233 {20050220, 144158, 6051039, 5.53022},
234 {20050220, 190400, 6051051, 5.52564},
235 {20050221, 53352, 6052002, 5.53205},
236 {20050221, 102253, 6052029, 5.53284},
237 {20050221, 162646, 6052060, 5.53282},
238 {20050221, 225714, 6052097, 5.53292},
239 {20050222, 114907, 6053023, 5.53075},
240 {20050222, 234210, 6053086, 5.52792},
241 {20050223, 61531, 6054012, 5.52486},
242 {20050223, 110532, 6054033, 5.53075},
243 {20050224, 21836, 6054065, 5.53024},
244 {20050224, 84010, 6055010, 5.52837},
245 {20050224, 163733, 6055029, 5.53052},
246 {20050225, 23504, 6055087, 5.52509},
247 {20050226, 30130, 6056064, 5.52827},
248 {20050226, 120455, 6057044, 5.52825},
249 {20050226, 213328, 6057061, 5.53108},
250 {20050227, 31649, 6057089, 5.52834},
251 {20050227, 81653, 6058012, 5.52791},
252 {20050227, 151947, 6058034, 5.5345},
253 {20050227, 213739, 6058060, 5.53537},
254 {20050228, 31937, 6058083, 5.53494},
255 {20050228, 101606, 6059017, 5.52675},
256 {20050301, 23343, 6059060, 5.53197},
257 {20050301, 102410, 6060015, 5.52895},
258 {20050301, 151134, 6060032, 5.53204},
259 {20050301, 205041, 6060061, 5.53292},
260 {20050302, 91930, 6061032, 5.5338},
261 {20050305, 15503, 6063050, 5.5293},
262 {20050305, 120235, 6064038, 5.52966},
263 {20050305, 151405, 6064055, 5.53044},
264 {20050306, 33120, 6064101, 5.52509},
266 {20050306, 211045, 6065040, 5.54036},
267 {20050307, 3049, 6065057, 5.52115},
268 {20050310, 83948, 6069011, 5.52924},
269 {20050310, 142906, 6069050, 5.53049},
270 {20050311, 4050, 6069096, 5.53251},
271 {20050311, 145622, 6070055, 5.53367},
272 {20050312, 5732, 6070082, 5.53116},
273 {20050312, 73517, 6071009, 5.53184},
274 {20050312, 144500, 6071041, 5.53136},
275 {20050312, 211742, 6071070, 5.53131},
276 {20050313, 30411, 6071090, 5.5322},
277 {20050313, 101722, 6072016, 5.5331},
278 {20050313, 172954, 6072036, 5.53156},
279 {20050314, 93720, 6073011, 5.53003},
280 {20050314, 152923, 6073040, 5.52837},
281 {20050314, 210618, 6073068, 5.5319},
282 {20050315, 52118, 6074001, 5.52993},
283 {20050315, 131634, 6074022, 5.53115},
284 {20050315, 221841, 6074085, 5.54607},
285 {20050316, 65929, 6075017, 5.52875},
286 {20050316, 124811, 6075039, 5.52795},
287 {20050317, 10452, 6075129, 5.52722},
288 {20050317, 42414, 6075150, 5.52759},
289 {20050317, 93921, 6076026, 5.52837},
290 {20050317, 94346, 6076028, 5.529},
291 {20050318, 711, 6076096, 5.53087},
292 {20050318, 50016, 6076120, 5.5291},
293 {20050318, 110515, 6077035, 5.5295},
294 {20050318, 192434, 6077066, 5.5288},
295 {20050319, 62423, 6078010, 5.5293},
296 {20050319, 122635, 6078040, 5.52927},
297 {20050319, 185246, 6078069, 5.54693},
298 {20050319, 220211, 6078081, 5.53029},
299 {20050320, 62136, 6079006, 5.52818},
300 {20050320, 81738, 6079018, 5.53008},
301 {20050320, 142834, 6079050, 5.52964},
302 {20050320, 203752, 6079099, 5.52911},
303 {20050321, 13809, 6079122, 5.52673},
304 {20050321, 63242, 6080008, 5.52614},
305 {20050321, 102111, 6080022, 5.52656},
306 {20050322, 75613, 6081015, 5.52739},
307 {20050323, 73716, 6082013, 5.52478},
308 {20050324, 90321, 6083016, 5.52537}
311 const Int_t NDates =
sizeof(dates)/
sizeof(
DateTime_t);
314 Float_t date, time, ut, run, dvel, Dbdvel;
315 Float_t barometricPressure;
316 Float_t inputTPCGasPressure;
317 Float_t nitrogenPressure;
318 Float_t gasPressureDiff;
319 Float_t inputGasTemperature;
320 Float_t outputGasTemperature;
321 Float_t flowRateArgon1;
322 Float_t flowRateArgon2;
323 Float_t flowRateMethane;
324 Float_t percentMethaneIn;
326 Float_t flowRateExhaust;
327 Float_t percentMethaneOut;
329 Float_t ppmOxygenOut;
330 Float_t flowRateRecirculation;
332 Float_t barometricPressureAv;
333 Float_t inputGasTemperatureAv;
334 Float_t outputGasTemperatureAv;
335 Float_t percentMethaneInAv;
336 Float_t percentMethaneOutAv;
338 const Char_t *vars =
"day:date:time:ut:run:dvel:Dbdvel:barometricPressure:inputTPCGasPressure:nitrogenPressure:gasPressureDiff:inputGasTemperature:outputGasTemperature:flowRateArgon1:flowRateArgon2:flowRateMethane:percentMethaneIn:ppmOxygenIn:flowRateExhaust:percentMethaneOut:ppmWaterOut:ppmOxygenOut:flowRateRecirculation:barometricPressureAv:inputGasTemperatureAv:outputGasTemperatureAv:percentMethaneInAv:percentMethaneOutAv";
341 if (gClassTable->GetID(
"StDbManager") < 0) {
344 gSystem->Load(
"/usr/lib/libmysqlclient");
345 gSystem->Load(
"St_base");
346 gSystem->Load(
"StChain");
347 gSystem->Load(
"StUtilities");
352 gSystem->Load(
"libStDb_Tables.so");
353 gSystem->Load(
"StDbLib.so");
354 gSystem->Load(
"StDbBroker.so");
355 gSystem->Load(
"St_db_Maker.so");
357 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"$PWD/StarDb");
360 dbMk->SetFlavor(
"laserDV",
"tpcDriftVelocity");
371 void Db2NtDv(Int_t i0=0){
372 if (dbMk == 0) Load();
379 TNtuple *FitP =
new TNtuple(
"FitP",
"Drift velocity",vars);
380 TDatime t0(2005,1,1,0,0,0);
381 Int_t ut0 = t0.Convert();
384 for (i = i0; i < NDates; i++) {
385 memset(&row.day, 0,
sizeof(
Row_t));
386 TDatime tt(dates[i].date,dates[i].time);
387 Int_t ut = tt.Convert();
388 row.day = (ut - ut0)/(24.*3600.) + 1;
390 row.date = dates[i].date;
391 row.time = dates[i].time;
392 row.run = dates[i].run;
393 row.dvel = dates[i].DriftVel;
394 Int_t date = dates[i].date;
395 Int_t time = dates[i].time;
396 for (Int_t k = 0; k < 10; k++) {
397 if (k > 0 && date == dates[i].date && time == dates[i].time)
break;
398 dbMk->SetDateTime(date,time+1);
401 set = dbMk->GetDataBase(
"Calibrations/tpc");
403 cout <<
"==================================== Calibrations/tpc has not been found i =" << i << endl;
407 St_tpcDriftVelocity *tpcDriftVelocity = (St_tpcDriftVelocity *) set->
Find(
"tpcDriftVelocity");
408 if (tpcDriftVelocity) {
409 dbMk->GetValidity(tpcDriftVelocity,t);
410 cout <<
"got " << tpcDriftVelocity->GetName() <<
" for d/t " << dates[i].date <<
"/" << dates[i].time << endl;
411 cout <<
"Found tpcDriftVelocity " << tpcDriftVelocity->GetName() << endl;
412 cout <<
"Validity:" << t[0].GetDate() <<
"/" << t[0].GetTime()
413 <<
" ----- " << t[1].GetDate() <<
"/" << t[1].GetTime() << endl;
415 tpcDriftVelocity_st *drift = tpcDriftVelocity->GetTable();
416 row.Dbdvel = drift->laserDriftVelocityEast;
417 cout <<
"got " << tpcDriftVelocity->GetName() <<
" for d/t " << dates[i].date <<
"/" << dates[i].time
418 <<
" dv = " << row.Dbdvel << endl;
422 cout <<
"==================================== tpcDriftVelocity has not been found i = " << i <<
"\t" << dates[i].date <<
"\t" << dates[i].time << endl;
426 St_tpcGas *tpcGas = (St_tpcGas *) set->
Find(
"tpcGas");
429 cout <<
"==================================== tpcGas has not been found i = " << i <<
"\t" << dates[i].date <<
"\t" << dates[i].time << endl;
432 dbMk->GetValidity(tpcGas,t);
433 cout <<
"got " << tpcGas->GetName() <<
" for d/t " << dates[i].date <<
"/" << dates[i].time << endl;
434 cout <<
"Found tpcGas " << tpcGas->GetName() << endl;
435 cout <<
"Validity:" << t[0].GetDate() <<
"/" << t[0].GetTime()
436 <<
" ----- " << t[1].GetDate() <<
"/" << t[1].GetTime() << endl;
437 date = t[1].GetDate();
438 time = t[1].GetTime();
439 tpcGas_st *Gas = tpcGas->GetTable();
443 row.barometricPressure = Gas->barometricPressure;
444 row.inputTPCGasPressure = Gas->inputTPCGasPressure;
445 row.nitrogenPressure = Gas->nitrogenPressure;
446 row.gasPressureDiff = Gas->gasPressureDiff;
447 row.inputGasTemperature = Gas->inputGasTemperature;
448 row.outputGasTemperature = Gas->outputGasTemperature;
449 row.flowRateArgon1 = Gas->flowRateArgon1;
450 row.flowRateArgon2 = Gas->flowRateArgon2;
451 row.flowRateMethane = Gas->flowRateMethane;
452 row.percentMethaneIn = Gas->percentMethaneIn;
453 row.ppmOxygenIn = Gas->ppmOxygenIn;
454 row.flowRateExhaust = Gas->flowRateExhaust;
455 row.percentMethaneOut = Gas->percentMethaneOut;
456 row.ppmWaterOut = Gas->ppmWaterOut;
457 row.ppmOxygenOut = Gas->ppmOxygenOut;
458 row.flowRateRecirculation = Gas->flowRateRecirculation;
459 cout <<
"got percentMethaneIn " << row.percentMethaneIn << endl;
460 row.barometricPressureAv = row.barometricPressure;
461 row.inputGasTemperatureAv = row.inputGasTemperature;
462 row.outputGasTemperatureAv= row.outputGasTemperature;
463 row.percentMethaneInAv = row.percentMethaneIn;
464 row.percentMethaneOutAv = row.percentMethaneOut;
466 row.barometricPressureAv = (k*row.barometricPressureAv + Gas->barometricPressure)/(k+1.);
467 row.inputGasTemperatureAv = (k*row.inputGasTemperatureAv + Gas->inputGasTemperature)/(k+1.);
468 row.outputGasTemperatureAv= (k*row.outputGasTemperatureAv + Gas->outputGasTemperature)/(k+1.);
469 row.percentMethaneInAv = (k*row.percentMethaneInAv + Gas->percentMethaneIn)/(k+1.);
470 row.percentMethaneOutAv = (k*row.percentMethaneOutAv + Gas->percentMethaneOut)/(k+1.);
473 FitP->Fill(&row.day);
virtual void Clear(Option_t *opt="")
User defined functions.
virtual TDataSet * Find(const char *path) const