/** * \file much_digi.C * \author Volker Friese * \date 11.06.2018 * \brief Digitization macro for MUCH. * * Digitization is event-by-event **/ void much_digi(Int_t nEvents = 3, Int_t flag = 0) { // --- Logger settings ---------------------------------------------------- FairLogger::GetLogger()->SetLogScreenLevel("INFO"); FairLogger::GetLogger()->SetLogVerbosityLevel("LOW"); // ------------------------------------------------------------------------ // ----- Allow overwriting of output file ----------------------------- Bool_t overwrite = kTRUE; // ------------------------------------------------------------------------ // ----- File names --------------------------------------------------- TString inFile = "data/mc.root"; TString parFile = "data/params.root"; TString outFile = "data/raw.root"; // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Digitization run --------------------------------------------- CbmDigitization run; run.AddInput(inFile); run.SetOutputFile(outFile, overwrite); run.SetParameterRootFile(parFile); run.SetEventMode(); run.Run(nEvents); // ------------------------------------------------------------------------ // ----- Finish ------------------------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); std::cout << std::endl; std::cout << "Macro finished successfully." << std::endl; std::cout << "Output file is " << outFile << std::endl; std::cout << "Parameter file is " << parFile << std::endl; std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl << std::endl; // ------------------------------------------------------------------------ // ----- CTest resource monitoring ------------------------------------ FairSystemInfo sysInfo; Float_t maxMemory=sysInfo.GetMaxMemory(); std::cout << ""; std::cout << maxMemory; std::cout << "" << std::endl; std::cout << ""; std::cout << rtime; std::cout << "" << std::endl; Float_t cpuUsage=ctime/rtime; std::cout << ""; std::cout << cpuUsage; std::cout << "" << std::endl; // ------------------------------------------------------------------------ // ----- Finish ------------------------------------------------------- std::cout << " Test passed" << std::endl; std::cout << " All ok " << std::endl; // ------------------------------------------------------------------------ } // End of macro