21 static const float etaEndOfBarrel = 1.497;
32 for (
unsigned int i = 0;
i < clusterHandle->size(); ++
i)
42 if (fabs(currentClusterPos.eta()) > etaEndOfBarrel)
79 double dummyEtaLAT = 0;
80 double dummyPhiLAT = 0;
84 std::vector<double> dummyEnergyBasketFractionEta_v;
85 std::vector<double> dummyEnergyBasketFractionPhi_v;
91 dummyLAT, dummyEtaLAT, dummyPhiLAT, dummyA20, dummyA42,
92 dummyEnergyBasketFractionEta_v, dummyEnergyBasketFractionPhi_v);
98 std::map<double, DetId> energyMap;
101 const std::vector<reco::PFRecHitFraction> & fraction_v =
currentCluster_p->recHitFractions();
103 for (std::vector<reco::PFRecHitFraction>::const_iterator it = fraction_v.begin(); it != fraction_v.end(); ++it)
109 const DetId rechitDetId =
DetId(rechit->detId());
111 energyMap[rechit->energy()] = rechitDetId;
114 std::map<double, DetId>::reverse_iterator it = energyMap.rbegin();
129 index =
static_cast<int>(
k);
139 const std::vector< reco::PFRecHitFraction > & fraction_v =
currentCluster_p->recHitFractions();
140 for (std::vector<reco::PFRecHitFraction>::const_iterator it = fraction_v.begin(); it != fraction_v.end(); ++it)
163 for (
int i = 0;
i < 5; ++
i)
165 for (
int j = 0; j < 5; ++j)
175 if (*position !=
DetId(0))
187 if (fraction_p) { fraction = fraction_p->
fraction(); }
192 const double energyFraction = rhRef->energy() *
fraction;
195 newEntry.
energy = energyFraction;
196 newEntry.
position = crystalPosition;
198 meanPosition_ = meanPosition_ + crystalPosition * energyFraction;
210 const int etaLow = etaIndexLow + 2;
211 const int etaHigh = etaIndexHigh + 2;
212 const int phiLow = phiIndexLow + 2;
213 const int phiHigh = phiIndexHigh + 2;
217 for (
int i = etaLow;
i <= etaHigh; ++
i)
219 for (
int j = phiLow; j <= phiHigh; ++j)
244 std::map<double, Direction> directionMap;
251 const std::map<double, Direction>::reverse_iterator eMaxDir_it = directionMap.rbegin();
255 e2x2_ = eMaxDir_it->first;
261 std::map<double, Direction> directionMap;
263 directionMap[map5x5[2][1].energy] =
S;
264 directionMap[map5x5[1][2].energy] =
E;
265 directionMap[map5x5[3][2].energy] =
W;
272 const double numerator = map5x5[3][2].energy + map5x5[1][2].energy;
273 const double denominator = map5x5[1][3].energy + map5x5[3][3].energy + 0.5;
279 const double numerator = map5x5[3][2].energy + map5x5[1][2].energy;
280 const double denominator = map5x5[1][1].energy + map5x5[3][1].energy + 0.5;
286 const double numerator = map5x5[2][3].energy + map5x5[2][1].energy;
287 const double denominator = map5x5[3][3].energy + map5x5[3][1].energy + 0.5;
293 const double numerator = map5x5[2][3].energy + map5x5[2][1].energy;
294 const double denominator = map5x5[1][1].energy + map5x5[1][3].energy + 0.5;
301 double numeratorEtaEta = 0;
302 double numeratorEtaPhi = 0;
303 double numeratorPhiPhi = 0;
306 for (
int i = 0;
i < 5; ++
i)
308 for (
int j = 0; j < 5; ++j)
321 numeratorEtaEta += w * dEta *
dEta;
322 numeratorEtaPhi += w * dEta *
dPhi;
323 numeratorPhiPhi += w * dPhi *
dPhi;
reco::ClusterShape makeClusterShape()
Fraction of a PFRecHit (rechits can be shared between several PFCluster's)
std::vector< ClusterShape > ClusterShapeCollection
collection of ClusterShape objects
int findPFRHIndexFromDetId(unsigned int id)
math::XYZVector meanPosition_
std::vector< const CaloSubdetectorGeometry * > geomVector
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
reco::ClusterShapeCollection * makeClusterShapes(edm::Handle< reco::PFClusterCollection > clusterHandle, edm::Handle< reco::PFRecHitCollection > rechitHandle, const CaloSubdetectorGeometry *barrelGeo_p, const CaloSubdetectorTopology *barrelTop_p, const CaloSubdetectorGeometry *endcapGeo_p, const CaloSubdetectorTopology *endcapTop_p)
RecHitWithFraction map5x5[5][5]
reco::PFClusterRef currentCluster_p
unsigned int currentClusterIndex_
void home() const
move the navigator back to the starting point
edm::Handle< reco::PFRecHitCollection > currentRecHit_v_p
XYZVectorD XYZVector
spatial vector with cartesian internal representation
std::vector< const CaloSubdetectorTopology * > topoVector
double addMapEnergies(int etaIndexLow, int etaIndexHigh, int phiIndexLow, int phiIndexHigh)
static int position[264][3]
const reco::PFRecHitFraction * getFractionFromDetId(const DetId &id)
PFClusterShapeAlgo(bool useFractions, double w0)