Definition at line 133 of file PrimaryVertexProducer.cc.
138 if (recoBeamSpotHandle.
isValid()) {
141 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot available from EventSetup";
146 if ((beamVertexState.error().cxx() <= 0.) || (beamVertexState.error().cyy() <= 0.) ||
147 (beamVertexState.error().czz() <= 0.)) {
149 edm::LogError(
"UnusableBeamSpot") <<
"Beamspot with invalid errors " << beamVertexState.error().matrix();
160 std::vector<reco::TransientTrack> t_tks;
169 t_tks = (*theB).build(tks,
beamSpot);
172 std::cout <<
"RecoVertex/PrimaryVertexProducer"
173 <<
"Found: " << t_tks.size() <<
" reconstructed tracks"
184 std::cout <<
" clustering returned " <<
clusters.size() <<
" clusters from " << seltks.size()
185 <<
" selected tracks" << std::endl;
190 auto result = std::make_unique<reco::VertexCollection>();
193 std::vector<TransientVertex>
pvs;
194 for (std::vector<std::vector<reco::TransientTrack> >::const_iterator iclus =
clusters.begin();
200 double meantime = 0.;
203 for (
const auto& tk : *iclus) {
204 const double time = tk.timeExt();
205 const double err = tk.dtErrorExt();
206 const double inverr =
err > 0. ? 1.0 /
err : 0.;
207 const double w = inverr * inverr;
212 meantime = sumwt / sumw;
213 double sumsq = sumwt2 - sumwt * sumwt / sumw;
214 double chisq = iclus->size() > 1 ? sumsq / double(iclus->size() - 1) : sumsq /
double(iclus->size());
215 vartime = chisq / sumw;
219 if (
algorithm->useBeamConstraint && validBS && ((*iclus).size() > 1)) {
224 auto err =
v.positionError().matrix4D();
230 }
else if (!(
algorithm->useBeamConstraint) && ((*iclus).size() > 1)) {
235 auto err =
v.positionError().matrix4D();
248 std::cout <<
"=" <<
v.position().x() <<
" " <<
v.position().y() <<
" " <<
v.position().z();
251 std::cout <<
" cluster size = " << (*iclus).size() << std::endl;
253 std::cout <<
"Invalid fitted vertex, cluster size=" << (*iclus).size() << std::endl;
257 if (
v.isValid() && (
v.degreesOfFreedom() >=
algorithm->minNdof) &&
258 (!validBS || (*(
algorithm->vertexSelector))(
v, beamVertexState)))
263 std::cout <<
"PrimaryVertexProducerAlgorithm::vertices candidates =" <<
pvs.size() << std::endl;
268 <<
"more than half of candidate vertices lost " <<
pvs.size() <<
' ' <<
clusters.size();
270 if (
pvs.empty() && seltks.size() > 5)
272 <<
"no vertex found with " << seltks.size() <<
" tracks and " <<
clusters.size() <<
" vertex-candidates";
275 if (
pvs.size() > 1) {
280 for (std::vector<TransientVertex>::const_iterator iv =
pvs.begin(); iv !=
pvs.end(); iv++) {
287 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
294 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
295 <<
"Beamspot with invalid errors " << bse.matrix() << std::endl;
296 std::cout <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n";
301 std::cout <<
"RecoVertex/PrimaryVertexProducer: "
302 <<
" will put Vertex derived from BeamSpot into Event.\n";
309 for (reco::VertexCollection::const_iterator
v = vColl.begin();
v != vColl.end(); ++
v) {
310 std::cout <<
"recvtx " << ivtx++ <<
"#trk " << std::setw(3) <<
v->tracksSize() <<
" chi2 " << std::setw(4)
311 <<
v->chi2() <<
" ndof " << std::setw(3) <<
v->ndof() <<
" x " << std::setw(6) <<
v->position().x()
312 <<
" dx " << std::setw(6) <<
v->xError() <<
" y " << std::setw(6) <<
v->position().y() <<
" dy "
313 << std::setw(6) <<
v->yError() <<
" z " << std::setw(6) <<
v->position().z() <<
" dz " << std::setw(6)
316 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(), runTheMatrix::err, VertexState::error(), f4D, fVerbose, edm::EventSetup::get(), get, iEvent, edm::HandleBase::isValid(), GlobalErrorBase< T, ErrorWeightType >::matrix(), eostools::move(), edm::Handle< T >::product(), FSQDQM_cfi::pvs, mps_fire::result, TrackFilterForPVFindingBase::select(), theTrackClusterizer, theTrackFilter, ntuplemaker::time, trkTimeResosToken, trkTimesToken, trkToken, findQualityFiles::v, and w.