{ // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 1; // Input file (MC events) //TString inFile = "etacphiphi.raw.root"; //TString inFile = "demo.raw.root"; //TString inFile = "2pions.raw.root"; // Number of events to process Int_t nEvents = 100; // Parameter file TString parFile = "testparams.root"; // Input file (MC events) //TString inFile = "etacphiphi.raw.root"; TString inFile = "data/pion.30deg.raw.root"; // Output file //TString outFile = "etacphiphi.reco.root"; TString outFile = "data/pion.30deg.reco.root"; // ---- Load libraries ------------------------------------------------- gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libMCStack"); gSystem->Load("libField"); gSystem->Load("libGen"); gSystem->Load("libPassive"); gSystem->Load("libgenfit"); gSystem->Load("libtpc"); gSystem->Load("libtpcreco"); gSystem->Load("librecotasks"); // ------------------------------------------------------------------------ // --- Now choose concrete engines for the different tasks ------------- // ------------------------------------------------------------------------ // In general, the following parts need not be touched // ======================================================================== // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Digitization run ------------------------------------------- CbmRunAna *fRun= new CbmRunAna(); fRun->SetInputFile(inFile); fRun->SetOutputFile(outFile); // ------------------------------------------------------------------------ // ----- Parameter database -------------------------------------------- CbmRuntimeDb* rtdb = fRun->GetRuntimeDb(); CbmParRootFileIo* parInput1 = new CbmParRootFileIo(); parInput1->open(parFile.Data()); //CbmParAsciiFileIo* parInput2 = new CbmParAsciiFileIo(); //TString stsDigiFile = gSystem->Getenv("VMCWORKDIR"); //stsDigiFile += "/parameters/sts/sts_digi_new_standard.par"; //parInput2->open(stsDigiFile.Data(),"in"); rtdb->setFirstInput(parInput1); //rtdb->setSecondInput(parInput2); fRun->LoadGeometry(); // ------------------------------------------------------------------------ // GenfitTask *Genfit= new GenfitTask(); // fRun->AddTask(Genfit); // ----- Tpc Event Mixer: Mixes background tracks to events ------------- // ----- Reco Sequence -------------------------------------------- TpcClusterFinderTask* tpcCF = new TpcClusterFinderTask(); tpcCF->SetPersistence(); tpcCF->timeslice(8); // = 4 sample times = 100ns @ 40MHz fRun->AddTask(tpcCF); TpcPatternRecoTask* tpcSPR = new TpcPatternRecoTask(); tpcSPR->SetTrkFinderParameters(1.,1.,1., 10., 3); tpcSPR->SetPersistence(); fRun->AddTask(tpcSPR); KalmanTask* kalman =new KalmanTask(); fRun->AddTask(kalman); TrackFitStatTask* fitstat=new TrackFitStatTask(); fitstat->SetPersistence(); fRun->AddTask(fitstat); TpcTrackVisTask* trkVis = new TpcTrackVisTask(); trkVis->SetTrackBranchName("TrackPreFit"); //fRun->AddTask(trkVis); // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0,nEvents); // ------------------------------------------------------------------------ // ----- Finish ------------------------------------------------------- tpcSPR->WriteHistograms("RecoHistos.root"); kalman->WriteHistograms("RecoHistos.root"); //delete tpcSplitter; timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished succesfully." << endl; cout << "Output file is " << outFile << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // ------------------------------------------------------------------------ }