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<reco::PFRecHit const*>> eltList;
72 for(RecHitSet::const_iterator it =
rechitsSet_.begin();
78 eltList.push_back(rh1);
83 double phi = rh1.dim[1] - 2 *
M_PI;
85 eltList.push_back(rh2);
89 double phi = rh1.dim[1] + 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<reco::PFRecHit const*> recHits;
144 KDTreeBox trackBox(tracketa - rangeeta, tracketa + rangeeta,
145 trackphi - rangephi, trackphi + rangephi);
149 for(
auto const&
recHit : recHits) {
151 const auto &rhrep =
recHit->positionREP();
152 const auto & corners =
recHit->getCornersREP();
154 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
155 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
156 if ( rhsizephi >
M_PI ) rhsizephi = 2.*
M_PI - rhsizephi;
158 double deta = fabs(rhrep.eta() - tracketa);
159 double dphi = fabs(rhrep.phi() - trackphi);
160 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
165 for(BlockEltSet::iterator clusterIt = ret->second.begin();
166 clusterIt != ret->second.end(); clusterIt++) {
169 int fracsNbr = clusterref->recHitFractions().size();
171 double _rhsizeeta = rhsizeeta * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHeta);
172 double _rhsizephi = rhsizephi * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHphi);
175 if(deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
192 for (BlockEltSet::iterator jt = it->second.begin();
193 jt != it->second.end(); ++jt) {
201 multitracks.
linkedClusters.push_back(std::make_pair(trackphi, tracketa));
204 it->first->setMultilinks(multitracks);
211 (*it)->setIsValidMultilinks(
true);
float phi() const
momentum azimuthal angle
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
~KDTreeLinkerTrackHcal() override
Abstract base class for a PFBlock element (track, cluster...)
float cristalPhiEtaMaxSize_
virtual const PFClusterRef & clusterRef() const
KDTreeLinkerAlgo< reco::PFRecHit const * > tree_
void searchLinks() override
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
RecHit2BlockEltMap rechit2ClusterLinks_
PFMultilinksType linkedClusters
void updatePFBlockEltWithLinks() override
void buildTree() override
void search(const KDTreeBox &searchBox, std::vector< DATA > &resRecHitList)
BlockElt2BlockEltMap cluster2TargetLinks_
const Fraction< n, m >::type & fract()
virtual const PFRecTrackRef & trackRefPF() const
bool isNull() const
Checks for null.
BlockEltSet fieldClusterSet_
void build(std::vector< KDTreeNodeInfo< DATA > > &eltList, const KDTreeBox ®ion)
bool isValid() const
is this point valid ?
void insertTargetElt(reco::PFBlockElement *track) override
void insertFieldClusterElt(reco::PFBlockElement *hcalCluster) override
#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