16 |
printf("\nUsage:\n"); |
printf("\nUsage:\n"); |
17 |
printf("\n YodaProfiler [options] -rawFile raw_filename -yodaFile yoda_filename \n"); |
printf("\n YodaProfiler [options] -rawFile raw_filename -yodaFile yoda_filename \n"); |
18 |
printf("\n -rawFile full path to the raw file\n"); |
printf("\n -rawFile full path to the raw file\n"); |
19 |
printf("\n -yodaFile full path to the YODA file\n"); |
printf( " -yodaFile full path to the YODA file\n"); |
20 |
printf("\n Options can be: \n"); |
printf("\n Options are:\n\n"); |
21 |
printf("\n --version print informations about compilation and exit\n"); |
printf(" --version print informations about compilation and exit\n"); |
22 |
printf("\n -h | --help print this help and exit \n"); |
printf(" -h | --help print this help and exit \n"); |
23 |
printf("\n -v | --verbose be verbose [default: print nothing on STDOUT]\n"); |
printf(" -v | --verbose be verbose [default]\n"); |
24 |
printf("\n -g | --debug be very verbose [default: no]\n"); |
printf(" -s | --silent print nothing on STDOUT\n"); |
25 |
printf("\n -boot number CPU boot number [default = taken from VarDump]\n"); |
printf(" -g | --debug be very verbose [default: no]\n"); |
26 |
printf("\n -tsync number timesync (s) [default = taken from data]\n"); |
printf(" -boot number CPU boot number [default = taken from VarDump]\n"); |
27 |
printf("\n -obt0 number obt at timesync (ms) [default = taken from data]\n"); |
printf(" -autoboot if no VarDump found try to determine the BOOT number\n"); |
28 |
printf("\n -clean number number in seconds after which the fragment table\n"); |
printf(" looking at timesync [default]\n"); |
29 |
printf("\n can be cleaned and runs validated [default = 864000 (10 days)],\n"); |
printf(" -no-autoboot disable previous check\n"); |
30 |
printf("\n if 0 force cleaning immediatly, if negative do not clean\n"); |
printf(" -tsync number timesync (s) [default = taken from data]\n"); |
31 |
printf("\n -host name for the host [default = mysql://localhost/pamelaprod]\n"); |
printf(" -obt0 number obt at timesync (ms) [default = taken from data]\n"); |
32 |
printf("\n -user username for the DB [default = anonymous] \n"); |
printf(" -clean number number in seconds after which the fragment table\n"); |
33 |
printf("\n -psw password for the DB [default = \"\"]\n"); |
printf(" can be cleaned and runs validated [default = -1 do not clean],\n"); |
34 |
|
printf(" if 0 force cleaning immediatly, if negative do not clean\n"); |
35 |
|
printf(" -remove file remove file and all related runs and calibrations from DB\n"); |
36 |
|
printf(" file must be the YODA filename (full path is not needed)\n"); |
37 |
|
printf(" 'same' can be used if in conjuction with -yodaFile\n"); |
38 |
|
printf(" -validate file validates runs between the two closest calibration to file \n"); |
39 |
|
printf(" not belonging to file itself. File must be the YODA filename\n"); |
40 |
|
printf(" 'same' can be used if in conjuction with -yodaFile\n"); |
41 |
|
printf(" -cleanfrag file clean run fragments for file only\n"); |
42 |
|
printf(" File must be the YODA filename\n"); |
43 |
|
printf(" 'same' can be used if in conjuction with -yodaFile\n"); |
44 |
|
printf(" -nofrag do not leave runs in the fragment table and look for fragments\n"); |
45 |
|
printf(" in the GL_RUN table.\n"); |
46 |
|
printf(" -force to be used to reprocess a file or to process a file\n"); |
47 |
|
printf(" when already validated the surroundings, it is equivalent to:\n"); |
48 |
|
printf(" -remove same -validate same -cleanfrag same -nofrag\n"); |
49 |
|
printf(" -host name of the DB host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
50 |
|
printf(" -user username for the DB connection [default = $PAM_DBUSER or \"anonymous\"] \n"); |
51 |
|
printf(" -psw password for the DB connection [default = $PAM_DBPSW or \"\"]\n"); |
52 |
|
printf(" -tle <file> ascii file containing TLE obtained from celestrak.org or space-track.org [default = no]\n"); |
53 |
printf("\n The order of input files and options does not matter. \n"); |
printf("\n The order of input files and options does not matter. \n"); |
54 |
printf("\nExample: \n"); |
printf("\n Example: \n"); |
55 |
printf("\n YodaProfiler -yodaFile /path/to/raw/files/000_000_00000_cln2.pam -rawFile /path/to/filesfromyoda/000_000_00000_cln2.root -v \n\n"); |
printf(" YodaProfiler -yodaFile /path/to/raw/files/000_000_00000_cln2.pam -rawFile /path/to/filesfromyoda/000_000_00000_cln2.root -v \n\n"); |
56 |
}; |
}; |
57 |
// |
// |
58 |
int main(int numinp, char *inps[]){ |
int main(int numinp, char *inps[]){ |
64 |
UInt_t boot = 0; |
UInt_t boot = 0; |
65 |
UInt_t tsync = 0; |
UInt_t tsync = 0; |
66 |
UInt_t obt0 = 0; |
UInt_t obt0 = 0; |
67 |
Long64_t olderthan = 864000LL; |
Long64_t olderthan = -1LL; |
68 |
// |
// |
69 |
// |
// |
70 |
TString filerawname; |
TString filerawname = ""; |
71 |
|
TString filerootname = ""; |
72 |
// |
// |
73 |
TString host; |
TString host = "mysql://localhost/pamelaprod"; |
74 |
TString user; |
TString user = "anonymous"; |
75 |
TString password; |
TString password = ""; |
76 |
|
// |
77 |
|
TString tlefilename = ""; |
78 |
|
// |
79 |
|
const char *pamdbhost = gSystem->Getenv("PAM_DBHOST"); |
80 |
|
const char *pamdbuser = gSystem->Getenv("PAM_DBUSER"); |
81 |
|
const char *pamdbpsw = gSystem->Getenv("PAM_DBPSW"); |
82 |
|
if ( !pamdbhost ) pamdbhost = ""; |
83 |
|
if ( !pamdbuser ) pamdbuser = ""; |
84 |
|
if ( !pamdbpsw ) pamdbpsw = ""; |
85 |
|
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
86 |
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
87 |
|
if ( strcmp(pamdbpsw,"") ) password = pamdbpsw; |
88 |
// |
// |
|
TString filerootname; |
|
89 |
// |
// |
90 |
Bool_t beverbose = false; |
Bool_t beverbose = true; |
91 |
Bool_t debug = false; |
Bool_t debug = false; |
92 |
|
Bool_t autoboot = true; |
93 |
|
// |
94 |
|
Bool_t remove = false; |
95 |
|
TString remfile = ""; |
96 |
|
// |
97 |
|
Bool_t forceclean = false; |
98 |
|
TString fcleanfile = ""; |
99 |
|
// |
100 |
|
Bool_t validate = false; |
101 |
|
TString validfile = ""; |
102 |
|
// |
103 |
|
Bool_t nofrag = false; |
104 |
|
// |
105 |
|
Bool_t force = false; |
106 |
|
// |
107 |
Int_t i = 0; |
Int_t i = 0; |
108 |
// |
// |
109 |
if ( numinp > 1 ){ |
if ( numinp > 1 ){ |
113 |
exit(0); |
exit(0); |
114 |
}; |
}; |
115 |
if ( !strcmp(inps[i],"-h") || !strcmp(inps[i],"--help") ){ |
if ( !strcmp(inps[i],"-h") || !strcmp(inps[i],"--help") ){ |
116 |
|
|
117 |
usage(); |
usage(); |
118 |
exit(0); |
exit(0); |
119 |
}; |
}; |
131 |
}; |
}; |
132 |
filerootname = (TString)inps[i+1]; |
filerootname = (TString)inps[i+1]; |
133 |
}; |
}; |
134 |
|
if ( !strcmp(inps[i],"-remove") ) { |
135 |
|
if ( numinp-1 < i+1 ){ |
136 |
|
usage(); |
137 |
|
exit(1); |
138 |
|
}; |
139 |
|
remfile = (TString)inps[i+1]; |
140 |
|
remove = true; |
141 |
|
}; |
142 |
|
if ( !strcmp(inps[i],"-cleanfrag") ) { |
143 |
|
if ( numinp-1 < i+1 ){ |
144 |
|
usage(); |
145 |
|
exit(1); |
146 |
|
}; |
147 |
|
fcleanfile = (TString)inps[i+1]; |
148 |
|
forceclean = true; |
149 |
|
}; |
150 |
|
if ( !strcmp(inps[i],"-validate") ) { |
151 |
|
if ( numinp-1 < i+1 ){ |
152 |
|
usage(); |
153 |
|
exit(1); |
154 |
|
}; |
155 |
|
validfile = (TString)inps[i+1]; |
156 |
|
validate = true; |
157 |
|
}; |
158 |
|
if ( !strcmp(inps[i],"-autoboot") ) { |
159 |
|
autoboot = true; |
160 |
|
}; |
161 |
|
if ( !strcmp(inps[i],"-no-autoboot") ) { |
162 |
|
autoboot = false; |
163 |
|
}; |
164 |
if ( !strcmp(inps[i],"-boot") ) { |
if ( !strcmp(inps[i],"-boot") ) { |
165 |
if ( numinp-1 < i+1 ){ |
if ( numinp-1 < i+1 ){ |
166 |
usage(); |
usage(); |
210 |
}; |
}; |
211 |
password = (TString)inps[i+1]; |
password = (TString)inps[i+1]; |
212 |
}; |
}; |
213 |
|
if ( !strcmp(inps[i],"-tle") ) { |
214 |
|
if ( numinp-1 < i+1 ){ |
215 |
|
usage(); |
216 |
|
exit(1); |
217 |
|
}; |
218 |
|
tlefilename = (TString)inps[i+1]; |
219 |
|
}; |
220 |
// |
// |
221 |
if ( !strcmp(inps[i],"-v") || !strcmp(inps[i],"--verbose") ) beverbose = true; |
if ( !strcmp(inps[i],"-v") || !strcmp(inps[i],"--verbose") ) beverbose = true; |
222 |
// |
// |
223 |
|
if ( !strcmp(inps[i],"-s") || !strcmp(inps[i],"--silent") ) beverbose = false; |
224 |
|
// |
225 |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ) debug = true; |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ) debug = true; |
226 |
// |
// |
227 |
|
if ( !strcmp(inps[i],"-f") || !strcmp(inps[i],"-force") ) force = true; |
228 |
|
// |
229 |
|
if ( !strcmp(inps[i],"-nofrag") ) nofrag = true; |
230 |
|
// |
231 |
i++; |
i++; |
232 |
}; |
}; |
233 |
} else { |
} else { |
248 |
dup2(nul,2); |
dup2(nul,2); |
249 |
}; |
}; |
250 |
// |
// |
251 |
|
if ( !strcmp(filerootname.Data(),"") ){ |
252 |
|
if ( (validate && !strcmp(validfile.Data(),"same")) || |
253 |
|
(remove && !strcmp(remfile.Data(),"same")) || |
254 |
|
(forceclean && !strcmp(fcleanfile.Data(),"same")) || force ){ |
255 |
|
printf("\n ERROR IN INPUT PARAMETERS \n"); |
256 |
|
usage(); |
257 |
|
exit(1); |
258 |
|
}; |
259 |
|
} else { |
260 |
|
if ( validate && !strcmp(validfile.Data(),"same") ) validfile = (TString)gSystem->BaseName(filerootname.Data()); |
261 |
|
if ( remove && !strcmp(remfile.Data(),"same") ) remfile = (TString)gSystem->BaseName(filerootname.Data()); |
262 |
|
if ( forceclean && !strcmp(fcleanfile.Data(),"same") ) fcleanfile = (TString)gSystem->BaseName(filerootname.Data()); |
263 |
|
}; |
264 |
|
// |
265 |
|
if ( force ){ |
266 |
|
nofrag = true; |
267 |
|
forceclean = true; |
268 |
|
remove = true; |
269 |
|
validate = true; |
270 |
|
fcleanfile = (TString)gSystem->BaseName(filerootname.Data()); |
271 |
|
remfile = fcleanfile; |
272 |
|
validfile = fcleanfile; |
273 |
|
}; |
274 |
|
// |
275 |
// Start: |
// Start: |
276 |
// |
// |
277 |
TString message; |
TString message; |
278 |
char *version = YodaProfilerInfo(false); |
char *version = YodaProfilerInfo(false); |
279 |
PamelaDBOperations *pamDB = 0; |
PamelaDBOperations *pamDB = 0; |
280 |
UInt_t sizeofwar = 10; |
UInt_t sizeofwar = 12; |
281 |
UInt_t WAR[10]; |
UInt_t WAR[12]; |
282 |
memset(WAR, 0, 10*sizeof(UInt_t)); |
memset(WAR, 0, sizeofwar*sizeof(UInt_t)); |
283 |
// |
// |
284 |
printf("\n Welcome to the PAMELA YodaProfiler, version %s \n\n",version); |
printf("\n Welcome to the PAMELA YodaProfiler, version %s \n\n",version); |
285 |
try{ |
try{ |
288 |
// Create pamDB object and open SQL connection |
// Create pamDB object and open SQL connection |
289 |
//------------------------------------------------------------------------------------------- |
//------------------------------------------------------------------------------------------- |
290 |
if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n"); |
if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n"); |
291 |
pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug); |
pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename); |
292 |
pamDB->CheckFile(); |
pamDB->CheckConnection(); |
|
pamDB->SetOlderThan(olderthan); |
|
293 |
//------------------------------------------------------------------------------------------- |
//------------------------------------------------------------------------------------------- |
294 |
// |
// |
295 |
//------------------------------------------------------------------------------------------- |
pamDB->SetNoFrag(nofrag); |
296 |
//Insert a Raw file in GL_RAW |
pamDB->SetAutoBoot(autoboot); |
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 2 => Insert a RAW file in GL_RAW \n"); |
|
|
WAR[0] = pamDB->insertPamelaRawFile(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
//------------------------------------------------------------------------------------------- |
|
|
//Update a single GL_RAW record with its BOOT_NUMBER |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 3 => Update a single GL_RAW record with its BOOT_NUMBER \n"); |
|
|
WAR[3] = pamDB->assignBOOT_NUMBER(); |
|
|
// if ( WAR[3] ) pamDB->SetNOBOOT(true); |
|
|
if ( WAR[3] && WAR[3] != 1 ) throw -9; |
|
|
//------------------------------------------------------------------------------------------- |
|
297 |
// |
// |
298 |
//------------------------------------------------------------------------------------------- |
if ( remove ){ |
299 |
//Insert an entry in GL_TIMESYNC |
//------------------------------------------------------------------------------------------- |
300 |
//------------------------------------------------------------------------------------------- |
// Remove a file and, on cascade, all that follows from the DB |
301 |
if ( beverbose ) printf(" 4 => Insert an entry in GL_TIMESYNC \n"); |
//------------------------------------------------------------------------------------------- |
302 |
WAR[1] = pamDB->insertPamelaGL_TIMESYNC(); |
if ( beverbose ) printf(" X => Remove file %s from DB \n",((TString)gSystem->BaseName(remfile)).Data()); |
303 |
//------------------------------------------------------------------------------------------- |
WAR[11] = pamDB->removeFile((TString)gSystem->BaseName(remfile.Data())); |
304 |
|
//------------------------------------------------------------------------------------------- |
305 |
|
}; |
306 |
|
// |
307 |
|
if( pamDB->InsertRaw() ){ |
308 |
|
//------------------------------------------------------------------------------------------- |
309 |
|
//Insert a Raw file in GL_RAW |
310 |
|
//------------------------------------------------------------------------------------------- |
311 |
|
if ( beverbose ) printf(" 2 => Insert a RAW file in GL_RAW \n"); |
312 |
|
WAR[0] = pamDB->insertPamelaRawFile(); |
313 |
|
//------------------------------------------------------------------------------------------- |
314 |
|
}; |
315 |
// |
// |
316 |
//------------------------------------------------------------------------------------------- |
if( pamDB->InsertRoot() ){ |
317 |
//Insert unpack ROOT file in GL_ROOT |
// |
318 |
//------------------------------------------------------------------------------------------- |
if( !pamDB->InsertRaw() )printf("=> RAW file not inserted --- the DB might not ( yet ) be filled correctly \n"); |
319 |
if ( beverbose ) printf(" 5 => Insert unpack ROOT file in GL_ROOT \n"); |
pamDB->CheckFile(); |
320 |
WAR[2] = pamDB->insertPamelaRootFile(); |
// |
321 |
//------------------------------------------------------------------------------------------- |
//------------------------------------------------------------------------------------------- |
322 |
|
//Insert an entry in GL_TIMESYNC |
323 |
|
//------------------------------------------------------------------------------------------- |
324 |
|
if ( beverbose ) printf(" 3 => Insert an entry in GL_TIMESYNC \n"); |
325 |
|
WAR[1] = pamDB->insertPamelaGL_TIMESYNC(); |
326 |
|
//------------------------------------------------------------------------------------------- |
327 |
|
// |
328 |
|
//------------------------------------------------------------------------------------------- |
329 |
|
//Update a single GL_RAW record with its BOOT_NUMBER |
330 |
|
//------------------------------------------------------------------------------------------- |
331 |
|
if ( beverbose ) printf(" 4 => Update a single GL_RAW record with its BOOT_NUMBER \n"); |
332 |
|
WAR[3] = pamDB->assignBOOT_NUMBER(); |
333 |
|
if ( WAR[3] && WAR[3] != 1 && WAR[3] != 8 ) throw -9; |
334 |
|
//------------------------------------------------------------------------------------------- |
335 |
|
// |
336 |
|
//------------------------------------------------------------------------------------------- |
337 |
|
//Insert unpack ROOT file in GL_ROOT |
338 |
|
//------------------------------------------------------------------------------------------- |
339 |
|
if ( beverbose ) printf(" 5 => Insert unpack ROOT file in GL_ROOT \n"); |
340 |
|
WAR[2] = pamDB->insertPamelaRootFile(); |
341 |
|
//------------------------------------------------------------------------------------------- |
342 |
|
// |
343 |
|
//------------------------------------------------------------------------------------------- |
344 |
|
//Insert in GL_RUN runs information records relative to a single unpack |
345 |
|
//------------------------------------------------------------------------------------------- |
346 |
|
if ( beverbose ) printf(" 6 => Scan physics and store runs in the GL_RUN table\n"); |
347 |
|
WAR[4] = pamDB->insertPamelaRUN(); |
348 |
|
//------------------------------------------------------------------------------------------- |
349 |
|
|
350 |
|
//------------------------------------------------------------------------------------------- |
351 |
|
//Insert in GL_CALO_CALIB calibration information records relative to a single unpack |
352 |
|
//------------------------------------------------------------------------------------------- |
353 |
|
if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n"); |
354 |
|
WAR[5] = pamDB->insertCALO_CALIB(); |
355 |
|
//------------------------------------------------------------------------------------------- |
356 |
|
|
357 |
|
//------------------------------------------------------------------------------------------- |
358 |
|
//Insert in GL_TRK_CALIB calibration information records relative to a single unpack |
359 |
|
//------------------------------------------------------------------------------------------- |
360 |
|
if ( beverbose ) printf(" 8 => Insert tracker calibrations in the GL_TRK_CALIB table\n"); |
361 |
|
WAR[6] = pamDB->insertTRK_CALIB(); |
362 |
|
//------------------------------------------------------------------------------------------- |
363 |
|
|
364 |
|
//------------------------------------------------------------------------------------------- |
365 |
|
//Insert in GL_S4_CALIB calibration information records relative to a single unpack |
366 |
|
//------------------------------------------------------------------------------------------- |
367 |
|
if ( beverbose ) printf(" 9 => Insert S4 calibrations in the GL_S4_CALIB table\n"); |
368 |
|
WAR[7] = pamDB->insertS4_CALIB(); |
369 |
|
//------------------------------------------------------------------------------------------- |
370 |
|
}; |
371 |
// |
// |
372 |
|
if ( forceclean ){ |
373 |
|
//------------------------------------------------------------------------------------------- |
374 |
|
//Clean the GL_RUN_FRAGMENTS for the given file |
375 |
|
//------------------------------------------------------------------------------------------- |
376 |
|
if ( beverbose ) printf(" 10 => Clean the GL_RUN_FRAGMENTS table for file %s \n",fcleanfile.Data()); |
377 |
|
WAR[8] = pamDB->CleanGL_RUN_FRAGMENTS((TString)gSystem->BaseName(fcleanfile.Data())); |
378 |
|
}; |
379 |
|
// |
380 |
|
// |
381 |
|
if ( validate ){ |
382 |
|
//------------------------------------------------------------------------------------------- |
383 |
|
//Validate runs |
384 |
|
//------------------------------------------------------------------------------------------- |
385 |
|
if ( beverbose ) printf(" 11 => Validate runs table for file %s \n",validfile.Data()); |
386 |
|
WAR[9] = pamDB->ValidateRuns((TString)gSystem->BaseName(validfile.Data())); |
387 |
|
//------------------------------------------------------------------------------------------- |
388 |
|
}; |
389 |
|
// |
390 |
|
pamDB->CheckValidate(olderthan); |
391 |
|
// |
392 |
|
if( pamDB->Validate() ){ |
393 |
|
//------------------------------------------------------------------------------------------- |
394 |
|
//Clean the GL_RUN_FRAGMENTS |
395 |
|
//------------------------------------------------------------------------------------------- |
396 |
|
if ( beverbose ) printf(" 10 => Clean the GL_RUN_FRAGMENTS table (earlier than %s) \n",pamDB->GetCleanTime() ); |
397 |
|
WAR[8] = pamDB->CleanGL_RUN_FRAGMENTS(); |
398 |
|
//------------------------------------------------------------------------------------------- |
399 |
|
//------------------------------------------------------------------------------------------- |
400 |
|
//Validate runs |
401 |
|
//------------------------------------------------------------------------------------------- |
402 |
|
if ( beverbose ) printf(" 11 => Validate runs (earlier than %s)\n",pamDB->GetCleanTime()); |
403 |
|
WAR[9] = pamDB->ValidateRuns(); |
404 |
|
//------------------------------------------------------------------------------------------- |
405 |
|
}; |
406 |
|
|
407 |
//------------------------------------------------------------------------------------------- |
if(! tlefilename.IsNull() ) { |
408 |
//Insert in GL_RUN runs information records relative to a single unpack |
//---------------------------------------------- |
409 |
//------------------------------------------------------------------------------------------- |
//Populate GL_TLE table using the file provided |
410 |
if ( beverbose ) printf(" 6 => Scan physics and store runs in the GL_RUN table\n"); |
//---------------------------------------------- |
411 |
WAR[4] = pamDB->insertPamelaRUN(); |
if ( beverbose ) printf(" 12 => Insert TLE elements in the GL_TLE table from file %s \n",tlefilename.Data()); |
412 |
//------------------------------------------------------------------------------------------- |
WAR[10] = pamDB->populateTLE(); |
413 |
|
} |
414 |
//------------------------------------------------------------------------------------------- |
|
|
//Insert in GL_CALO_CALIB calibration information records relative to a single unpack |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n"); |
|
|
WAR[5] = pamDB->insertCALO_CALIB(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
|
|
|
//------------------------------------------------------------------------------------------- |
|
|
//Insert in GL_TRK_CALIB calibration information records relative to a single unpack |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 8 => Insert tracker calibrations in the GL_TRK_CALIB table\n"); |
|
|
WAR[6] = pamDB->insertTRK_CALIB(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
|
|
|
//------------------------------------------------------------------------------------------- |
|
|
//Insert in GL_S4_CALIB calibration information records relative to a single unpack |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 9 => Insert S4 calibrations in the GL_S4_CALIB table\n"); |
|
|
WAR[7] = pamDB->insertS4_CALIB(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
|
|
|
//------------------------------------------------------------------------------------------- |
|
|
//Clean the GL_RUN_FRAGMENTS |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 10 => Clean the GL_RUN_FRAGMENTS table\n"); |
|
|
WAR[8] = pamDB->CleanGL_RUN_FRAGMENTS(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
|
|
|
//------------------------------------------------------------------------------------------- |
|
|
//Validate runs |
|
|
//------------------------------------------------------------------------------------------- |
|
|
if ( beverbose ) printf(" 11 => Validate runs\n"); |
|
|
WAR[9] = pamDB->ValidateRuns(); |
|
|
//------------------------------------------------------------------------------------------- |
|
|
|
|
415 |
} catch (Int_t exc) { |
} catch (Int_t exc) { |
416 |
signal = exc; |
signal = exc; |
417 |
switch(exc){ |
switch(exc){ |
421 |
case -4: message += " Error querying DB"; break; |
case -4: message += " Error querying DB"; break; |
422 |
case -5: message += " Inconsistent OBT/pkt_num"; break; |
case -5: message += " Inconsistent OBT/pkt_num"; break; |
423 |
case -6: message += " The file is not in the database"; break; |
case -6: message += " The file is not in the database"; break; |
424 |
|
case -7: message += " Cannot open TLE file"; break; |
425 |
case -8: message += " Event file is empty"; break; |
case -8: message += " Event file is empty"; break; |
426 |
case -9: message += " No VarDump no BOOT number, use the -boot option to override"; break; |
case -9: message += " No VarDump no BOOT number, use the -boot option to override"; break; |
427 |
case -10: message += " No results from DB"; break; |
case -10: message += " No results from DB"; break; |
441 |
case -24: message += " No CalibS4 tree in Level0 file"; break; |
case -24: message += " No CalibS4 tree in Level0 file"; break; |
442 |
case -25: message += " Cannot find the run just inserted"; break; |
case -25: message += " Cannot find the run just inserted"; break; |
443 |
case -26: message += " Raw file not found looking for VarDump"; break; |
case -26: message += " Raw file not found looking for VarDump"; break; |
444 |
|
case -27: message += " Cannot determine downlink orbit, wrong filename format?"; break; |
445 |
|
case -28: message += " Cannot assign a RUN ID unique number!"; break; |
446 |
|
case -29: message += " No VarDump and impossible to find a consistent BOOT number, use the -boot option to override"; break; |
447 |
default: message += " Unidentified error"; break; |
default: message += " Unidentified error"; break; |
448 |
}; |
}; |
449 |
printf("\n"); |
printf("\n"); |
496 |
if ( bit == 0 ) message += "=> BOOT number already inserted\n";// |
if ( bit == 0 ) message += "=> BOOT number already inserted\n";// |
497 |
else if ( bit == 1 ) message += "=> VarDump event tree is empty, use the -boot option to override\n";// |
else if ( bit == 1 ) message += "=> VarDump event tree is empty, use the -boot option to override\n";// |
498 |
else if ( bit == 2 ) message += "=> No BOOT number in VarDump(!), use the -boot option to override\n";// |
else if ( bit == 2 ) message += "=> No BOOT number in VarDump(!), use the -boot option to override\n";// |
499 |
|
else if ( bit == 3 ) message += "=> No VarDump! autoboot option used\n";// |
500 |
else if ( bit == 4 ) message += "=> The file is not in the database looking for VarDump, use the -boot option to override\n";// |
else if ( bit == 4 ) message += "=> The file is not in the database looking for VarDump, use the -boot option to override\n";// |
501 |
else message += "=> Unidentified assignBOOTnumber warning\n"; |
else message += "=> Unidentified assignBOOTnumber warning\n"; |
502 |
}; |
}; |
548 |
for (UInt_t bit=0; bit<32; bit++){ |
for (UInt_t bit=0; bit<32; bit++){ |
549 |
if ( WAR[j] & (1 << bit) ){ |
if ( WAR[j] & (1 << bit) ){ |
550 |
if ( bit == 0 ) message += "=> Skip the GL_RUN_FRAGMENTS table cleaning\n"; |
if ( bit == 0 ) message += "=> Skip the GL_RUN_FRAGMENTS table cleaning\n"; |
551 |
|
if ( bit == 1 ) message += "=> Problems retrieving ROOT ID from DB\n"; |
552 |
else message += "=> Unidentified CleanGL_RUN_FRAGMENTS warning\n"; |
else message += "=> Unidentified CleanGL_RUN_FRAGMENTS warning\n"; |
553 |
}; |
}; |
554 |
}; |
}; |
558 |
for (UInt_t bit=0; bit<32; bit++){ |
for (UInt_t bit=0; bit<32; bit++){ |
559 |
if ( WAR[j] & (1 << bit) ){ |
if ( WAR[j] & (1 << bit) ){ |
560 |
if ( bit == 0 ) message += "=> Skip the run validation \n"; |
if ( bit == 0 ) message += "=> Skip the run validation \n"; |
561 |
|
if ( bit == 1 ) message += "=> Problems retrieving ROOT ID from DB\n"; |
562 |
else message += "=> Unidentified ValidateRuns warning\n"; |
else message += "=> Unidentified ValidateRuns warning\n"; |
563 |
}; |
}; |
564 |
}; |
}; |
565 |
}; |
}; |
566 |
|
// |
567 |
|
if ( j == 10 ){ // populateTLE |
568 |
|
for (UInt_t bit=0; bit<32; bit++){ |
569 |
|
if ( WAR[j] & (1 << bit) ){ |
570 |
|
if ( bit == 0 ) message += "=> TLE insertion failed\n"; |
571 |
|
if ( bit == 1 ) message += "=> No new TLE available\n"; |
572 |
|
else message += "=> Unidentified populateTle warning\n"; |
573 |
|
}; |
574 |
|
}; |
575 |
|
}; |
576 |
|
// |
577 |
|
if ( j == 11 ){ // removeFile |
578 |
|
for (UInt_t bit=0; bit<32; bit++){ |
579 |
|
if ( WAR[j] & (1 << bit) ){ |
580 |
|
if ( bit == 0 ) message += "=> No file to delete from DB \n"; |
581 |
|
else message += "=> Unidentified populateTle warning\n"; |
582 |
|
}; |
583 |
|
}; |
584 |
|
}; |
585 |
}; |
}; |
586 |
}; |
}; |
587 |
// |
// |
595 |
//--------------------------------------------------------------------------------------- |
//--------------------------------------------------------------------------------------- |
596 |
// Close and exit |
// Close and exit |
597 |
//--------------------------------------------------------------------------------------- |
//--------------------------------------------------------------------------------------- |
598 |
if ( beverbose ) printf(" 12 => Free objects and close SQL connection \n"); |
if ( beverbose ) printf(" 13 => Free objects and close SQL connection \n"); |
599 |
pamDB->Close(); |
pamDB->Close(); |
600 |
// |
// |
601 |
printf("\n"); |
printf("\n"); |