1 |
//============================================================================ |
//============================================================================ |
2 |
// $Id: PamOffLineSW_Main.cpp,v 1.4 2008/12/18 12:58:37 mocchiut Exp $ |
// $Id: PamOffLineSW_Main.cpp,v 1.6 2009-02-01 16:38:26 mocchiut Exp $ |
3 |
// Description : Pamela Off-Line Software |
// Description : Pamela Off-Line Software |
4 |
//============================================================================ |
//============================================================================ |
5 |
|
|
45 |
//bool do_vrl_check = false; //EMI |
//bool do_vrl_check = false; //EMI |
46 |
bool do_vrl_check = true; //EMI |
bool do_vrl_check = true; //EMI |
47 |
|
|
48 |
char* db_host = ""; |
const char* db_host = ""; |
49 |
int db_port = 0; |
int db_port = 0; |
50 |
char* db_name = ""; |
const char* db_name = ""; |
51 |
char conn[100]=""; |
char conn[100]=""; |
52 |
|
|
53 |
LogUtil::logLevel loglevel=LogUtil::LOGERROR; |
LogUtil::logLevel loglevel=LogUtil::LOGERROR; |
54 |
char* logfilename = "chewbacca.log"; |
const char* logfilename = "chewbacca.log"; |
55 |
//current route |
//current route |
56 |
int route = 999; |
int route = 999; |
57 |
//previous route |
//previous route |
63 |
// global variables used in all the project |
// global variables used in all the project |
64 |
namespace PamOffLineSW |
namespace PamOffLineSW |
65 |
{ |
{ |
66 |
char* db_user = ""; |
const char* db_user = ""; |
67 |
char* db_pwd = ""; |
const char* db_pwd = ""; |
68 |
char* connection = NULL; |
char* connection = NULL; |
69 |
//marco_new_01 |
//marco_new_01 |
70 |
bool single_connection=false; |
bool single_connection=false; |
75 |
char* fni; //path completo |
char* fni; //path completo |
76 |
short compression = 3; |
short compression = 3; |
77 |
// char *outDir = "."; |
// char *outDir = "."; |
78 |
char *outDir = ""; |
const char *outDir = ""; |
79 |
|
|
80 |
// char * nome_output="chewbacca"; //EMI |
// char * nome_output="chewbacca"; //EMI |
81 |
char * nome_output="L0PAM";//EMI |
const char * nome_output="L0PAM";//EMI |
82 |
bool multiFile = 0; |
bool multiFile = 0; |
83 |
// unsigned long int step_pkt_number=0; // EMI |
// unsigned long int step_pkt_number=0; // EMI |
84 |
unsigned long int step_pkt_number=3000; |
unsigned long int step_pkt_number=3000; |
166 |
cout << "\t (-help | --help | -h) print this help and exit \n"; |
cout << "\t (-help | --help | -h) print this help and exit \n"; |
167 |
cout << "\t -simu if the input file contains simulated data instead of real data\n"; |
cout << "\t -simu if the input file contains simulated data instead of real data\n"; |
168 |
cout << "\t -vrl if you want to perform the vrl check\n"; |
cout << "\t -vrl if you want to perform the vrl check\n"; |
169 |
|
cout << "\t -no-vrl if you DO NOT want to perform the vrl check\n"; |
170 |
|
cout << "\t -gpamela gpamela data as input\n"; |
171 |
cout << "\t -filelog set the log filename. [default: chewbacca.log]\n"; |
cout << "\t -filelog set the log filename. [default: chewbacca.log]\n"; |
172 |
cout << "\t -loglevel set the log level. Values: [0,3] (error,warning,info,all) [default:0]\n"; |
cout << "\t -loglevel set the log level. Values: [0,3] (error,warning,info,all) [default:0]\n"; |
173 |
cout << "\t -c set the compression level for the generated ROOT file(s). Values: [0,9] [default = 3]\n"; |
cout << "\t -c set the compression level for the generated ROOT file(s). Values: [0,9] [default = 3]\n"; |
209 |
exit(1); |
exit(1); |
210 |
} |
} |
211 |
|
|
212 |
|
//input file |
213 |
|
fni= argv[1]; |
214 |
|
|
215 |
for (int i = 2; i < argc; i++) |
for (int i = 2; i < argc; i++) |
216 |
{ |
{ |
217 |
//marco_new_01 |
//marco_new_01 |
320 |
simulated_data = true; |
simulated_data = true; |
321 |
continue; |
continue; |
322 |
} |
} |
323 |
|
|
324 |
|
if (!strcmp(argv[i], "-gpamela")) |
325 |
|
{ |
326 |
|
simulated_data = true; |
327 |
|
do_vrl_check = false; |
328 |
|
nome_output = (char *)gSystem->BaseName(fni); |
329 |
|
tryMerge = false; |
330 |
|
continue; |
331 |
|
} |
332 |
|
|
333 |
if (!strcmp(argv[i], "-no-vrl")) //EMI |
if (!strcmp(argv[i], "-no-vrl")) //EMI |
334 |
{ |
{ |
537 |
// if (!strcmp(argv[i], "-multi")){multiFile = 1; cout<<"debug: multi= "<<multiFile<<endl;} |
// if (!strcmp(argv[i], "-multi")){multiFile = 1; cout<<"debug: multi= "<<multiFile<<endl;} |
538 |
} |
} |
539 |
|
|
|
//input file |
|
|
fni= argv[1]; |
|
|
|
|
540 |
//TODO: maybe if simulated data I don't need nothig so I can skip the following lines |
//TODO: maybe if simulated data I don't need nothig so I can skip the following lines |
541 |
// and use instead something similar to: |
// and use instead something similar to: |
542 |
//if(simulated data){orbit_number=99999; mmm_number=999; download=999; } |
if (simulated_data) {orbit_number=99999; mmm_number=999; download=999; } |
543 |
|
|
544 |
//I need the following lines only to retrieve orbit_number and mmm_number (session_number)from the filename |
//I need the following lines only to retrieve orbit_number and mmm_number (session_number)from the filename |
545 |
if((!orbit_number)||(!mmm_number)) |
if((!orbit_number)||(!mmm_number)) |