37 void clear()
override;
79 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
83 for (
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
85 double fract = fraction[rhit].fraction();
102 std::vector<KDTreeNodeInfo<reco::PFRecHit const *, 2>> eltList;
109 eltList.push_back(rh1);
114 float phi = rh1.dims[1] - 2 *
M_PI;
116 eltList.push_back(rh2);
120 float phi = rh1.dims[1] + 2 *
M_PI;
122 eltList.push_back(rh3);
146 (*it)->setIsValidMultilinks(
true);
159 double trackx = atECAL.
position().X();
160 double tracky = atECAL.
position().Y();
161 double trackz = atECAL.
position().Z();
168 std::vector<reco::PFRecHit const *>
recHits;
169 KDTreeBox trackBox(tracketa - range, tracketa + range, trackphi - range, trackphi + range);
173 for (
auto const &
recHit : recHits) {
174 const auto &cornersxyz =
recHit->getCornersXYZ();
175 const auto &posxyz =
recHit->position();
176 const auto &rhrep =
recHit->positionREP();
177 const auto &corners =
recHit->getCornersREP();
179 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
180 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
181 if (rhsizephi >
M_PI)
182 rhsizephi = 2. *
M_PI - rhsizephi;
184 double deta = fabs(rhrep.eta() - tracketa);
185 double dphi = fabs(rhrep.phi() - trackphi);
187 dphi = 2. *
M_PI - dphi;
192 for (BlockEltSet::const_iterator clusterIt = ret->second.begin(); clusterIt != ret->second.end(); clusterIt++) {
194 double clusterz = clusterref->position().z();
195 int fracsNbr = clusterref->recHitFractions().size();
199 if (fabs(trackz) > 300.)
202 double _rhsizeeta = rhsizeeta * (2.00 + 1.0 / (fracsNbr *
std::min(1., trackPt / 2.)));
203 double _rhsizephi = rhsizephi * (2.00 + 1.0 / (fracsNbr *
std::min(1., trackPt / 2.)));
206 if (deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
212 if (fabs(trackz) < 300.)
214 if (trackz * clusterz < 0.)
219 for (
unsigned jc = 0; jc < 4; ++jc) {
220 auto cornerposxyz = cornersxyz[jc];
221 x[3 - jc] = cornerposxyz.x() +
222 (cornerposxyz.x() - posxyz.x()) * (1.00 + 0.50 / fracsNbr /
std::min(1., trackPt / 2.));
223 y[3 - jc] = cornerposxyz.y() +
224 (cornerposxyz.y() - posxyz.y()) * (1.00 + 0.50 / fracsNbr /
std::min(1., trackPt / 2.));
230 bool isinside = TMath::IsInside(trackx, tracky, 5, x, y);
248 for (BlockEltSet::iterator jt = it->second.begin(); jt != it->second.end(); ++jt) {
249 double clusterphi = (*jt)->clusterRef()->positionREP().phi();
250 double clustereta = (*jt)->clusterRef()->positionREP().eta();
252 multitracks.
linkedClusters.push_back(std::make_pair(clusterphi, clustereta));
255 it->first->setMultilinks(multitracks);
float phi() const
momentum azimuthal angle
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
void insertTargetElt(reco::PFBlockElement *track) override
std::set< reco::PFBlockElement * > BlockEltSet
Abstract base class for a PFBlock element (track, cluster...)
float cristalPhiEtaMaxSize_
void search(const KDTreeBox< DIM > &searchBox, std::vector< DATA > &resRecHitList)
KDTreeLinkerAlgo< reco::PFRecHit const * > tree_
ret
prodAgent to be discontinued
virtual const PFClusterRef & clusterRef() const
const math::XYZPoint & position() const
cartesian position (x, y, z)
void searchLinks() override
std::map< const reco::PFRecHit *, BlockEltSet > RecHit2BlockEltMap
std::map< reco::PFBlockElement *, BlockEltSet > BlockElt2BlockEltMap
void buildTree() override
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster) override
KDTreeLinkerTrackEcal(const edm::ParameterSet &conf)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
PFMultilinksType linkedClusters
void updatePFBlockEltWithLinks() override
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
virtual const PFRecTrackRef & trackRefPF() const
bool isNull() const
Checks for null.
void build(std::vector< KDTreeNodeInfo< DATA, DIM > > &eltList, const KDTreeBox< DIM > ®ion)
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
bool isValid() const
is this point valid ?
~KDTreeLinkerTrackEcal() override
BlockEltSet fieldClusterSet_
RecHit2BlockEltMap rechit2ClusterLinks_
BlockElt2BlockEltMap target2ClusterLinks_
#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