32 const std::vector<reco::PFRecHitFraction> &fraction = clusterref->recHitFractions();
36 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
38 double fract = fraction[rhit].fraction();
40 if ((rh.
isNull()) || (fract < 1E-4))
57 std::vector<KDTreeNodeInfo> eltList;
60 for(RecHitSet::const_iterator it =
rechitsSet_.begin();
66 eltList.push_back(rh1);
71 double phi = rh1.dim2 - 2 *
M_PI;
73 eltList.push_back(rh2);
77 double phi = rh1.dim2 + 2 *
M_PI;
79 eltList.push_back(rh3);
88 KDTreeBox region(-3.0, 3.0, phimin, phimax);
100 for(BlockEltSet::iterator it =
targetSet_.begin();
107 (*it)->setIsValidMultilinks(
true);
113 if( ! atECAL.
isValid() )
continue;
118 double trackPt =
sqrt(atVertex.
momentum().Vect().Perp2());
121 double trackx = atECAL.
position().X();
122 double tracky = atECAL.
position().Y();
123 double trackz = atECAL.
position().Z();
130 std::vector<KDTreeNodeInfo> recHits;
131 KDTreeBox trackBox(tracketa-range, tracketa+range, trackphi-range, trackphi+range);
135 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
136 rhit != recHits.end(); ++rhit) {
138 const std::vector< math::XYZPoint >& cornersxyz = rhit->ptr->getCornersXYZ();
141 const std::vector<reco::PFRecHit::REPPoint>& corners = rhit->ptr->getCornersREP();
142 if(corners.size() != 4)
continue;
144 double rhsizeEta = fabs(corners[0].
Eta() - corners[2].
Eta());
145 double rhsizePhi = fabs(corners[0].
Phi() - corners[2].
Phi());
146 if ( rhsizePhi >
M_PI ) rhsizePhi = 2.*
M_PI - rhsizePhi;
148 double deta = fabs(rhrep.Eta() - tracketa);
149 double dphi = fabs(rhrep.Phi() - trackphi);
150 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
155 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
156 clusterIt != ret->second.end(); clusterIt++) {
159 double clusterz = clusterref->position().Z();
160 int fracsNbr = clusterref->recHitFractions().size();
164 if (fabs(trackz) > 300.)
continue;
166 double _rhsizeEta = rhsizeEta * (2.00 + 1.0 / (fracsNbr *
std::min(1.,trackPt/2.)));
167 double _rhsizePhi = rhsizePhi * (2.00 + 1.0 / (fracsNbr *
std::min(1.,trackPt/2.)));
170 if(deta < (_rhsizeEta / 2.) && dphi < (_rhsizePhi / 2.))
177 if (fabs(trackz) < 300.)
continue;
178 if (trackz * clusterz < 0.)
continue;
182 for (
unsigned jc=0; jc<4; ++jc ) {
184 x[jc] = cornerposxyz.X() + (cornerposxyz.X()-posxyz.X())
185 * (1.00+0.50/fracsNbr /
std::min(1.,trackPt/2.));
186 y[jc] = cornerposxyz.Y() + (cornerposxyz.Y()-posxyz.Y())
187 * (1.00+0.50/fracsNbr /
std::min(1.,trackPt/2.));
193 bool isinside = TMath::IsInside(trackx,
216 for (BlockEltSet::iterator jt = it->second.begin();
217 jt != it->second.end(); ++jt) {
219 double clusterPhi = (*jt)->clusterRef()->positionREP().Phi();
220 double clusterEta = (*jt)->clusterRef()->positionREP().Eta();
222 multitracks.
linkedClusters.push_back(std::make_pair(clusterPhi, clusterEta));
225 it->first->setMultilinks(multitracks);
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
Abstract base class for a PFBlock element (track, cluster...)
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< Double32_t > > REPPoint
const math::XYZPoint & position() const
cartesian position (x, y, z)
bool isNull() const
Checks for null.
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
virtual PFClusterRef clusterRef() const
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
const Fraction< n, m >::type & fract()
void build(std::vector< KDTreeNodeInfo > &eltList, const KDTreeBox ®ion)
void updatePFBlockEltWithLinks()
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &resRecHitList)
bool isValid() const
is this point valid ?
XYZPointD XYZPoint
point in space with cartesian internal representation
void insertTargetElt(reco::PFBlockElement *track)
BlockEltSet fieldClusterSet_
float getCristalPhiEtaMaxSize() const
RecHit2BlockEltMap rechit2ClusterLinks_
BlockElt2BlockEltMap target2ClusterLinks_
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
float getPhiOffset() const