diff --git a/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc b/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc index b0a0a59cf74f1..bc5737354372c 100644 --- a/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc +++ b/CommonTools/RecoAlgos/src/PrimaryVertexAssignment.cc @@ -60,7 +60,7 @@ PrimaryVertexAssignment::chargedHadronVertex( const reco::VertexCollection& vert double distmin = std::numeric_limits::max(); double dzmin = std::numeric_limits::max(); double dtmin = std::numeric_limits::max(); - int vtxIdMinDist = -1; + int vtxIdMinSignif = -1; for(IV iv=vertices.begin(); iv!=vertices.end(); ++iv) { double dz = std::abs(track->dz(iv->position())); double dt = std::abs(time-iv->t()); @@ -82,18 +82,18 @@ PrimaryVertexAssignment::chargedHadronVertex( const reco::VertexCollection& vert distmin = dist; dzmin = dz; dtmin = dt; - vtxIdMinDist = iv-vertices.begin(); + vtxIdMinSignif = iv-vertices.begin(); } } // first use "closest in Z" with tight cuts (targetting primary particles) - const float add_cov = vtxIdMinDist >= 0 ? vertices[vtxIdMinDist].covariance(2,2) : 0.f; + const float add_cov = vtxIdMinSignif >= 0 ? vertices[vtxIdMinSignif].covariance(2,2) : 0.f; const float dzE=sqrt(track->dzError()*track->dzError()+add_cov); - if(vtxIdMinDist>=0 and + if(vtxIdMinSignif>=0 and (dzmin < maxDzForPrimaryAssignment_ and dzmin/dzE < maxDzSigForPrimaryAssignment_ and track->dzError()= 0 ) return std::pair(iVertex,PrimaryVertexAssignment::PrimaryDz); @@ -147,13 +147,13 @@ PrimaryVertexAssignment::chargedHadronVertex( const reco::VertexCollection& vert // if the track is not compatible with other PVs but is compatible with the BeamSpot, we may simply have not reco'ed the PV! // we still point it to the closest in Z, but flag it as possible orphan-primary if(!vertices.empty() && std::abs(track->dxy(vertices[0].position()))dxy(vertices[0].position())/track->dxyError())(vtxIdMinDist,PrimaryVertexAssignment::NotReconstructedPrimary); + return std::pair(vtxIdMinSignif,PrimaryVertexAssignment::NotReconstructedPrimary); //FIXME: here we could better handle V0s and NucInt // all other tracks could be non-B secondaries and we just attach them with closest Z - if(vtxIdMinDist>=0) - return std::pair(vtxIdMinDist,PrimaryVertexAssignment::OtherDz); + if(vtxIdMinSignif>=0) + return std::pair(vtxIdMinSignif,PrimaryVertexAssignment::OtherDz); //If for some reason even the dz failed (when?) we consider the track not assigned return std::pair(-1,PrimaryVertexAssignment::Unassigned); } diff --git a/SimTracker/TrackAssociation/plugins/TrackTimeValueMapProducer.cc b/SimTracker/TrackAssociation/plugins/TrackTimeValueMapProducer.cc index c653e79251509..57ce6a73b28cf 100644 --- a/SimTracker/TrackAssociation/plugins/TrackTimeValueMapProducer.cc +++ b/SimTracker/TrackAssociation/plugins/TrackTimeValueMapProducer.cc @@ -70,7 +70,6 @@ class TrackTimeValueMapProducer : public edm::global::EDProducer<> { DEFINE_FWK_MODULE(TrackTimeValueMapProducer); namespace { - constexpr float fakeBeamSpotTimeWidth = 0.300f; // ns constexpr float m_pion = 139.57061e-3; const std::string resolution("Resolution"); diff --git a/TrackingTools/TransientTrack/src/TransientTrackBuilder.cc b/TrackingTools/TransientTrack/src/TransientTrackBuilder.cc index c302da51290e0..51bb6a088a6ad 100644 --- a/TrackingTools/TransientTrack/src/TransientTrackBuilder.cc +++ b/TrackingTools/TransientTrack/src/TransientTrackBuilder.cc @@ -10,7 +10,7 @@ using namespace std; using namespace edm; namespace { - constexpr float fakeBeamSpotTimeWidth = 0.175f; + constexpr float defaultInvalidTrackReso = 0.350f; } TransientTrack TransientTrackBuilder::build (const Track * t) const { @@ -106,10 +106,10 @@ TransientTrackBuilder::build ( const edm::Handle & trkCol TrackRef ref(trkColl, i); double time = trackTimes[ref]; double timeReso = trackTimeResos[ref]; - timeReso = ( timeReso > 1e-6 ? timeReso : 2.0*fakeBeamSpotTimeWidth ); // make the error much larger than the BS time width + timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width if( edm::isNotFinite(time) ) { time = 0.0; - timeReso = 2.0*fakeBeamSpotTimeWidth; + timeReso = defaultInvalidTrackReso; } ttVect.push_back(TransientTrack(ref, time, timeReso, theField, theTrackingGeometry)); } @@ -127,10 +127,10 @@ TransientTrackBuilder::build (const edm::Handle & trkC GsfTrackRef ref(trkColl, i); double time = trackTimes[ref]; double timeReso = trackTimeResos[ref]; - timeReso = ( timeReso > 1e-6 ? timeReso : 2.0*fakeBeamSpotTimeWidth ); // make the error much larger than the BS time width + timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width if( edm::isNotFinite(time) ) { time = 0.0; - timeReso = 2.0*fakeBeamSpotTimeWidth; + timeReso = defaultInvalidTrackReso; } ttVect.push_back( TransientTrack( new GsfTransientTrack(ref, time, timeReso, theField, theTrackingGeometry)) ); @@ -152,10 +152,10 @@ TransientTrackBuilder::build (const edm::Handle > & trkColl, GsfTrackRef ref = RefToBase(trkColl, i).castTo(); double time = trackTimes[ref]; double timeReso = trackTimeResos[ref]; - timeReso = ( timeReso > 1e-6 ? timeReso : 2.0*fakeBeamSpotTimeWidth ); // make the error much larger than the BS time width + timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width if( edm::isNotFinite(time) ) { time = 0.0; - timeReso = 2.0*fakeBeamSpotTimeWidth; + timeReso = defaultInvalidTrackReso; } ttVect.push_back( TransientTrack( new GsfTransientTrack(RefToBase(trkColl, i).castTo(), time, timeReso, theField, theTrackingGeometry)) ); @@ -163,10 +163,10 @@ TransientTrackBuilder::build (const edm::Handle > & trkColl, TrackRef ref = RefToBase(trkColl, i).castTo(); double time = trackTimes[ref]; double timeReso = trackTimeResos[ref]; - timeReso = ( timeReso > 1e-6 ? timeReso : 2.0*fakeBeamSpotTimeWidth ); // make the error much larger than the BS time width + timeReso = ( timeReso > 1e-6 ? timeReso : defaultInvalidTrackReso ); // make the error much larger than the BS time width if( edm::isNotFinite(time) ) { time = 0.0; - timeReso = 2.0*fakeBeamSpotTimeWidth; + timeReso = defaultInvalidTrackReso; } ttVect.push_back(TransientTrack(RefToBase(trkColl, i).castTo(), time, timeReso, theField, theTrackingGeometry)); }