36 void clear()
override;
91 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
96 double clusterz = clusterref->position().Z();
99 for (
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
101 double fract = fraction[rhit].fraction();
112 rechitsSet.insert(&rechit);
123 std::vector<KDTreeNodeInfo<reco::PFRecHit const *, 2>> eltList;
126 for (RecHitSet::const_iterator it = rechitsSet.begin(); it != rechitsSet.end(); it++) {
128 const auto &posxyz = rh->
position();
131 eltList.push_back(rhinfo);
146 (*it)->setIsValidMultilinks(
true);
152 double zPS = clusterPS.
position().Z();
153 double xPS = clusterPS.
position().X();
154 double yPS = clusterPS.
position().Y();
156 double etaPS = fabs(clusterPS.
positionREP().eta());
159 float xPSonEcal = xPS;
160 float yPSonEcal = yPS;
185 double inflation = 2.4 - (etaPS - 1.6);
186 float rangeX = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaX / 2.)) * inflation;
187 float rangeY = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaY / 2.)) * inflation;
190 std::vector<reco::PFRecHit const *>
recHits;
191 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX, yPSonEcal - rangeY, yPSonEcal + rangeY);
198 for (
auto const &
recHit : recHits) {
199 const auto &corners =
recHit->getCornersXYZ();
204 for (BlockEltSet::const_iterator clusterIt = ret->second.begin(); clusterIt != ret->second.end(); clusterIt++) {
206 double clusterz = clusterref->position().z();
208 const auto &posxyz =
recHit->position() * zPS / clusterz;
212 for (
unsigned jc = 0; jc < 4; ++jc) {
213 auto cornerpos = corners[jc].basicVector() * zPS / clusterz;
214 x[3 - jc] = cornerpos.x() +
215 (cornerpos.x() - posxyz.x()) * (0.05 + 1.0 / fabs((cornerpos.x() - posxyz.x())) * deltaX / 2.);
216 y[3 - jc] = cornerpos.y() +
217 (cornerpos.y() - posxyz.y()) * (0.05 + 1.0 / fabs((cornerpos.y() - posxyz.y())) * deltaY / 2.);
223 bool isinside = TMath::IsInside(xPS, yPS, 5, x, y);
240 for (BlockEltSet::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) {
241 double clusterphi = (*jt)->clusterRef()->positionREP().phi();
242 double clustereta = (*jt)->clusterRef()->positionREP().eta();
244 multitracks.
linkedClusters.push_back(std::make_pair(clusterphi, clustereta));
247 it->first->setMultilinks(multitracks);
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
const double resPSlength_
std::set< reco::PFBlockElement * > BlockEltSet
Abstract base class for a PFBlock element (track, cluster...)
const math::XYZPoint & position() const
cluster centroid position
void search(const KDTreeBox< DIM > &searchBox, std::vector< DATA > &resRecHitList)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void buildTree() override
ret
prodAgent to be discontinued
virtual const PFClusterRef & clusterRef() const
std::map< const reco::PFRecHit *, BlockEltSet > RecHit2BlockEltMap
std::map< reco::PFBlockElement *, BlockEltSet > BlockElt2BlockEltMap
BlockElt2BlockEltMap target2ClusterLinks_
PositionType const & position() const
rechit cell centre x, y, z
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster) override
KDTreeLinkerPSEcal(const edm::ParameterSet &conf)
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
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
KDTreeLinkerAlgo< reco::PFRecHit const * > treePos_
bool isNull() const
Checks for null.
void build(std::vector< KDTreeNodeInfo< DATA, DIM > > &eltList, const KDTreeBox< DIM > ®ion)
KDTreeLinkerAlgo< reco::PFRecHit const * > treeNeg_
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks() override
void searchLinks() override
#define DEFINE_EDM_PLUGIN(factory, type, name)
~KDTreeLinkerPSEcal() override
RecHit2BlockEltMap rechit2ClusterLinks_