/[PAMELA software]/DarthVader/src/DarthVader.cpp
ViewVC logotype

Annotation of /DarthVader/src/DarthVader.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations) (download)
Tue Sep 12 13:51:35 2006 UTC (18 years, 3 months ago) by mocchiut
Branch: MAIN
Changes since 1.11: +20 -12 lines
PAM_DB* bug fixed

1 mocchiut 1.1 //
2     // C/C++ headers
3     //
4     #include <iostream>
5     #include <sstream>
6     //
7     // ROOT headers
8     //
9     #include <TString.h>
10     #include <TSQLServer.h>
11     #include <TFile.h>
12     #include <TSystem.h>
13     //
14     // Detector's package headers
15     //
16     #include <RunInfoCore.h>
17     #include <TrkCore.h>
18     #include <TrigCore.h>
19     #include <ToFCore.h>
20     #include <CaloCore.h>
21     #include <AcCore.h>
22     #include <S4Core.h>
23     #include <NDCore.h>
24     #include <OrbitalInfoCore.h>
25 mocchiut 1.4 #include <RunInfo.h>
26 mocchiut 1.1 //
27     using namespace std;
28     //
29     //
30     //
31     #include <DarthVaderVerl2.h>
32     //
33     // Usage subroutine
34     //
35     void usage(){
36     printf("\nUsage:\n");
37     printf("\n DarthVader [-v | --verbose] [-h | --help] [--version] -idRun ID_RUN [-processFile filename]\n");
38 mocchiut 1.8 printf("\n [-host host] [-user username] [-psw password] [+-all] [+-detector [ detector options ] ]\n");
39 mocchiut 1.1 printf("\n --version print informations about compilation and exit\n");
40     printf("\n -h | --help print this help and exit \n");
41 mocchiut 1.10 printf("\n -v | --verbose be verbose [default]\n");
42     printf("\n -s | --silent print nothing on STDOUT]\n");
43 mocchiut 1.1 printf("\n -idRun ID_RUN: ID number of the run to be processed \n");
44     printf("\n -processFile output filename [default ID_RUN.Level2.root]\n");
45 mocchiut 1.10 printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n");
46     printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n");
47     printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n");
48 mocchiut 1.8 printf("\n +all | +ALL call all detectors software [default]\n");
49     printf("\n -all | -ALL call nothing\n");
50 mocchiut 1.1 printf("\n +detector process detector; detector can be: TOF,TRK,CAL,TRG,ORB,S4,ND,AC,RUN\n");
51     printf("\n -detector do not process detector (as above)\n");
52 mocchiut 1.8 printf("\n detector options must be included in square parenthesis with spaces, for example:\n");
53     printf("\n +CAL [ --verbose -g ] +TRK [ -v --level1 ] \n");
54    
55 mocchiut 1.1 printf("\nExamples: \n");
56     printf("\nStandard call: DarthVader -idRun 1085 \n");
57     printf("\nProcess only RunInfo and Tracker (be verbose for tracker): DarthVader -idRun 1085 -all +RUN +TRK [ --verbose ] \n");
58     printf("\nProcess all and be verbose for calorimeter: DarthVader -idRun 1085 +CAL [ --verbose ] \n\n");
59     };
60     //
61     // Here the main
62     //
63     int main(int numinp, char *inps[]){
64     //
65     // Variables booking
66     //
67     TString message;
68     int nul = 0;
69     Int_t error = 0;
70     //
71     Int_t CALSGN = 0;
72     Int_t TRKSGN = 0;
73     Int_t TRGSGN = 0;
74     Int_t TOFSGN = 0;
75     Int_t RUNSGN = 0;
76     Int_t ORBSGN = 0;
77     Int_t ACSGN = 0;
78     Int_t S4SGN = 0;
79     Int_t NDSGN = 0;
80 mocchiut 1.12 Int_t DVSGN = 0;
81 mocchiut 1.1 //
82     Bool_t debug = false;
83 mocchiut 1.10 Bool_t beverbose = true;
84 mocchiut 1.1 Bool_t givenid = false;
85     Bool_t CAL = true;
86     Bool_t TRK = true;
87     Bool_t TRG = true;
88     Bool_t TOF = true;
89     Bool_t S4 = true;
90     Bool_t ND = true;
91     Bool_t AC = true;
92     Bool_t ORB = true;
93     Bool_t RUN = true;
94     //
95     Int_t calargc = 0;
96     char *calargv[50];
97     Int_t trkargc = 0;
98     char *trkargv[50];
99     Int_t tofargc = 0;
100     char *tofargv[50];
101     Int_t trgargc = 0;
102     char *trgargv[50];
103     Int_t orbargc = 0;
104     char *orbargv[50];
105     Int_t runargc = 0;
106     char *runargv[50];
107     Int_t acargc = 0;
108     char *acargv[50];
109     Int_t s4argc = 0;
110     char *s4argv[50];
111     Int_t ndargc = 0;
112     char *ndargv[50];
113     //
114     //
115     //
116 mocchiut 1.8 UInt_t run = 0;
117 mocchiut 1.1 //
118     TString filename;
119     TString outDir = gSystem->WorkingDirectory();
120     //
121     TSQLServer *dbc = 0;
122     TString host = "mysql://localhost/pamelaprod";
123     TString user = "anonymous";
124     TString psw = "";
125     //
126 mocchiut 1.10 //
127     const char *pamdbhost=gSystem->Getenv("PAM_DBHOST");
128     const char *pamdbuser=gSystem->Getenv("PAM_DBUSER");
129     const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW");
130 mocchiut 1.12 if ( !pamdbhost ) pamdbhost = "";
131     if ( !pamdbuser ) pamdbuser = "";
132     if ( !pamdbpsw ) pamdbpsw = "";
133 mocchiut 1.10 if ( strcmp(pamdbhost,"") ) host = pamdbhost;
134     if ( strcmp(pamdbuser,"") ) user = pamdbuser;
135     if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw;
136     //
137     //
138 mocchiut 1.1 TFile *processFile = 0;
139     //
140     // Checking input parameters
141     //
142     Int_t i = 0;
143     try {
144     if ( numinp > 1 ){
145     while ( i < numinp ){
146 mocchiut 1.8 Bool_t found = false;
147 mocchiut 1.1 if ( !strcmp(inps[i],"--version") ){
148     DarthVaderInfo(true);
149     exit(0);
150     };
151     if ( !strcmp(inps[i],"-h") || !strcmp(inps[i],"--help") ){
152     usage();
153     exit(0);
154     };
155     if ( !strcmp(inps[i],"-idRun") ) {
156     if ( numinp-1 < i+1 ) {
157     usage();
158     throw -3;
159     };
160 mocchiut 1.8 i++;
161     found = true;
162 mocchiut 1.1 givenid = true;
163 mocchiut 1.8 run = atoll(inps[i]);
164 mocchiut 1.1 };
165     if ( !strcmp(inps[i],"-processFile") ) {
166     if ( numinp-1 < i+1 ){
167     usage();
168     throw -3;
169     };
170 mocchiut 1.8 i++;
171     found = true;
172     filename = (TString)inps[i];
173 mocchiut 1.1 };
174     if ( !strcmp(inps[i],"-outDir") ) {
175     if ( numinp-1 < i+1 ){
176     usage();
177     throw -3;
178     };
179 mocchiut 1.8 i++;
180     found = true;
181     outDir = (TString)inps[i];
182 mocchiut 1.1 };
183     if ( !strcmp(inps[i],"-host") ) {
184     if ( numinp-1 < i+1 ){
185     usage();
186     throw -3;
187     };
188 mocchiut 1.8 i++;
189     found = true;
190     host = (TString)inps[i];
191 mocchiut 1.1 };
192     if ( !strcmp(inps[i],"-user") ) {
193     if ( numinp-1 < i+1 ){
194     usage();
195     throw -3;
196     };
197 mocchiut 1.8 i++;
198     found = true;
199     user = (TString)inps[i];
200 mocchiut 1.1 };
201     if ( !strcmp(inps[i],"-psw") ) {
202     if ( numinp-1 < i+1 ){
203     usage();
204     throw -3;
205     };
206 mocchiut 1.8 i++;
207     found = true;
208     psw = (TString)inps[i];
209     };
210     if ( !strcmp(inps[i],"-v") || !strcmp(inps[i],"--verbose") ){
211     found = true;
212     beverbose = true;
213 mocchiut 1.1 };
214 mocchiut 1.10 if ( !strcmp(inps[i],"-s") || !strcmp(inps[i],"--silent") ){
215     found = true;
216     beverbose = false;
217     };
218 mocchiut 1.1 //
219 mocchiut 1.8 if ( !strcmp(inps[i],"-g") || !strcmp(inps[i],"--debug") ){
220     debug = true;
221     found = true;
222     };
223 mocchiut 1.1 //
224     if ( !strcmp(inps[i],"-CAL") ) {
225 mocchiut 1.8 found = true;
226 mocchiut 1.1 CAL = false;
227     };
228     if ( !strcmp(inps[i],"-TRK") ) {
229 mocchiut 1.8 found = true;
230 mocchiut 1.1 TRK = false;
231     };
232     if ( !strcmp(inps[i],"-TOF") ) {
233 mocchiut 1.8 found = true;
234 mocchiut 1.1 TOF = false;
235     };
236     if ( !strcmp(inps[i],"-TRG") ) {
237 mocchiut 1.8 found = true;
238 mocchiut 1.1 TRG = false;
239     };
240     if ( !strcmp(inps[i],"-S4") ) {
241 mocchiut 1.8 found = true;
242 mocchiut 1.1 S4 = false;
243     };
244     if ( !strcmp(inps[i],"-ND") ) {
245 mocchiut 1.8 found = true;
246 mocchiut 1.1 ND = false;
247     };
248     if ( !strcmp(inps[i],"-AC") ) {
249 mocchiut 1.8 found = true;
250 mocchiut 1.1 AC = false;
251     };
252     if ( !strcmp(inps[i],"-RUN") ) {
253 mocchiut 1.8 found = true;
254 mocchiut 1.1 RUN = false;
255     };
256     if ( !strcmp(inps[i],"-ORB") ) {
257 mocchiut 1.8 found = true;
258 mocchiut 1.1 ORB = false;
259     };
260     //
261 mocchiut 1.8 if ( !strcmp(inps[i],"-all") || !strcmp(inps[i],"-ALL") ) {
262 mocchiut 1.1 CAL = false;
263     ORB = false;
264     TRK = false;
265     TRG = false;
266     TOF = false;
267     S4 = false;
268     ND = false;
269     AC = false;
270     RUN = false;
271 mocchiut 1.8 found = true;
272 mocchiut 1.1 };
273     //
274 mocchiut 1.8 if ( !strcmp(inps[i],"+all") || !strcmp(inps[i],"+ALL") ) {
275 mocchiut 1.1 CAL = true;
276     ORB = true;
277     TRK = true;
278     TRG = true;
279     TOF = true;
280     S4 = true;
281     ND = true;
282     AC = true;
283     RUN = true;
284 mocchiut 1.8 found = true;
285 mocchiut 1.1 };
286     //
287     if ( !strcmp(inps[i],"+CAL") ) {
288 mocchiut 1.8 found = true;
289 mocchiut 1.1 CAL = true;
290     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
291     if ( numinp < i+2 ){
292     usage();
293     throw -3;
294     };
295     i += 2;
296     calargc = 0;
297     while ( strcmp(inps[i],"]") ){
298     calargv[calargc] = inps[i];
299     calargc++;
300     i++;
301     if ( i > numinp-1 ){
302     usage();
303     throw -3;
304     };
305     };
306     };
307     };
308     if ( !strcmp(inps[i],"+TRK") ) {
309 mocchiut 1.8 found = true;
310 mocchiut 1.1 TRK = true;
311     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
312     if ( numinp-1 < i+2 ){
313     usage();
314     throw -3;
315     };
316     i += 2;
317     trkargc = 0;
318     while ( strcmp(inps[i],"]") ){
319     trkargv[trkargc] = inps[i];
320     trkargc++;
321     i++;
322     if ( i > numinp-1 ){
323     usage();
324     throw -3;
325     };
326     };
327     };
328     };
329     if ( !strcmp(inps[i],"+TOF") ) {
330 mocchiut 1.8 found = true;
331 mocchiut 1.1 TOF = true;
332     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
333     i += 2;
334     tofargc = 0;
335     while ( strcmp(inps[i],"]") ){
336     tofargv[tofargc] = inps[i];
337     tofargc++;
338     i++;
339     if ( i > numinp-1 ){
340     usage();
341     throw -3;
342     };
343     };
344     };
345     };
346     if ( !strcmp(inps[i],"+TRG") ) {
347 mocchiut 1.8 found = true;
348 mocchiut 1.1 TRG = true;
349     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
350     i += 2;
351     trgargc = 0;
352     while ( strcmp(inps[i],"]") ){
353     trgargv[trgargc] = inps[i];
354     trgargc++;
355     i++;
356     if ( i > numinp-1 ){
357     usage();
358     throw -3;
359     };
360     };
361     };
362     };
363     if ( !strcmp(inps[i],"+ORB") ) {
364 mocchiut 1.8 found = true;
365 mocchiut 1.1 ORB = true;
366     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
367     i += 2;
368     orbargc = 0;
369     while ( strcmp(inps[i],"]") ){
370     orbargv[orbargc] = inps[i];
371     orbargc++;
372     i++;
373     if ( i > numinp-1 ){
374     usage();
375     throw -3;
376     };
377     };
378     };
379     };
380     if ( !strcmp(inps[i],"+RUN") ) {
381 mocchiut 1.8 found = true;
382 mocchiut 1.1 RUN = true;
383     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
384     i += 2;
385     runargc = 0;
386     while ( strcmp(inps[i],"]") ){
387     runargv[runargc] = inps[i];
388     runargc++;
389     i++;
390     if ( i > numinp-1 ){
391     usage();
392     throw -3;
393     };
394     };
395     };
396     };
397     if ( !strcmp(inps[i],"+AC") ) {
398 mocchiut 1.8 found = true;
399 mocchiut 1.1 AC = true;
400     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
401     i += 2;
402     acargc = 0;
403     while ( strcmp(inps[i],"]") ){
404     acargv[acargc] = inps[i];
405     acargc++;
406     i++;
407     if ( i > numinp-1 ){
408     usage();
409     throw -3;
410     };
411     };
412     };
413     };
414     if ( !strcmp(inps[i],"+S4") ) {
415 mocchiut 1.8 found = true;
416 mocchiut 1.1 S4 = true;
417     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
418     i += 2;
419     s4argc = 0;
420     while ( strcmp(inps[i],"]") ){
421     s4argv[s4argc] = inps[i];
422     s4argc++;
423     i++;
424     if ( i > numinp-1 ){
425     usage();
426     throw -3;
427     };
428     };
429     };
430     };
431     if ( !strcmp(inps[i],"+ND") ) {
432 mocchiut 1.8 found = true;
433 mocchiut 1.1 ND = true;
434     if ( numinp >= i+2 && !strcmp(inps[i+1],"[") ){
435     i += 2;
436     ndargc = 0;
437     while ( strcmp(inps[i],"]") ){
438     ndargv[ndargc] = inps[i];
439     ndargc++;
440     i++;
441     if ( i > numinp-1 ){
442     usage();
443     throw -3;
444     };
445     };
446     };
447     };
448     //
449 mocchiut 1.8 if ( !found && i > 0 ){
450     usage();
451     printf(" Unknown input number %i, that is \"%s\" \n",i,inps[i]);
452     throw -22;
453     };
454     //
455 mocchiut 1.1 i++;
456     };
457     //
458     } else {
459     //
460     // no input parameters exit with error, we need at least the run id.
461     //
462     throw -1;
463     };
464     //
465     // If not in verbose mode redirect to /dev/null the stdout and stderr
466     //
467     if ( !beverbose ){
468     nul = open("/dev/null", O_CREAT | O_RDWR,S_IREAD | S_IWRITE);
469     dup2(nul,1);
470     dup2(nul,2);
471     };
472     //
473     // Check that an input run number has been given
474     //
475     if ( !givenid ) throw -1;
476     //
477     char *version = DarthVaderInfo(false);
478     //
479     // Start:
480     //
481     printf("\n Welcome to the PAMELA LEVEL2 flight software, version %s \n\n",version);
482     //
483     // Connect to the DB
484     //
485     if ( debug ) printf("\nConnecting to database... \n");
486     //
487     dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data());
488     if( !dbc ) throw -2;
489     //
490     bool connect = dbc->IsConnected();
491     //
492     if( !connect ) throw -2;
493     //
494     if ( debug ) printf("...connected! \n\n");
495     //
496     // Create LEVEL2 filename and open it in update mode
497     //
498     if ( filename.IsNull() ){
499     stringstream strun;
500     strun.str("");
501     strun << run;
502 mocchiut 1.3 filename += outDir;
503     filename += "/";
504 mocchiut 1.1 filename += strun.str();
505     filename += ".Level2.root";
506     };
507 mocchiut 1.3 // filename = outDir + "/" + filename;
508 mocchiut 1.1 processFile = new TFile(filename.Data(),"UPDATE");
509     if ( !processFile->IsOpen() ) throw -15;
510     //
511     // Run the core program, put any output error in the "error" variable
512     //
513     if ( RUN ) {
514     printf(" Calling RunInfo... ");
515     RUNSGN = RunInfoCore(run,processFile,dbc,runargc,runargv);
516     printf("done\n");
517     };
518 mocchiut 1.4 //
519     // From the Run Infos extract acq_var_info to determine if detectors are in the acquisition or not
520     //
521     printf(" Checking if requested detectors are in the acquisition\n");
522     ItoRunInfo *runinfo = new ItoRunInfo(processFile);
523     runinfo->Read(run);
524     printf(" => ACQ_VAR_INFO = %i \n",runinfo->ACQ_VAR_INFO);
525 mocchiut 1.12 if ( TRK && !(runinfo->ACQ_VAR_INFO & (1 << 4)) ) DVSGN = 16;
526     if ( TOF && !(runinfo->ACQ_VAR_INFO & (1 << 0)) ) DVSGN = 17;
527     if ( CAL && !(runinfo->ACQ_VAR_INFO & (1 << 3)) ) DVSGN = 18;
528     if ( AC && !(runinfo->ACQ_VAR_INFO & (1 << 1)) && !(runinfo->ACQ_VAR_INFO & (1 << 2)) ) DVSGN = 19;
529     if ( S4 && !(runinfo->ACQ_VAR_INFO & (1 << 5)) ) DVSGN = 20;
530     if ( ND && !(runinfo->ACQ_VAR_INFO & (1 << 9)) ) DVSGN = 21;
531 mocchiut 1.4 printf(" OK! start processing detector's data. \n");
532     //
533 mocchiut 1.1 if ( TRK ) {
534     printf(" Calling TrackerLevel2... ");
535     TRKSGN = TrkCore(run,processFile,dbc,trkargc,trkargv);
536 mocchiut 1.11 gSystem->Unlink("TrackerFolder"); //patch
537 mocchiut 1.1 printf("done\n");
538     };
539     if ( TOF ) {
540     printf(" Calling ToFLevel2... ");
541     TOFSGN = ToFCore(run,processFile,dbc,tofargc,tofargv);
542     printf("done\n");
543     };
544     if ( CAL ) {
545     printf(" Calling CalorimeterLevel2... ");
546     CALSGN = CaloCore(run,processFile,dbc,calargc,calargv);
547     printf("done\n");
548     };
549     if ( TRG ) {
550     printf(" Calling TriggerLevel2... ");
551     TRGSGN = TrigCore(run,processFile,dbc,trgargc,trgargv);
552     printf("done\n");
553     };
554     if ( AC ) {
555     printf(" Calling AnticounterLevel2... ");
556     ACSGN = AcCore(run,processFile,dbc,acargc,acargv);
557     printf("done\n");
558     };
559     if ( S4 ) {
560     printf(" Calling S4Level2 ... ");
561     S4SGN = S4Core(run,processFile,dbc,s4argc,s4argv);
562     printf("done\n");
563     };
564     if ( ND ) {
565     printf(" Calling NDLevel2... ");
566     NDSGN = NDCore(run,processFile,dbc,ndargc,ndargv);
567     printf("done\n");
568     };
569     if ( ORB ) {
570     printf(" Calling OrbitalInfo... ");
571     ORBSGN = OrbitalInfoCore(run,processFile,dbc,orbargc,orbargv);
572     printf("done\n");
573     };
574     //
575     } catch(Int_t signal) {
576     error = signal;
577     switch(signal){
578     case 51: message += " GLTABLES - TO_TIME < time when querying tables"; break;
579     case -1: message += " Missing/wrong run ID input parameter"; break;
580     case -2: message += " DB connection failure"; break;
581     case -3: message += " Error in input parameters (check format)"; break;
582     case -4: message += " Request reprocessing of all runs (idRun = 0) but processFile is missing"; break;
583     case -6: message += " No LEVEL0 file "; break;
584     case -7: message += " No Physics tree in LEVEL0 file"; break;
585     case -8: message += " No Header branch in LEVEL0 Physics tree"; break;
586     case -9: message += " No Registry branch in LEVEL0 Physics tree"; break;
587     case -11: message += " LEVEL0 Physics tree is empty"; break;
588 mocchiut 1.9 case -12: message += " Too few entries in the tree"; break;
589 mocchiut 1.1 case -13: message += " Cannot create processFolder directory"; break;
590     case -14: message += " Error querying the DB"; break;
591     case -15: message += " Cannot open file for writing"; break;
592 mocchiut 1.8 case -22: message += " Unknown input or wrong syntax in input paramters!"; break;
593 mocchiut 1.1 //
594     case -50: message += " GLTABLES - No entries matching GL_RUN query"; break;
595     case -51: message += " GLTABLES - No entries matching GL_ROOT query"; break;
596     case -52: message += " GLTABLES - No entries matching GL_PARAM query"; break;
597     case -53: message += " GLTABLES - No entries matching GL_TRK_CALIB query"; break;
598     case -54: message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;
599     case -55: message += " GLTABLES - No entries matching GL_CALO_CALIB query"; break;
600     //
601     case -100: message += " CALORIMETERLEVEL2 - No Level2 input file"; break;
602     case -101: message += " CALORIMETERLEVEL2 - Cannot open Level2 file"; break;
603     case -102: message += " CALORIMETERLEVEL2 - No Tracker TTree in Level2 file"; break;
604     case -103: message += " CALORIMETERLEVEL2 - No Calorimeter TBranch in Level0 file"; break;
605     case -104: message += " CALORIMETERLEVEL2 - No Trigger TTree in Level0 file"; break;
606     case -105: message += " CALORIMETERLEVEL2 - No Calorimeter ADC2MIP conversion file"; break;
607     case -106: message += " CALORIMETERLEVEL2 - No Calorimeter alignement file"; break;
608     case -107: message += " CALORIMETERLEVEL2 - Cannot find Level0 file needed for the calibration"; break;
609     case -108: message += " CALORIMETERLEVEL2 - Cannot open Level0 file needed for the calibration"; break;
610     case -109: message += " CALORIMETERLEVEL2 - No CalibCalPed TTree in Level0 file needed for the calibration"; break;
611     case -110: message += " CALORIMETERLEVEL2 - No calibrations in Level0 file needed for the calibration"; break;
612     case -111: message += " CALORIMETERLEVEL2 - Corrupted calibration"; break;
613     case -112: message += " CALORIMETERLEVEL2 - No physics event related to registry entry in Level0 file"; break;
614     case -113: message += " CALORIMETERLEVEL2 - No tracker event related to registry entry in Level2 file"; break;
615     //
616     case -200: message += " TRACKERLEVEL2 - LEVEL1 framework unknown (HBOOK/ROOT)"; break;
617     case -201: message += " TRACKERLEVEL2 - LEVEL2 framework unknown (HBOOK/ROOT)"; break;
618     case -202: message += " TRACKERLEVEL2 - Neither LEVEL1 nor LEVEL2 output requested"; break;
619     case -203: message += " TRACKERLEVEL2 - No Tracker branch in LEVEL0 Physics tree"; break;
620     case -204: message += " TRACKERLEVEL2 - No reprocessing implemented for LEVEL1 output"; break;
621     case -205: message += " TRACKERLEVEL2 - Error accessing RunInfo "; break;
622     case -210: message += " TRACKERLEVEL2 - Error opening/reading trk mask GL_PARAM parameters "; break;
623     case -211: message += " TRACKERLEVEL2 - Error opening/reading trk alignment GL_PARAM parameters"; break;
624     case -212: message += " TRACKERLEVEL2 - Error opening/reading trk mip GL_PARAM parameters"; break;
625     case -213: message += " TRACKERLEVEL2 - Error opening/reading trk charge GL_PARAM parameters"; break;
626     case -214: message += " TRACKERLEVEL2 - Error opening/reading trk pfa GL_PARAM parameters"; break;
627     case -215: message += " TRACKERLEVEL2 - Error opening/reading field GL_PARAM parameters"; break;
628     case -216: message += " TRACKERLEVEL2 - Error opening/reading default calibration GL_PARAM parameters"; break;
629     case -298: message += " TRACKERLEVEL2 - Reprocessing not implemented in standalone mode"; break;
630     case -299: message += " TRACKERLEVEL2 - Not yet implemented"; break;
631     //
632     case -300: message += " TOFLEVEL2 - No Trigger branch in Level0 tree"; break;
633     case -301: message += " TOFLEVEL2 - Cannot open file for writing"; break;
634     case -302: message += " TOFLEVEL2 - No tracker tree in Level2 file"; break;
635     case -303: message += " TOFLEVEL2 - No Tof branch in Level0 file"; break;
636     case -313: message += " TOFLEVEL2 - No more tracker events in Level2 file"; break;
637     //
638     case -401: message += " TRIGGERLEVEL2 - Cannot open file for writing"; break;
639     case -402: message += " TRIGGERLEVEL2 - No Trigger branch in Level0 tree"; break;
640     //
641     case -500: message += " S4LEVEL2 - No level2 file"; break;
642     case -501: message += " S4LEVEL2 - Cannot open file for writing"; break;
643     case -502: message += " S4LEVEL2 - No result from GL_S4_CALIB"; break;
644     case -503: message += " S4LEVEL2 - No S4 branch in Level0 tree"; break;
645     //
646     case -600: message += " NDLEVEL2 - No level2 file"; break;
647     case -601: message += " NDLEVEL2 - Cannot open file for writing"; break;
648     case -603: message += " NDLEVEL2 - No S4Level2 branch in Level0 tree"; break;
649     //
650     case -701: message += " NDLEVEL2 - Cannot open file for writing"; break;
651     case -704: message += " NDLEVEL2 - No Anticounter branch in Level0 tree"; break;
652     //
653     case -800: message += " RUNINFO - No such run in the RunInfo list"; break;
654     case -801: message += " RUNINFO - No RunInfo tree in Level2 file"; break;
655     case -802: message += " RUNINFO - Cannot open file for writing"; break;
656     case -803: message += " RUNINFO - Updating but no RunInfo tree in Level2 file"; break;
657     case -804: message += " RUNINFO - Unknown detector"; break;
658 mocchiut 1.2 case -805: message += " RUNINFO - Reprocessing data but no RunInfo tree in Level2 file"; break;
659 mocchiut 1.7 case -806: message += " RUNINFO - Can not handle more than 500 runs"; break;
660 mocchiut 1.1 //
661     default: message += "Unidentified error or warning"; break;
662     };
663     printf("\n");
664     if ( signal < 0 ) cout << " ERROR ("<< signal << ") "<< message <<endl;
665     }
666 mocchiut 1.12 //
667     switch(DVSGN){ // change message with printf!!
668     case 16: message += " No tracker in the acquisition\n"; break;
669     case 17: message += " No ToF in the acquisition\n"; break;
670     case 18: message += " No calorimeter in the acquisition\n"; break;
671     case 19: message += " No anticounters in the acquisition\n"; break;
672     case 20: message += " No S4 in the acquisition\n"; break;
673     case 21: message += " No neutron detector in the acquisition\n"; break;
674     };
675     //
676 mocchiut 1.1 // switch(RUNSGN){
677     // };
678     switch(CALSGN){
679     case 100: printf("\n WARNING CALORIMETER - Data with no associated calibration\n"); break;
680     case 101: printf("\n WARNING CALORIMETER - No tracks or good events in this run\n"); break;
681     };
682     //
683     // Close the DB connection
684     //
685     if ( dbc ){
686     if ( debug ) printf("\nClose the connection to the database... \n");
687     dbc->Close();
688     if ( debug ) printf("...connection terminated!\n\n");
689     };
690     if ( processFile ){
691     processFile->cd();
692     processFile->Close();
693     };
694     //
695     if ( error != 0 ) printf("\n\n WARNING: exiting with signal %i \n\n",error);
696     printf("\n");
697 mocchiut 1.6 printf("Finished, exiting...\n");
698     printf("\n");
699 mocchiut 1.1 //
700     // Close redirection if the case.
701     //
702     if ( !beverbose ) close(nul);
703     //
704     //
705     exit(error);
706     }

  ViewVC Help
Powered by ViewVC 1.1.23