////////////////////////////////////////////////////////////////////////// // // HAND detector replay script // ////////////////////////////////////////////////////////////////////////// // // Author : Vincent A. Sulkosky & Jin Huang // // Updated : I. Korover // ////////////////////////////////////////////////////////////////////////// #include "def.h" using namespace std; void replay_2HRS(Int_t runnumber=0,Int_t all=0,Int_t fstEvt=0,Bool_t QuietRun = kFALSE) { ////////////////////////////////////////// /// Beams ////////////////////////////////////////// THaApparatus* B = new THaIdealBeam("B","Idea Beam, for Test Only"); gHaApps->Add( B ); cout<<"replay: Adding Decoder Data ..."<Add(new THaDecData("D","Misc. Decoder Data")); //////////////////////////////////////////// /// LHRS /////////////////////////////////////////// cout<<"replay: Adding HRS-L ..."<Add( HRSL ); // add detectors that are not in the default config HRSL->AddDetector( new THaCherenkov("cer", "Gas Cherenkov counter" )); // HRSL->AddDetector( new THaCherenkov("a1", "A1 Cherenkov counter" )); HRSL->AddDetector( new THaShower("prl1", "Pre-shower pion rej." )); HRSL->AddDetector( new THaShower("prl2", "Show pion rej." )); cout<<"replay: adding LHRS track(physics) modules ..."<Add( new THaGoldenTrack("L.gold","Golden track for LHRS", "L") ); //=========================================================== cout<<"replay: Adding HRS-R ..."<Add( HRSR ); gHaPhysics->Add( new THaGoldenTrack("R.gold","Golden track for RHRS", "R") ); //=========================================================== gHaPhysics->Add(new THaPrimaryKine("PriKineL","kinematics of scattering of electron to HRSR","L",0.000511,0.939565)); THaSecondaryKine *SecKineP=new THaSecondaryKine( "SecKineP","secondary kinematics of scattering proton into HRSR","R", "PriKineL", .938); gHaPhysics->Add(SecKineP); //============================================================ THaS2CoincTime *CT=new THaS2CoincTime("CT","Coincidence time","L","R",0.939565,0.000511); gHaPhysics->Add(CT); //////////////////////////////////////// // Do replay //////////////////////////////////////// THaAnalyzer* analyzer = THaAnalyzer::GetInstance(); if( !analyzer ) { analyzer = new THaAnalyzer; } analyzer->EnableBenchmarks(); analyzer->EnableHelicity(); analyzer->EnableScalers(); if (runnumber<20000) analyzer->SetCrateMapFileName("cratemap"); else if(runnumber>20000) analyzer->SetCrateMapFileName("cratemap_R"); ReplayCore( runnumber, //run # all, //-1=replay all;0=ask for a number 100000, //defaut replay event num "%s/e01015_%d.root", //output file format "replay_2HRS.odef", //out define "replay_2HRS.cdef", //empty cut define kTRUE, //replay scalar? fstEvt, //First Event To Replay QuietRun //whether ask user for inputs ); // cout << endl; // cout << "Look at histograms for Right arm" << endl // << "\t online(\"detectorR\"," << runnumber << ")" << endl; // cout << "And Neutron Detector.. " << endl // << "\t online(\"detectorND\"," << runnumber << ")" << endl << endl; // cout << "Exit ROOT session before performing another analysis:" << endl // << " .q" << endl << endl; analyzer->SetCrateMapFileName("cratemap"); }