50 produces<reco::VertexCollection>();
66 theTracker = trackerHandle.
product();
71 (vector<VertexHit> hits,
float z0,
float & chi)
76 for(vector<VertexHit>::const_iterator
hit = hits.begin();
80 float p = 2 * fabs(
hit->
z - z0)/
hit->r + 0.5;
82 if(fabs(p -
hit->w) <= 1.)
84 chi += fabs(p -
hit->w);
104 if(thePixelHits->
size() > 0)
106 vector<VertexHit> hits;
109 recHit = thePixelHits->
data().begin(),
110 recHitEnd = thePixelHits->
data().end();
111 recHit != recHitEnd; ++recHit)
113 if(recHit->isValid())
116 DetId id = recHit->geographicalId();
120 vector<SiPixelCluster::Pixel> pixels = recHit->cluster()->pixels();
122 bool pixelOnEdge =
false;
123 for(vector<SiPixelCluster::Pixel>::const_iterator
124 pixel = pixels.begin(); pixel!= pixels.end(); pixel++)
126 int pos_x = (int)pixel->x;
127 int pos_y = (
int)pixel->y;
131 { pixelOnEdge =
true;
break; }
140 recHit->localPosition().y(),
141 recHit->localPosition().z());
143 GlobalPoint gpos = theTracker->idToDet(
id)->toGlobal(lpos);
148 hit.
w = recHit->cluster()->sizeY();
155 int nhits;
int nhits_max = 0;
156 float chi;
float chi_max = 1
e+9;
160 for(
float z0 = -15.9; z0 <= 15.95; z0 += 0.1)
162 nhits = getContainedHits(hits, z0, chi);
166 if(nhits > nhits_max)
167 { chi_max = 1
e+9; nhits_max = nhits; }
169 if(nhits >= nhits_max)
171 { chi_max = chi; zest = z0; }
176 <<
" [vertex position] estimated = " << zest
177 <<
" | pixel barrel hits = " << thePixelHits->
size();
180 err(2,2) = 0.6 * 0.6;
182 vertices->push_back(ver);
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void beginRun(edm::Run const &run, edm::EventSetup const &es)
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(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
virtual void produce(edm::Event &ev, const edm::EventSetup &es)
PixelVertexProducerClusters(const edm::ParameterSet &ps)