Definition at line 146 of file PrimaryVertexProducer.cc.
151 if (recoBeamSpotHandle.
isValid()) {
154 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot available from EventSetup";
159 if ((beamVertexState.error().cxx() <= 0.) || (beamVertexState.error().cyy() <= 0.) ||
160 (beamVertexState.error().czz() <= 0.)) {
162 edm::LogError(
"UnusableBeamSpot") <<
"Beamspot with invalid errors " << beamVertexState.error().matrix();
169 for (
auto const& old : oldVertices) {
170 if (!(old.isFake())) {
173 auto result = std::make_unique<reco::VertexCollection>();
189 std::vector<reco::TransientTrack> t_tks;
198 t_tks = (*theB).build(tks,
beamSpot);
201 std::cout <<
"RecoVertex/PrimaryVertexProducer"
202 <<
"Found: " << t_tks.size() <<
" reconstructed tracks"
213 std::cout <<
" clustering returned " <<
clusters.size() <<
" clusters from " << seltks.size()
214 <<
" selected tracks" << std::endl;
219 auto result = std::make_unique<reco::VertexCollection>();
222 std::vector<TransientVertex>
pvs;
223 for (
std::vector<std::vector<reco::TransientTrack> >::const_iterator iclus =
clusters.begin();
229 double meantime = 0.;
232 for (
const auto& tk : *iclus) {
233 const double time = tk.timeExt();
234 const double err = tk.dtErrorExt();
235 const double inverr =
err > 0. ? 1.0 /
err : 0.;
236 const double w = inverr * inverr;
241 meantime = sumwt / sumw;
242 double sumsq = sumwt2 - sumwt * sumwt / sumw;
243 double chisq = iclus->size() > 1 ? sumsq / double(iclus->size() - 1) : sumsq /
double(iclus->size());
244 vartime = chisq / sumw;
248 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
253 auto err =
v.positionError().matrix4D();
259 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
264 auto err =
v.positionError().matrix4D();
277 std::cout <<
"=" <<
v.position().x() <<
" " <<
v.position().y() <<
" " <<
v.position().z();
280 std::cout <<
" cluster size = " << (*iclus).size() << std::endl;
282 std::cout <<
"Invalid fitted vertex, cluster size=" << (*iclus).size() << std::endl;
286 if (
v.isValid() && (
v.degreesOfFreedom() >=
algorithm->minNdof) &&
287 (!validBS || (*(
algorithm->vertexSelector))(
v, beamVertexState)))
292 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" <<
pvs.size() << std::endl;
297 <<
"more than half of candidate vertices lost " <<
pvs.size() <<
' ' <<
clusters.size();
299 if (
pvs.empty() && seltks.size() > 5)
301 <<
"no vertex found with " << seltks.size() <<
" tracks and " <<
clusters.size() <<
" vertex-candidates";
304 if (
pvs.size() > 1) {
309 for (std::vector<TransientVertex>::const_iterator iv =
pvs.begin(); iv !=
pvs.end(); iv++) {
316 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
323 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
324 <<
"Beamspot with invalid errors " << bse.matrix() << std::endl;
325 std::cout <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n";
330 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
331 <<
" will put Vertex derived from BeamSpot into Event.\n";
338 for (reco::VertexCollection::const_iterator
v = vColl.begin();
v != vColl.end(); ++
v) {
339 std::cout <<
"recvtx " << ivtx++ <<
"#trk " << std::setw(3) <<
v->tracksSize() <<
" chi2 " << std::setw(4)
340 <<
v->chi2() <<
" ndof " << std::setw(3) <<
v->ndof() <<
" x " << std::setw(6) <<
v->position().x()
341 <<
" dx " << std::setw(6) <<
v->xError() <<
" y " << std::setw(6) <<
v->position().y() <<
" dy "
342 << std::setw(6) <<
v->yError() <<
" z " << std::setw(6) <<
v->position().z() <<
" dz " << std::setw(6)
345 std::cout <<
" t " << std::setw(6) <<
v->t() <<
" dt " << std::setw(6) <<
v->tError();
References qcdUeDQM_cfi::algorithm, algorithms, pwdgSkimBPark_cfi::beamSpot, bsToken, TrackClusterizerInZ::clusterize(), bsc_activity_cfg::clusters, gather_cfg::cout, GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::cyy(), GlobalErrorBase< T, ErrorWeightType >::czz(), submitPVResolutionJobs::err, VertexState::error(), f4D, fRecoveryIteration, fVerbose, edm::EventSetup::get(), get, iEvent, edm::HandleBase::isValid(), GlobalErrorBase< T, ErrorWeightType >::matrix(), eostools::move(), edm::Handle< T >::product(), FSQDQM_cfi::pvs, recoveryVtxToken, mps_fire::result, TrackFilterForPVFindingBase::select(), theTrackClusterizer, theTrackFilter, ntuplemaker::time, trkTimeResosToken, trkTimesToken, trkToken, findQualityFiles::v, trackerHitRTTI::vector, and w.