14 : verbose_(0), dvf_(0), ptMin_(1.0)
17 produces<reco::VertexCollection>();
25 double zSeparation = conf.
getParameter<
double>(
"ZSeparation");
34 double track_pt_min =
ptMin_;
35 double track_pt_max = 10.;
36 double track_chi2_max = 9999999.;
37 double track_prob_min = -1.;
39 if ( conf.
exists(
"PVcomparer") ) {
41 track_pt_min = PVcomparerPSet.
getParameter<
double>(
"track_pt_min");
42 if (track_pt_min != ptMin_) {
43 if (track_pt_min < ptMin_)
44 edm::LogWarning(
"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") {
54 if (verbose_ > 0)
edm::LogInfo(
"PixelVertexProducer") <<
": Using the DivisiveVertexFinder\n";
55 dvf_ =
new DivisiveVertexFinder(track_pt_min,track_pt_max,track_chi2_max,track_prob_min,zOffset, ntrkMin, useError, zSeparation, wtAverage, verbose_);
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";
104 edm::LogInfo(
"PixelVertexProducer") <<
": Found " << vertexes->size() <<
" vertexes\n";
105 for (
unsigned int i=0;
i<vertexes->size(); ++
i) {
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) );
115 for (
unsigned int i=0;
i<vertexes->size(); ++
i) {
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) ";
134 if(!vertexes->size() && bsHandle.
isValid()){
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";
164 else if(!vertexes->size() && !bsHandle.
isValid())
166 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot and no vertex found. No vertex returned.";
T getParameter(std::string const &) const
double z0() const
z coordinate
virtual void produce(edm::Event &, const edm::EventSetup &)
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
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::InputTag trackCollName
edm::EDGetTokenT< reco::TrackCollection > token_Tracks
double dydz() const
dydz slope
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::BeamSpot > token_BeamSpot
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
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
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
Covariance3DMatrix rotatedCovariance3D() const
double x0() const
x coordinate