36 void clear()
override;
74 :
KDTreeLinkerBase(conf), resPSpitch_(0.19), resPSlength_(6.1), ps1ToEcal_(1.072), ps2ToEcal_(1.057) {}
91 const std::vector<reco::PFRecHitFraction> &
fraction = clusterref->recHitFractions();
96 double clusterz = clusterref->position().Z();
99 for (
size_t rhit = 0; rhit <
fraction.size(); ++rhit) {
112 rechitsSet.insert(&rechit);
123 std::vector<KDTreeNodeInfo<reco::PFRecHit const *, 2>> eltList;
126 for (RecHitSet::const_iterator
it = rechitsSet.begin();
it != rechitsSet.end();
it++) {
128 const auto &posxyz = rh->
position();
131 eltList.push_back(rhinfo);
150 double zPS = clusterPS.
position().Z();
151 double xPS = clusterPS.
position().X();
152 double yPS = clusterPS.
position().Y();
154 double etaPS = fabs(clusterPS.
positionREP().eta());
157 float xPSonEcal = xPS;
158 float yPSonEcal = yPS;
183 double inflation = 2.4 - (etaPS - 1.6);
184 float rangeX = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaX / 2.)) * inflation;
185 float rangeY = maxEcalRadius * (1 + (0.05 + 1.0 / maxEcalRadius * deltaY / 2.)) * inflation;
188 std::vector<reco::PFRecHit const *>
recHits;
189 KDTreeBox trackBox(xPSonEcal - rangeX, xPSonEcal + rangeX, yPSonEcal - rangeY, yPSonEcal + rangeY);
197 const auto &corners =
recHit->getCornersXYZ();
202 for (BlockEltSet::const_iterator clusterIt =
ret->second.begin(); clusterIt !=
ret->second.end(); clusterIt++) {
204 double clusterz = clusterref->position().z();
206 const auto &posxyz =
recHit->position() * zPS / clusterz;
210 for (
unsigned jc = 0; jc < 4; ++jc) {
211 auto cornerpos = corners[jc].basicVector() * zPS / clusterz;
212 x[3 - jc] = cornerpos.x() +
213 (cornerpos.x() - posxyz.x()) * (0.05 + 1.0 / fabs((cornerpos.x() - posxyz.x())) * deltaX / 2.);
214 y[3 - jc] = cornerpos.y() +
215 (cornerpos.y() - posxyz.y()) * (0.05 + 1.0 / fabs((cornerpos.y() - posxyz.y())) * deltaY / 2.);
221 bool isinside = TMath::IsInside(xPS, yPS, 5,
x,
y);
236 const auto &psElt =
it->first;
237 const auto &ecalEltSet =
it->second;
240 for (
const auto &ecalElt : ecalEltSet) {
250 psElt->setMultilinks(multitracks,
_fieldType);
const math::XYZPoint & position() const
cluster centroid position
const double resPSlength_
std::set< reco::PFBlockElement * > BlockEltSet
Abstract base class for a PFBlock element (track, cluster...)
void search(const KDTreeBox< DIM > &searchBox, std::vector< DATA > &resRecHitList)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void buildTree() override
reco::PFBlockElement::Type _fieldType
ret
prodAgent to be discontinued
std::map< const reco::PFRecHit *, BlockEltSet > RecHit2BlockEltMap
std::map< reco::PFBlockElement *, BlockEltSet > BlockElt2BlockEltMap
BlockElt2BlockEltMap target2ClusterLinks_
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
PositionType const & position() const
rechit cell centre x, y, z
const REPPoint & positionREP() const
cluster position: rho, eta, phi
void insertFieldClusterElt(reco::PFBlockElement *ecalCluster) override
KDTreeLinkerPSEcal(const edm::ParameterSet &conf)
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
void insertTargetElt(reco::PFBlockElement *psCluster) override
virtual const PFClusterRef & clusterRef() const
Abstract This class is used by the KDTree Track / Ecal Cluster linker to store all found links...
std::set< const reco::PFRecHit * > RecHitSet
const Fraction< n, m >::type & fract()
KDTreeLinkerAlgo< reco::PFRecHit const * > treePos_
bool isNull() const
Checks for null.
KDTreeLinkerAlgo< reco::PFRecHit const * > treeNeg_
PFMultilinksType linkedPFObjects
BlockEltSet fieldClusterSet_
void updatePFBlockEltWithLinks() override
void searchLinks() override
reco::PFBlockElement::Type _targetType
#define DEFINE_EDM_PLUGIN(factory, type, name)
~KDTreeLinkerPSEcal() override
RecHit2BlockEltMap rechit2ClusterLinks_