Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VolumeMaterialInteraction.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file VolumeMaterialInteraction.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
18 
19 namespace Acts {
20 namespace detail {
21 
27  const Vector3 pos = Vector3::Zero();
29  const double time = 0;
31  const Vector3 dir = Vector3::Zero();
33  const float qOverP = 0;
35  const float absQ = 0;
37  const float momentum = 0;
39  const float mass = 0;
43  const bool performCovarianceTransport = false;
46 
50  double pathCorrection = 0;
51 
60  template <typename propagator_state_t, typename stepper_t>
62  const propagator_state_t& state,
63  const stepper_t& stepper)
64  : volume(vVolume),
65  pos(stepper.position(state.stepping)),
66  time(stepper.time(state.stepping)),
67  dir(stepper.direction(state.stepping)),
68  qOverP(stepper.qOverP(state.stepping)),
69  absQ(stepper.particleHypothesis(state.stepping).absoluteCharge()),
70  momentum(stepper.absoluteMomentum(state.stepping)),
71  mass(stepper.particleHypothesis(state.stepping).mass()),
72  absPdg(stepper.particleHypothesis(state.stepping).absolutePdg()),
73  performCovarianceTransport(state.stepping.covTransport),
74  navDir(state.options.direction) {}
75 
85  template <typename propagator_state_t, typename navigator_t>
86  bool evaluateMaterialSlab(const propagator_state_t& state,
87  const navigator_t& navigator) {
88  pathCorrection = 0;
89  if (navigator.currentVolume(state.navigation) != nullptr &&
90  navigator.currentVolume(state.navigation)->volumeMaterial() !=
91  nullptr) {
92  slab = MaterialSlab(navigator.currentVolume(state.navigation)
93  ->volumeMaterial()
94  ->material(pos),
95  1); // state.stepping.StepSize
96  } else {
97  slab = MaterialSlab();
98  }
99  return slab;
100  }
101 };
102 
103 } // namespace detail
104 } // end of namespace Acts