--- chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2008/12/18 12:58:37 1.4 +++ chewbacca/PamOffLineSW/PamOffLineSW_Main.cpp 2009/08/05 18:48:43 1.7 @@ -1,5 +1,5 @@ //============================================================================ -// $Id: PamOffLineSW_Main.cpp,v 1.52 2008-09-12 14:03:55 messineo Exp $ +// $Id: PamOffLineSW_Main.cpp,v 1.6 2009-02-01 16:38:26 mocchiut Exp $ // Description : Pamela Off-Line Software //============================================================================ @@ -42,15 +42,16 @@ //global variables bool simulated_data = false; -bool do_vrl_check = false; +//bool do_vrl_check = false; //EMI +bool do_vrl_check = true; //EMI -char* db_host = ""; +const char* db_host = ""; int db_port = 0; -char* db_name = ""; +const char* db_name = ""; char conn[100]=""; LogUtil::logLevel loglevel=LogUtil::LOGERROR; -char* logfilename = "chewbacca.log"; +const char* logfilename = "chewbacca.log"; //current route int route = 999; //previous route @@ -62,8 +63,8 @@ // global variables used in all the project namespace PamOffLineSW { - char* db_user = ""; - char* db_pwd = ""; + const char* db_user = ""; + const char* db_pwd = ""; char* connection = NULL; //marco_new_01 bool single_connection=false; @@ -74,23 +75,28 @@ char* fni; //path completo short compression = 3; // char *outDir = "."; - char *outDir = ""; + const char *outDir = ""; - char * nome_output="chewbacca"; + // char * nome_output="chewbacca"; //EMI + const char * nome_output="L0PAM";//EMI bool multiFile = 0; - unsigned long int step_pkt_number=0; - unsigned long int step_pkt_obt=0; + // unsigned long int step_pkt_number=0; // EMI + unsigned long int step_pkt_number=3000; + // unsigned long int step_pkt_obt=0; // EMI + unsigned long int step_pkt_obt=7200000; // EMI LogUtil* mainLogUtil = NULL; TSQLServer* sqlServer = NULL; unsigned long int max_pkt_number = 16777215;//biggest value before reset unsigned long int max_pkt_obt = 4294967295u;//biggest value before reset - bool is_new_route = false; + // bool is_new_route = false; // EMI + bool is_new_route = true; // EMI ??????????? VA BENE? SECONDO ME SI` unsigned int download = 0; unsigned int orbit_number=0; unsigned int mmm_number = 0;//session_number unsigned long int time_Offset=0; - bool tryMerge = false; + // bool tryMerge = false; + bool tryMerge = true; bool do_cont_check=true;//if do_cont_check is false do not use a DB ... @@ -160,6 +166,8 @@ cout << "\t (-help | --help | -h) print this help and exit \n"; cout << "\t -simu if the input file contains simulated data instead of real data\n"; cout << "\t -vrl if you want to perform the vrl check\n"; + cout << "\t -no-vrl if you DO NOT want to perform the vrl check\n"; + cout << "\t -gpamela gpamela data as input\n"; cout << "\t -filelog set the log filename. [default: chewbacca.log]\n"; cout << "\t -loglevel set the log level. Values: [0,3] (error,warning,info,all) [default:0]\n"; cout << "\t -c set the compression level for the generated ROOT file(s). Values: [0,9] [default = 3]\n"; @@ -178,6 +186,7 @@ cout << "\t -session_number Value of the session number. If 0 this is retrieved from the input file name. [default = 0]\n"; cout << "\t -time_Offset Value of the timeOffset. If 0 this is retrieved using the orbital number. [default = 0]\n"; cout << "\t -tryMerge if you want to try to Merge ROOT files\n"; + cout << "\t -dontMerge if you don not want to try to Merge ROOT files\n"; //marco_new_01 cout << "\t -single_connection if you want to open only one connection to DB.\n"; cout << "\t -tag if you want add the 'The owner of the file' - the tag lenght is 4 char\n"; @@ -200,6 +209,9 @@ exit(1); } + //input file + fni= argv[1]; + for (int i = 2; i < argc; i++) { //marco_new_01 @@ -215,6 +227,12 @@ tryMerge = true; continue; } + + if (!strcmp(argv[i], "-dontMerge")) // EMI + { + tryMerge = false; + continue; + } if (!strcmp(argv[i], "-time_Offset")){ if (++i >= argc){ @@ -302,7 +320,20 @@ simulated_data = true; continue; } + + if (!strcmp(argv[i], "-gpamela")) + { + simulated_data = true; + do_vrl_check = false; + nome_output = (char *)gSystem->BaseName(fni); + tryMerge = false; + continue; + } + if (!strcmp(argv[i], "-no-vrl")) //EMI + { + do_vrl_check = false; + } if (!strcmp(argv[i], "-vrl")) { do_vrl_check = true; @@ -366,7 +397,7 @@ exit(1); } DIR* tempdir; - if ((tempdir = opendir(argv[i])) != 0) { + if ((tempdir = opendir(gSystem->ExpandPathName(argv[i]))) != 0) { // EMI outDir = argv[i]; closedir(tempdir); } else { @@ -506,12 +537,9 @@ // if (!strcmp(argv[i], "-multi")){multiFile = 1; cout<<"debug: multi= "<logAlways(msg); - msg = "Output directory for the generated root file(s): " + (string)outDir; + msg = "Output directory for the generated root file(s): " + (string)outDir; mainLogUtil->logAlways(msg); + msg = "Output directory for the generated root file(s) expanded: " + (string)gSystem->ExpandPathName(outDir); // EMI + mainLogUtil->logAlways(msg); //EMI msg = "Output root name for the generated root file(s): " + (string)nome_output; mainLogUtil->logAlways(msg);