00001 class St_db_Maker;
00002 St_db_Maker *dbMk = 0;
00003 struct DateTime_t {Int_t date, time, run; Double_t DriftVel;};
00004 DateTime_t dates[] = {
00005 #if 1
00006 {20050112, 50534, 6012001, 5.51158},
00007 {20050112, 50758, 6012002, 5.51569},
00008 {20050112, 95303, 6012016, 5.5132},
00009 {20050112, 133813, 6012033, 5.51618},
00010 {20050112, 135406, 6012035, 5.51455},
00011 {20050113, 101622, 6013045, 5.52229},
00012 {20050113, 141843, 6013065, 5.52361},
00013 {20050115, 41638, 6014101, 5.53022},
00014 {20050115, 141755, 6015033, 5.53198},
00015 {20050116, 1145, 6015048, 5.53351},
00016 {20050116, 152429, 6016016, 5.5368},
00017 {20050116, 214621, 6016052, 5.53951},
00018 {20050117, 65455, 6017010, 5.54057},
00019 {20050117, 175657, 6017059, 5.54217},
00020 {20050118, 100541, 6018008, 5.54382},
00021 {20050118, 124710, 6018013, 5.54412},
00022 {20050119, 2831, 6018043, 5.54583},
00023 {20050120, 203341, 6020026, 5.55259},
00024 {20050121, 34208, 6020063, 5.55251},
00025 {20050121, 95757, 6021008, 5.55296},
00026 {20050122, 12419, 6021046, 5.5529},
00027 {20050122, 91552, 6022008, 5.55378},
00028 {20050122, 181854, 6022047, 5.55532},
00029 {20050123, 12353, 6022091, 5.55527},
00030 {20050123, 75912, 6023010, 5.55453},
00031 {20050125, 90829, 6025039, 5.55641},
00032 {20050125, 123652, 6025051, 5.5545},
00033 {20050126, 64957, 6026019, 5.55327},
00034 {20050126, 132839, 6026047, 5.55412},
00035 {20050126, 160050, 6026062, 5.55436},
00036 {20050126, 160545, 6026063, 5.55412},
00037 {20050126, 161052, 6026064, 5.55373},
00038 {20050126, 161611, 6026065, 5.55393},
00039 {20050126, 211937, 6026080, 5.55416},
00040 {20050127, 25328, 6026099, 5.55333},
00041 {20050127, 105558, 6027019, 5.55268},
00042 {20050128, 11529, 6027068, 5.55317},
00043 {20050128, 103114, 6028005, 5.55379},
00044 {20050129, 12044, 6028079, 5.55317},
00045 {20050129, 65330, 6029006, 5.55541},
00046 {20050129, 123942, 6029020, 5.55685},
00047 {20050130, 191841, 6030063, 5.55509},
00048 {20050204, 234609, 6035110, 5.53933},
00049 {20050205, 65947, 6036015, 5.53788},
00050 {20050206, 14944, 6036099, 5.53647},
00051 {20050206, 80215, 6037012, 5.53488},
00052 {20050206, 202739, 6037051, 5.53423},
00053 {20050207, 33312, 6037072, 5.53359},
00054 {20050207, 82020, 6038010, 5.53304},
00055 {20050208, 5610, 6039030, 5.53217},
00056 {20050208, 231639, 6039137, 5.53247},
00057 {20050209, 62924, 6040002, 5.53152},
00058 {20050210, 3726, 6040046, 5.53055},
00059 {20050210, 5835, 6040047, 5.53017},
00060 {20050210, 73740, 6041019, 5.52913},
00061 {20050210, 135549, 6041052, 5.52792},
00062 {20050210, 235401, 6041094, 5.52832},
00063 {20050211, 51902, 6042002, 5.52798},
00064 {20050212, 212458, 6043088, 5.52926},
00065 {20050213, 94115, 6044023, 5.52825},
00066 {20050213, 185950, 6044052, 5.52902},
00067 {20050214, 80622, 6045032, 5.52836},
00068 {20050215, 81343, 6046021, 5.52719},
00069 {20050215, 121651, 6046036, 5.52685},
00070 {20050216, 85004, 6047024, 5.52791},
00071 {20050216, 120550, 6047041, 5.52746},
00072 {20050217, 105839, 6048015, 5.52682},
00073 {20050218, 32216, 6048078, 5.52986},
00074 {20050218, 100313, 6049035, 5.52971},
00075 {20050219, 74124, 6050014, 5.53347},
00076 {20050220, 44905, 6050133, 5.5351},
00077 {20050220, 102253, 6051019, 5.53449},
00078 {20050220, 144158, 6051039, 5.53475},
00079 {20050221, 53352, 6052002, 5.53392},
00080 {20050221, 162646, 6052060, 5.53456},
00081 {20050222, 114907, 6053023, 5.53526},
00082 {20050223, 61531, 6054012, 5.53338},
00083 {20050223, 110532, 6054033, 5.53299},
00084 {20050224, 21836, 6054065, 5.532},
00085 {20050224, 84010, 6055010, 5.53268},
00086 {20050224, 163733, 6055029, 5.53269},
00087 {20050225, 23504, 6055087, 5.53288},
00088 {20050226, 30130, 6056064, 5.53429},
00089 {20050226, 120455, 6057044, 5.53361},
00090 {20050226, 213328, 6057061, 5.53604},
00091 {20050227, 31649, 6057089, 5.53715},
00092 {20050227, 151947, 6058034, 5.53684},
00093 {20050227, 213739, 6058060, 5.5374},
00094 {20050228, 31937, 6058083, 5.53682},
00095 {20050228, 101606, 6059017, 5.53681},
00096 {20050301, 23343, 6059060, 5.53771},
00097 {20050301, 102410, 6060015, 5.53725},
00098 {20050301, 103609, 6060017, 5.53668},
00099 {20050301, 151134, 6060032, 5.53748},
00100 {20050305, 15503, 6063050, 5.53586},
00101 {20050305, 120235, 6064038, 5.53513},
00102 {20050305, 151405, 6064055, 5.53589},
00103
00104 {20050306, 144726, 6065020, 5.53568},
00105 {20050306, 211045, 6065040, 5.54223},
00106 {20050307, 3049, 6065057, 5.53381},
00107 {20050310, 83948, 6069011, 5.53228},
00108 {20050311, 4050, 6069096, 5.53175},
00109 {20050311, 83919, 6070008, 5.53267},
00110 {20050312, 5732, 6070082, 5.53184},
00111 {20050312, 73517, 6071009, 5.5311},
00112 {20050313, 30411, 6071090, 5.53233},
00113 {20050313, 101722, 6072016, 5.53222},
00114 {20050314, 93720, 6073011, 5.53181},
00115 {20050315, 52118, 6074001, 5.53001},
00116 {20050315, 131634, 6074022, 5.53014},
00117 {20050316, 65929, 6075017, 5.53025},
00118 {20050316, 124811, 6075039, 5.52925},
00119 {20050317, 10452, 6075129, 5.52944},
00120 {20050317, 93921, 6076026, 5.52962},
00121 {20050317, 94346, 6076028, 5.52994},
00122 {20050318, 711, 6076096, 5.53064},
00123 {20050318, 50016, 6076120, 5.53024},
00124 {20050318, 110515, 6077035, 5.5301},
00125 {20050319, 62423, 6078010, 5.5303},
00126 {20050319, 122635, 6078040, 5.53046},
00127 {20050319, 185246, 6078069, 5.52945},
00128 {20050319, 220211, 6078081, 5.52949},
00129 {20050320, 62136, 6079006, 5.52902},
00130 {20050320, 142834, 6079050, 5.52904},
00131 {20050321, 63242, 6080008, 5.52811},
00132 {20050321, 102111, 6080022, 5.52798},
00133 {20050322, 75613, 6081015, 5.52662},
00134 {20050323, 73716, 6082013, 5.5255},
00135 {20050324, 90321, 6083016, 5.52539}
00136 #else
00137
00138 {20050112, 50758, 6012002, 5.51157},
00139 {20050112, 95303, 6012016, 5.5132},
00140
00141 {20050113, 101622, 6013045, 5.5223},
00142 {20050113, 141843, 6013065, 5.52435},
00143 {20050115, 41638, 6014101, 5.54366},
00144 {20050115, 141755, 6015033, 5.53199},
00145 {20050116, 1145, 6015048, 5.53364},
00146 {20050116, 25914, 6015060, 5.534},
00147 {20050116, 152429, 6016016, 5.53679},
00148 {20050116, 214621, 6016052, 5.53725},
00149 {20050117, 65455, 6017010, 5.54066},
00150 {20050117, 175657, 6017059, 5.54225},
00151 {20050118, 100541, 6018008, 5.54283},
00152 {20050120, 203341, 6020026, 5.55234},
00153 {20050121, 34208, 6020063, 5.54418},
00154 {20050121, 95757, 6021008, 5.54934},
00155 {20050122, 12419, 6021046, 5.55269},
00156 {20050122, 91552, 6022008, 5.55323},
00157 {20050122, 181854, 6022047, 5.54593},
00158 {20050123, 12353, 6022091, 5.55532},
00159 {20050123, 75912, 6023010, 5.54408},
00160 {20050125, 90829, 6025039, 5.54859},
00161 {20050125, 123652, 6025051, 5.55462},
00162 {20050126, 3421, 6025113, 5.55414},
00163 {20050126, 4111, 6025114, 5.55299},
00164 {20050126, 64957, 6026019, 5.5437},
00165 {20050126, 132839, 6026047, 5.54863},
00166
00167 {20050126, 211641, 6026079, 5.5407},
00168 {20050127, 25328, 6026099, 5.54604},
00169 {20050127, 105558, 6027019, 5.54545},
00170 {20050128, 11529, 6027068, 5.53774},
00171 {20050128, 103114, 6028005, 5.54783},
00172 {20050129, 12044, 6028079, 5.53631},
00173 {20050129, 65330, 6029006, 5.5554},
00174 {20050129, 123942, 6029020, 5.55688},
00175 {20050130, 40833, 6029065, 5.55695},
00176 {20050130, 81847, 6030014, 5.56481},
00177 {20050130, 191841, 6030063, 5.56136},
00178 {20050131, 11315, 6030095, 5.54455},
00179 {20050131, 81832, 6031007, 5.55291},
00180 {20050131, 142745, 6031035, 5.54009},
00181 {20050201, 40502, 6031112, 5.55085},
00182 {20050201, 91018, 6032012, 5.53852},
00183 {20050201, 194502, 6032033, 5.50951},
00184 {20050203, 113858, 6034011, 5.53663},
00185 {20050203, 141730, 6034018, 5.53663},
00186 {20050204, 5142, 6034110, 5.53823},
00187 {20050204, 61742, 6035008, 5.51409},
00188 {20050204, 123111, 6035029, 5.51517},
00189 {20050204, 234609, 6035110, 5.53393},
00190 {20050205, 65947, 6036015, 5.53794},
00191 {20050205, 140613, 6036041, 5.53763},
00192 {20050206, 14944, 6036099, 5.53648},
00193 {20050206, 80215, 6037012, 5.52662},
00194 {20050206, 141515, 6037032, 5.51939},
00195 {20050206, 202739, 6037051, 5.53042},
00196 {20050207, 33312, 6037072, 5.52101},
00197 {20050207, 82020, 6038010, 5.53307},
00198 {20050208, 41502, 6038086, 5.53247},
00199 {20050208, 105610, 6039030, 5.53212},
00200 {20050208, 135930, 6039047, 5.52078},
00201 {20050208, 231639, 6039137, 5.53248},
00202 {20050209, 62924, 6040002, 5.52961},
00203 {20050210, 3726, 6040046, 5.52311},
00204 {20050210, 73740, 6041019, 5.52911},
00205 {20050210, 135549, 6041052, 5.52823},
00206 {20050210, 235401, 6041094, 5.52823},
00207 {20050211, 51902, 6042002, 5.52801},
00208 {20050211, 123421, 6042056, 5.5291},
00209 {20050212, 11513, 6042106, 5.52945},
00210
00211 {20050212, 141340, 6043053, 5.52952},
00212 {20050212, 212458, 6043088, 5.52887},
00213 {20050213, 24905, 6043116, 5.52894},
00214 {20050213, 94115, 6044023, 5.52421},
00215 {20050213, 185950, 6044052, 5.52766},
00216 {20050214, 10251, 6044082, 5.52581},
00217 {20050214, 80622, 6045032, 5.52645},
00218 {20050215, 24515, 6045074, 5.523},
00219 {20050215, 81343, 6046021, 5.52722},
00220 {20050215, 121651, 6046036, 5.527},
00221 {20050216, 85004, 6047024, 5.52791},
00222 {20050216, 120550, 6047041, 5.5275},
00223 {20050217, 105839, 6048015, 5.52684},
00224 {20050218, 32216, 6048078, 5.52786},
00225 {20050218, 100313, 6049035, 5.52804},
00226 {20050218, 192936, 6049093, 5.52867},
00227 {20050219, 30018, 6049121, 5.52961},
00228 {20050219, 74124, 6050014, 5.52577},
00229 {20050219, 140650, 6050038, 5.52763},
00230 {20050220, 1609, 6050118, 5.52805},
00231 {20050220, 44905, 6050133, 5.52617},
00232 {20050220, 102253, 6051019, 5.53095},
00233 {20050220, 144158, 6051039, 5.53022},
00234 {20050220, 190400, 6051051, 5.52564},
00235 {20050221, 53352, 6052002, 5.53205},
00236 {20050221, 102253, 6052029, 5.53284},
00237 {20050221, 162646, 6052060, 5.53282},
00238 {20050221, 225714, 6052097, 5.53292},
00239 {20050222, 114907, 6053023, 5.53075},
00240 {20050222, 234210, 6053086, 5.52792},
00241 {20050223, 61531, 6054012, 5.52486},
00242 {20050223, 110532, 6054033, 5.53075},
00243 {20050224, 21836, 6054065, 5.53024},
00244 {20050224, 84010, 6055010, 5.52837},
00245 {20050224, 163733, 6055029, 5.53052},
00246 {20050225, 23504, 6055087, 5.52509},
00247 {20050226, 30130, 6056064, 5.52827},
00248 {20050226, 120455, 6057044, 5.52825},
00249 {20050226, 213328, 6057061, 5.53108},
00250 {20050227, 31649, 6057089, 5.52834},
00251 {20050227, 81653, 6058012, 5.52791},
00252 {20050227, 151947, 6058034, 5.5345},
00253 {20050227, 213739, 6058060, 5.53537},
00254 {20050228, 31937, 6058083, 5.53494},
00255 {20050228, 101606, 6059017, 5.52675},
00256 {20050301, 23343, 6059060, 5.53197},
00257 {20050301, 102410, 6060015, 5.52895},
00258 {20050301, 151134, 6060032, 5.53204},
00259 {20050301, 205041, 6060061, 5.53292},
00260 {20050302, 91930, 6061032, 5.5338},
00261 {20050305, 15503, 6063050, 5.5293},
00262 {20050305, 120235, 6064038, 5.52966},
00263 {20050305, 151405, 6064055, 5.53044},
00264 {20050306, 33120, 6064101, 5.52509},
00265
00266 {20050306, 211045, 6065040, 5.54036},
00267 {20050307, 3049, 6065057, 5.52115},
00268 {20050310, 83948, 6069011, 5.52924},
00269 {20050310, 142906, 6069050, 5.53049},
00270 {20050311, 4050, 6069096, 5.53251},
00271 {20050311, 145622, 6070055, 5.53367},
00272 {20050312, 5732, 6070082, 5.53116},
00273 {20050312, 73517, 6071009, 5.53184},
00274 {20050312, 144500, 6071041, 5.53136},
00275 {20050312, 211742, 6071070, 5.53131},
00276 {20050313, 30411, 6071090, 5.5322},
00277 {20050313, 101722, 6072016, 5.5331},
00278 {20050313, 172954, 6072036, 5.53156},
00279 {20050314, 93720, 6073011, 5.53003},
00280 {20050314, 152923, 6073040, 5.52837},
00281 {20050314, 210618, 6073068, 5.5319},
00282 {20050315, 52118, 6074001, 5.52993},
00283 {20050315, 131634, 6074022, 5.53115},
00284 {20050315, 221841, 6074085, 5.54607},
00285 {20050316, 65929, 6075017, 5.52875},
00286 {20050316, 124811, 6075039, 5.52795},
00287 {20050317, 10452, 6075129, 5.52722},
00288 {20050317, 42414, 6075150, 5.52759},
00289 {20050317, 93921, 6076026, 5.52837},
00290 {20050317, 94346, 6076028, 5.529},
00291 {20050318, 711, 6076096, 5.53087},
00292 {20050318, 50016, 6076120, 5.5291},
00293 {20050318, 110515, 6077035, 5.5295},
00294 {20050318, 192434, 6077066, 5.5288},
00295 {20050319, 62423, 6078010, 5.5293},
00296 {20050319, 122635, 6078040, 5.52927},
00297 {20050319, 185246, 6078069, 5.54693},
00298 {20050319, 220211, 6078081, 5.53029},
00299 {20050320, 62136, 6079006, 5.52818},
00300 {20050320, 81738, 6079018, 5.53008},
00301 {20050320, 142834, 6079050, 5.52964},
00302 {20050320, 203752, 6079099, 5.52911},
00303 {20050321, 13809, 6079122, 5.52673},
00304 {20050321, 63242, 6080008, 5.52614},
00305 {20050321, 102111, 6080022, 5.52656},
00306 {20050322, 75613, 6081015, 5.52739},
00307 {20050323, 73716, 6082013, 5.52478},
00308 {20050324, 90321, 6083016, 5.52537}
00309 #endif
00310 };
00311 const Int_t NDates = sizeof(dates)/sizeof(DateTime_t);
00312 struct Row_t {
00313 Float_t day;
00314 Float_t date, time, ut, run, dvel, Dbdvel;
00315 Float_t barometricPressure;
00316 Float_t inputTPCGasPressure;
00317 Float_t nitrogenPressure;
00318 Float_t gasPressureDiff;
00319 Float_t inputGasTemperature;
00320 Float_t outputGasTemperature;
00321 Float_t flowRateArgon1;
00322 Float_t flowRateArgon2;
00323 Float_t flowRateMethane;
00324 Float_t percentMethaneIn;
00325 Float_t ppmOxygenIn;
00326 Float_t flowRateExhaust;
00327 Float_t percentMethaneOut;
00328 Float_t ppmWaterOut;
00329 Float_t ppmOxygenOut;
00330 Float_t flowRateRecirculation;
00331
00332 Float_t barometricPressureAv;
00333 Float_t inputGasTemperatureAv;
00334 Float_t outputGasTemperatureAv;
00335 Float_t percentMethaneInAv;
00336 Float_t percentMethaneOutAv;
00337 };
00338 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";
00339
00340 void Load() {
00341 if (gClassTable->GetID("StDbManager") < 0) {
00342
00343
00344 gSystem->Load("/usr/lib/libmysqlclient");
00345 gSystem->Load("St_base");
00346 gSystem->Load("StChain");
00347 gSystem->Load("StUtilities");
00348
00349
00350
00351
00352 gSystem->Load("libStDb_Tables.so");
00353 gSystem->Load("StDbLib.so");
00354 gSystem->Load("StDbBroker.so");
00355 gSystem->Load("St_db_Maker.so");
00356 }
00357 dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb","$PWD/StarDb");
00358 dbMk->SetDebug(1);
00359
00360 dbMk->SetFlavor("laserDV","tpcDriftVelocity");
00361
00362
00363
00364
00365
00366
00367 dbMk->Init();
00368 }
00369
00370
00371 void Db2NtDv(Int_t i0=0){
00372 if (dbMk == 0) Load();
00373
00374
00375
00376
00377 Int_t i = 0;
00378 Row_t row;
00379 TNtuple *FitP = new TNtuple("FitP","Drift velocity",vars);
00380 TDatime t0(2005,1,1,0,0,0);
00381 Int_t ut0 = t0.Convert();
00382 TDatime t[2];
00383 TDataSet *set = 0;
00384 for (i = i0; i < NDates; i++) {
00385 memset(&row.day, 0, sizeof(Row_t));
00386 TDatime tt(dates[i].date,dates[i].time);
00387 Int_t ut = tt.Convert();
00388 row.day = (ut - ut0)/(24.*3600.) + 1;
00389 row.ut = ut;
00390 row.date = dates[i].date;
00391 row.time = dates[i].time;
00392 row.run = dates[i].run;
00393 row.dvel = dates[i].DriftVel;
00394 Int_t date = dates[i].date;
00395 Int_t time = dates[i].time;
00396 for (Int_t k = 0; k < 10; k++) {
00397 if (k > 0 && date == dates[i].date && time == dates[i].time) break;
00398 dbMk->SetDateTime(date,time+1);
00399 dbMk->Clear();
00400 dbMk->Make();
00401 set = dbMk->GetDataBase("Calibrations/tpc");
00402 if (! set) {
00403 cout << "==================================== Calibrations/tpc has not been found i =" << i << endl;
00404 continue;
00405 }
00406 if (k == 0) {
00407 St_tpcDriftVelocity *tpcDriftVelocity = (St_tpcDriftVelocity *) set->Find("tpcDriftVelocity");
00408 if (tpcDriftVelocity) {
00409 dbMk->GetValidity(tpcDriftVelocity,t);
00410 cout << "got " << tpcDriftVelocity->GetName() << " for d/t " << dates[i].date << "/" << dates[i].time << endl;
00411 cout << "Found tpcDriftVelocity " << tpcDriftVelocity->GetName() << endl;
00412 cout << "Validity:" << t[0].GetDate() << "/" << t[0].GetTime()
00413 << " ----- " << t[1].GetDate() << "/" << t[1].GetTime() << endl;
00414
00415 tpcDriftVelocity_st *drift = tpcDriftVelocity->GetTable();
00416 row.Dbdvel = drift->laserDriftVelocityEast;
00417 cout << "got " << tpcDriftVelocity->GetName() << " for d/t " << dates[i].date << "/" << dates[i].time
00418 << " dv = " << row.Dbdvel << endl;
00419 } else {
00420 row.Dbdvel = -1;
00421
00422 cout << "==================================== tpcDriftVelocity has not been found i = " << i << "\t" << dates[i].date << "\t" << dates[i].time << endl;
00423
00424 }
00425 }
00426 St_tpcGas *tpcGas = (St_tpcGas *) set->Find("tpcGas");
00427 if (! tpcGas) {
00428
00429 cout << "==================================== tpcGas has not been found i = " << i << "\t" << dates[i].date << "\t" << dates[i].time << endl;
00430 continue;
00431 }
00432 dbMk->GetValidity(tpcGas,t);
00433 cout << "got " << tpcGas->GetName() << " for d/t " << dates[i].date << "/" << dates[i].time << endl;
00434 cout << "Found tpcGas " << tpcGas->GetName() << endl;
00435 cout << "Validity:" << t[0].GetDate() << "/" << t[0].GetTime()
00436 << " ----- " << t[1].GetDate() << "/" << t[1].GetTime() << endl;
00437 date = t[1].GetDate();
00438 time = t[1].GetTime();
00439 tpcGas_st *Gas = tpcGas->GetTable();
00440 if (k == 0) {
00441
00442
00443 row.barometricPressure = Gas->barometricPressure;
00444 row.inputTPCGasPressure = Gas->inputTPCGasPressure;
00445 row.nitrogenPressure = Gas->nitrogenPressure;
00446 row.gasPressureDiff = Gas->gasPressureDiff;
00447 row.inputGasTemperature = Gas->inputGasTemperature;
00448 row.outputGasTemperature = Gas->outputGasTemperature;
00449 row.flowRateArgon1 = Gas->flowRateArgon1;
00450 row.flowRateArgon2 = Gas->flowRateArgon2;
00451 row.flowRateMethane = Gas->flowRateMethane;
00452 row.percentMethaneIn = Gas->percentMethaneIn;
00453 row.ppmOxygenIn = Gas->ppmOxygenIn;
00454 row.flowRateExhaust = Gas->flowRateExhaust;
00455 row.percentMethaneOut = Gas->percentMethaneOut;
00456 row.ppmWaterOut = Gas->ppmWaterOut;
00457 row.ppmOxygenOut = Gas->ppmOxygenOut;
00458 row.flowRateRecirculation = Gas->flowRateRecirculation;
00459 cout << "got percentMethaneIn " << row.percentMethaneIn << endl;
00460 row.barometricPressureAv = row.barometricPressure;
00461 row.inputGasTemperatureAv = row.inputGasTemperature;
00462 row.outputGasTemperatureAv= row.outputGasTemperature;
00463 row.percentMethaneInAv = row.percentMethaneIn;
00464 row.percentMethaneOutAv = row.percentMethaneOut;
00465 } else {
00466 row.barometricPressureAv = (k*row.barometricPressureAv + Gas->barometricPressure)/(k+1.);
00467 row.inputGasTemperatureAv = (k*row.inputGasTemperatureAv + Gas->inputGasTemperature)/(k+1.);
00468 row.outputGasTemperatureAv= (k*row.outputGasTemperatureAv + Gas->outputGasTemperature)/(k+1.);
00469 row.percentMethaneInAv = (k*row.percentMethaneInAv + Gas->percentMethaneIn)/(k+1.);
00470 row.percentMethaneOutAv = (k*row.percentMethaneOutAv + Gas->percentMethaneOut)/(k+1.);
00471 }
00472 }
00473 FitP->Fill(&row.day);
00474 }
00475 }