10 "KDTreePreshowerAndECALLinker");
44 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
49 double clusterz = clusterref->position().Z();
52 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
54 double fract = fraction[rhit].fraction();
56 if ((rh.
isNull()) || (fract < 1E-4))
65 rechitsSet.insert(&rechit);
81 std::vector<KDTreeNodeInfo> eltList;
84 for(RecHitSet::const_iterator it = rechitsSet.begin();
85 it != rechitsSet.end(); it++) {
88 const auto & posxyz = rh->
position();
91 eltList.push_back(rhinfo);
95 KDTreeBox region(-150., 150., -150., 150.);
98 tree.
build(eltList, region);
107 for(BlockEltSet::iterator it =
targetSet_.begin();
110 (*it)->setIsValidMultilinks(
true);
116 double zPS = clusterPS.
position().Z();
117 double xPS = clusterPS.
position().X();
118 double yPS = clusterPS.
position().Y();
120 double etaPS = fabs(clusterPS.
positionREP().eta());
123 double xPSonEcal = xPS;
124 double yPSonEcal = yPS;
152 double inflation = 2.4 - (etaPS-1.6);
153 double rangeX = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaX / 2.)) * inflation;
154 double rangeY = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaY / 2.)) * inflation;
157 std::vector<KDTreeNodeInfo> recHits;
158 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX,
159 yPSonEcal - rangeY, yPSonEcal + rangeY);
167 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
168 rhit != recHits.end(); ++rhit) {
170 const auto & corners = rhit->ptr->getCornersXYZ();
175 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
176 clusterIt != ret->second.end(); clusterIt++) {
179 double clusterz = clusterref->position().z();
181 const auto & posxyz = rhit->ptr->position() * zPS / clusterz;
185 for (
unsigned jc=0; jc<4; ++jc ) {
186 auto cornerpos = corners[jc].basicVector() * zPS / clusterz;
187 x[3-jc] = cornerpos.x() + (cornerpos.x()-posxyz.x()) * (0.05 +1.0/fabs((cornerpos.x()-posxyz.x()))*deltaX/2.);
188 y[3-jc] = cornerpos.y() + (cornerpos.y()-posxyz.y()) * (0.05 +1.0/fabs((cornerpos.y()-posxyz.y()))*deltaY/2.);
194 bool isinside = TMath::IsInside(xPS,
217 for (BlockEltSet::iterator jt = it->second.begin();
218 jt != it->second.end(); ++jt) {
220 double clusterphi = (*jt)->clusterRef()->positionREP().phi();
221 double clustereta = (*jt)->clusterRef()->positionREP().eta();
223 multitracks.
linkedClusters.push_back(std::make_pair(clusterphi, clustereta));
226 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
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void buildTree() override
void build(std::vector< KDTreeNodeInfoT< DATA, DIM > > &eltList, const KDTreeBoxT< DIM > ®ion)
virtual const PFClusterRef & clusterRef() const
void search(const KDTreeBoxT< DIM > &searchBox, std::vector< KDTreeNodeInfoT< DATA, DIM > > &resRecHitList)
BlockElt2BlockEltMap target2ClusterLinks_
PositionType const & position() const
rechit cell centre x, y, z
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster) override
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
void insertTargetElt(reco::PFBlockElement *psCluster) override
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.
std::set< const reco::PFRecHit * > RecHitSet
KDTreeLinkerAlgo treePos_
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks() override
void searchLinks() override
#define DEFINE_EDM_PLUGIN(factory, type, name)
KDTreeLinkerAlgo treeNeg_
~KDTreeLinkerPSEcal() override
RecHit2BlockEltMap rechit2ClusterLinks_