From 7aadc58f50d12960e5da5a667fee4aaa848442af Mon Sep 17 00:00:00 2001 From: Josh Bendavid Date: Tue, 21 Oct 2014 12:32:27 +0200 Subject: [PATCH] add full5x5 shower variables to reco::Photon (given that they were removed from pat::Photon for this reason) --- .../EgammaCandidates/interface/Photon.h | 15 +++++++++++ DataFormats/EgammaCandidates/src/Photon.cc | 1 + .../EgammaCandidates/src/classes_def.xml | 3 ++- .../src/GEDPhotonProducer.cc | 25 +++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/DataFormats/EgammaCandidates/interface/Photon.h b/DataFormats/EgammaCandidates/interface/Photon.h index 869739f38736e..7245e97c8bd7c 100644 --- a/DataFormats/EgammaCandidates/interface/Photon.h +++ b/DataFormats/EgammaCandidates/interface/Photon.h @@ -165,6 +165,8 @@ namespace reco { {} } ; void setShowerShapeVariables ( const ShowerShape& a ) { showerShapeBlock_ = a ;} + void full5x5_setShowerShapeVariables ( const ShowerShape& a ) { full5x5_showerShapeBlock_ = a ;} + /// the total hadronic over electromagnetic fraction float hadronicOverEm() const {return showerShapeBlock_.hcalDepth1OverEcal + showerShapeBlock_.hcalDepth2OverEcal ;} /// the hadronic release in depth1 over electromagnetic fraction @@ -191,6 +193,18 @@ namespace reco { float r1x5 () const {return showerShapeBlock_.e1x5/showerShapeBlock_.e5x5;} float r2x5 () const {return showerShapeBlock_.e2x5/showerShapeBlock_.e5x5;} float r9 () const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();} + + ///full5x5 Shower shape variables + float full5x5_e1x5() const {return full5x5_showerShapeBlock_.e1x5;} + float full5x5_e2x5() const {return full5x5_showerShapeBlock_.e2x5;} + float full5x5_e3x3() const {return full5x5_showerShapeBlock_.e3x3;} + float full5x5_e5x5() const {return full5x5_showerShapeBlock_.e5x5;} + float full5x5_maxEnergyXtal() const {return full5x5_showerShapeBlock_.maxEnergyXtal;} + float full5x5_sigmaEtaEta() const {return full5x5_showerShapeBlock_.sigmaEtaEta;} + float full5x5_sigmaIetaIeta() const {return full5x5_showerShapeBlock_.sigmaIetaIeta;} + float full5x5_r1x5 () const {return full5x5_showerShapeBlock_.e1x5/full5x5_showerShapeBlock_.e5x5;} + float full5x5_r2x5 () const {return full5x5_showerShapeBlock_.e2x5/full5x5_showerShapeBlock_.e5x5;} + float full5x5_r9 () const {return full5x5_showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();} //======================================================= // Energy Determinations @@ -467,6 +481,7 @@ namespace reco { IsolationVariables isolationR04_; IsolationVariables isolationR03_; ShowerShape showerShapeBlock_; + ShowerShape full5x5_showerShapeBlock_; EnergyCorrections eCorrections_; MIPVariables mipVariableBlock_; PflowIsolationVariables pfIsolation_; diff --git a/DataFormats/EgammaCandidates/src/Photon.cc b/DataFormats/EgammaCandidates/src/Photon.cc index 0932bd8eb287f..c0be91986b457 100644 --- a/DataFormats/EgammaCandidates/src/Photon.cc +++ b/DataFormats/EgammaCandidates/src/Photon.cc @@ -23,6 +23,7 @@ Photon::Photon( const Photon& rhs ) : isolationR04_ ( rhs.isolationR04_), isolationR03_ ( rhs.isolationR03_), showerShapeBlock_ ( rhs.showerShapeBlock_), + full5x5_showerShapeBlock_ ( rhs.full5x5_showerShapeBlock_), eCorrections_(rhs.eCorrections_), mipVariableBlock_ (rhs.mipVariableBlock_), pfIsolation_ ( rhs.pfIsolation_ ) diff --git a/DataFormats/EgammaCandidates/src/classes_def.xml b/DataFormats/EgammaCandidates/src/classes_def.xml index 0ffb47a48667e..9617f2623c7a9 100644 --- a/DataFormats/EgammaCandidates/src/classes_def.xml +++ b/DataFormats/EgammaCandidates/src/classes_def.xml @@ -9,8 +9,9 @@ - + + diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index e3eda23d857bb..3e1a4dd03c1a4 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -498,6 +498,20 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, float sigmaEtaEta = sqrt(cov[0]); float sigmaIetaIeta = sqrt(locCov[0]); + + float full5x5_maxXtal = noZS::EcalClusterTools::eMax( *(scRef->seed()), &(*hits) ); + //AA + //Change these to consider severity level of hits + float full5x5_e1x5 = noZS::EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology)); + float full5x5_e2x5 = noZS::EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology)); + float full5x5_e3x3 = noZS::EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology)); + float full5x5_e5x5 = noZS::EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology)); + std::vector full5x5_cov = noZS::EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry); + std::vector full5x5_locCov = noZS::EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology)); + + float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]); + float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]); + // compute position of ECAL shower math::XYZPoint caloPosition = scRef->position(); @@ -542,6 +556,17 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, showerShape.hcalTowersBehindClusters = TowersBehindClus; newCandidate.setShowerShapeVariables ( showerShape ); + /// fill full5x5 shower shape block + reco::Photon::ShowerShape full5x5_showerShape; + full5x5_showerShape.e1x5= full5x5_e1x5; + full5x5_showerShape.e2x5= full5x5_e2x5; + full5x5_showerShape.e3x3= full5x5_e3x3; + full5x5_showerShape.e5x5= full5x5_e5x5; + full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal; + full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta; + full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta; + newCandidate.full5x5_setShowerShapeVariables ( full5x5_showerShape ); + /// get ecal photon specific corrected energy /// plus values from regressions and store them in the Photon // Photon candidate takes by default (set in photons_cfi.py)