Description: This produces 1D (z only) primary vertexes using only pixel information.
Implementation: This producer can use either the Divisive Primary Vertex Finder or the Histogramming Primary Vertex Finder (currently not implemented). It relies on the PixelTripletProducer and PixelTrackProducer having already been run upstream. This is code ported from ORCA originally written by S Cucciarelli, M Konecki, D Kotlinski.
Definition at line 41 of file PixelVertexProducer.cc.
Definition at line 125 of file PixelVertexProducer.cc.
References reco::Vertex::add(), cms::cuda::bs, HLT_FULL_cff::chi2, dvf_, reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), relativeConstraints::error, DivisiveVertexFinder::findVertexes(), DivisiveVertexFinder::findVertexesAlt(), edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), method2, eostools::move(), ndof, convertSQLiteXML::ok, reco::BeamSpot::position(), edm::Handle< T >::product(), DiDispStaMuonMonitor_cfi::pt, ptMin_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), reco::BeamSpot::rotatedCovariance3D(), edm::RefVector< C, T, F >::size(), mathSSE::sqrt(), token_BeamSpot, token_Tracks, HLT_FULL_cff::trackCollection, trackCollName, tracks, findQualityFiles::v, verbose_, x, reco::BeamSpot::x0(), y, reco::BeamSpot::y0(), z, and reco::BeamSpot::z0().
131 edm::LogInfo(
"PixelVertexProducer") <<
": Found " << tracks.size() <<
" tracks in TrackCollection called "
136 for (
unsigned int i = 0;
i < tracks.size();
i++) {
141 edm::LogInfo(
"PixelVertexProducer") <<
": Selected " << trks.
size() <<
" of these tracks for vertexing\n";
151 auto vertexes = std::make_unique<reco::VertexCollection>();
158 edm::LogInfo(
"PixelVertexProducer") <<
"Method2 returned status of " <<
ok;
163 edm::LogInfo(
"PixelVertexProducer") <<
"Method1 returned status of " <<
ok;
167 edm::LogInfo(
"PixelVertexProducer") <<
": Found " << vertexes->size() <<
" vertexes\n";
168 for (
unsigned int i = 0;
i < vertexes->size(); ++
i) {
170 <<
"Vertex number " <<
i <<
" has " << (*vertexes)[
i].tracksSize() <<
" tracks with a position of "
171 << (*vertexes)[
i].z() <<
" +- " <<
std::sqrt((*vertexes)[
i].covariance(2, 2));
178 for (
unsigned int i = 0;
i < vertexes->size(); ++
i) {
179 double z = (*vertexes)[
i].z();
180 double x = bs.
x0() + bs.
dxdz() * (z - bs.
z0());
181 double y = bs.
y0() + bs.
dydz() * (z - bs.
z0());
184 (*vertexes)[
i].
chi2(),
185 (*vertexes)[
i].
ndof(),
186 (*vertexes)[
i].tracksSize());
188 for (std::vector<reco::TrackBaseRef>::const_iterator it = (*vertexes)[
i].tracks_begin();
189 it != (*vertexes)[
i].tracks_end();
196 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. Using returning vertexes with (0,0,Z) ";
199 if (vertexes->empty() && bsHandle.
isValid()) {
203 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
211 <<
"No vertices found. Beamspot with invalid errors " << bse.matrix() << std::endl
212 <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n"
213 << (*vertexes)[0].x() <<
"\n"
214 << (*vertexes)[0].y() <<
"\n"
215 << (*vertexes)[0].z() <<
"\n";
219 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Will put Vertex derived from BeamSpot into Event:\n"
220 << (*vertexes)[0].x() <<
"\n"
221 << (*vertexes)[0].y() <<
"\n"
222 << (*vertexes)[0].z() <<
"\n";
226 else if (vertexes->empty() && !bsHandle.
isValid()) {
227 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot and no vertex found. No vertex returned.";
double z0() const
z coordinate
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::TrackCollection > token_Tracks
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
bool findVertexesAlt(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes, const math::XYZPoint &bs)
const edm::InputTag trackCollName
auto const & tracks
cannot be loose
const edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
double dydz() const
dydz slope
math::XYZPoint Point
point in the space
bool findVertexes(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes)
Run the divisive algorithm and return a vector of vertexes for the input track collection.
double dxdz() const
dxdz slope
Log< level::Info, false > LogInfo
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
DivisiveVertexFinder * dvf_
double y0() const
y coordinate
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
const Point & position() const
position
Covariance3DMatrix rotatedCovariance3D() const
Log< level::Warning, false > LogWarning
double x0() const
x coordinate