37 void clear()
override;
79 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
83 for (
size_t rhit = 0; rhit <
fraction.size(); ++rhit) {
102 std::vector<KDTreeNodeInfo<reco::PFRecHit const *, 2>> eltList;
109 eltList.push_back(rh1);
114 float phi = rh1.dims[1] - 2 *
M_PI;
116 eltList.push_back(rh2);
120 float phi = rh1.dims[1] + 2 *
M_PI;
122 eltList.push_back(rh3);
146 (*it)->setIsValidMultilinks(
true);
159 double trackx = atECAL.
position().X();
160 double tracky = atECAL.
position().Y();
161 double trackz = atECAL.
position().Z();
168 std::vector<reco::PFRecHit const *>
recHits;
174 const auto &cornersxyz =
recHit->getCornersXYZ();
175 const auto &posxyz =
recHit->position();
176 const auto &rhrep =
recHit->positionREP();
177 const auto &corners =
recHit->getCornersREP();
179 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
180 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
181 if (rhsizephi >
M_PI)
182 rhsizephi = 2. *
M_PI - rhsizephi;
184 double deta = fabs(rhrep.eta() - tracketa);
185 double dphi = fabs(rhrep.phi() - trackphi);
187 dphi = 2. *
M_PI - dphi;
192 for (BlockEltSet::const_iterator clusterIt =
ret->second.begin(); clusterIt !=
ret->second.end(); clusterIt++) {
194 double clusterz = clusterref->position().z();
195 int fracsNbr = clusterref->recHitFractions().size();
199 if (fabs(trackz) > 300.)
202 double _rhsizeeta = rhsizeeta * (2.00 + 1.0 / (fracsNbr *
std::min(1.,
trackPt / 2.)));
203 double _rhsizephi = rhsizephi * (2.00 + 1.0 / (fracsNbr *
std::min(1.,
trackPt / 2.)));
206 if (deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
212 if (fabs(trackz) < 300.)
214 if (trackz * clusterz < 0.)
219 for (
unsigned jc = 0; jc < 4; ++jc) {
220 auto cornerposxyz = cornersxyz[jc];
221 x[3 - jc] = cornerposxyz.x() +
222 (cornerposxyz.x() - posxyz.x()) * (1.00 + 0.50 / fracsNbr /
std::min(1.,
trackPt / 2.));
223 y[3 - jc] = cornerposxyz.y() +
224 (cornerposxyz.y() - posxyz.y()) * (1.00 + 0.50 / fracsNbr /
std::min(1.,
trackPt / 2.));
230 bool isinside = TMath::IsInside(trackx, tracky, 5,
x,
y);
248 for (BlockEltSet::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) {
249 double clusterphi = (*jt)->clusterRef()->positionREP().phi();
250 double clustereta = (*jt)->clusterRef()->positionREP().eta();
252 multitracks.
linkedClusters.push_back(std::make_pair(clusterphi, clustereta));
255 it->first->setMultilinks(multitracks);