15 : verbose_(conf.getParameter<
int>(
"Verbosity")),
17 ptMin_(conf.getParameter<double>(
"PtMin")),
18 method2(conf.getParameter<
bool>(
"Method2")),
23 produces<reco::VertexCollection>();
39 if (conf.
exists(
"PVcomparer")) {
41 track_pt_min = PVcomparerPSet.
getParameter<
double>(
"track_pt_min");
42 if (track_pt_min !=
ptMin_) {
45 <<
"minimum track pT setting differs between PixelVertexProducer (" <<
ptMin_ <<
") and PVcomparer (" 46 << track_pt_min <<
") [PVcomparer considers tracks w/ lower threshold than PixelVertexProducer does] !!!";
48 edm::LogInfo(
"PixelVertexProducer") <<
"minimum track pT setting differs between PixelVertexProducer (" 49 <<
ptMin_ <<
") and PVcomparer (" << track_pt_min <<
") !!!";
51 track_pt_max = PVcomparerPSet.
getParameter<
double>(
"track_pt_max");
52 track_chi2_max = PVcomparerPSet.
getParameter<
double>(
"track_chi2_max");
53 track_prob_min = PVcomparerPSet.
getParameter<
double>(
"track_prob_min");
56 if (finder ==
"DivisiveVertexFinder") {
58 edm::LogInfo(
"PixelVertexProducer") <<
": Using the DivisiveVertexFinder\n";
82 edm::LogInfo(
"PixelVertexProducer") <<
": Found " << tracks.size() <<
" tracks in TrackCollection called " 87 for (
unsigned int i = 0;
i < tracks.size();
i++) {
92 edm::LogInfo(
"PixelVertexProducer") <<
": Selected " << trks.
size() <<
" of these tracks for vertexing\n";
102 auto vertexes = std::make_unique<reco::VertexCollection>();
109 edm::LogInfo(
"PixelVertexProducer") <<
"Method2 returned status of " <<
ok;
114 edm::LogInfo(
"PixelVertexProducer") <<
"Method1 returned status of " <<
ok;
119 for (
unsigned int i = 0;
i <
vertexes->size(); ++
i) {
121 <<
"Vertex number " <<
i <<
" has " << (*vertexes)[
i].tracksSize() <<
" tracks with a position of " 129 for (
unsigned int i = 0;
i <
vertexes->size(); ++
i) {
130 double z = (*vertexes)[
i].z();
131 double x = bs.
x0() + bs.
dxdz() * (z - bs.
z0());
132 double y = bs.
y0() + bs.
dydz() * (z - bs.
z0());
139 for (std::vector<reco::TrackBaseRef>::const_iterator it = (*
vertexes)[
i].tracks_begin();
140 it != (*vertexes)[
i].tracks_end();
147 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. Using returning vertexes with (0,0,Z) ";
154 if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
162 <<
"No vertices found. Beamspot with invalid errors " << bse.matrix() << std::endl
163 <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n" 164 << (*vertexes)[0].x() <<
"\n" 165 << (*vertexes)[0].y() <<
"\n" 166 << (*vertexes)[0].z() <<
"\n";
170 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Will put Vertex derived from BeamSpot into Event:\n" 171 << (*vertexes)[0].x() <<
"\n" 172 << (*vertexes)[0].y() <<
"\n" 173 << (*vertexes)[0].z() <<
"\n";
178 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot and no vertex found. No vertex returned.";
T getParameter(std::string const &) const
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 &)
std::vector< Track > TrackCollection
collection of Tracks
bool findVertexesAlt(const reco::TrackRefVector &trks, reco::VertexCollection &vertexes, const math::XYZPoint &bs)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const edm::InputTag trackCollName
const edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
~PixelVertexProducer() override
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.
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
double dxdz() const
dxdz slope
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
void produce(edm::Event &, const edm::EventSetup &) override
Covariance3DMatrix rotatedCovariance3D() const
double x0() const
x coordinate