Skip to content

Commit

Permalink
add full5x5 shower variables to reco::Photon (given that they were re…
Browse files Browse the repository at this point in the history
…moved from pat::Photon for this reason)
  • Loading branch information
bendavid committed Oct 21, 2014
1 parent e11f2d9 commit 7aadc58
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
15 changes: 15 additions & 0 deletions DataFormats/EgammaCandidates/interface/Photon.h
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -467,6 +481,7 @@ namespace reco {
IsolationVariables isolationR04_;
IsolationVariables isolationR03_;
ShowerShape showerShapeBlock_;
ShowerShape full5x5_showerShapeBlock_;
EnergyCorrections eCorrections_;
MIPVariables mipVariableBlock_;
PflowIsolationVariables pfIsolation_;
Expand Down
1 change: 1 addition & 0 deletions DataFormats/EgammaCandidates/src/Photon.cc
Expand Up @@ -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_ )
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/EgammaCandidates/src/classes_def.xml
Expand Up @@ -9,8 +9,9 @@
</ioread>


<class name="reco::Photon" ClassVersion="13">
<class name="reco::Photon" ClassVersion="14">
<version ClassVersion="13" checksum="2963666409"/>
<version ClassVersion="14" checksum="753726370"/>
</class>
<class name="reco::Conversion" ClassVersion="11">
<version ClassVersion="10" checksum="2140222741"/>
Expand Down
25 changes: 25 additions & 0 deletions RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc
Expand Up @@ -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<float> full5x5_cov = noZS::EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry);
std::vector<float> 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();

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7aadc58

Please sign in to comment.