46 #include <boost/program_options.hpp>
51 struct HitSurfaceSelector {
52 bool sensitive =
false;
82 template <
typename magnetic_field_t>
83 void setupSimulationAlgorithms(
86 std::shared_ptr<const ActsExamples::RandomNumbers> randomNumbers,
95 select.inputParticles =
"particles_generated";
96 select.outputParticles =
"particles_selected";
98 std::make_shared<ActsExamples::ParticleSelector>(select, logLevel));
113 using ChargedSelector =
119 using NeutralSelector =
125 NeutralSelector, NeutralSimulator>;
133 ChargedPropagator chargedPropagator(std::move(chargedStepper),
navigator);
134 ChargedSimulator chargedSimulator(std::move(chargedPropagator), logLevel);
136 NeutralStepper neutralStepper;
137 NeutralPropagator neutralPropagator(std::move(neutralStepper),
navigator);
138 NeutralSimulator neutralSimulator(std::move(neutralPropagator), logLevel);
140 Simulator simulator(std::move(chargedSimulator), std::move(neutralSimulator));
145 fatras.inputParticles = select.outputParticles;
146 fatras.outputParticlesInitial =
"particles_initial";
147 fatras.outputParticlesFinal =
"particles_final";
148 fatras.outputHits =
"hits";
149 fatras.randomNumbers = randomNumbers;
151 std::make_shared<SimulationAlgorithm>(fatras, logLevel));
155 variables[
"output-dir"].
template as<std::string>());
158 if (variables[
"output-csv"].
template as<bool>()) {
162 writeInitial.
outputStem = fatras.outputParticlesInitial;
163 sequencer.
addWriter(std::make_shared<ActsExamples::CsvParticleWriter>(
164 writeInitial, logLevel));
168 writeFinal.
outputStem = fatras.outputParticlesFinal;
169 sequencer.
addWriter(std::make_shared<ActsExamples::CsvParticleWriter>(
170 writeFinal, logLevel));
174 if (variables[
"output-root"].
template as<bool>()) {
179 outputDir, fatras.outputParticlesInitial +
".root");
180 sequencer.
addWriter(std::make_shared<ActsExamples::RootParticleWriter>(
181 writeInitial, logLevel));
187 outputDir, fatras.outputParticlesFinal +
".root");
188 sequencer.
addWriter(std::make_shared<ActsExamples::RootParticleWriter>(
189 writeFinal, logLevel));
197 std::make_shared<ActsExamples::RootSimHitWriter>(writeHits, logLevel));
206 std::shared_ptr<const RandomNumbers> randomNumbers,
207 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry) {
210 [&](
auto&& inputField) {
211 using magnetic_field_t =
212 typename std::decay_t<decltype(inputField)>::element_type;
214 setupSimulationAlgorithms(variables, sequencer, randomNumbers,
215 trackingGeometry, std::move(magneticField));
217 magneticFieldVariant);