File indexing completed on 2024-04-06 12:31:29
0001 #ifndef MultiGaussianStateAssembler_h_
0002 #define MultiGaussianStateAssembler_h_
0003
0004 #include "TrackingTools/GsfTools/interface/SingleGaussianState.h"
0005 #include "TrackingTools/GsfTools/interface/MultiGaussianState.h"
0006
0007 #include <vector>
0008
0009
0010
0011
0012
0013 template <unsigned int N>
0014 class MultiGaussianStateAssembler {
0015 private:
0016 typedef SingleGaussianState<N> SingleState;
0017 typedef MultiGaussianState<N> MultiState;
0018 typedef typename MultiGaussianState<N>::SingleStatePtr SingleStatePtr;
0019 typedef typename MultiGaussianState<N>::SingleStateContainer SingleStateContainer;
0020
0021 public:
0022
0023
0024
0025 MultiGaussianStateAssembler() = default;
0026
0027
0028
0029
0030 void addState(const MultiState& state);
0031 void addState(const SingleStatePtr& state);
0032
0033
0034
0035
0036 MultiState combinedState();
0037
0038
0039
0040 MultiState combinedState(const float weight);
0041
0042 private:
0043
0044
0045
0046 void addStateVector(const SingleStateContainer&);
0047
0048
0049
0050
0051 bool prepareCombinedState();
0052
0053
0054
0055
0056
0057 MultiState reweightedCombinedState(const double) const;
0058
0059
0060
0061
0062 void removeSmallWeights();
0063
0064 private:
0065 double minFractionalWeight = 1.e-16;
0066
0067 bool combinationDone = false;
0068
0069 double theValidWeightSum = 0;
0070 SingleStateContainer theStates;
0071 };
0072
0073 #include "TrackingTools/GsfTools/interface/MultiGaussianStateAssembler.icc"
0074
0075 #endif