42 const std::vector<reco::PFRecHitFraction> &fraction = clusterref->recHitFractions();
47 double clusterz = clusterref->position().Z();
50 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
52 double fract = fraction[rhit].fraction();
54 if ((rh.
isNull()) || (fract < 1E-4))
63 rechitsSet.insert(&rechit);
79 std::vector<KDTreeNodeInfo> eltList;
82 for(RecHitSet::const_iterator it = rechitsSet.begin();
83 it != rechitsSet.end(); it++) {
89 eltList.push_back(rhinfo);
93 KDTreeBox region(-150., 150., -150., 150.);
96 tree.
build(eltList, region);
105 for(BlockEltSet::iterator it =
targetSet_.begin();
108 (*it)->setIsValidMultilinks(
true);
114 double zPS = clusterPS.
position().Z();
115 double xPS = clusterPS.
position().X();
116 double yPS = clusterPS.
position().Y();
118 double etaPS = fabs(clusterPS.
positionREP().eta());
121 double xPSonEcal = xPS;
122 double yPSonEcal = yPS;
150 double inflation = 2.4 - (etaPS-1.6);
151 double rangeX = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaX / 2.)) * inflation;
152 double rangeY = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaY / 2.)) * inflation;
155 std::vector<KDTreeNodeInfo> recHits;
156 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX,
157 yPSonEcal - rangeY, yPSonEcal + rangeY);
165 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
166 rhit != recHits.end(); ++rhit) {
168 const std::vector< math::XYZPoint >& corners = rhit->ptr->getCornersXYZ();
169 if(corners.size() != 4)
continue;
174 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
175 clusterIt != ret->second.end(); clusterIt++) {
178 double clusterz = clusterref->position().Z();
180 const math::XYZPoint& posxyz = rhit->ptr->position() * zPS / clusterz;
184 for (
unsigned jc=0; jc<4; ++jc ) {
186 x[jc] = cornerpos.X() + (cornerpos.X()-posxyz.X()) * (0.05 +1.0/fabs((cornerpos.X()-posxyz.X()))*deltaX/2.);
187 y[jc] = cornerpos.Y() + (cornerpos.Y()-posxyz.Y()) * (0.05 +1.0/fabs((cornerpos.Y()-posxyz.Y()))*deltaY/2.);
193 bool isinside = TMath::IsInside(xPS,
216 for (BlockEltSet::iterator jt = it->second.begin();
217 jt != it->second.end(); ++jt) {
219 double clusterPhi = (*jt)->clusterRef()->positionREP().Phi();
220 double clusterEta = (*jt)->clusterRef()->positionREP().Eta();
222 multitracks.
linkedClusters.push_back(std::make_pair(clusterPhi, clusterEta));
225 it->first->setMultilinks(multitracks);
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
const double resPSlength_
Abstract base class for a PFBlock element (track, cluster...)
const math::XYZPoint & position() const
cluster centroid position
void build(std::vector< KDTreeNodeInfo > &eltList, const KDTreeBox ®ion)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
BlockElt2BlockEltMap target2ClusterLinks_
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &resRecHitList)
bool isNull() const
Checks for null.
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
const REPPoint & positionREP() const
cluster position: rho, eta, phi
PFMultilinksType linkedClusters
float getCristalXYMaxSize() const
virtual PFClusterRef clusterRef() const
const Fraction< n, m >::type & fract()
const math::XYZPoint & position() const
is seed ?
std::set< const reco::PFRecHit * > RecHitSet
KDTreeLinkerAlgo treePos_
XYZPointD XYZPoint
point in space with cartesian internal representation
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks()
void insertTargetElt(reco::PFBlockElement *psCluster)
KDTreeLinkerAlgo treeNeg_
RecHit2BlockEltMap rechit2ClusterLinks_