Skip to content

Commit

Permalink
making the dR comparision dR2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Harper committed Sep 19, 2014
1 parent 21d327b commit a074f0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions RecoEgamma/EgammaTools/interface/EcalRegressionData.h
Expand Up @@ -4,6 +4,7 @@
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include <vector>
#include <cmath>

class CaloGeometry;
class CaloTopology;
Expand Down Expand Up @@ -51,7 +52,7 @@ class EcalRegressionData {
float seedCrysEtaOrX()const{return seedCrysEtaOrX_;}
float seedCrysIEtaOrIX()const{return seedCrysIEtaOrIX_;}
float seedCrysIPhiOrIY()const{return seedCrysIPhiOrIY_;}
float maxSubClusDR()const{return maxSubClusDR_;}
float maxSubClusDR()const{return std::sqrt(maxSubClusDR2_);}
float maxSubClusDRDPhi()const{return maxSubClusDRDPhi_;}
float maxSubClusDRDEta()const{return maxSubClusDRDEta_;}
float maxSubClusDRRawEnergy()const{return maxSubClusDRRawEnergy_;}
Expand Down Expand Up @@ -134,7 +135,7 @@ class EcalRegressionData {
int seedCrysIPhiOrIY_;

//sub cluster (non-seed) quantities
float maxSubClusDR_;
float maxSubClusDR2_;
float maxSubClusDRDPhi_;
float maxSubClusDRDEta_;
float maxSubClusDRRawEnergy_;
Expand Down
10 changes: 5 additions & 5 deletions RecoEgamma/EgammaTools/src/EcalRegressionData.cc
Expand Up @@ -93,9 +93,9 @@ void EcalRegressionData::fill(const reco::SuperCluster& superClus,
for( auto clus = superClus.clustersBegin()+1;clus != superClus.clustersEnd(); ++clus ) {
const float dEta = (*clus)->eta() - superClus.seed()->eta();
const float dPhi = reco::deltaPhi((*clus)->phi(),superClus.seed()->phi());
const float dR = std::hypot(dEta,dPhi);
if(dR > maxSubClusDR_ || maxSubClusDR_ == 999.0f) {
maxSubClusDR_ = dR;
const float dR2 = dEta*dEta+dPhi*dPhi;
if(dR2 > maxSubClusDR2_ || maxSubClusDR2_ == 998001.) {
maxSubClusDR2_ = dR2;
maxSubClusDRDEta_ = dEta;
maxSubClusDRDPhi_ = dPhi;
maxSubClusDRRawEnergy_ = (*clus)->energy();
Expand Down Expand Up @@ -139,9 +139,9 @@ void EcalRegressionData::clear()
seedCrysIEtaOrIX_=0;
seedCrysIPhiOrIY_=0;

maxSubClusDR_=999.;
maxSubClusDR2_=998001.;
maxSubClusDRDPhi_=999.;
maxSubClusDRDEta_=999.;
maxSubClusDRDEta_=999;
maxSubClusDRRawEnergy_=0.;

subClusRawEnergy_.clear();
Expand Down

0 comments on commit a074f0e

Please sign in to comment.