diff --git a/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h b/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h index 436957fcf729d..bd5f866e2f21f 100644 --- a/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h +++ b/RecoVertex/PrimaryVertexProducer/interface/SequentialPrimaryVertexFitterAdapter.h @@ -15,7 +15,7 @@ class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase { public: SequentialPrimaryVertexFitterAdapter() : fitter(nullptr){}; - SequentialPrimaryVertexFitterAdapter(VertexFitter<5>* vertex_fitter) : fitter(vertex_fitter){}; + SequentialPrimaryVertexFitterAdapter(const VertexFitter<5>* vertex_fitter) : fitter(vertex_fitter){}; ~SequentialPrimaryVertexFitterAdapter() override = default; std::vector fit(const std::vector& dummy, @@ -41,6 +41,6 @@ class SequentialPrimaryVertexFitterAdapter : public PrimaryVertexFitterBase { protected: // configuration - VertexFitter<5>* fitter; // Kalman or Adaptive + const VertexFitter<5>* fitter; // Kalman or Adaptive }; #endif diff --git a/RecoVertex/PrimaryVertexProducer/interface/WeightedMeanFitter.h b/RecoVertex/PrimaryVertexProducer/interface/WeightedMeanFitter.h index 810902c4a42ea..881bf2014187c 100644 --- a/RecoVertex/PrimaryVertexProducer/interface/WeightedMeanFitter.h +++ b/RecoVertex/PrimaryVertexProducer/interface/WeightedMeanFitter.h @@ -460,7 +460,7 @@ namespace WeightedMeanFitter { // adapter for the multiprimaryvertexfitter scheme // this code was originally introduced as part of PrimaryVertexProducer.cc -// by Adriano Dee et.al., then moved here with minor modifications +// by Adriano Di Florio , Giorgio Pizzati et.al. in #39995, then moved here with minor modifications class WeightedMeanPrimaryVertexEstimator : public PrimaryVertexFitterBase { public: WeightedMeanPrimaryVertexEstimator() = default; diff --git a/RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc b/RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc index 0b6e6f7cda4e8..b8536fe59d749 100644 --- a/RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc +++ b/RecoVertex/PrimaryVertexProducer/plugins/PrimaryVertexProducer.cc @@ -205,13 +205,12 @@ void PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& i std::vector t_tks; if (useTransientTrackTime_) { - edm::Handle > trackTimeResosH; - iEvent.getByToken(trkTimeResosToken, trackTimeResosH); + auto const& trackTimeResos_ = iEvent.get(trkTimeResosToken); + auto trackTimes_ = iEvent.get(trkTimesToken); if (useMVASelection_) { trackMTDTimeQualities_ = iEvent.get(trackMTDTimeQualityToken); - trackTimes_ = iEvent.get(trkTimesToken); for (unsigned int i = 0; i < (*tks).size(); i++) { const reco::TrackRef ref(tks, i); auto const trkTimeQuality = trackMTDTimeQualities_[ref]; @@ -219,9 +218,9 @@ void PrimaryVertexProducer::produce(edm::Event& iEvent, const edm::EventSetup& i trackTimes_[ref] = std::numeric_limits::max(); } } - t_tks = (*theB).build(tks, beamSpot, trackTimes_, *(trackTimeResosH.product())); + t_tks = (*theB).build(tks, beamSpot, trackTimes_, trackTimeResos_); } else { - t_tks = (*theB).build(tks, beamSpot, iEvent.get(trkTimesToken), *(trackTimeResosH.product())); + t_tks = (*theB).build(tks, beamSpot, trackTimes_, trackTimeResos_); } } else { t_tks = (*theB).build(tks, beamSpot); diff --git a/RecoVertex/PrimaryVertexProducer/src/AdaptiveChisquarePrimaryVertexFitter.cc b/RecoVertex/PrimaryVertexProducer/src/AdaptiveChisquarePrimaryVertexFitter.cc index 4b5bb01c270ca..199e0918e6380 100644 --- a/RecoVertex/PrimaryVertexProducer/src/AdaptiveChisquarePrimaryVertexFitter.cc +++ b/RecoVertex/PrimaryVertexProducer/src/AdaptiveChisquarePrimaryVertexFitter.cc @@ -258,19 +258,19 @@ double AdaptiveChisquarePrimaryVertexFitter::update(const reco::BeamSpot &beamsp // initial value for S, 0 or inverse of the beamspot covariance matrix Error3 S0; - double c0 = 0, c1 = 0, c2 = 0; + double c_beam[3] = {0, 0, 0}; if (beam_weight > 0) { S0 = get_inverse_beam_covariance(beamspot); - c0 = -(S0(0, 0) * beamspot.x0() + S0(0, 1) * beamspot.y0() + S0(0, 2) * beamspot.z0()); - c1 = -(S0(1, 0) * beamspot.x0() + S0(1, 1) * beamspot.y0() + S0(1, 2) * beamspot.z0()); - c2 = -(S0(2, 0) * beamspot.x0() + S0(2, 1) * beamspot.y0() + S0(2, 2) * beamspot.z0()); + for (unsigned int j = 0; j < 3; j++) { + c_beam[j] = -(S0(j, 0) * beamspot.x0() + S0(j, 1) * beamspot.y0() + S0(j, 2) * beamspot.z0()); + } } for (unsigned int k = 0; k < nv; k++) { rho_vtx = 0; Error3 S(S0); // sum track contributions - double c[3] = {c0, c1, c2}; + double c[3] = {c_beam[0], c_beam[1], c_beam[2]}; for (unsigned int j = tkfirstv_[k]; j < tkfirstv_[k + 1]; j++) { const unsigned int i = tkmap_[j]; const auto w = tkweight_[j]; diff --git a/RecoVertex/PrimaryVertexProducer/src/VertexTimeAlgorithmFromTracksPID.cc b/RecoVertex/PrimaryVertexProducer/src/VertexTimeAlgorithmFromTracksPID.cc index a777fbab6cddb..db1fd074b4621 100644 --- a/RecoVertex/PrimaryVertexProducer/src/VertexTimeAlgorithmFromTracksPID.cc +++ b/RecoVertex/PrimaryVertexProducer/src/VertexTimeAlgorithmFromTracksPID.cc @@ -35,27 +35,27 @@ void VertexTimeAlgorithmFromTracksPID::fillPSetDescription(edm::ParameterSetDesc VertexTimeAlgorithmBase::fillPSetDescription(iDesc); iDesc.add("trackMTDTimeVMapTag", edm::InputTag("trackExtenderWithMTD:generalTracktmtd")) - ->setComment(""); + ->setComment("Input ValueMap for track time at MTD"); iDesc.add("trackMTDTimeErrorVMapTag", edm::InputTag("trackExtenderWithMTD:generalTracksigmatmtd")) - ->setComment(""); + ->setComment("Input ValueMap for track time uncertainty at MTD"); iDesc.add("trackMTDTimeQualityVMapTag", edm::InputTag("mtdTrackQualityMVA:mtdQualMVA")) - ->setComment(""); + ->setComment("Input ValueMap for track MVA quality value"); iDesc.add("trackMTDTofPiVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofPi")) - ->setComment(""); + ->setComment("Input ValueMap for track tof as pion"); iDesc.add("trackMTDTofKVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofK")) - ->setComment(""); + ->setComment("Input ValueMap for track tof as kaon"); iDesc.add("trackMTDTofPVMapTag", edm::InputTag("trackExtenderWithMTD:generalTrackTofP")) - ->setComment(""); + ->setComment("Input ValueMap for track tof as proton"); - iDesc.add("minTrackVtxWeight", 0.5)->setComment(""); - iDesc.add("minTrackTimeQuality", 0.8)->setComment(""); + iDesc.add("minTrackVtxWeight", 0.5)->setComment("Minimum track weight"); + iDesc.add("minTrackTimeQuality", 0.8)->setComment("Minimum MVA Quality selection on tracks"); - iDesc.add("probPion", 0.7)->setComment(""); - iDesc.add("probKaon", 0.2)->setComment(""); - iDesc.add("probProton", 0.1)->setComment(""); + iDesc.add("probPion", 0.7)->setComment("A priori probability pions"); + iDesc.add("probKaon", 0.2)->setComment("A priori probability kaons"); + iDesc.add("probProton", 0.1)->setComment("A priori probability protons"); - iDesc.add("Tstart", 256.)->setComment(""); - iDesc.add("coolingFactor", 0.5)->setComment(""); + iDesc.add("Tstart", 256.)->setComment("DA initial temperature T"); + iDesc.add("coolingFactor", 0.5)->setComment("DA cooling factor"); } void VertexTimeAlgorithmFromTracksPID::setEvent(edm::Event& iEvent, edm::EventSetup const&) {