void digi(Int_t nEvents = 1000) { TString inputdir = gSystem->Getenv("VMCWORKDIR"); inputdir = inputdir + "/input/"; TString inFile = inputdir + "he8_05_0002.lmd.root"; TString confFile = inputdir + "myXML.xml"; // --- Specify output file name (this is just an example) TString outFile = "myDigi.root"; std::cout << ">>> input file is " << inFile << std::endl; std::cout << ">>> output file is " << outFile << std::endl; // --- Source task ERDigibuilder* builder = new ERDigibuilder(); builder->SetConfigurationFile("/media/user/work/software/fork/usr/myXML.xml"); builder->AddFile("/media/user/work/data/exp201810/workdir/he8_07_0001.lmd.root"); ERBeamDetUnpack* beamDetUnpack = new ERBeamDetUnpack("Beam_detector"); ERTelescopeUnpack* rtUnpack = new ERTelescopeUnpack("Right_telescope"); rtUnpack->AddSingleSiStation("SSD20_R", "SSD20_R","tSSD20_R", inputdir + "/parameters/SSD20_R.cal", "X"); rtUnpack->AddSingleSiStation("SSDY_R", "SSDY_R","tSSDY_R", inputdir + "/parameters/SSDY_R.cal", "Y"); rtUnpack->AddSingleSiStation("SSD_R", "SSD_R","tSSD_R", inputdir + "/parameters/SSD_R.cal", "Y"); ERTelescopeUnpack* ltUnpack = new ERTelescopeUnpack("Left_telescope"); ltUnpack->AddDoubleSiStation("DSD_L", "DSDX_L","tDSDX_L", "DSDY_L","tDSDY_L", inputdir + "/parameters/DSDX_L.cal", inputdir + "/parameters/DSDY_L.cal", "XY"); ltUnpack->AddSingleSiStation("SSD20_L", "SSD20_L","tSSD20_L", inputdir + "/parameters/SSD20_L.cal", "X"); ltUnpack->AddSingleSiStation("SSD_L", "SSD_L","tSSD_L", inputdir + "/parameters/SSD_L.cal", "X"); ERTelescopeUnpack* ctUnpack = new ERTelescopeUnpack("Central_telescope"); ltUnpack->AddDoubleSiStation("DSD_C", "DSDX_C","tDSDX_C", "DSDY_C","tDSDY_C", inputdir + "/parameters/DSDX_C.cal", inputdir + "/parameters/DSDY_C.cal", "XY"); ctUnpack->AddCsIStation("CsI","CsI","tCsI",inputdir + "/parameters/CsI.cal"); builder->AddUnpack(beamDetUnpack); builder->AddUnpack(rtUnpack); builder->AddUnpack(ltUnpack); builder->AddUnpack(ctUnpack); // --- Run FairRunOnline *run = new FairRunOnline(builder); run->SetOutputFile(outFile); ERBeamTimeEventHeader* header = new ERBeamTimeEventHeader(); run->SetEventHeader(header); // ----- Logger settings -------------------------------------------- FairLogger::GetLogger()->SetLogScreenLevel("INFO"); // --- Start run TStopwatch timer; timer.Start(); std::cout << ">>> Starting run..." << std::endl; run->Init(); run->Run(0,nEvents); timer.Stop(); // --- End-of-run info Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); std::cout << std::endl << std::endl; std::cout << ">>> Macro finished successfully." << std::endl; std::cout << ">>> Output file is " << outFile << std::endl; std::cout << ">>> Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; }