5#ifndef ISF_ACTSTOOLS_ACTSFATRASSIMTOOL_H
6#define ISF_ACTSTOOLS_ACTSFATRASSIMTOOL_H
9#include "GaudiKernel/ServiceHandle.h"
10#include "GaudiKernel/ToolHandle.h"
25#include "Acts/Utilities/UnitVectors.hpp"
28#include "Acts/Geometry/GeometryContext.hpp"
29#include "Acts/MagneticField/MagneticFieldContext.hpp"
30#include "Acts/EventData/TrackParameters.hpp"
31#include "Acts/Propagator/Navigator.hpp"
32#include "Acts/Propagator/EigenStepper.hpp"
33#include "Acts/Propagator/EigenStepperDefaultExtension.hpp"
34#include "Acts/Propagator/StraightLineStepper.hpp"
35#include "Acts/Propagator/detail/SteppingLogger.hpp"
36#include "Acts/Propagator/ActorList.hpp"
37#include "Acts/Propagator/Propagator.hpp"
38#include "Acts/Definitions/ParticleData.hpp"
39#include "ActsFatras/EventData/ProcessType.hpp"
40#include "ActsFatras/Kernel/InteractionList.hpp"
41#include "ActsFatras/Kernel/Simulation.hpp"
42#include "ActsFatras/Kernel/SimulationResult.hpp"
43#include "ActsFatras/Physics/Decay/NoDecay.hpp"
44#include "ActsFatras/Physics/StandardInteractions.hpp"
45#include "ActsFatras/Physics/ElectroMagnetic/PhotonConversion.hpp"
46#include "ActsFatras/Selectors/SurfaceSelectors.hpp"
77 return surface.isSensitive();
87 template <
typename propagator_t,
typename interactions_t,
88 typename hit_surface_selector_t,
typename decay_t>
117 std::shared_ptr<const Acts::Logger> localLogger_)
132 template <
typename generator_t>
133 Acts::Result<ActsFatras::SimulationResult>
simulate(
134 const Acts::GeometryContext &geoCtx,
135 const Acts::MagneticFieldContext &magCtx, generator_t &generator,
136 const ActsFatras::Particle &particle)
const {
138 ACTS_VERBOSE(
"Using ActsFatrasSimTool simulate()");
140 using SteppingLogger = Acts::detail::SteppingLogger;
141 using SimulationActor = ActsFatras::detail::SimulationActor<generator_t, decay_t, interactions_t, hit_surface_selector_t>;
142 using Result =
typename SimulationActor::result_type;
143 using Actions = Acts::ActorList<SteppingLogger, SimulationActor, Acts::EndOfWorldReached>;
144 using PropagatorOptions =
typename propagator_t::template Options<Actions>;
147 PropagatorOptions options(geoCtx, magCtx);
150 actor.generator = &generator;
154 actor.initialParticle = particle;
156 Acts::BoundTrackParameters startPoint = Acts::BoundTrackParameters::createCurvilinear(
157 particle.fourPosition(), particle.direction(),
158 particle.qOverP(), std::nullopt, particle.hypothesis());
159 options.pathLimit =
pathLimit * Acts::UnitConstants::cm;
162 options.stepping.maxStepSize =
maxStepSize * Acts::UnitConstants::m;
188 ActsFatras::StandardChargedElectroMagneticInteractions;
191 ActsFatras::NoDecay>;
197 ActsFatras::NoDecay>;
204 const IInterface* parent);
212 const EventContext& ctx,
216 virtual StatusCode
setupEvent(
const EventContext&)
override {
220 return StatusCode::SUCCESS; };
222 std::vector<SiHitCollection> hitcolls;
227 return StatusCode::SUCCESS; };
232 const EventContext&)
const;
241 if (!thandle.empty() && thandle.retrieve().isFailure()) {
243 return StatusCode::FAILURE;
245 return StatusCode::SUCCESS;
252 "RandomEngineName",
"Name of random number stream"};
256 this,
"TrackingGeometryTool",
"ActsTrackingGeometryTool"};
263 std::shared_ptr<const Acts::Logger>
m_logger{
nullptr};
267 this,
"ParticleFilter",
"",
"Particle filter kinematic cuts, etc."};
273 this,
"ActsFatrasWriteHandler",
"ActsFatrasWriteHandler"};
276 "Min pT of the interactions (MeV)"};
279 Gaudi::Property<bool>
m_meanEnergyLoss{
this,
"MeanEnergyLoss",
true,
"Toggle between mean and mode evaluation of energy loss"};
280 Gaudi::Property<bool>
m_includeGgradient{
this,
"IncludeGgradient",
true,
"Boolean flag for inclusion of d(dEds)d(q/p) into energy loss"};
281 Gaudi::Property<double>
m_momentumCutOff{
this,
"MomentumCutOff", 0.,
"Cut-off value for the momentum in SI units"};
283 Gaudi::Property<double>
m_maxStep{
this,
"MaxSteps", 1000,
284 "Max number of steps"};
286 "Maximum number of Runge-Kutta steps for the stepper step call"};
288 "Max step size (converted to Acts::UnitConstants::m)"};
290 "Track path limit (converted to Acts::UnitConstants::cm)"};
292 "Loop protection, it adapts the pathLimit"};
294 "Allowed loop fraction, 1 is a full loop"};
296 "Tolerance for the error of the integration"};
298 "Cut-off value for the step size"};
301 {{0,0}, {1,201}, {2,14}, {3,3}, {4,121}},
"proessType map <ActsFatras,G4>"};
#define ATH_CHECK
Evaluate an expression and check for errors.
AtlasHitsVector< SiHit > SiHitCollection
Define macros for attributes used to control the static checker.
A wrapper class for event-slot-local random engines.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
The generic ISF particle definition,.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
The sim hit creator recieves a std::vector of Trk::TrackParameters and uses them to create simulated ...
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
int SimulationFlavor
Identifier type for simulation flavor.
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Single particle simulation with fixed propagator, interactions, and decay.
HitSurfaceSelector selectHitSurface
ChargedInteractions interactions
double maxRungeKuttaStepTrials
const Acts::Logger & logger() const
Provide access to the local logger instance, e.g. for logging macros.
Acts::Result< ActsFatras::SimulationResult > simulate(const Acts::GeometryContext &geoCtx, const Acts::MagneticFieldContext &magCtx, generator_t &generator, const ActsFatras::Particle &particle) const
Simulate a single particle without secondaries.
ChargedPropagator propagator
SingleParticleSimulation(propagator_t &&propagator_, std::shared_ptr< const Acts::Logger > localLogger_)
Alternatively construct the simulator with an external logger.
std::shared_ptr< const Acts::Logger > localLogger
ActsFatras::NoDecay decay