35 void clear()
override;
103 const std::vector<reco::PFRecHitFraction>&
fraction = clusterref->recHitFractions();
107 for (
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
109 double fract = fraction[rhit].fraction();
126 std::vector<KDTreeNodeInfo<reco::PFRecHit const*, 2>> eltList;
133 eltList.push_back(rh1);
138 float phi = rh1.dims[1] - 2 *
M_PI;
140 eltList.push_back(rh2);
144 float phi = rh1.dims[1] + 2 *
M_PI;
146 eltList.push_back(rh3);
182 dHphi = dHphi - 2. *
M_PI;
183 else if (dHphi < -
M_PI)
184 dHphi = dHphi + 2. *
M_PI;
187 float tracketa = atHCAL.
positionREP().eta() + 0.1 * dHeta;
188 float trackphi = atHCAL.
positionREP().phi() + 0.1 * dHphi;
191 trackphi -= 2 *
M_PI;
192 else if (trackphi < -
M_PI)
193 trackphi += 2 *
M_PI;
197 double inflation = 1.;
202 std::vector<reco::PFRecHit const*>
recHits;
203 KDTreeBox trackBox(tracketa - rangeeta, tracketa + rangeeta, trackphi - rangephi, trackphi + rangephi);
207 for (
auto const&
recHit : recHits) {
208 const auto& rhrep =
recHit->positionREP();
209 const auto& corners =
recHit->getCornersREP();
211 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
212 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
213 if (rhsizephi >
M_PI)
214 rhsizephi = 2. *
M_PI - rhsizephi;
216 double deta = fabs(rhrep.eta() - tracketa);
217 double dphi = fabs(rhrep.phi() - trackphi);
219 dphi = 2. *
M_PI - dphi;
224 for (BlockEltSet::iterator clusterIt = ret->second.begin(); clusterIt != ret->second.end(); clusterIt++) {
226 int fracsNbr = clusterref->recHitFractions().size();
228 double _rhsizeeta = rhsizeeta * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHeta);
229 double _rhsizephi = rhsizephi * (1.5 + 0.5 / fracsNbr) + 0.2 * fabs(dHphi);
232 if (deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
246 for (BlockEltSet::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) {
252 multitracks.
linkedClusters.push_back(std::make_pair(trackphi, tracketa));
255 it->first->setMultilinks(multitracks);
261 (*it)->setIsValidMultilinks(
true);
float phi() const
momentum azimuthal angle
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
~KDTreeLinkerTrackHcal() override
std::set< reco::PFBlockElement * > BlockEltSet
Abstract base class for a PFBlock element (track, cluster...)
reco::PFTrajectoryPoint::LayerType trajectoryLayerEntrance_
float cristalPhiEtaMaxSize_
void search(const KDTreeBox< DIM > &searchBox, std::vector< DATA > &resRecHitList)
ret
prodAgent to be discontinued
virtual const PFClusterRef & clusterRef() const
std::map< const reco::PFRecHit *, BlockEltSet > RecHit2BlockEltMap
std::map< reco::PFBlockElement *, BlockEltSet > BlockElt2BlockEltMap
KDTreeLinkerTrackHcal(const edm::ParameterSet &conf)
KDTreeLinkerAlgo< reco::PFRecHit const * > tree_
std::string trajectoryLayerEntranceString_
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
BlockElt2BlockEltMap cluster2TargetLinks_
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
static LayerType layerTypeByName(const std::string &name)
virtual const PFRecTrackRef & trackRefPF() const
bool isNull() const
Checks for null.
void build(std::vector< KDTreeNodeInfo< DATA, DIM > > &eltList, const KDTreeBox< DIM > ®ion)
BlockEltSet fieldClusterSet_
bool isValid() const
is this point valid ?
void insertTargetElt(reco::PFBlockElement *track) override
reco::PFTrajectoryPoint::LayerType trajectoryLayerExit_
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
LayerType
Define the different layers where the track can be propagated.
std::string trajectoryLayerExitString_