////////////////////////////////////////////////////////////////////////// // // HAND detector replay script // ////////////////////////////////////////////////////////////////////////// // // Author : Vincent A. Sulkosky & Jin Huang // // Updated : I. Korover // ////////////////////////////////////////////////////////////////////////// #include "def.h" using namespace std; void replay_neutrons(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 R-arm Helicity"<< endl; B->AddDetector( new THaADCHelicity("adchel.R","Beam helicity R-arm") ); B->AddDetector( new THaG0Helicity("g0hel.R","Right arm G0 helicity") ); cout<<"replay: Adding UnRastered and Rastered Beam ..."<Add(new THaUnRasteredBeam("Rurb","Unrastered beam")); gHaApps->Add(new THaRasteredBeam("Rrb","Rastered Beam")); */ cout<<"replay: Adding Decoder Data ..."<Add(new THaDecData("D","Misc. Decoder Data")); //////////////////////////////////////////// /// RHRS //////////////////////////////////////////// cout<<"replay: Adding HRS-R ..."<Add( HRSR ); // add detectors that are not in the default config // HRSR->AddDetector( new THaCherenkov("cer", "Gas Cherenkov counter" )); // HRSR->AddDetector( new THaShower("ps", "Pre-shower" )); // HRSR->AddDetector( new THaShower("sh", "Shower" )); // add neutron detector THaNA* NA=new THaNA("NA","NeutronDetector"); gHaApps->Add(NA); /* cout<<"replay: adding Physics modules ..."<Add( new THaGoldenTrack("R.gold","Golden track for RHRS", "R") ); THaPhysicsModule *Rpt_r = new THaReactionPoint( "ReactPt_R","Reaction vertex for Right","R","B"); gHaPhysics->Add( Rpt_r ); // Correct for using an Extended target // This needs information about the Point of interaction (hence a THaVertexModule) THaPhysicsModule* TgC_r = new THaExtTarCor("ExTgtCor_R", "Corrected for extended target, HRS-R", "R","ReactPt_R"); gHaPhysics->Add( TgC_r ); gHaPhysics->Add(new THaPrimaryKine("PriKineR","kinematics of scattering of electron to HRS","R","Rurb",.939565)); gHaPhysics->Add(new THaPrimaryKine("PriKineRHe3","kinematics of scattering of electron to HRS","R","Rurb",3.016*0.931494)); // add scalers THaScalerGroup* RightScalers = new THaScalerGroup("Right"); gHaScalers->Add(RightScalers); //////////////////////////////////////// // Norm Ana //////////////////////////////////////// char buff[1000]=""; sprintf(buff,"./summaryfiles/RNormAna%d.log",runnumber); cout<<"replay: Adding NormAna_R & saving result to "<Add(norm); */ // 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/e05102_ND_%d.root", //output file format "replay_neutrons.odef", //out define "replay_neutrons.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"); }