68 auto EvntHeader = std::make_unique<R3BEventHeader>();
69 auto read_branch_names = std::vector<std::string>{};
70 auto write_branch_names = std::vector<std::string>{};
71 LOGP(info,
"Setting the event header to be R3BEventHeader!");
72 run->SetEventHeader(std::move(EvntHeader));
76 if (
const auto& option = task_option.digi; option.enable)
79 run->AddTask(task.release());
82 if (
const auto& option = task_option.sim_cal_to_cal; option.enable)
85 auto task = std::make_unique<R3B::Neuland::SimCal2Cal>(read_branch_names.at(0), write_branch_names.at(0));
86 task->SetName(option.name.c_str());
87 run->AddTask(task.release());
90 if (
const auto& option = task_option.hit_monitor; option.enable)
93 auto task = std::make_unique<R3BNeulandHitMon>(read_branch_names.at(0));
94 task->SetName(option.name.c_str());
95 run->AddTask(task.release());
98 if (
const auto& option = task_option.prim_inter_finder; option.enable)
101 auto task = std::make_unique<R3BNeulandPrimaryInteractionFinder>(read_branch_names.at(0),
102 read_branch_names.at(1),
103 write_branch_names.at(0),
104 write_branch_names.at(1),
105 write_branch_names.at(2));
106 task->SetName(option.name.c_str());
107 run->AddTask(task.release());
110 if (
const auto& option = task_option.cluster_finder; option.enable)
113 auto task = std::make_unique<R3BNeulandClusterFinder>(read_branch_names.at(0), write_branch_names.at(0));
114 task->SetName(option.name.c_str());
115 run->AddTask(task.release());
118 if (
const auto& option = task_option.prim_cluster_finder; option.enable)
121 auto task = std::make_unique<R3BNeulandPrimaryClusterFinder>(
122 read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0), write_branch_names.at(1));
123 task->SetName(option.name.c_str());
124 run->AddTask(task.release());
127 if (
const auto& option = task_option.multi_calorimeter_train; option.enable)
130 auto task = std::make_unique<R3BNeulandMultiplicityCalorimetricTrain>(
131 read_branch_names.at(0), read_branch_names.at(1), read_branch_names.at(2));
132 task->SetName(option.name.c_str());
133 task->SetUseHits(option.use_hit);
134 task->SetWeight(option.weight);
135 task->SetEdepOpt(option.edep_opt.init, option.edep_opt.step, option.edep_opt.lower, option.edep_opt.upper);
136 task->SetEdepOffOpt(option.edep_off_opt.init,
137 option.edep_off_opt.step,
138 option.edep_off_opt.lower,
139 option.edep_off_opt.upper);
140 task->SetNclusterOffOpt(option.n_cluster_opt.init,
141 option.n_cluster_opt.step,
142 option.n_cluster_opt.lower,
143 option.n_cluster_opt.upper);
144 task->SetNclusterOffOpt(option.n_cluster_off_opt.init,
145 option.n_cluster_off_opt.step,
146 option.n_cluster_off_opt.lower,
147 option.n_cluster_off_opt.upper);
148 run->AddTask(task.release());
151 if (
const auto& option = task_option.multi_bayes_train; option.enable)
155 std::make_unique<R3BNeulandMultiplicityBayesTrain>(read_branch_names.at(0), read_branch_names.at(1));
156 task->SetName(option.name.c_str());
157 run->AddTask(task.release());
160 if (
const auto& option = task_option.multi_bayes; option.enable)
164 std::make_unique<R3BNeulandMultiplicityBayes>(read_branch_names.at(0), write_branch_names.at(0));
165 task->SetName(option.name.c_str());
166 run->AddTask(task.release());
169 if (
const auto& option = task_option.neutron_r_value; option.enable)
172 auto task = std::make_unique<R3BNeulandNeutronsRValue>(
173 option.neutron_energy_mev, read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0));
174 task->SetName(option.name.c_str());
175 run->AddTask(task.release());
178 if (
const auto& option = task_option.map_data_converter_task; option.enable)
181 auto task = std::make_unique<Calibration::MapDataConverterTask>(
182 read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0), write_branch_names.at(1));
183 task->SetName(option.name.c_str());
184 run->AddTask(task.release());
187 if (
const auto& option = task_option.map_to_cal_par_task; option.enable)
190 auto task = std::make_unique<R3B::Neuland::Map2CalParTask>(
191 read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0), write_branch_names.at(1));
192 task->SetTrigEnabled(option.has_trig_enabled);
193 task->SetErrorMethod(option.error_method);
194 run->AddTask(task.release());
196 if (
const auto& option = task_option.map_to_cal_task; option.enable)
199 auto task = std::make_unique<R3B::Neuland::Map2CalTask>(read_branch_names.at(0),
200 read_branch_names.at(1),
201 read_branch_names.at(2),
202 read_branch_names.at(3),
203 write_branch_names.at(0));
204 task->SetPulserMode(option.enable_pulse_mode);
205 task->SetNhitmin(option.min_stat);
206 task->EnableWalk(option.enable_walk_effect);
207 run->AddTask(task.release());
210 if (
const auto& option = task_option.los_map_to_cal_par_task; option.enable)
213 auto task = std::make_unique<R3BLosMapped2CalPar>();
214 run->AddTask(task.release());
217 if (
const auto& option = task_option.los_map_to_cal_task; option.enable)
220 auto task = std::make_unique<R3BLosMapped2Cal>();
221 static constexpr auto LOS_MODULE_NUM = 8;
222 task->SetNofModules(1, LOS_MODULE_NUM);
224 run->AddTask(task.release());
226 if (
const auto& option = task_option.cal_to_hit_par_task; option.enable)
229 auto task = std::make_unique<R3B::Neuland::Cal2HitParTask>(
230 option.method, read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0));
231 task->SetMinStat(option.min_stat);
232 task->SetTrigger(option.mode);
233 run->AddTask(task.release());
235 if (
const auto& option = task_option.los_provide_t_start; option.enable)
238 auto task = std::make_unique<R3BLosProvideTStart>();
239 run->AddTask(task.release());
242 if (
const auto& option = task_option.cal_to_hit_task; option.enable)
245 auto task = std::make_unique<R3B::Neuland::Cal2HitTask>(
246 read_branch_names.at(0), read_branch_names.at(1), write_branch_names.at(0));
247 task->SetTrigger(option.mode);
248 task->SetGlobalTimeOffset(option.global_time_offset);
249 run->AddTask(task.release());