10 "KDTreeTrackAndHCALLinker");
44 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
48 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
50 double fract = fraction[rhit].fraction();
52 if ((rh.
isNull()) || (fract < 1E-4))
69 std::vector<KDTreeNodeInfo> eltList;
72 for(RecHitSet::const_iterator it =
rechitsSet_.begin();
78 eltList.push_back(rh1);
83 double phi = rh1.dim2 - 2 *
M_PI;
85 eltList.push_back(rh2);
89 double phi = rh1.dim2 + 2 *
M_PI;
91 eltList.push_back(rh3);
100 KDTreeBox region(-3.0, 3.0, phimin, phimax);
112 for(BlockEltSet::iterator it =
targetSet_.begin();
123 if( ! atHCAL.
isValid())
continue;
127 if ( dHphi >
M_PI ) dHphi = dHphi - 2. *
M_PI;
128 else if ( dHphi < -
M_PI ) dHphi = dHphi + 2. *
M_PI;
130 double tracketa = atHCAL.
positionREP().eta() + 0.1 * dHeta;
131 double trackphi = atHCAL.
positionREP().phi() + 0.1 * dHphi;
133 if (trackphi >
M_PI) trackphi -= 2 *
M_PI;
134 else if (trackphi < -
M_PI) trackphi += 2 *
M_PI;
138 double inflation = 1.;
143 std::vector<KDTreeNodeInfo> recHits;
144 KDTreeBox trackBox(tracketa - rangeeta, tracketa + rangeeta,
145 trackphi - rangephi, trackphi + rangephi);
149 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
150 rhit != recHits.end(); ++rhit) {
152 const auto &rhrep = rhit->ptr->positionREP();
153 const auto & corners = rhit->ptr->getCornersREP();
155 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
156 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
157 if ( rhsizephi >
M_PI ) rhsizephi = 2.*
M_PI - rhsizephi;
159 double deta = fabs(rhrep.eta() - tracketa);
160 double dphi = fabs(rhrep.phi() - trackphi);
161 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
166 for(BlockEltSet::iterator clusterIt = ret->second.begin();
167 clusterIt != ret->second.end(); clusterIt++) {
170 int fracsNbr = clusterref->recHitFractions().size();
172 double _rhsizeeta = rhsizeeta * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHeta);
173 double _rhsizephi = rhsizephi * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHphi);
176 if(deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
193 for (BlockEltSet::iterator jt = it->second.begin();
194 jt != it->second.end(); ++jt) {
202 multitracks.
linkedClusters.push_back(std::make_pair(trackphi, tracketa));
205 it->first->setMultilinks(multitracks);
212 (*it)->setIsValidMultilinks(
true);
float phi() const
momentum azimuthal angle
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< 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)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
RecHit2BlockEltMap rechit2ClusterLinks_
void setPhiOffset(double phiOffset)
PFMultilinksType linkedClusters
BlockElt2BlockEltMap cluster2TargetLinks_
const Fraction< n, m >::type & fract()
virtual const PFRecTrackRef & trackRefPF() const
bool isNull() const
Checks for null.
void insertTargetElt(reco::PFBlockElement *track)
BlockEltSet fieldClusterSet_
void setCristalPhiEtaMaxSize(float size)
bool isValid() const
is this point valid ?
void updatePFBlockEltWithLinks()
float getCristalPhiEtaMaxSize() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
float eta() const
momentum pseudorapidity
float getPhiOffset() const