41 (
const vector<VertexHit>& hits,
float z0,
float & chi)
46 for(vector<VertexHit>::const_iterator
hit = hits.begin();
50 float p = 2 * fabs(
hit->
z - z0)/
hit->r + 0.5;
52 if(fabs(p -
hit->w) <= 1.)
54 chi += fabs(p -
hit->w);
68 produces<reco::VertexCollection>();
99 if(thePixelHits->
size() > 0)
101 vector<VertexHit> hits;
104 recHit = thePixelHits->
data().begin(),
105 recHitEnd = thePixelHits->
data().end();
106 recHit != recHitEnd; ++recHit)
108 if(recHit->isValid())
111 DetId id = recHit->geographicalId();
115 vector<SiPixelCluster::Pixel> pixels = recHit->cluster()->pixels();
117 bool pixelOnEdge =
false;
118 for(vector<SiPixelCluster::Pixel>::const_iterator
119 pixel = pixels.begin(); pixel!= pixels.end(); pixel++)
121 int pos_x = (int)pixel->x;
122 int pos_y = (
int)pixel->y;
126 { pixelOnEdge =
true;
break; }
135 recHit->localPosition().y(),
136 recHit->localPosition().z());
143 hit.w = recHit->cluster()->sizeY();
150 int nhits;
int nhits_max = 0;
151 float chi;
float chi_max = 1
e+9;
155 for(
float z0 = -15.9; z0 <= 15.95; z0 += 0.1)
157 nhits = getContainedHits(hits, z0, chi);
161 if(nhits > nhits_max)
162 { chi_max = 1
e+9; nhits_max =
nhits; }
164 if(nhits >= nhits_max)
166 { chi_max = chi; zest = z0; }
171 <<
" [vertex position] estimated = " << zest
172 <<
" | pixel barrel hits = " << thePixelHits->
size();
175 err(2,2) = 0.6 * 0.6;
177 vertices->push_back(ver);
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
math::Error< dimension >::type Error
covariance error matrix (3x3)
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual void produce(edm::StreamID, edm::Event &ev, const edm::EventSetup &es) const override
~PixelVertexProducerClusters()
virtual bool isItEdgePixelInX(int ixbin) const =0
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
T const * product() const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
T const * product() const
virtual bool isItEdgePixelInY(int iybin) const =0
PixelVertexProducerClusters(const edm::ParameterSet &ps)
virtual const TrackerGeomDet * idToDet(DetId) const