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 ==
nullptr ) {
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_
double energy() const
cluster energy
const_iterator end() const
const EcalRecHitCollection * recHits_
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
iterator find(key_type k)
static int position[264][3]
SuperClusterShapeAlgo(const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)