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++) {
92 const auto & posxyz = rh->
position();
95 eltList.push_back(rhinfo);
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 auto & corners = rhit->ptr->getCornersXYZ();
179 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
180 clusterIt != ret->second.end(); clusterIt++) {
183 double clusterz = clusterref->position().z();
185 const auto & posxyz = rhit->ptr->position() * zPS / clusterz;
189 for (
unsigned jc=0; jc<4; ++jc ) {
190 auto cornerpos = corners[jc].basicVector() * zPS / clusterz;
191 x[3-jc] = cornerpos.x() + (cornerpos.x()-posxyz.x()) * (0.05 +1.0/fabs((cornerpos.x()-posxyz.x()))*deltaX/2.);
192 y[3-jc] = cornerpos.y() + (cornerpos.y()-posxyz.y()) * (0.05 +1.0/fabs((cornerpos.y()-posxyz.y()))*deltaY/2.);
198 bool isinside = TMath::IsInside(xPS,
221 for (BlockEltSet::iterator jt = it->second.begin();
222 jt != it->second.end(); ++jt) {
224 double clusterphi = (*jt)->clusterRef()->positionREP().phi();
225 double clustereta = (*jt)->clusterRef()->positionREP().eta();
227 multitracks.
linkedClusters.push_back(std::make_pair(clusterphi, clustereta));
230 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
tuple ret
prodAgent to be discontinued
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)
PositionType const & position() const
rechit cell centre x, y, z
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.
std::set< const reco::PFRecHit * > RecHitSet
KDTreeLinkerAlgo treePos_
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks()
void insertTargetElt(reco::PFBlockElement *psCluster)
#define DEFINE_EDM_PLUGIN(factory, type, name)
KDTreeLinkerAlgo treeNeg_
RecHit2BlockEltMap rechit2ClusterLinks_