9 : combinationDone(
false), thePzError(
false), theValidWeightSum(0.), theInvalidWeightSum(0.) {
23 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryStateAssembler: trying to add states after combination";
28 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryStateAssembler: trying to add invalid state";
42 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryStateAssembler: trying to add states after combination";
48 double pzFirst =
theStates.empty() ? 0. :
theStates.front().localParameters().pzSign();
49 for (MultiTSOS::const_iterator
i = states.begin();
i != states.end();
i++) {
51 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryStateAssembler: trying to add invalid state";
55 if (!
theStates.empty() && pzFirst *
i->localParameters().pzSign() < 0.)
153 reweightedStates.reserve(
theStates.size());
155 auto oldWeight = is.weight();
156 reweightedStates.emplace_back(factor * oldWeight,
157 is.localParameters(),
160 &(is.globalParameters().magneticField()),
171 if (totalWeight == 0.) {
183 LogDebug(
"GsfTrackFitters") <<
"MultiTrajectoryStateAssembler: found at least one state with inconsistent pz\n"
184 <<
" #state / weights before cleaning = " <<
theStates.size() <<
" / "
191 meanPz += is.weight() * is.localParameters().pzSign();
199 for (
auto const &is : oldStates) {
200 if (meanPz * is.localParameters().pzSign() >= 0.) {
202 theStates.push_back(is);
204 theInvalidWeightSum += is.weight();
205 LogDebug(
"GsfTrackFitters") <<
"removing weight / pz / global position = " << is.weight() <<
" "
206 << is.localParameters().pzSign() <<
" " << is.globalPosition();
209 LogDebug(
"GsfTrackFitters") <<
" #state / weights after cleaning = " << theStates.size() <<
" / "
void addState(const TrajectoryStateOnSurface)
double theInvalidWeightSum
void addStateVector(const MultiTSOS &)
void removeSmallWeights()
Container::value_type value_type
void removeWrongPz()
Removes states with local p_z != average p_z.
float minFractionalWeight
void addInvalidState(const double)
Adds (the weight of an) invalid state to the list.
TrajectoryStateOnSurface reweightedCombinedState(const double) const
TrajectoryStateOnSurface TSOS
MultiTrajectoryStateAssembler()
std::vector< TrajectoryStateOnSurface > MultiTSOS
bool prepareCombinedState()
Preparation of combined state (cleaning & sorting)
TrajectoryStateOnSurface combinedState()
bool invalidCombinedState() const
Checks status of combined state.