14 : verbose_(conf.getParameter<
int>(
"Verbosity") )
15 , ptMin_ (conf.getParameter<double>(
"PtMin") )
16 , method2 ( conf.getParameter<bool>(
"Method2") )
19 , token_BeamSpot ( consumes<
reco::
BeamSpot> (conf.getParameter<
edm::InputTag>(
"beamSpot") ) )
22 produces<reco::VertexCollection>();
39 if ( conf.
exists(
"PVcomparer") ) {
41 track_pt_min = PVcomparerPSet.
getParameter<
double>(
"track_pt_min");
42 if (track_pt_min !=
ptMin_) {
44 edm::LogInfo(
"PixelVertexProducer") <<
"minimum track pT setting differs between PixelVertexProducer (" <<
ptMin_ <<
") and PVcomparer (" << track_pt_min <<
") [PVcomparer considers tracks w/ lower threshold than PixelVertexProducer does] !!!";
46 edm::LogInfo(
"PixelVertexProducer") <<
"minimum track pT setting differs between PixelVertexProducer (" <<
ptMin_ <<
") and PVcomparer (" << track_pt_min <<
") !!!";
48 track_pt_max = PVcomparerPSet.
getParameter<
double>(
"track_pt_max");
49 track_chi2_max = PVcomparerPSet.
getParameter<
double>(
"track_chi2_max");
50 track_prob_min = PVcomparerPSet.
getParameter<
double>(
"track_prob_min");
53 if (finder ==
"DivisiveVertexFinder") {
78 for (
unsigned int i=0;
i<tracks.size();
i++) {
82 if (
verbose_ > 0)
edm::LogInfo(
"PixelVertexProducer") <<
": Selected " << trks.
size() <<
" of these tracks for vertexing\n";
90 auto vertexes = std::make_unique<reco::VertexCollection>();
106 edm::LogInfo(
"PixelVertexProducer") <<
"Vertex number " <<
i <<
" has " << (*vertexes)[
i].tracksSize() <<
" tracks with a position of " << (*vertexes)[
i].z() <<
" +- " <<
std::sqrt( (*
vertexes)[
i].covariance(2,2) );
116 double z=(*vertexes)[
i].z();
121 for (std::vector<reco::TrackBaseRef >::const_iterator it = (*
vertexes)[
i].tracks_begin();
122 it !=(*vertexes)[
i].tracks_end(); it++) {
131 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. Using returning vertexes with (0,0,Z) ";
139 if ( (bse.cxx() <= 0.) ||
141 (bse.czz() <= 0.) ) {
148 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Beamspot with invalid errors " << bse.matrix() << std::endl
149 <<
"Will put Vertex derived from dummy-fake BeamSpot into Event.\n" 150 << (*vertexes)[0].x() <<
"\n" 151 << (*vertexes)[0].y() <<
"\n" 152 << (*vertexes)[0].z() <<
"\n";
157 edm::LogInfo(
"PixelVertexProducer") <<
"No vertices found. Will put Vertex derived from BeamSpot into Event:\n" 158 << (*vertexes)[0].x() <<
"\n" 159 << (*vertexes)[0].y() <<
"\n" 160 << (*vertexes)[0].z() <<
"\n";
166 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
double dydz() const
dydz slope
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
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
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
DivisiveVertexFinder * dvf_
double y0() const
y coordinate
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
virtual void produce(edm::Event &, const edm::EventSetup &) override
Covariance3DMatrix rotatedCovariance3D() const
double x0() const
x coordinate