162 if (recoBeamSpotHandle.
isValid()) {
165 edm::LogError(
"UnusableBeamSpot") <<
"No beam spot available from EventSetup";
170 if ((beamVertexState.error().cxx() <= 0.) || (beamVertexState.error().cyy() <= 0.) ||
171 (beamVertexState.error().czz() <= 0.)) {
172 edm::LogError(
"UnusableBeamSpot") <<
"Beamspot with invalid errors " << beamVertexState.error().matrix();
180 for (
auto const& old : oldVertices) {
181 if (!(old.isFake())) {
184 auto result = std::make_unique<reco::VertexCollection>();
200 auto result = std::make_unique<reco::VertexCollection>();
204 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
211 std::cout <<
"RecoVertex/PrimaryVertexProducer: " 212 <<
"Beamspot with invalid errors " << bse.matrix() << std::endl;
213 std::cout <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n";
218 std::cout <<
"RecoVertex/PrimaryVertexProducer: " 219 <<
" will put Vertex derived from BeamSpot into Event.\n";
229 if (
algo.pv_time_estimator) {
230 algo.pv_time_estimator->setEvent(
iEvent, iSetup);
236 std::vector<reco::TransientTrack> t_tks;
245 for (
unsigned int i = 0;
i < (*tks).size();
i++) {
257 t_tks = (*theB).build(tks,
beamSpot);
268 <<
"Clustering returned " <<
clusters.size() <<
" clusters from " << seltks.size() <<
" selected tracks";
273 auto result = std::make_unique<reco::VertexCollection>();
275 std::vector<TransientVertex>
pvs;
283 if (
algorithm->pv_time_estimator !=
nullptr) {
288 if (
pvs.size() > 1) {
293 for (std::vector<TransientVertex>::const_iterator
iv =
pvs.begin();
iv !=
pvs.end();
iv++) {
294 if (
iv->isValid() && (
iv->degreesOfFreedom() >=
algorithm->minNdof)) {
296 if (!validBS || ((*(
algorithm->vertexSelector))(
v, beamVertexState))) {
303 edm::LogPrint(
"PrimaryVertexProducer") <<
"PrimaryVertexProducer \"" <<
algorithm->label <<
"\" contains " 304 <<
pvs.size() <<
" reco::Vertex candidates";
309 <<
"More than 50% of candidate vertices lost (" <<
pvs.size() <<
" out of " <<
clusters.size() <<
")";
312 if (
pvs.empty() && seltks.size() > 5) {
314 <<
"No vertex found with " << seltks.size() <<
" tracks and " <<
clusters.size() <<
" vertex candidates";
319 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
325 edm::LogWarning(
"PrimaryVertexProducer") <<
"Zero recostructed vertices, will put reco::Vertex derived from " 326 "dummy/fake BeamSpot into Event, BeamSpot has invalid errors: " 332 <<
"Zero recostructed vertices, will put reco::Vertex derived from BeamSpot into Event.";
339 for (reco::VertexCollection::const_iterator
v = vColl.begin();
v != vColl.end(); ++
v) {
341 <<
"recvtx " << std::setw(3) <<
std::fixed << ivtx++ <<
" #trk " << std::setw(3) <<
v->tracksSize()
342 <<
" chi2 " << std::setw(5) << std::setprecision(1) <<
v->chi2() <<
" ndof " << std::setw(5)
343 << std::setprecision(1) <<
v->ndof() <<
" x " << std::setw(7) << std::setprecision(4) <<
v->position().x()
344 <<
" dx " << std::setw(6) << std::setprecision(4) <<
v->xError() <<
" y " << std::setw(7)
345 << std::setprecision(4) <<
v->position().y() <<
" dy " << std::setw(6) << std::setprecision(4)
346 <<
v->yError() <<
" z " << std::setw(8) << std::setprecision(4) <<
v->position().z() <<
" dz " 347 << std::setw(6) << std::setprecision(4) <<
v->zError();
348 if (
v->tError() > 0) {
349 edm::LogPrint(
"PrimaryVertexProducer") <<
" t " << std::setw(6) << std::setprecision(3) <<
v->t() <<
" dt " 350 << std::setw(6) << std::setprecision(3) <<
v->tError();
edm::EDGetTokenT< edm::ValueMap< float > > trackMTDTimeQualityToken
edm::EDGetTokenT< reco::BeamSpot > bsToken
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > theTTBToken
std::vector< algo > algorithms
edm::EDGetTokenT< reco::VertexCollection > recoveryVtxToken
edm::EDGetTokenT< reco::TrackCollection > trkToken
TrackClusterizerInZ * theTrackClusterizer
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::ValueMap< float > trackTimes_
Log< level::Error, false > LogError
edm::EDGetTokenT< edm::ValueMap< float > > trkTimesToken
edm::ValueMap< float > trackMTDTimeQualities_
edm::EDGetTokenT< edm::ValueMap< float > > trkTimeResosToken
TrackFilterForPVFindingBase * theTrackFilter
virtual std::vector< reco::TransientTrack > select(const std::vector< reco::TransientTrack > &tracks) const =0
bool useTransientTrackTime_
Log< level::Warning, true > LogPrint
virtual std::vector< TransientVertex > vertices(const std::vector< reco::TransientTrack > &tracks) const =0
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
double minTrackTimeQuality_
Log< level::Warning, false > LogWarning