51 produces<reco::VertexCollection>();
67 theTracker = trackerHandle.
product();
72 (
const vector<VertexHit>& hits,
float z0,
float & chi)
77 for(vector<VertexHit>::const_iterator
hit = hits.begin();
81 float p = 2 * fabs(
hit->
z - z0)/
hit->r + 0.5;
83 if(fabs(p -
hit->w) <= 1.)
85 chi += fabs(p -
hit->w);
110 if(thePixelHits->
size() > 0)
112 vector<VertexHit> hits;
115 recHit = thePixelHits->
data().begin(),
116 recHitEnd = thePixelHits->
data().end();
117 recHit != recHitEnd; ++recHit)
119 if(recHit->isValid())
122 DetId id = recHit->geographicalId();
126 vector<SiPixelCluster::Pixel> pixels = recHit->cluster()->pixels();
128 bool pixelOnEdge =
false;
129 for(vector<SiPixelCluster::Pixel>::const_iterator
130 pixel = pixels.begin(); pixel!= pixels.end(); pixel++)
132 int pos_x = (int)pixel->x;
133 int pos_y = (
int)pixel->y;
137 { pixelOnEdge =
true;
break; }
146 recHit->localPosition().y(),
147 recHit->localPosition().z());
149 GlobalPoint gpos = theTracker->idToDet(
id)->toGlobal(lpos);
154 hit.
w = recHit->cluster()->sizeY();
161 int nhits;
int nhits_max = 0;
162 float chi;
float chi_max = 1
e+9;
166 for(
float z0 = -15.9; z0 <= 15.95; z0 += 0.1)
168 nhits = getContainedHits(hits, z0, chi);
172 if(nhits > nhits_max)
173 { chi_max = 1
e+9; nhits_max = nhits; }
175 if(nhits >= nhits_max)
177 { chi_max = chi; zest = z0; }
182 <<
" [vertex position] estimated = " << zest
183 <<
" | pixel barrel hits = " << thePixelHits->
size();
186 err(2,2) = 0.6 * 0.6;
188 vertices->push_back(ver);
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
~PixelVertexProducerClusters()
virtual bool isItEdgePixelInX(int ixbin) const =0
int getContainedHits(const std::vector< VertexHit > &hits, float z0, float &chi)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
data_type const * data(size_t cell) const
math::XYZPoint Point
point in the space
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T const * product() const
T const * product() const
virtual bool isItEdgePixelInY(int iybin) const =0
void beginRun(edm::Run const &run, edm::EventSetup const &es) override
virtual void produce(edm::Event &ev, const edm::EventSetup &es) override
PixelVertexProducerClusters(const edm::ParameterSet &ps)