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);
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) {
153 const std::vector<reco::PFRecHit::REPPoint>& corners = rhit->ptr->getCornersREP();
154 if(corners.size() != 4)
continue;
156 double rhsizeEta = fabs(corners[0].
Eta() - corners[2].
Eta());
157 double rhsizePhi = fabs(corners[0].
Phi() - corners[2].
Phi());
158 if ( rhsizePhi >
M_PI ) rhsizePhi = 2.*
M_PI - rhsizePhi;
160 double deta = fabs(rhrep.Eta() - tracketa);
161 double dphi = fabs(rhrep.Phi() - trackphi);
162 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
167 for(BlockEltSet::iterator clusterIt = ret->second.begin();
168 clusterIt != ret->second.end(); clusterIt++) {
171 int fracsNbr = clusterref->recHitFractions().size();
173 double _rhsizeEta = rhsizeEta * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHEta);
174 double _rhsizePhi = rhsizePhi * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHPhi);
177 if(deta < (_rhsizeEta / 2.) && dphi < (_rhsizePhi / 2.))
194 for (BlockEltSet::iterator jt = it->second.begin();
195 jt != it->second.end(); ++jt) {
203 multitracks.
linkedClusters.push_back(std::make_pair(trackphi, tracketa));
206 it->first->setMultilinks(multitracks);
213 (*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...)
tuple ret
prodAgent to be discontinued
void build(std::vector< KDTreeNodeInfo > &eltList, const KDTreeBox ®ion)
virtual const PFClusterRef & clusterRef() const
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &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_
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
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 getPhiOffset() const