ATLAS Offline Software
Loading...
Searching...
No Matches
MultiComponentStateAssembler.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
20
21#ifndef MultiComponentStateAssembler_H
22#define MultiComponentStateAssembler_H
23
26#include <vector>
27
28namespace Trk {
29
35struct Cache {
40 double validWeightSum = 0;
41 double invalidWeightSum = 0;
42 static constexpr double minimumValidFraction = 0.01;
43 static constexpr double minimumFractionalWeight = 1e-09;
44};
45
48void
51 ComponentParameters&& multiComponentState);
52
55void
58 Trk::MultiComponentState&& multiComponentState);
59
65
66} // End MultiComponentStateAssembler namespace
67
68} // End Trk namepace
69
70// inline methods
72 Cache& cache, ComponentParameters&& componentParameters) {
73
74 cache.validWeightSum += componentParameters.weight;
75 cache.multiComponentState.push_back({std::move(componentParameters.params),
76 componentParameters.weight});
77}
78
80 Cache& cache, Trk::MultiComponentState&& multiComponentState) {
81
82 double sumW(0.);
83 for (auto& component : multiComponentState) {
84 sumW += component.weight;
85 cache.multiComponentState.push_back({std::move(component.params),
86 component.weight});
87 }
88 cache.validWeightSum += sumW;
89}
90
91#endif
Definition of component parameters for use in a mixture of many components. In this regime each track...
constexpr int8_t maxNumberofStateComponents
The state is described by N Gaussian components The Beth Heitler Material effect are also described b...
Helper struct representing a cache of the Multicomponent state under assembly.
void addMultiState(MultiComponentStateAssembler::Cache &cache, Trk::MultiComponentState &&multiComponentState)
Method to add a new Trk::MultiComponentState to the cached Trk::MultiComponentState object under cons...
MultiComponentState assembledState(MultiComponentStateAssembler::Cache &&cache)
Method to return the cached state object - it performs a reweighting before returning the object base...
void addComponent(MultiComponentStateAssembler::Cache &cache, ComponentParameters &&multiComponentState)
Method to add a single set of Trk::ComponentParameters to the cached Trk::MultiComponentState object ...
Ensure that the ATLAS eigen extensions are properly loaded.
std::vector< ComponentParameters > MultiComponentState