35 const std::vector<reco::PFRecHitFraction> &fraction = clusterref->recHitFractions();
39 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
41 double fract = fraction[rhit].fraction();
43 if ((rh.
isNull()) || (fract < 1E-4))
60 std::vector<KDTreeNodeInfo> eltList;
63 for(RecHitSet::const_iterator it =
rechitsSet_.begin();
69 eltList.push_back(rh1);
74 double phi = rh1.dim2 - 2 *
M_PI;
76 eltList.push_back(rh2);
80 double phi = rh1.dim2 + 2 *
M_PI;
82 eltList.push_back(rh3);
91 KDTreeBox region(-3.0, 3.0, phimin, phimax);
103 for(BlockEltSet::iterator it =
targetSet_.begin();
114 if( ! atHCAL.
isValid())
continue;
118 if ( dHPhi >
M_PI ) dHPhi = dHPhi - 2. *
M_PI;
119 else if ( dHPhi < -
M_PI ) dHPhi = dHPhi + 2. *
M_PI;
121 double tracketa = atHCAL.
positionREP().Eta() + 0.1 * dHEta;
122 double trackphi = atHCAL.
positionREP().Phi() + 0.1 * dHPhi;
124 if (trackphi >
M_PI) trackphi -= 2 *
M_PI;
125 else if (trackphi < -
M_PI) trackphi += 2 *
M_PI;
129 double inflation = 1.;
134 std::vector<KDTreeNodeInfo> recHits;
135 KDTreeBox trackBox(tracketa - rangeEta, tracketa + rangeEta,
136 trackphi - rangePhi, trackphi + rangePhi);
140 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
141 rhit != recHits.end(); ++rhit) {
144 const std::vector<reco::PFRecHit::REPPoint>& corners = rhit->ptr->getCornersREP();
145 if(corners.size() != 4)
continue;
147 double rhsizeEta = fabs(corners[0].
Eta() - corners[2].
Eta());
148 double rhsizePhi = fabs(corners[0].
Phi() - corners[2].
Phi());
149 if ( rhsizePhi >
M_PI ) rhsizePhi = 2.*
M_PI - rhsizePhi;
151 double deta = fabs(rhrep.Eta() - tracketa);
152 double dphi = fabs(rhrep.Phi() - trackphi);
153 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
158 for(BlockEltSet::iterator clusterIt = ret->second.begin();
159 clusterIt != ret->second.end(); clusterIt++) {
162 int fracsNbr = clusterref->recHitFractions().size();
164 double _rhsizeEta = rhsizeEta * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHEta);
165 double _rhsizePhi = rhsizePhi * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHPhi);
168 if(deta < (_rhsizeEta / 2.) && dphi < (_rhsizePhi / 2.))
185 for (BlockEltSet::iterator jt = it->second.begin();
186 jt != it->second.end(); ++jt) {
194 multitracks.
linkedClusters.push_back(std::make_pair(trackphi, tracketa));
197 it->first->setMultilinks(multitracks);
204 (*it)->setIsValidMultilinks(
true);
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
void insertFieldClusterElt(reco::PFBlockElement *hcalCluster)
Abstract base class for a PFBlock element (track, cluster...)
void build(std::vector< KDTreeNodeInfo > &eltList, const KDTreeBox ®ion)
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< Double32_t > > REPPoint
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &resRecHitList)
bool isNull() const
Checks for null.
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
RecHit2BlockEltMap rechit2ClusterLinks_
void setPhiOffset(double phiOffset)
PFMultilinksType linkedClusters
virtual PFClusterRef clusterRef() const
BlockElt2BlockEltMap cluster2TargetLinks_
const Fraction< n, m >::type & fract()
void insertTargetElt(reco::PFBlockElement *track)
BlockEltSet fieldClusterSet_
void setCristalPhiEtaMaxSize(float size)
bool isValid() const
is this point valid ?
void updatePFBlockEltWithLinks()
float getCristalPhiEtaMaxSize() const
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
float getPhiOffset() const