10 "KDTreePreshowerAndECALLinker");
48 const std::vector<reco::PFRecHitFraction> &fraction = clusterref->recHitFractions();
53 double clusterz = clusterref->position().Z();
56 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
58 double fract = fraction[rhit].fraction();
60 if ((rh.
isNull()) || (fract < 1E-4))
69 rechitsSet.insert(&rechit);
85 std::vector<KDTreeNodeInfo> eltList;
88 for(RecHitSet::const_iterator it = rechitsSet.begin();
89 it != rechitsSet.end(); it++) {
95 eltList.push_back(rhinfo);
99 KDTreeBox region(-150., 150., -150., 150.);
102 tree.
build(eltList, region);
111 for(BlockEltSet::iterator it =
targetSet_.begin();
114 (*it)->setIsValidMultilinks(
true);
120 double zPS = clusterPS.
position().Z();
121 double xPS = clusterPS.
position().X();
122 double yPS = clusterPS.
position().Y();
124 double etaPS = fabs(clusterPS.
positionREP().eta());
127 double xPSonEcal = xPS;
128 double yPSonEcal = yPS;
156 double inflation = 2.4 - (etaPS-1.6);
157 double rangeX = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaX / 2.)) * inflation;
158 double rangeY = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaY / 2.)) * inflation;
161 std::vector<KDTreeNodeInfo> recHits;
162 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX,
163 yPSonEcal - rangeY, yPSonEcal + rangeY);
171 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
172 rhit != recHits.end(); ++rhit) {
174 const std::vector< math::XYZPoint >& corners = rhit->ptr->getCornersXYZ();
175 if(corners.size() != 4)
continue;
180 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
181 clusterIt != ret->second.end(); clusterIt++) {
184 double clusterz = clusterref->position().Z();
186 const math::XYZPoint& posxyz = rhit->ptr->position() * zPS / clusterz;
190 for (
unsigned jc=0; jc<4; ++jc ) {
192 x[jc] = cornerpos.X() + (cornerpos.X()-posxyz.X()) * (0.05 +1.0/fabs((cornerpos.X()-posxyz.X()))*deltaX/2.);
193 y[jc] = cornerpos.Y() + (cornerpos.Y()-posxyz.Y()) * (0.05 +1.0/fabs((cornerpos.Y()-posxyz.Y()))*deltaY/2.);
199 bool isinside = TMath::IsInside(xPS,
222 for (BlockEltSet::iterator jt = it->second.begin();
223 jt != it->second.end(); ++jt) {
225 double clusterPhi = (*jt)->clusterRef()->positionREP().Phi();
226 double clusterEta = (*jt)->clusterRef()->positionREP().Eta();
228 multitracks.
linkedClusters.push_back(std::make_pair(clusterPhi, clusterEta));
231 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.
virtual const PFClusterRef & clusterRef() const
BlockElt2BlockEltMap target2ClusterLinks_
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &resRecHitList)
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
const Fraction< n, m >::type & fract()
bool isNull() const
Checks for null.
const math::XYZPoint & position() const
rechit cell centre x, y, z
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)
#define DEFINE_EDM_PLUGIN(factory, type, name)
KDTreeLinkerAlgo treeNeg_
RecHit2BlockEltMap rechit2ClusterLinks_