File indexing completed on 2025-12-16 09:22:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/PdgParticle.hpp"
0013 #include "Acts/Geometry/TrackingVolume.hpp"
0014 #include "Acts/Material/ISurfaceMaterial.hpp"
0015 #include "Acts/Material/MaterialInteraction.hpp"
0016 #include "Acts/Material/MaterialSlab.hpp"
0017 #include "Acts/Surfaces/Surface.hpp"
0018
0019 namespace Acts::detail {
0020
0021
0022 struct VolumeMaterialInteraction {
0023
0024 InteractionVolume volume{};
0025
0026 const Vector3 pos = Vector3::Zero();
0027
0028 const double time = 0;
0029
0030 const Vector3 dir = Vector3::Zero();
0031
0032 const float qOverP = 0;
0033
0034 const float absQ = 0;
0035
0036 const float momentum = 0;
0037
0038 const float mass = 0;
0039
0040 const PdgParticle absPdg = eInvalid;
0041
0042 const bool performCovarianceTransport = false;
0043
0044 const Direction navDir;
0045
0046
0047 MaterialSlab slab = MaterialSlab::Nothing();
0048
0049 double pathCorrection = 0;
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 template <typename propagator_state_t, typename stepper_t>
0060 VolumeMaterialInteraction(const TrackingVolume* vVolume,
0061 const propagator_state_t& state,
0062 const stepper_t& stepper)
0063 : volume(vVolume),
0064 pos(stepper.position(state.stepping)),
0065 time(stepper.time(state.stepping)),
0066 dir(stepper.direction(state.stepping)),
0067 qOverP(stepper.qOverP(state.stepping)),
0068 absQ(stepper.particleHypothesis(state.stepping).absoluteCharge()),
0069 momentum(stepper.absoluteMomentum(state.stepping)),
0070 mass(stepper.particleHypothesis(state.stepping).mass()),
0071 absPdg(stepper.particleHypothesis(state.stepping).absolutePdg()),
0072 performCovarianceTransport(state.stepping.covTransport),
0073 navDir(state.options.direction) {}
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 template <typename propagator_state_t, typename navigator_t>
0085 bool evaluateMaterialSlab(const propagator_state_t& state,
0086 const navigator_t& navigator) {
0087 pathCorrection = 0;
0088 if (navigator.currentVolume(state.navigation) != nullptr &&
0089 navigator.currentVolume(state.navigation)->volumeMaterial() !=
0090 nullptr) {
0091 slab = MaterialSlab(navigator.currentVolume(state.navigation)
0092 ->volumeMaterial()
0093 ->material(pos),
0094 1);
0095 } else {
0096 slab = MaterialSlab::Nothing();
0097 }
0098 return !slab.isVacuum();
0099 }
0100 };
0101
0102 }