64 : verbose_(conf.getParameter<int>(
"Verbosity")),
66 ptMin_(conf.getParameter<double>(
"PtMin")),
67 method2(conf.getParameter<bool>(
"Method2")),
68 trackCollName(conf.getParameter<edm::
InputTag>(
"TrackCollection")),
72 produces<reco::VertexCollection>();
79 double zSeparation = conf.
getParameter<
double>(
"ZSeparation");
88 if (conf.
exists(
"PVcomparer")) {
90 track_pt_min = PVcomparerPSet.
getParameter<
double>(
"track_pt_min");
91 if (track_pt_min !=
ptMin_) {
94 <<
"minimum track pT setting differs between PixelVertexProducer (" <<
ptMin_ <<
") and PVcomparer ("
95 << track_pt_min <<
") [PVcomparer considers tracks w/ lower threshold than PixelVertexProducer does] !!!";
97 edm::LogInfo(
"PixelVertexProducer") <<
"minimum track pT setting differs between PixelVertexProducer ("
98 <<
ptMin_ <<
") and PVcomparer (" << track_pt_min <<
") !!!";
100 track_pt_max = PVcomparerPSet.
getParameter<
double>(
"track_pt_max");
101 track_chi2_max = PVcomparerPSet.
getParameter<
double>(
"track_chi2_max");
102 track_prob_min = PVcomparerPSet.
getParameter<
double>(
"track_prob_min");
105 if (finder ==
"DivisiveVertexFinder") {
107 edm::LogInfo(
"PixelVertexProducer") <<
": Using the DivisiveVertexFinder\n";
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
PixelVertexProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
bool findVertexesAlt(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes, const math::XYZPoint &bs)
void add(Ref const &r, float w=1.0)
add a reference to a Track
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const edm::InputTag trackCollName
auto const & tracks
cannot be loose
const edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
~PixelVertexProducer() override
double dydz() const
dydz slope
ptMin_(conf.getParameter< double >("ptMin"))
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
T getParameter(std::string const &) const
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
void produce(edm::Event &, const edm::EventSetup &) override
Covariance3DMatrix rotatedCovariance3D() const
Log< level::Warning, false > LogWarning
double x0() const
x coordinate