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 std::vector<std::pair<DetId,float> > detId = passedCluster.
hitsAndFractions();
31 for(std::vector<std::pair<DetId,float> >::iterator
hit = detId.begin();
32 hit != detId.end(); ++
hit) {
39 if ( this_cell == 0 ) {
44 double energyHit = rHit->energy();
47 double dPhi = position.
phi() - scPhi;
51 double dEta = position.
eta() - scEta;
53 if ( energyHit > 0 ) {
54 numeratorEtaWidth += energyHit * dEta * dEta;
55 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_
static int position[TOTALCHAMBERS][3]
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)
SuperClusterShapeAlgo(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.