#include <SuperClusterShapeAlgo.h>
Public Member Functions | |
void | Calculate_Covariances (const reco::SuperCluster &passedCluster) |
double | etaWidth () |
double | phiWidth () |
SuperClusterShapeAlgo (const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry) | |
Private Attributes | |
double | etaWidth_ |
const CaloSubdetectorGeometry * | geometry_ |
double | phiWidth_ |
const EcalRecHitCollection * | recHits_ |
Definition at line 28 of file SuperClusterShapeAlgo.h.
SuperClusterShapeAlgo::SuperClusterShapeAlgo | ( | const EcalRecHitCollection * | hits, |
const CaloSubdetectorGeometry * | geometry | ||
) |
Definition at line 14 of file SuperClusterShapeAlgo.cc.
void SuperClusterShapeAlgo::Calculate_Covariances | ( | const reco::SuperCluster & | passedCluster | ) |
Definition at line 18 of file SuperClusterShapeAlgo.cc.
References RecoTauValidation_cfi::denominator, dPhi(), edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::energy(), PV3DBase< T, PVType, FrameType >::eta(), etaWidth_, edm::SortedCollection< T, SORT >::find(), geometry_, CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), reco::CaloCluster::hitsAndFractions(), PV3DBase< T, PVType, FrameType >::phi(), phiWidth_, Geom::pi(), reco::CaloCluster::position(), position, recHits_, mathSSE::sqrt(), and Geom::twoPi().
Referenced by HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), and EcalClusterPUCleaningTools::CleanedSuperCluster().
{ double numeratorEtaWidth = 0; double numeratorPhiWidth = 0; double scEnergy = passedCluster.energy(); double denominator = scEnergy; double scEta = passedCluster.position().eta(); double scPhi = passedCluster.position().phi(); std::vector<std::pair<DetId,float> > detId = passedCluster.hitsAndFractions(); // Loop over recHits associated with the given SuperCluster for(std::vector<std::pair<DetId,float> >::iterator hit = detId.begin(); hit != detId.end(); ++hit) { EcalRecHitCollection::const_iterator rHit = recHits_->find((*hit).first); //FIXME: THIS IS JUST A WORKAROUND A FIX SHOULD BE APPLIED if(rHit == recHits_->end()) { continue; } const CaloCellGeometry *this_cell = geometry_->getGeometry(rHit->id()); if ( this_cell == 0 ) { //edm::LogInfo("SuperClusterShapeAlgo") << "pointer to the cell in Calculate_Covariances is NULL!"; continue; } GlobalPoint position = this_cell->getPosition(); double energyHit = rHit->energy(); //form differences double dPhi = position.phi() - scPhi; if (dPhi > + Geom::pi()) { dPhi = Geom::twoPi() - dPhi; } if (dPhi < - Geom::pi()) { dPhi = Geom::twoPi() + dPhi; } double dEta = position.eta() - scEta; if ( energyHit > 0 ) { numeratorEtaWidth += energyHit * dEta * dEta; numeratorPhiWidth += energyHit * dPhi * dPhi; } etaWidth_ = sqrt(numeratorEtaWidth / denominator); phiWidth_ = sqrt(numeratorPhiWidth / denominator); } }
double SuperClusterShapeAlgo::etaWidth | ( | ) | [inline] |
Definition at line 37 of file SuperClusterShapeAlgo.h.
References etaWidth_.
Referenced by HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), and EcalClusterPUCleaningTools::CleanedSuperCluster().
{ return etaWidth_; }
double SuperClusterShapeAlgo::phiWidth | ( | ) | [inline] |
Definition at line 38 of file SuperClusterShapeAlgo.h.
References phiWidth_.
Referenced by HiEgammaSCEnergyCorrectionAlgo::applyCorrection(), EgammaSCEnergyCorrectionAlgo::applyCorrection(), and EcalClusterPUCleaningTools::CleanedSuperCluster().
{ return phiWidth_; }
double SuperClusterShapeAlgo::etaWidth_ [private] |
Definition at line 45 of file SuperClusterShapeAlgo.h.
Referenced by Calculate_Covariances(), and etaWidth().
const CaloSubdetectorGeometry* SuperClusterShapeAlgo::geometry_ [private] |
Definition at line 43 of file SuperClusterShapeAlgo.h.
Referenced by Calculate_Covariances().
double SuperClusterShapeAlgo::phiWidth_ [private] |
Definition at line 45 of file SuperClusterShapeAlgo.h.
Referenced by Calculate_Covariances(), and phiWidth().
const EcalRecHitCollection* SuperClusterShapeAlgo::recHits_ [private] |
Definition at line 42 of file SuperClusterShapeAlgo.h.
Referenced by Calculate_Covariances().