11 #include <boost/program_options.hpp>
51 struct HitSurfaceSelector {
52 bool sensitive =
false;
82 template <
typename magnetic_field_t>
83 void setupSimulationAlgorithms(
85 std::shared_ptr<const FW::RandomNumbers> randomNumbers,
87 magnetic_field_t&& magneticField) {
93 select.inputEvent =
"event_generated";
94 select.outputEvent =
"event_selected";
96 std::make_shared<FW::ParticleSelector>(select, logLevel));
100 sequencer.
addAlgorithm(std::make_shared<FW::FlattenEvent>(flatten, logLevel));
115 using ChargedSelector =
121 using NeutralSelector =
127 NeutralSelector, NeutralSimulator>;
134 ChargedStepper chargedStepper(std::move(magneticField));
135 ChargedPropagator chargedPropagator(std::move(chargedStepper),
navigator);
136 ChargedSimulator chargedSimulator(std::move(chargedPropagator), logLevel);
138 NeutralStepper neutralStepper;
139 NeutralPropagator neutralPropagator(std::move(neutralStepper),
navigator);
140 NeutralSimulator neutralSimulator(std::move(neutralPropagator), logLevel);
142 Simulator simulator(std::move(chargedSimulator), std::move(neutralSimulator));
147 fatras.outputParticlesInitial =
"particles_initial";
148 fatras.outputParticlesFinal =
"particles_final";
149 fatras.outputHits =
"hits";
150 fatras.randomNumbers = randomNumbers;
152 std::make_shared<SimulationAlgorithm>(fatras, logLevel));
156 variables[
"output-dir"].
template as<std::string>());
159 if (variables[
"output-csv"].
template as<bool>()) {
163 writeInitial.
outputStem = fatras.outputParticlesInitial;
165 std::make_shared<FW::CsvParticleWriter>(writeInitial, logLevel));
169 writeFinal.
outputStem = fatras.outputParticlesFinal;
171 std::make_shared<FW::CsvParticleWriter>(writeFinal, logLevel));
175 if (variables[
"output-root"].
template as<bool>()) {
180 FW::joinPaths(outputDir, fatras.outputParticlesInitial +
".root");
182 std::make_shared<FW::RootParticleWriter>(writeInitial, logLevel));
188 FW::joinPaths(outputDir, fatras.outputParticlesFinal +
".root");
190 std::make_shared<FW::RootParticleWriter>(writeFinal, logLevel));
197 std::make_shared<FW::RootSimHitWriter>(writeHits, logLevel));
205 std::shared_ptr<const RandomNumbers> randomNumbers,
206 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry) {
209 [&](
auto&& inputField) {
210 using magnetic_field_t =
211 typename std::decay_t<decltype(inputField)>::element_type;
213 setupSimulationAlgorithms(variables, sequencer, randomNumbers,
214 trackingGeometry, std::move(magneticField));
216 magneticFieldVariant);