Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NuclearInteractionParametrisation.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file NuclearInteractionParametrisation.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020-2021 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 
14 
15 #include <algorithm>
16 #include <cstdint>
17 #include <tuple>
18 #include <unordered_map>
19 #include <utility>
20 #include <vector>
21 
22 #include <TH1F.h>
23 #include <TVectorFfwd.h>
24 
25 namespace ActsExamples {
26 namespace detail {
28 
31 struct EventFraction {
32  EventFraction() = default;
33 
39  : initialParticle(event.initial),
40  interactingParticle(event.before),
41  finalParticles(event.after) {}
42 
48  std::vector<ActsExamples::SimParticle> finalParticles;
49 
51  bool soft = false;
53  unsigned int multiplicity = 0;
55  float initialMomentum = 0.;
56 };
57 
58 static constexpr uint32_t s_MaxValue = UINT32_MAX;
59 using EventCollection = std::vector<EventFraction>;
60 using EventProperties = std::vector<std::vector<float>>;
61 using ProbabilityDistributions = std::vector<TH1F*>;
62 using CumulativeDistribution = TH1F*;
65 using EigenspaceComponents = std::tuple<Vector, Matrix, Vector>;
66 using Parametrisation =
67  std::pair<EigenspaceComponents, std::vector<CumulativeDistribution>>;
68 
77  unsigned int multiplicity, bool soft);
78 
88  unsigned int nBins);
89 
99  const EventProperties& events);
100 
108 std::pair<Vector, Matrix> calculateMeanAndCovariance(
109  unsigned int multiplicity, const EventProperties& events);
110 
119  const Matrix& covariance);
120 
130  unsigned int multiplicity, bool soft,
131  unsigned int nBins);
132 
141  unsigned int multiplicity, bool soft);
142 
152  unsigned int multiplicity,
153  bool soft, unsigned int nBins);
154 
161 std::unordered_map<int, std::unordered_map<int, float>>
163 
170 std::pair<CumulativeDistribution, CumulativeDistribution>
172  unsigned int multiplicityMax);
173 
180 TVectorF softProbability(const EventCollection& events);
181 
194  const EventCollection& events, unsigned int interactionProbabilityBins);
195 } // namespace NuclearInteractionParametrisation
196 } // namespace detail
197 } // namespace ActsExamples