ATLAS Offline Software
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 
21 #ifndef MultiComponentStateAssembler_H
22 #define MultiComponentStateAssembler_H
23 
26 #include <vector>
27 
28 namespace Trk {
29 
34 namespace MultiComponentStateAssembler {
35 struct Cache {
36  Cache() {
38  }
40  double validWeightSum = 0;
41  double invalidWeightSum = 0;
42  static constexpr double minimumValidFraction = 0.01;
43  static constexpr double minimumFractionalWeight = 1e-09;
44 };
45 
48 void
51  ComponentParameters&& multiComponentState);
52 
55 void
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
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::MultiComponentStateAssembler::assembledState
MultiComponentState assembledState(MultiComponentStateAssembler::Cache &&cache)
Method to return the cached state object - it performs a reweighting before returning the object base...
Definition: MultiComponentStateAssembler.cxx:120
Trk::MultiComponentStateAssembler::Cache::Cache
Cache()
Definition: MultiComponentStateAssembler.h:36
Trk::MultiComponentStateAssembler::Cache
Definition: MultiComponentStateAssembler.h:35
GSFConstants::maxNumberofStateComponents
constexpr int8_t maxNumberofStateComponents
Note the Gaussian sum approach as describe e.g in " Optimal Filtering" Anderson and Moore "Track Fitt...
Definition: GsfConstants.h:47
Trk::MultiComponentStateAssembler::Cache::minimumValidFraction
static constexpr double minimumValidFraction
Definition: MultiComponentStateAssembler.h:42
Trk::MultiComponentState
std::vector< ComponentParameters > MultiComponentState
Definition: ComponentParameters.h:27
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::MultiComponentStateAssembler::Cache::minimumFractionalWeight
static constexpr double minimumFractionalWeight
Definition: MultiComponentStateAssembler.h:43
Trk::MultiComponentStateAssembler::Cache::invalidWeightSum
double invalidWeightSum
Definition: MultiComponentStateAssembler.h:41
Trk::ComponentParameters
Definition: ComponentParameters.h:22
ComponentParameters.h
Definition of component parameters for use in a mixture of many components. In this regime each track...
Trk::MultiComponentStateAssembler::Cache::multiComponentState
Trk::MultiComponentState multiComponentState
Definition: MultiComponentStateAssembler.h:39
Trk::MultiComponentStateAssembler::addMultiState
void addMultiState(MultiComponentStateAssembler::Cache &cache, Trk::MultiComponentState &&multiComponentState)
Method to add a new Trk::MultiComponentState to the cached Trk::MultiComponentState object under cons...
Definition: MultiComponentStateAssembler.h:79
GsfConstants.h
Trk::MultiComponentStateAssembler::Cache::validWeightSum
double validWeightSum
Definition: MultiComponentStateAssembler.h:40
Trk::MultiComponentStateAssembler::addComponent
void addComponent(MultiComponentStateAssembler::Cache &cache, ComponentParameters &&multiComponentState)
Method to add a single set of Trk::ComponentParameters to the cached Trk::MultiComponentState object ...
Definition: MultiComponentStateAssembler.h:71