//----------------------------------------------------------------------------- // 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 - supposed to run on a single file //----------------------------------------------------------------------------- TStnAna* x = 0; TStnCatalog* catalog = NULL; TStnDataset* dataset = NULL; int run_validation(const char* Book, const char* Dataset, Int_t MinRun = 0, int MaxRun = 999999, 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(); dataset = new TStnDataset(Book,Dataset,MinRun,MaxRun); catalog->InitDataset(dataset); x = new TStnAna(dataset); //----------------------------------------------------------------------------- // 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); 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"); if (MinRun > 0) { x->ProcessRun(MinRun); } else { x->Run(NEvents); } if (SaveHistograms > 0) { char hist_file[200], cmd[200]; sprintf(cmd,"echo %s | awk -F / '{print $NF}'",Dataset); printf("command: %s \n",cmd); FILE* f = gSystem->OpenPipe(cmd,"r"); fscanf(f,"%s",text); sprintf(hist_file,"%s.hist",text); printf("saving histograms into %s \n",hist_file); x->SaveHist(hist_file); } }