27auto main(
int argc,
const char** argv) ->
int
30 auto timer = TStopwatch{};
34 auto help = programOptions.create_option<
bool>(
"help,h",
"help message",
false);
36 programOptions.create_option<std::string>(
"paraFile",
"set the filename of parameter sink",
"para.root");
38 programOptions.create_option<std::string>(
"digiFile",
"set the filename of digitization output",
"digi.root");
40 programOptions.create_option<std::string>(
"simuFile",
"set the filename of simulation input",
"simu.root");
41 if (!programOptions.verify(argc, argv))
48 std::cout << programOptions.get_desc_ref() << std::endl;
52 FairLogger::GetLogger()->SetLogScreenLevel(
"error");
54 auto run = std::make_unique<FairRunAna>();
55 auto filesource = std::make_unique<FairFileSource>(simuFileName->value().c_str());
56 auto filesink = std::make_unique<FairRootFileSink>(digiFileName->value().c_str());
57 run->SetSource(filesource.release());
58 run->SetSink(filesink.release());
60 auto fileio = std::make_unique<FairParRootFileIo>();
61 fileio->open(paraFileName->value().c_str());
62 run->GetRuntimeDb()->setFirstInput(fileio.release());
69 tamexParameter.fPMTThresh = 1.;
70 tamexParameter.fTimeMin = 1.;
71 auto digiNeuland = std::make_unique<R3BNeulandDigitizer>();
73 digiNeuland->SetEngine(std::move(engine));
74 run->AddTask(digiNeuland.release());
77 auto hitmon = std::make_unique<R3BNeulandHitMon>();
78 run->AddTask(hitmon.release());
81 auto r3bNeulandClusterFinder = std::make_unique<R3BNeulandClusterFinder>(2. * 7.5, 2. * 7.5, 2. * 7.5, 5.);
82 run->AddTask(r3bNeulandClusterFinder.release());
87 auto* sink = run->GetSink();
89 std::cout <<
"Macro finished successfully." << std::endl;
90 std::cout <<
"Real time: " << timer.RealTime() <<
"s, CPU time: " << timer.CpuTime() <<
"s" << std::endl;