16 recHits_(hits), geometry_(geo) { }
20 double numeratorEtaWidth = 0;
21 double numeratorPhiWidth = 0;
23 double scEnergy = passedCluster.
energy();
26 double scEta = passedCluster.
position().eta();
27 double scPhi = passedCluster.
position().phi();
29 const std::vector<std::pair<DetId,float> > &detId = passedCluster.
hitsAndFractions();
31 for(std::vector<std::pair<DetId,float> >::const_iterator
hit = detId.begin();
32 hit != detId.end(); ++
hit) {
39 if ( this_cell == 0 ) {
45 double energyHit = rHit->energy()*
hit->second;
48 double dPhi = position.
phi() - scPhi;
52 double dEta = position.
eta() - scEta;
54 if ( energyHit > 0 ) {
55 numeratorEtaWidth += energyHit * dEta * dEta;
56 numeratorPhiWidth += energyHit * dPhi *
dPhi;
const math::XYZPoint & position() const
cluster centroid position
void Calculate_Covariances(const reco::SuperCluster &passedCluster)
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
const CaloSubdetectorGeometry * geometry_
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double dPhi(double phi1, double phi2)
double energy() const
cluster energy
const_iterator end() const
const EcalRecHitCollection * recHits_
iterator find(key_type k)
static int position[264][3]
SuperClusterShapeAlgo(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.