File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
TrackingTools/GsfTools/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,23 @@ void MultiTrajectoryStateAssembler::removeWrongPz() {
190190 for (auto const &is : theStates)
191191 meanPz += is.weight () * is.localParameters ().pzSign ();
192192 meanPz /= theValidWeightSum;
193+
194+ // When meanPz=0 it is not possible to check which are the states non agreeing with the average pZ sign
195+ if (meanPz == 0 .) {
196+ edm::LogError (" MultiTrajectoryStateAssembler" )
197+ << " input multistate has average pZ sign == 0. Rejecting!" << std::endl;
198+ theStates.clear ();
199+ return ;
200+ }
201+
193202 //
194203 // Now keep only states compatible with the average pz
195204 //
196205 theValidWeightSum = 0 .;
197206 MultiTSOS oldStates (theStates);
198207 theStates.clear ();
199208 for (auto const &is : oldStates) {
200- if (meanPz * is.localParameters ().pzSign () >= 0 .) {
209+ if (meanPz * is.localParameters ().pzSign () > 0 .) {
201210 theValidWeightSum += is.weight ();
202211 theStates.push_back (is);
203212 } else {
You can’t perform that action at this time.
0 commit comments