File indexing completed on 2025-01-18 09:10:56
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;
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 template <typename propagator_state_t, typename stepper_t>
0084 VolumeMaterialInteraction(const Acts::Experimental::DetectorVolume* vVolume,
0085 const propagator_state_t& state,
0086 const stepper_t& stepper)
0087 : volume(vVolume),
0088 pos(stepper.position(state.stepping)),
0089 time(stepper.time(state.stepping)),
0090 dir(stepper.direction(state.stepping)),
0091 qOverP(stepper.qOverP(state.stepping)),
0092 absQ(stepper.particleHypothesis(state.stepping).absoluteCharge()),
0093 momentum(stepper.absoluteMomentum(state.stepping)),
0094 mass(stepper.particleHypothesis(state.stepping).mass()),
0095 absPdg(stepper.particleHypothesis(state.stepping).absolutePdg()),
0096 performCovarianceTransport(state.stepping.covTransport),
0097 navDir(state.options.direction) {}
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 template <typename propagator_state_t, typename navigator_t>
0109 bool evaluateMaterialSlab(const propagator_state_t& state,
0110 const navigator_t& navigator) {
0111 pathCorrection = 0;
0112 if (navigator.currentVolume(state.navigation) != nullptr &&
0113 navigator.currentVolume(state.navigation)->volumeMaterial() !=
0114 nullptr) {
0115 slab = MaterialSlab(navigator.currentVolume(state.navigation)
0116 ->volumeMaterial()
0117 ->material(pos),
0118 1);
0119 } else {
0120 slab = MaterialSlab();
0121 }
0122 return slab.isValid();
0123 }
0124 };
0125
0126 }