9 combinationDone(
false),
11 theValidWeightSum(0.),
12 theInvalidWeightSum(0.)
28 <<
"MultiTrajectoryStateAssembler: trying to add states after combination";
33 throw cms::Exception(
"LogicError") <<
"MultiTrajectoryStateAssembler: trying to add invalid state";
49 <<
"MultiTrajectoryStateAssembler: trying to add states after combination";
55 double pzFirst =
theStates.empty() ? 0. :
theStates.front().localParameters().pzSign();
56 for ( MultiTSOS::const_iterator
i=states.begin();
57 i!=states.end();
i++ ) {
58 if ( !(
i->isValid()) )
60 <<
"MultiTrajectoryStateAssembler: trying to add invalid state";
65 pzFirst*
i->localParameters().pzSign()<0. )
thePzError =
true;
157 reweightedStates.reserve(
theStates.size());
159 auto oldWeight = is.weight();
160 reweightedStates.emplace_back(factor*oldWeight,
161 is.localParameters(),
164 &(is.globalParameters().magneticField()),
178 if ( totalWeight == 0. ) {
190 <<
"MultiTrajectoryStateAssembler: found at least one state with inconsistent pz\n"
191 <<
" #state / weights before cleaning = " <<
theStates.size()
199 meanPz += is.weight()*is.localParameters().pzSign();
207 for (
auto const & is :oldStates) {
208 if ( meanPz*is.localParameters().pzSign()>=0. ) {
213 theInvalidWeightSum += is.weight();
215 <<
"removing weight / pz / global position = " << is.weight()
216 <<
" " << is.localParameters().pzSign()
217 <<
" " << is.globalPosition();
222 <<
" #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()
volatile std::atomic< bool > shutdown_flag false
std::vector< TrajectoryStateOnSurface > MultiTSOS
bool prepareCombinedState()
Preparation of combined state (cleaning & sorting)
TrajectoryStateOnSurface combinedState()
bool invalidCombinedState() const
Checks status of combined state.