10 "KDTreeTrackAndECALLinker");
41 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
45 for(
size_t rhit = 0; rhit < fraction.size(); ++rhit) {
47 double fract = fraction[rhit].fraction();
49 if ((rh.
isNull()) || (fract < 1E-4))
66 std::vector<KDTreeNodeInfo> eltList;
69 for(RecHitSet::const_iterator it =
rechitsSet_.begin();
75 eltList.push_back(rh1);
80 double phi = rh1.dim2 - 2 *
M_PI;
82 eltList.push_back(rh2);
86 double phi = rh1.dim2 + 2 *
M_PI;
88 eltList.push_back(rh3);
109 for(BlockEltSet::iterator it =
targetSet_.begin();
116 (*it)->setIsValidMultilinks(
true);
122 if( ! atECAL.
isValid() )
continue;
130 double trackx = atECAL.
position().X();
131 double tracky = atECAL.
position().Y();
132 double trackz = atECAL.
position().Z();
139 std::vector<KDTreeNodeInfo>
recHits;
140 KDTreeBox trackBox(tracketa-range, tracketa+range, trackphi-range, trackphi+range);
144 for(std::vector<KDTreeNodeInfo>::const_iterator rhit = recHits.begin();
145 rhit != recHits.end(); ++rhit) {
147 const std::vector< math::XYZPoint >& cornersxyz = rhit->ptr->getCornersXYZ();
150 const std::vector<reco::PFRecHit::REPPoint>& corners = rhit->ptr->getCornersREP();
151 if(corners.size() != 4)
continue;
153 double rhsizeEta = fabs(corners[0].
Eta() - corners[2].
Eta());
154 double rhsizePhi = fabs(corners[0].
Phi() - corners[2].
Phi());
155 if ( rhsizePhi >
M_PI ) rhsizePhi = 2.*
M_PI - rhsizePhi;
157 double deta = fabs(rhrep.Eta() - tracketa);
158 double dphi = fabs(rhrep.Phi() - trackphi);
159 if ( dphi >
M_PI ) dphi = 2.*
M_PI - dphi;
164 for(BlockEltSet::const_iterator clusterIt = ret->second.begin();
165 clusterIt != ret->second.end(); clusterIt++) {
168 double clusterz = clusterref->position().Z();
169 int fracsNbr = clusterref->recHitFractions().size();
173 if (fabs(trackz) > 300.)
continue;
175 double _rhsizeEta = rhsizeEta * (2.00 + 1.0 / (fracsNbr *
std::min(1.,trackPt/2.)));
176 double _rhsizePhi = rhsizePhi * (2.00 + 1.0 / (fracsNbr *
std::min(1.,trackPt/2.)));
179 if(deta < (_rhsizeEta / 2.) && dphi < (_rhsizePhi / 2.))
186 if (fabs(trackz) < 300.)
continue;
187 if (trackz * clusterz < 0.)
continue;
191 for (
unsigned jc=0; jc<4; ++jc ) {
193 x[jc] = cornerposxyz.X() + (cornerposxyz.X()-posxyz.X())
194 * (1.00+0.50/fracsNbr /
std::min(1.,trackPt/2.));
195 y[jc] = cornerposxyz.Y() + (cornerposxyz.Y()-posxyz.Y())
196 * (1.00+0.50/fracsNbr /
std::min(1.,trackPt/2.));
202 bool isinside = TMath::IsInside(trackx,
225 for (BlockEltSet::iterator jt = it->second.begin();
226 jt != it->second.end(); ++jt) {
228 double clusterPhi = (*jt)->clusterRef()->positionREP().Phi();
229 double clusterEta = (*jt)->clusterRef()->positionREP().Eta();
231 multitracks.
linkedClusters.push_back(std::make_pair(clusterPhi, clusterEta));
234 it->first->setMultilinks(multitracks);
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
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
const math::XYZPoint & position() const
cartesian position (x, y, z)
void search(const KDTreeBox &searchBox, std::vector< KDTreeNodeInfo > &resRecHitList)
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 insertFieldClusterElt(reco::PFBlockElement *ecalCluster)
const Fraction< n, m >::type & fract()
virtual const PFRecTrackRef & trackRefPF() const
bool isNull() const
Checks for null.
void updatePFBlockEltWithLinks()
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
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_
#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