Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PointwiseMaterialInteraction.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PointwiseMaterialInteraction.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 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 
10 
12 
13 namespace Acts {
14 namespace detail {
15 
17  bool multipleScattering, bool energyLoss) {
18  if (energyLoss) {
20  }
21  // Compute contributions from interactions
23  covarianceContributions(multipleScattering, energyLoss);
24  }
25 }
26 
28  bool multipleScattering, bool energyLoss) {
29  // Compute contributions from interactions
30  if (multipleScattering) {
31  // TODO use momentum before or after energy loss in backward mode?
32  const float theta0 =
34  // sigmaPhi = theta0 / sin(theta)
35  const auto sigmaPhi = theta0 * (dir.norm() / VectorHelpers::perp(dir));
36  variancePhi = sigmaPhi * sigmaPhi;
37  // sigmaTheta = theta0
38  varianceTheta = theta0 * theta0;
39  }
40  // TODO just ionisation loss or full energy loss?
41  if (energyLoss) {
42  const float sigmaQoverP =
44  varianceQoverP = sigmaQoverP * sigmaQoverP;
45  }
46 }
47 
49  double variance, double change, NoiseUpdateMode updateMode) const {
50  // Add/Subtract the change
51  // Protect the variance against becoming negative
52  return std::max(0., variance + std::copysign(change, updateMode));
53 }
54 
55 } // namespace detail
56 } // end of namespace Acts