//----------------------------------------------------------------------------- // STNTUPLE validation script: reads STNTUPLE file and runs all the available // analysis modules on it. In the end produces histogram file with the // validation histograms //----------------------------------------------------------------------------- TStnAna* x = 0; TChain* chain = NULL; TStnCatalog* catalog = NULL; //int run_validation(const char* Dataset, Int_t NEvents = 0, Int_t SaveHistograms = 1) { int run_validation_s(const char* InputFile, const char* relname, Int_t NEvents = 0, Int_t SaveHistograms = 1) { //----------------------------------------------------------------------------- // make sure all the initializations are done //----------------------------------------------------------------------------- // gInterpreter->ExecuteMacro("Stntuple/scripts/rootlogon.C"); chain = new TChain("STNTUPLE"); // catalog = new TStnCatalog(); //catalog->InitChain(chain,Dataset); chain->AddFile(InputFile, 1000000); x = new TStnAna(chain); //----------------------------------------------------------------------------- // define list of modules to be executed //----------------------------------------------------------------------------- const char* module[] = { "TCalAnaModule", "TCesAnaModule", "TClusterAnaModule", "TConversionFilterModule", "TEmFilterModule", "TFwdDetAnaModule", "TJetAnaModule", "TMcAnaModule", "TMetAnaModule", "TMuoAnaModule", "TPesAnaModule", "TPhotonAnaModule", "TSvtAnaModule", "TTrackAnaModule", "TTrigAnaModule", NULL, "TClcAnaModule", // SvxAna creates its own histogram files, // don't run in the validation "TSvxAnaModule", // XftAna uses its own Helix... "TXftAnaModule", NULL }; const char text[200]; int i=0; TStnModule* m; while (module[i]) { m = x->AddModule(module[i],0); if (i==0) m->SetPrintLevel(999); i++; } //----------------------------------------------------------------------------- // WenuMonModule: require ELECTRON_CENTRAL_18 trigger path //----------------------------------------------------------------------------- m = x->AddModule("TWenuMonModule",0); m->AddL3TriggerName("ELECTRON_CENTRAL_18"); //----------------------------------------------------------------------------- // JpsiMonModule: require event to pass one of the stream A dimuon trigger paths //----------------------------------------------------------------------------- m = x->AddModule("TJpsiMonModule",0); m->AddL3TriggerName("JPSI_CMUP4_CMU1.5"); m->AddL3TriggerName("JPSI_CMUCMU1.5"); m->AddL3TriggerName("JPSI_CMUP4_CMX2"); m->AddL3TriggerName("JPSI_CMU1.5_CMX2"); char* basename = strrchr(InputFile,'/') ; printf("%s\n",basename) ; char* directory = gSystem->Getenv("PWD") ; // if (SaveHistograms > 0) printf(Form("%s%s.hist.root\n",directory,basename)) ; if (SaveHistograms > 0) printf(Form("%s%s.hist.%s.root\n",directory,basename,relname)) ; x->Run(NEvents); // if (SaveHistograms > 0) x->SaveHist(Form("%s%s.hist.root",directory,basename)) ; if (SaveHistograms > 0) x->SaveHist(Form("%s%s.hist.%s.root",directory,basename,relname)) ; // if (SaveHistograms > 0) x->SaveHist(Form("%s.hist.%s.root",InputFile,rel_name)); }