preanalysis/PreanProcFinuda.cxx

00001 // @(#)fROOT/preanalysis:$Name:  $:$Id: PreanProcFinuda.cxx,v 1.4 2007/09/05 10:25:02 Diego_Faso Exp $
00002 // Author: Diego Faso <mailto:faso@to.infn.it>, 2006/12/06
00003 
00004 #include "TFndPreanProcess.h"
00005 
00006 void PreanProcFinuda(const TString &run_type, const Int_t &first_run, const Int_t &last_run, const Int_t &n_evs_run, const Int_t &n_evs_tot){
00007   // NOTE:
00008   //      in order to follow DAQ close run use "last_run = -1"
00009 
00010   Int_t debug_lev = 0;
00011 
00012   TFndPreanProcess *PreanProc = new TFndPreanProcess();
00013 
00014   PreanProc->SetDBhost("$MSQL_DB_HOST");
00015   PreanProc->SetDataPath("$RDT");
00016   PreanProc->SetRunType(run_type);
00017   PreanProc->SetRunEventTarget(n_evs_run);
00018   PreanProc->SetTotEventTarget(n_evs_tot);
00019   PreanProc->SetDebugLevel(debug_lev);
00020 
00021   PreanProc->SetFirstRun(first_run);
00022   PreanProc->SetLastRun(last_run);
00023 
00024 
00025   cout << " -> FinudaPreanalysis starting ..." << endl;
00026   
00027   PreanProc->ProcessPreanalysis();
00028 
00029   
00030   
00031   // ---
00032   delete PreanProc; // free used memory
00033   
00034   cout << "    -> done!" << endl;
00035   cout << " -> FinudaPreanalysis completed!" << endl;
00036   gApplication->Terminate();
00037   return;
00038 }
00039 
00040 
00044 int main(int argc, char **argv)
00045 {
00046 
00047   //   if(argc < 4){
00048   //     cerr << "geb2hdt error: too few arguments received" << endl;
00049   //     exit(0);
00050   //   }
00051 
00052   cout << endl << " =============================== " << endl;
00053   cout << "  PreanProcFinuda is deprecated  " << endl; 
00054   cout << " =============================== " << endl << endl;
00055   return 0;
00056 
00057   cout << "PreanProcFinuda executable started: number of arguments: " << argc << endl;
00058 
00059 
00060 
00061   TString run_type = "FINU";
00062   if(argc > 1) run_type = TString(argv[1]);
00063   Int_t first_run = -1;
00064   if(argc > 2) first_run = atoi(argv[2]);
00065   Int_t last_run = -1;
00066   if(argc > 3) last_run = atoi(argv[3]);
00067   Int_t n_evs_run=-1;
00068   if(argc > 4) n_evs_run = atoi(argv[4]);
00069   Int_t n_evs_tot=-1;
00070   if(argc > 5) n_evs_tot = atoi(argv[5]);
00071   
00072   
00073   cout << "run_type: \"" << run_type << "\"; first_run: \"" << last_run << "\"; last_run: \"" << last_run << "\"; n_evs_run: " << n_evs_run << "; n_evs_tot: " << n_evs_tot << endl;
00074   
00075   argc = 0;
00076   for(Int_t ar=0;ar<argc;ar++)argv[ar] = '\0';
00077 
00078   for(Int_t ar=0;ar<argc;ar++) cout << "arg[" << ar << "]: \"" << argv[ar] << "\"." << endl;
00079   cout << endl;
00080 
00081   cout << " -------------> \"" << *(argv+2) << "\"" << endl;
00082   TApplication *theApp = new TApplication("PreanProcFinuda run application", &argc,argv,0,1);
00083   //  TApplication *theApp = new TApplication("geb2hdt run application", &argc,argv,0,-1);
00084 
00085   theApp->ProcessFile("$FROOTSYS/preanalysis/preanlogon.C");
00086 
00087   PreanProcFinuda(run_type, first_run, last_run, n_evs_run, n_evs_tot);
00088 
00089   theApp->Run();
00090   theApp->Terminate(0);
00091   delete theApp;
00092   return 0;
00093 }

Generated on Tue Oct 16 15:40:47 2007 by  doxygen 1.5.2