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<reco::PFRecHit const*>> 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<reco::PFRecHit const*> recHits;
158 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX,
159 yPSonEcal - rangeY, yPSonEcal + rangeY);
167 for(
auto const&
recHit : recHits) {
169 const auto & corners =
recHit->getCornersXYZ();
174 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
175 clusterIt != ret->second.end(); clusterIt++) {
178 double clusterz = clusterref->position().z();
180 const auto & posxyz =
recHit->position() * zPS / clusterz;
184 for (
unsigned jc=0; jc<4; ++jc ) {
185 auto cornerpos = corners[jc].basicVector() * zPS / clusterz;
186 x[3-jc] = cornerpos.x() + (cornerpos.x()-posxyz.x()) * (0.05 +1.0/fabs((cornerpos.x()-posxyz.x()))*deltaX/2.);
187 y[3-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
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
KDTreeLinkerAlgo< reco::PFRecHit const * > treePos_
void buildTree() override
virtual const PFClusterRef & clusterRef() const
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
void search(const KDTreeBox &searchBox, std::vector< DATA > &resRecHitList)
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
bool isNull() const
Checks for null.
void build(std::vector< KDTreeNodeInfo< DATA > > &eltList, const KDTreeBox ®ion)
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks() override
void searchLinks() override
KDTreeLinkerAlgo< reco::PFRecHit const * > treeNeg_
#define DEFINE_EDM_PLUGIN(factory, type, name)
~KDTreeLinkerPSEcal() override
RecHit2BlockEltMap rechit2ClusterLinks_