1 |
mocchiut |
1.1 |
// |
2 |
|
|
#include <iostream> |
3 |
|
|
#include <sstream> |
4 |
|
|
#include <errno.h> |
5 |
|
|
// |
6 |
|
|
#include <TSystem.h> |
7 |
|
|
// |
8 |
|
|
#include <PamelaDBOperations.h> |
9 |
|
|
#include <YodaProfilerVerl2.h> |
10 |
|
|
// |
11 |
|
|
using namespace std; |
12 |
|
|
// |
13 |
|
|
// Usage subroutine |
14 |
|
|
// |
15 |
|
|
void usage(){ |
16 |
|
|
printf("\nUsage:\n"); |
17 |
mocchiut |
1.2 |
printf("\n YodaProfiler [options] -rawFile raw_filename -yodaFile yoda_filename \n"); |
18 |
|
|
printf("\n -rawFile full path to the raw file\n"); |
19 |
|
|
printf("\n -yodaFile full path to the YODA file\n"); |
20 |
|
|
printf("\n Options can be: \n"); |
21 |
mocchiut |
1.1 |
printf("\n --version print informations about compilation and exit\n"); |
22 |
|
|
printf("\n -h | --help print this help and exit \n"); |
23 |
mocchiut |
1.3 |
printf("\n -v | --verbose be verbose [default]\n"); |
24 |
mocchiut |
1.6 |
printf("\n -s | --silent print nothing on STDOUT\n"); |
25 |
mocchiut |
1.1 |
printf("\n -g | --debug be very verbose [default: no]\n"); |
26 |
|
|
printf("\n -boot number CPU boot number [default = taken from VarDump]\n"); |
27 |
|
|
printf("\n -tsync number timesync (s) [default = taken from data]\n"); |
28 |
|
|
printf("\n -obt0 number obt at timesync (ms) [default = taken from data]\n"); |
29 |
mocchiut |
1.2 |
printf("\n -clean number number in seconds after which the fragment table\n"); |
30 |
mocchiut |
1.3 |
printf("\n can be cleaned and runs validated [default = -1 do not clean],\n"); |
31 |
mocchiut |
1.2 |
printf("\n if 0 force cleaning immediatly, if negative do not clean\n"); |
32 |
mocchiut |
1.3 |
printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); |
33 |
|
|
printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); |
34 |
|
|
printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); |
35 |
mocchiut |
1.10 |
printf("\n -tle <file> ascii file containing TLE obtained from celestrak.org or space-track.org [default = no]\n"); |
36 |
mocchiut |
1.2 |
printf("\n The order of input files and options does not matter. \n"); |
37 |
|
|
printf("\nExample: \n"); |
38 |
|
|
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"); |
39 |
mocchiut |
1.1 |
}; |
40 |
|
|
// |
41 |
|
|
int main(int numinp, char *inps[]){ |
42 |
|
|
// |
43 |
|
|
// Variables booking |
44 |
|
|
// |
45 |
|
|
Int_t signal = 0; |
46 |
|
|
Int_t nul = 0; |
47 |
|
|
UInt_t boot = 0; |
48 |
|
|
UInt_t tsync = 0; |
49 |
|
|
UInt_t obt0 = 0; |
50 |
mocchiut |
1.3 |
// Long64_t olderthan = 864000LL; |
51 |
|
|
Long64_t olderthan = -1LL; |
52 |
pam-fi |
1.5 |
|
53 |
mocchiut |
1.1 |
// |
54 |
|
|
// |
55 |
pam-fi |
1.5 |
TString filerawname = ""; |
56 |
|
|
TString filerootname = ""; |
57 |
mocchiut |
1.1 |
// |
58 |
mocchiut |
1.3 |
TString host = "mysql://localhost/pamelaprod"; |
59 |
|
|
TString user = "anonymous"; |
60 |
|
|
TString password = ""; |
61 |
|
|
// |
62 |
mocchiut |
1.10 |
TString tlefilename = ""; |
63 |
|
|
|
64 |
mocchiut |
1.9 |
const char *pamdbhost = gSystem->Getenv("PAM_DBHOST"); |
65 |
|
|
const char *pamdbuser = gSystem->Getenv("PAM_DBUSER"); |
66 |
|
|
const char *pamdbpsw = gSystem->Getenv("PAM_DBPSW"); |
67 |
|
|
if ( !pamdbhost ) pamdbhost = ""; |
68 |
|
|
if ( !pamdbuser ) pamdbuser = ""; |
69 |
|
|
if ( !pamdbpsw ) pamdbpsw = ""; |
70 |
mocchiut |
1.3 |
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
71 |
|
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
72 |
mocchiut |
1.6 |
if ( strcmp(pamdbpsw,"") ) password = pamdbpsw; |
73 |
mocchiut |
1.1 |
// |
74 |
|
|
// |
75 |
mocchiut |
1.3 |
Bool_t beverbose = true; |
76 |
mocchiut |
1.1 |
Bool_t debug = false; |
77 |
mocchiut |
1.10 |
// |
78 |
mocchiut |
1.1 |
Int_t i = 0; |
79 |
|
|
// |
80 |
|
|
if ( numinp > 1 ){ |
81 |
|
|
while ( i < numinp ){ |
82 |
|
|
if ( !strcmp(inps[i],"--version") ){ |
83 |
|
|
YodaProfilerInfo(true); |
84 |
|
|
exit(0); |
85 |
|
|
}; |
86 |
|
|
if ( !strcmp(inps[i],"-h") || !strcmp(inps[i],"--help") ){ |
87 |
pam-fi |
1.5 |
|
88 |
mocchiut |
1.1 |
usage(); |
89 |
|
|
exit(0); |
90 |
|
|
}; |
91 |
|
|
if ( !strcmp(inps[i],"-rawFile") ) { |
92 |
|
|
if ( numinp-1 < i+1 ){ |
93 |
|
|
usage(); |
94 |
|
|
exit(1); |
95 |
|
|
}; |
96 |
|
|
filerawname = (TString)inps[i+1]; |
97 |
|
|
}; |
98 |
|
|
if ( !strcmp(inps[i],"-yodaFile") ) { |
99 |
|
|
if ( numinp-1 < i+1 ){ |
100 |
|
|
usage(); |
101 |
|
|
exit(1); |
102 |
|
|
}; |
103 |
|
|
filerootname = (TString)inps[i+1]; |
104 |
|
|
}; |
105 |
|
|
if ( !strcmp(inps[i],"-boot") ) { |
106 |
|
|
if ( numinp-1 < i+1 ){ |
107 |
|
|
usage(); |
108 |
|
|
exit(1); |
109 |
|
|
}; |
110 |
|
|
boot = atoi(inps[i+1]); |
111 |
|
|
}; |
112 |
|
|
if ( !strcmp(inps[i],"-tsync") ) { |
113 |
|
|
if ( numinp-1 < i+1 ){ |
114 |
|
|
usage(); |
115 |
|
|
exit(1); |
116 |
|
|
}; |
117 |
mocchiut |
1.2 |
tsync = (UInt_t)atoll(inps[i+1]); |
118 |
mocchiut |
1.1 |
}; |
119 |
|
|
if ( !strcmp(inps[i],"-obt0") ) { |
120 |
|
|
if ( numinp-1 < i+1 ){ |
121 |
|
|
usage(); |
122 |
|
|
exit(1); |
123 |
|
|
}; |
124 |
mocchiut |
1.2 |
obt0 = (UInt_t)atoll(inps[i+1]); |
125 |
|
|
}; |
126 |
|
|
if ( !strcmp(inps[i],"-clean") ) { |
127 |
|
|
if ( numinp-1 < i+1 ){ |
128 |
|
|
usage(); |
129 |
|
|
exit(1); |
130 |
|
|
}; |
131 |
|
|
olderthan = (Long64_t)atoll(inps[i+1]); |
132 |
mocchiut |
1.1 |
}; |
133 |
|
|
if ( !strcmp(inps[i],"-host") ) { |
134 |
|
|
if ( numinp-1 < i+1 ){ |
135 |
|
|
usage(); |
136 |
|
|
exit(1); |
137 |
|
|
}; |
138 |
|
|
host = (TString)inps[i+1]; |
139 |
|
|
}; |
140 |
|
|
if ( !strcmp(inps[i],"-user") ) { |
141 |
|
|
if ( numinp-1 < i+1 ){ |
142 |
|
|
usage(); |
143 |
|
|
exit(1); |
144 |
|
|
}; |
145 |
|
|
user = (TString)inps[i+1]; |
146 |
|
|
}; |
147 |
|
|
if ( !strcmp(inps[i],"-psw") ) { |
148 |
|
|
if ( numinp-1 < i+1 ){ |
149 |
|
|
usage(); |
150 |
|
|
exit(1); |
151 |
|
|
}; |
152 |
|
|
password = (TString)inps[i+1]; |
153 |
|
|
}; |
154 |
mocchiut |
1.10 |
|
155 |
|
|
if ( !strcmp(inps[i],"-tle") ) { |
156 |
|
|
if ( numinp-1 < i+1 ){ |
157 |
|
|
usage(); |
158 |
|
|
exit(1); |
159 |
|
|
}; |
160 |
|
|
tlefilename = (TString)inps[i+1]; |
161 |
|
|
}; |
162 |
|
|
|
163 |
mocchiut |
1.1 |
// |
164 |
|
|
if ( !strcmp(inps[i],"-v") || !strcmp(inps[i],"--verbose") ) beverbose = true; |
165 |
|
|
// |
166 |
mocchiut |
1.3 |
if ( !strcmp(inps[i],"-s") || !strcmp(inps[i],"--silent") ) beverbose = false; |
167 |
|
|
// |
168 |
mocchiut |
1.1 |
if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ) debug = true; |
169 |
|
|
// |
170 |
|
|
i++; |
171 |
|
|
}; |
172 |
|
|
} else { |
173 |
|
|
// |
174 |
|
|
// no input parameters exit with error, we need at least the run id. |
175 |
|
|
// |
176 |
|
|
cout << "\n ERROR: NO INPUT PARAMETERS \n"; |
177 |
|
|
usage(); |
178 |
|
|
exit(1); |
179 |
|
|
}; |
180 |
|
|
|
181 |
|
|
// |
182 |
|
|
// If not in verbose mode redirect to /dev/null the stdout and stderr |
183 |
|
|
// |
184 |
|
|
if ( !beverbose ){ |
185 |
|
|
nul = open("/dev/null", O_CREAT | O_RDWR,S_IREAD | S_IWRITE); |
186 |
|
|
dup2(nul,1); |
187 |
|
|
dup2(nul,2); |
188 |
|
|
}; |
189 |
|
|
// |
190 |
|
|
// Start: |
191 |
|
|
// |
192 |
|
|
TString message; |
193 |
|
|
char *version = YodaProfilerInfo(false); |
194 |
|
|
PamelaDBOperations *pamDB = 0; |
195 |
mocchiut |
1.10 |
UInt_t sizeofwar = 11; |
196 |
|
|
UInt_t WAR[11]; |
197 |
|
|
memset(WAR, 0, 11*sizeof(UInt_t)); |
198 |
mocchiut |
1.1 |
// |
199 |
mocchiut |
1.2 |
printf("\n Welcome to the PAMELA YodaProfiler, version %s \n\n",version); |
200 |
mocchiut |
1.1 |
try{ |
201 |
|
|
// |
202 |
|
|
//------------------------------------------------------------------------------------------- |
203 |
|
|
// Create pamDB object and open SQL connection |
204 |
|
|
//------------------------------------------------------------------------------------------- |
205 |
mocchiut |
1.2 |
if ( beverbose ) printf(" 1 => Initialize and open SQL connection \n"); |
206 |
mocchiut |
1.10 |
pamDB = new PamelaDBOperations(host,user,password,filerawname,filerootname,boot,tsync,obt0,debug,tlefilename); |
207 |
mocchiut |
1.7 |
pamDB->CheckConnection(); |
208 |
|
|
//------------------------------------------------------------------------------------------- |
209 |
mocchiut |
1.1 |
// |
210 |
mocchiut |
1.7 |
|
211 |
|
|
if(pamDB->InsertRaw()){ |
212 |
|
|
//------------------------------------------------------------------------------------------- |
213 |
|
|
//Insert a Raw file in GL_RAW |
214 |
|
|
//------------------------------------------------------------------------------------------- |
215 |
|
|
if ( beverbose ) printf(" 2 => Insert a RAW file in GL_RAW \n"); |
216 |
|
|
WAR[0] = pamDB->insertPamelaRawFile(); |
217 |
|
|
//------------------------------------------------------------------------------------------- |
218 |
|
|
}; |
219 |
mocchiut |
1.1 |
|
220 |
mocchiut |
1.7 |
if(pamDB->InsertRoot()){ |
221 |
|
|
|
222 |
|
|
if(!pamDB->InsertRaw())printf("=> RAW file not inserted --- the DB might not ( yet ) be filled correctly \n"); |
223 |
|
|
pamDB->CheckFile(); |
224 |
|
|
//------------------------------------------------------------------------------------------- |
225 |
|
|
//Update a single GL_RAW record with its BOOT_NUMBER |
226 |
|
|
//------------------------------------------------------------------------------------------- |
227 |
|
|
if ( beverbose ) printf(" 3 => Update a single GL_RAW record with its BOOT_NUMBER \n"); |
228 |
|
|
WAR[3] = pamDB->assignBOOT_NUMBER(); |
229 |
|
|
// if ( WAR[3] ) pamDB->SetNOBOOT(true); |
230 |
|
|
if ( WAR[3] && WAR[3] != 1 ) throw -9; |
231 |
|
|
//------------------------------------------------------------------------------------------- |
232 |
|
|
// |
233 |
|
|
//------------------------------------------------------------------------------------------- |
234 |
|
|
//Insert an entry in GL_TIMESYNC |
235 |
|
|
//------------------------------------------------------------------------------------------- |
236 |
|
|
if ( beverbose ) printf(" 4 => Insert an entry in GL_TIMESYNC \n"); |
237 |
|
|
WAR[1] = pamDB->insertPamelaGL_TIMESYNC(); |
238 |
|
|
//------------------------------------------------------------------------------------------- |
239 |
|
|
// |
240 |
|
|
//------------------------------------------------------------------------------------------- |
241 |
|
|
//Insert unpack ROOT file in GL_ROOT |
242 |
|
|
//------------------------------------------------------------------------------------------- |
243 |
|
|
if ( beverbose ) printf(" 5 => Insert unpack ROOT file in GL_ROOT \n"); |
244 |
|
|
WAR[2] = pamDB->insertPamelaRootFile(); |
245 |
|
|
//------------------------------------------------------------------------------------------- |
246 |
|
|
// |
247 |
|
|
//------------------------------------------------------------------------------------------- |
248 |
|
|
//Insert in GL_RUN runs information records relative to a single unpack |
249 |
|
|
//------------------------------------------------------------------------------------------- |
250 |
|
|
if ( beverbose ) printf(" 6 => Scan physics and store runs in the GL_RUN table\n"); |
251 |
|
|
WAR[4] = pamDB->insertPamelaRUN(); |
252 |
|
|
//------------------------------------------------------------------------------------------- |
253 |
pam-fi |
1.5 |
|
254 |
mocchiut |
1.7 |
//------------------------------------------------------------------------------------------- |
255 |
|
|
//Insert in GL_CALO_CALIB calibration information records relative to a single unpack |
256 |
|
|
//------------------------------------------------------------------------------------------- |
257 |
|
|
if ( beverbose ) printf(" 7 => Insert calorimeter calibrations in the GL_CALO_CALIB table\n"); |
258 |
|
|
WAR[5] = pamDB->insertCALO_CALIB(); |
259 |
|
|
//------------------------------------------------------------------------------------------- |
260 |
pam-fi |
1.5 |
|
261 |
mocchiut |
1.7 |
//------------------------------------------------------------------------------------------- |
262 |
|
|
//Insert in GL_TRK_CALIB calibration information records relative to a single unpack |
263 |
|
|
//------------------------------------------------------------------------------------------- |
264 |
|
|
if ( beverbose ) printf(" 8 => Insert tracker calibrations in the GL_TRK_CALIB table\n"); |
265 |
|
|
WAR[6] = pamDB->insertTRK_CALIB(); |
266 |
|
|
//------------------------------------------------------------------------------------------- |
267 |
pam-fi |
1.5 |
|
268 |
mocchiut |
1.7 |
//------------------------------------------------------------------------------------------- |
269 |
|
|
//Insert in GL_S4_CALIB calibration information records relative to a single unpack |
270 |
|
|
//------------------------------------------------------------------------------------------- |
271 |
|
|
if ( beverbose ) printf(" 9 => Insert S4 calibrations in the GL_S4_CALIB table\n"); |
272 |
|
|
WAR[7] = pamDB->insertS4_CALIB(); |
273 |
|
|
//------------------------------------------------------------------------------------------- |
274 |
|
|
}; |
275 |
|
|
// |
276 |
|
|
pamDB->CheckValidate(olderthan); |
277 |
|
|
// |
278 |
|
|
if(pamDB->Validate()){ |
279 |
|
|
//------------------------------------------------------------------------------------------- |
280 |
|
|
//Clean the GL_RUN_FRAGMENTS |
281 |
|
|
//------------------------------------------------------------------------------------------- |
282 |
mocchiut |
1.8 |
if ( beverbose ) printf(" 10 => Clean the GL_RUN_FRAGMENTS table (earlier than %s) \n",pamDB->GetCleanTime() ); |
283 |
mocchiut |
1.7 |
WAR[8] = pamDB->CleanGL_RUN_FRAGMENTS(); |
284 |
|
|
//------------------------------------------------------------------------------------------- |
285 |
pam-fi |
1.5 |
|
286 |
mocchiut |
1.7 |
//------------------------------------------------------------------------------------------- |
287 |
|
|
//Validate runs |
288 |
|
|
//------------------------------------------------------------------------------------------- |
289 |
mocchiut |
1.8 |
if ( beverbose ) printf(" 11 => Validate runs (earlier than %s)\n",pamDB->GetCleanTime()); |
290 |
mocchiut |
1.7 |
WAR[9] = pamDB->ValidateRuns(); |
291 |
|
|
//------------------------------------------------------------------------------------------- |
292 |
|
|
}; |
293 |
mocchiut |
1.10 |
|
294 |
|
|
if(! tlefilename.IsNull() ) { |
295 |
|
|
//---------------------------------------------- |
296 |
|
|
//Populate GL_TLE table using the file provided |
297 |
|
|
//---------------------------------------------- |
298 |
|
|
if ( beverbose ) printf(" 12 => Insert TLE elements in the GL_TLE table from file %s \n",tlefilename.Data()); |
299 |
|
|
WAR[10] = pamDB->populateTLE(); |
300 |
|
|
} |
301 |
pam-fi |
1.5 |
|
302 |
mocchiut |
1.1 |
} catch (Int_t exc) { |
303 |
|
|
signal = exc; |
304 |
|
|
switch(exc){ |
305 |
|
|
case -1: message += " DB connection failure"; break; |
306 |
|
|
case -2: message += " Connection failure"; break; |
307 |
|
|
case -3: message += " Cannot determine the timesync, use the -tsync and -obt0 options to override"; break; |
308 |
|
|
case -4: message += " Error querying DB"; break; |
309 |
|
|
case -5: message += " Inconsistent OBT/pkt_num"; break; |
310 |
|
|
case -6: message += " The file is not in the database"; break; |
311 |
mocchiut |
1.10 |
case -7: message += " Cannot open TLE file"; break; |
312 |
mocchiut |
1.1 |
case -8: message += " Event file is empty"; break; |
313 |
|
|
case -9: message += " No VarDump no BOOT number, use the -boot option to override"; break; |
314 |
|
|
case -10: message += " No results from DB"; break; |
315 |
|
|
case -11: message += " Raw file not found"; break; |
316 |
|
|
case -12: message += " Cannot open Level0 file"; break; |
317 |
|
|
case -13: message += " No consistent OBT/PKT_NUM information"; break; |
318 |
|
|
case -14: message += " Not supported yet: run with no events, no runtrailer, no runheader"; break; |
319 |
|
|
case -15: message += " Not supported yet: run with no runheader at the beginning/end of file not recognized as run fragment"; break; |
320 |
|
|
case -16: message += " No Physics tree in Level0 file"; break; |
321 |
|
|
case -17: message += " No RunHeader tree in Level0 file"; break; |
322 |
|
|
case -18: message += " No RunTrailer tree in Level0 file"; break; |
323 |
|
|
case -19: message += " No Mcmd tree in Level0 file"; break; |
324 |
|
|
case -20: message += " No VarDump tree in Level0 file"; break; |
325 |
|
|
case -21: message += " No CalibCalPed tree in Level0 file"; break; |
326 |
|
|
case -22: message += " No CalibTrk1 tree in Level0 file"; break; |
327 |
|
|
case -23: message += " No CalibTrk2 tree in Level0 file"; break; |
328 |
|
|
case -24: message += " No CalibS4 tree in Level0 file"; break; |
329 |
mocchiut |
1.2 |
case -25: message += " Cannot find the run just inserted"; break; |
330 |
|
|
case -26: message += " Raw file not found looking for VarDump"; break; |
331 |
mocchiut |
1.1 |
default: message += " Unidentified error"; break; |
332 |
|
|
}; |
333 |
|
|
printf("\n"); |
334 |
|
|
printf(" ERROR (%i) %s \n",exc,message.Data()); |
335 |
|
|
printf("\n"); |
336 |
|
|
} |
337 |
|
|
// |
338 |
|
|
// warnings handlers |
339 |
|
|
// |
340 |
|
|
Bool_t printwarning = false; |
341 |
|
|
message=""; |
342 |
|
|
for (UInt_t j=0; j<sizeofwar; j++){ |
343 |
|
|
if ( WAR[j] ){ |
344 |
|
|
printwarning = true; |
345 |
|
|
// |
346 |
|
|
if ( j == 0 ){ // insertPamelaRaw warnings |
347 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
348 |
|
|
if ( WAR[j] & (1 << bit) ){ |
349 |
|
|
if ( bit == 0 ) message += "=> RAW file already inserted\n"; |
350 |
mocchiut |
1.2 |
else message += "=> Unidentified insertPamelaRaw warning\n"; |
351 |
mocchiut |
1.1 |
}; |
352 |
|
|
}; |
353 |
|
|
}; |
354 |
|
|
// |
355 |
|
|
if ( j == 1 ){ // insertTimeSync warnings |
356 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
357 |
|
|
if ( WAR[j] & (1 << bit) ){ |
358 |
|
|
if ( bit == 0 ) message += "=> TIMESYNC already inserted\n"; |
359 |
mocchiut |
1.2 |
else if ( bit == 1 ) message += "=> No mcmd timesync in the file\n"; |
360 |
|
|
else if ( bit == 2 ) message += "=> No runheaders in the file\n"; |
361 |
|
|
else if ( bit == 3 ) message += "=> No runtrailers in the file\n"; |
362 |
|
|
else if ( bit == 4 ) message += "=> No mcmd inclination in the file\n"; |
363 |
|
|
else message += "=> Unidentified insertTimeSync warning\n"; |
364 |
mocchiut |
1.1 |
}; |
365 |
|
|
}; |
366 |
|
|
}; |
367 |
|
|
// |
368 |
|
|
if ( j == 2 ){ // insertPamelaRoot warnings |
369 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
370 |
|
|
if ( WAR[j] & (1 << bit) ){ |
371 |
|
|
if ( bit == 0 ) message += "=> ROOT file already inserted\n"; |
372 |
mocchiut |
1.2 |
else message += "=> Unidentified insertPamelaRoot warning\n"; |
373 |
mocchiut |
1.1 |
}; |
374 |
|
|
}; |
375 |
|
|
}; |
376 |
|
|
// |
377 |
|
|
if ( j == 3 ){ // assignBOOTnumber warnings |
378 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
379 |
|
|
if ( WAR[j] & (1 << bit) ){ |
380 |
mocchiut |
1.2 |
if ( bit == 0 ) message += "=> BOOT number already inserted\n";// |
381 |
|
|
else if ( bit == 1 ) message += "=> VarDump event tree is empty, use the -boot option to override\n";// |
382 |
|
|
else if ( bit == 2 ) message += "=> No BOOT number in VarDump(!), use the -boot option to override\n";// |
383 |
|
|
else if ( bit == 4 ) message += "=> The file is not in the database looking for VarDump, use the -boot option to override\n";// |
384 |
|
|
else message += "=> Unidentified assignBOOTnumber warning\n"; |
385 |
mocchiut |
1.1 |
}; |
386 |
|
|
}; |
387 |
|
|
}; |
388 |
|
|
// |
389 |
|
|
if ( j == 4 ){ // insertPamelaRUN |
390 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
391 |
|
|
if ( WAR[j] & (1 << bit) ){ |
392 |
mocchiut |
1.2 |
if ( bit == 0 ) message += "=> Inconsistent PKT/OBT sequence\n"; |
393 |
|
|
else if ( bit == 1 ) message += "=> No physics events in the file\n"; |
394 |
|
|
else if ( bit == 2 ) message += "=> Less than 2 physics events in the file\n"; |
395 |
|
|
else message += "=> Unidentified insertPamelaRun warning\n"; |
396 |
mocchiut |
1.1 |
}; |
397 |
|
|
}; |
398 |
|
|
}; |
399 |
|
|
// |
400 |
|
|
if ( j == 5 ){ // insertCALO_CALIB |
401 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
402 |
|
|
if ( WAR[j] & (1 << bit) ){ |
403 |
mocchiut |
1.2 |
if ( bit == 0 ) message += "=> No calorimeter calibrations in the file\n"; |
404 |
|
|
else message += "=> Unidentified insertCaloCalib warning\n"; |
405 |
mocchiut |
1.1 |
}; |
406 |
|
|
}; |
407 |
|
|
}; |
408 |
|
|
// |
409 |
|
|
// |
410 |
|
|
if ( j == 6 ){ // insertTRACKER_CALIB |
411 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
412 |
|
|
if ( WAR[j] & (1 << bit) ){ |
413 |
mocchiut |
1.2 |
if ( bit == 0 ) message += "=> No tracker calibrations in the file\n"; |
414 |
|
|
else message += "=> Unidentified insertTrkCalib warning\n"; |
415 |
mocchiut |
1.1 |
}; |
416 |
|
|
}; |
417 |
|
|
}; |
418 |
|
|
// |
419 |
|
|
// |
420 |
|
|
if ( j == 7 ){ // insertS4_CALIB |
421 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
422 |
|
|
if ( WAR[j] & (1 << bit) ){ |
423 |
mocchiut |
1.2 |
if ( bit == 0 ) message += "=> No s4 calibrations in the file\n"; |
424 |
|
|
else message += "=> Unidentified insertS4calib warning\n"; |
425 |
|
|
}; |
426 |
|
|
}; |
427 |
|
|
}; |
428 |
|
|
// |
429 |
|
|
// |
430 |
|
|
if ( j == 8 ){ // CleanGL_RUN_FRAGMENTS |
431 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
432 |
|
|
if ( WAR[j] & (1 << bit) ){ |
433 |
|
|
if ( bit == 0 ) message += "=> Skip the GL_RUN_FRAGMENTS table cleaning\n"; |
434 |
|
|
else message += "=> Unidentified CleanGL_RUN_FRAGMENTS warning\n"; |
435 |
mocchiut |
1.1 |
}; |
436 |
|
|
}; |
437 |
|
|
}; |
438 |
|
|
// |
439 |
mocchiut |
1.2 |
if ( j == 9 ){ // ValidateRuns |
440 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
441 |
|
|
if ( WAR[j] & (1 << bit) ){ |
442 |
|
|
if ( bit == 0 ) message += "=> Skip the run validation \n"; |
443 |
|
|
else message += "=> Unidentified ValidateRuns warning\n"; |
444 |
|
|
}; |
445 |
|
|
}; |
446 |
|
|
}; |
447 |
mocchiut |
1.10 |
// |
448 |
|
|
if ( j == 10 ){ // populateTLE |
449 |
|
|
for (UInt_t bit=0; bit<32; bit++){ |
450 |
|
|
if ( WAR[j] & (1 << bit) ){ |
451 |
|
|
if ( bit == 0 ) message += "=> TLE insertion failed\n"; |
452 |
|
|
if ( bit == 1 ) message += "=> No new TLE available\n"; |
453 |
|
|
else message += "=> Unidentified populateTle warning\n"; |
454 |
|
|
}; |
455 |
|
|
}; |
456 |
|
|
}; |
457 |
mocchiut |
1.1 |
}; |
458 |
|
|
}; |
459 |
|
|
// |
460 |
|
|
if ( printwarning ){ |
461 |
|
|
printf("\n"); |
462 |
|
|
printf(" WARNING(s):\n%s\n",message.Data()); |
463 |
|
|
printf("\n"); |
464 |
|
|
if ( !signal ) signal = 1; |
465 |
|
|
}; |
466 |
|
|
// |
467 |
|
|
//--------------------------------------------------------------------------------------- |
468 |
|
|
// Close and exit |
469 |
|
|
//--------------------------------------------------------------------------------------- |
470 |
mocchiut |
1.10 |
if ( beverbose ) printf(" 13 => Free objects and close SQL connection \n"); |
471 |
mocchiut |
1.1 |
pamDB->Close(); |
472 |
|
|
// |
473 |
|
|
printf("\n"); |
474 |
|
|
printf(" Finished, exiting...\n"); |
475 |
|
|
printf("\n"); |
476 |
|
|
// |
477 |
|
|
// Close redirection if the case. |
478 |
|
|
// |
479 |
|
|
if ( !beverbose ) close(nul); |
480 |
|
|
// |
481 |
|
|
exit(signal); |
482 |
|
|
// |
483 |
|
|
} |