//----------------------------------------------------------------------------- // to run: // root.exe 'make_run_hist.C("results/aa025b53.0001phys.stn")' // or // root.exe 'make_run_hist.C("results/aa025bd0.0001phys.stn*")' // // env variables used: // ------------------- // SAVE_HIST_FILE: if defined, the resulting histograms will be saved into // file //----------------------------------------------------------------------------- TStnAna* x = NULL; TChain* chain; TWenuMonModule* m_wen; TWmunuMonModule* m_wmn; TJpsiMonModule* m_jpsi; TMetAnaModule* m_met; // TEmAnaModule* m_ele; //_____________________________________________________________________________ void make_run_hist_1(Int_t RunNumber, int SaveHist = 1) { //----------------------------------------------------------------------------- // create histogram file for a given RunNumber //----------------------------------------------------------------------------- char cmd[200], remote_file[200], save_hist_file[200]; double mypar[1]; //----------------------------------------------------------------------------- // configure list of input files // get all the files for a given run number from the catalog //----------------------------------------------------------------------------- TStnCatalog* cl; TStnDataset* ds; cl = new TStnCatalog(); ds = new TStnDataset("stntuple","sewk00",RunNumber,RunNumber,"STNTUPLE"); cl->InitDataset(ds); ds->Print(); printf(" --- dataset has %i events\n",ds->GetNEvents()); if (ds->GetNEvents() <= 0) { return 0; } //----------------------------------------------------------------------------- // initialize the event loop //----------------------------------------------------------------------------- if (x) { delete x; delete m_met; delete m_wen; delete m_wmn; delete m_jpsi; } x = new TStnAna(ds); x->SetPrintLevel(0); //----------------------------------------------------------------------------- // initialize list of modules, 1) MET monitor //----------------------------------------------------------------------------- m_met = new TMetAnaModule; x->AddModule(m_met,0); //----------------------------------------------------------------------------- // W->mu nu monitor //----------------------------------------------------------------------------- m_wmn = new TWmunuMonModule; m_wmn->AddL3TriggerName("MUON_CMUP18"); m_wmn->AddL3TriggerName("MUON_CMX18" ); x->AddModule(m_wmn,0); TStnMuonID* muo_id = m_wmn->MuonID(); // 5.3 requirements on the number of hits // plus relaxed reqs on the hit contents muo_id->SetMinNCotAxHits(5); muo_id->SetMinNCotStHits(5); muo_id->SetMinNCotStSeg (2); muo_id->SetMinNCotAxSeg (2); //----------------------------------------------------------------------------- // W->e nu monitor //----------------------------------------------------------------------------- m_wen = new TWenuMonModule; m_wen->AddL3TriggerName("ELECTRON_CENTRAL_18"); TStnElectronID* ele_id = m_wen->GetTightID(); // output of Express Production: // no beamlines, cut on non-constrained // parameters ele_id->SetMaxZ0 (60.); ele_id->SetMinDelX(-3.); ele_id->SetMaxDelX(1.5); ele_id->SetMaxDelZ(3.); ele_id->SetMaxBcZ0 ( 1.e10); ele_id->SetMinBcDelX(-1.e10); ele_id->SetMaxBcDelX( 1.e10); ele_id->SetMaxBcDelZ( 1.e10); // 5.3 requirements on the number of hits // plus relaxed reqs on the hit contents ele_id->SetMinNCotAxHits(5); ele_id->SetMinNCotStHits(5); ele_id->SetMinNCotStSeg (2); ele_id->SetMinNCotAxSeg (2); x->AddModule(m_wen,0); //----------------------------------------------------------------------------- // J/psi monitor //----------------------------------------------------------------------------- m_jpsi = new TJpsiMonModule; m_jpsi->AddL3TriggerName("JPSI_CMUP4_CMU1.5"); m_jpsi->AddL3TriggerName("JPSI_CMUCMU1.5"); m_jpsi->AddL3TriggerName("JPSI_CMUP4_CMX2"); m_jpsi->AddL3TriggerName("JPSI_CMU1.5_CMX2"); x->AddModule(m_jpsi,0); //----------------------------------------------------------------------------- // define output histogram file and run //----------------------------------------------------------------------------- x->ProcessRun(RunNumber); // do not create empty histogram files // for runs with no events if (SaveHist != 0) { if (x->NProcessedEvents() > 0) { sprintf(save_hist_file,"%s/hist/%i/stra_mon_hist.%i", gSystem->Getenv("PWD"),RunNumber/1000,RunNumber); x->SaveHist(save_hist_file); } } } //_____________________________________________________________________________ //void ntuple_loop(int Run1=185083, int Run2=185223) { //void ntuple_loop(int Run1=185223, int Run2=185223) { //void ntuple_loop(int Run1=185224, int Run2=185271) { //void ntuple_loop(int Run1=185248, int Run2=185259) { //void ntuple_loop(int Run1=185259, int Run2=185281) { //void ntuple_loop(int Run1=185281, int Run2=185281) { //void ntuple_loop(int Run1=185281, int Run2=185332) { //void ntuple_loop(int Run1=185332, int Run2=185332) { // void ntuple_loop(int Run1=185332, int Run2=185332) { // void ntuple_loop(int Run1=185332, int Run2=185524) { // void ntuple_loop(int Run1=185524, int Run2=185544) { // --->Get the last run((for example below 185544) from: // ---> http://fcdfwww.fnal.gov/~cdfopr/Stntuple/cafdfc/stntuple/sewk00/ //--->Last line: cdf/scratch/cdfopr/val/results 1 185260 185544 void make_run_hist(int Run1=185544, int Run2=185544, Int_t Save = 1) { //---------------------------------------------------------------------------- // loop over ntuples and call make_hist for each one //----------------------------------------------------------------------------- for (int run = Run1; run <= Run2; run++) { make_run_hist_1(run,Save); } return; }