38 void clear()
override;
80 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
84 for (
size_t rhit = 0; rhit <
fraction.size(); ++rhit) {
103 std::vector<KDTreeNodeInfo<reco::PFRecHit const *, 2>> eltList;
110 eltList.push_back(rh1);
115 float phi = rh1.dims[1] - 2 *
M_PI;
117 eltList.push_back(rh2);
121 float phi = rh1.dims[1] + 2 *
M_PI;
123 eltList.push_back(rh3);
156 double trackx = atECAL.
position().X();
157 double tracky = atECAL.
position().Y();
158 double trackz = atECAL.
position().Z();
165 std::vector<reco::PFRecHit const *>
recHits;
171 const auto &cornersxyz =
recHit->getCornersXYZ();
172 const auto &posxyz =
recHit->position();
173 const auto &rhrep =
recHit->positionREP();
174 const auto &corners =
recHit->getCornersREP();
176 double rhsizeeta = fabs(corners[3].
eta() - corners[1].
eta());
177 double rhsizephi = fabs(corners[3].
phi() - corners[1].
phi());
178 if (rhsizephi >
M_PI)
179 rhsizephi = 2. *
M_PI - rhsizephi;
181 double deta = fabs(rhrep.eta() - tracketa);
182 double dphi = fabs(rhrep.phi() - trackphi);
184 dphi = 2. *
M_PI - dphi;
189 for (BlockEltSet::const_iterator clusterIt =
ret->second.begin(); clusterIt !=
ret->second.end(); clusterIt++) {
191 double clusterz = clusterref->position().z();
192 int fracsNbr = clusterref->recHitFractions().size();
196 if (fabs(trackz) > 300.)
199 double _rhsizeeta = rhsizeeta * (2.00 + 1.0 / (fracsNbr *
std::min(1.,
trackPt / 2.)));
200 double _rhsizephi = rhsizephi * (2.00 + 1.0 / (fracsNbr *
std::min(1.,
trackPt / 2.)));
203 if (deta < (_rhsizeeta / 2.) && dphi < (_rhsizephi / 2.))
209 if (fabs(trackz) < 300.)
211 if (trackz * clusterz < 0.)
216 for (
unsigned jc = 0; jc < 4; ++jc) {
217 auto cornerposxyz = cornersxyz[jc];
218 x[3 - jc] = cornerposxyz.x() +
219 (cornerposxyz.x() - posxyz.x()) * (1.00 + 0.50 / fracsNbr /
std::min(1.,
trackPt / 2.));
220 y[3 - jc] = cornerposxyz.y() +
221 (cornerposxyz.y() - posxyz.y()) * (1.00 + 0.50 / fracsNbr /
std::min(1.,
trackPt / 2.));
227 bool isinside = TMath::IsInside(trackx, tracky, 5,
x,
y);
243 const auto &ecalElt = it->first;
244 const auto &trackEltSet = it->second;
247 for (
const auto &trackElt : trackEltSet) {
255 trackElt->setIsValidMultilinks(
true,
_fieldType);
void insertTargetElt(reco::PFBlockElement *track) override
std::set< reco::PFBlockElement * > BlockEltSet
Abstract base class for a PFBlock element (track, cluster...)
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
float cristalPhiEtaMaxSize_
void search(const KDTreeBox< DIM > &searchBox, std::vector< DATA > &resRecHitList)
KDTreeLinkerAlgo< reco::PFRecHit const * > tree_
reco::PFBlockElement::Type _fieldType
ret
prodAgent to be discontinued
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
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
bool isValid() const
is this point valid ?
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) ...
float phi() const
momentum azimuthal angle
virtual const PFClusterRef & clusterRef() const
Abstract This class is used by the KDTree Track / Ecal Cluster linker to store all found links...
void updatePFBlockEltWithLinks() override
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
bool isNull() const
Checks for null.
void build(std::vector< KDTreeNodeInfo< DATA, DIM > > &eltList, const KDTreeBox< DIM > ®ion)
const math::XYZPoint & position() const
cartesian position (x, y, z)
PFMultilinksType linkedPFObjects
~KDTreeLinkerTrackEcal() override
BlockEltSet fieldClusterSet_
float eta() const
momentum pseudorapidity
RecHit2BlockEltMap rechit2ClusterLinks_
reco::PFBlockElement::Type _targetType
#define DEFINE_EDM_PLUGIN(factory, type, name)
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
BlockElt2BlockEltMap cluster2TargetLinks_