Go to the documentation of this file.00001 #ifndef PhysicsTools_PatAlgos_interface_SuperClusterHelper_h
00002 #define PhysicsTools_PatAlgos_interface_SuperClusterHelper_h
00003
00004 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00005 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
00006 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00007 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00008 #include "DataFormats/PatCandidates/interface/Electron.h"
00009 #include "RecoEgamma/EgammaTools/interface/EcalClusterLocal.h"
00010 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00011 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00012
00013
00014 class SuperClusterHelper {
00015 public:
00016 SuperClusterHelper(const reco::GsfElectron * electron, const EcalRecHitCollection * rechits, const CaloTopology*, const CaloGeometry* );
00017 SuperClusterHelper(const pat::Electron * electron, const EcalRecHitCollection * rechits, const CaloTopology*, const CaloGeometry* );
00018 ~SuperClusterHelper(){};
00019
00020 float rawEnergy() const {return theSuperCluster_->rawEnergy();}
00021 float eta() const {return theSuperCluster_->eta();}
00022 float phi() const {return theSuperCluster_->phi();}
00023 float etaWidth() const {return theSuperCluster_->etaWidth();}
00024 float phiWidth() const {return theSuperCluster_->phiWidth();}
00025 float clustersSize() const {return theSuperCluster_->clustersSize();}
00026 float hadronicOverEm() const {return theElectron_->hadronicOverEm();}
00027 float sigmaIetaIeta() const {return theElectron_->sigmaIetaIeta();}
00028 float preshowerEnergy() const {return theSuperCluster_->preshowerEnergy();}
00029 float preshowerEnergyOverRaw() const {return theSuperCluster_->preshowerEnergy()/theSuperCluster_->rawEnergy();}
00030 float e3x3() const { return EcalClusterTools::e3x3(*seedCluster_,rechits_,topology_); }
00031 float e5x5() const { return EcalClusterTools::e5x5(*seedCluster_,rechits_,topology_); }
00032 float eMax() const { return EcalClusterTools::eMax(*seedCluster_,rechits_); }
00033 float e2nd() const { return EcalClusterTools::e2nd(*seedCluster_,rechits_); }
00034 float eTop() const { return EcalClusterTools::eTop(*seedCluster_,rechits_,topology_); }
00035 float eBottom() const { return EcalClusterTools::eBottom(*seedCluster_,rechits_,topology_); }
00036 float eLeft() const { return EcalClusterTools::eLeft(*seedCluster_,rechits_,topology_); }
00037 float eRight() const { return EcalClusterTools::eRight(*seedCluster_,rechits_,topology_); }
00038 float e2x5Max() const { return EcalClusterTools::e2x5Max(*seedCluster_,rechits_,topology_); }
00039 float e2x5Top() const { return EcalClusterTools::e2x5Top(*seedCluster_,rechits_,topology_); }
00040 float e2x5Bottom()const { return EcalClusterTools::e2x5Bottom(*seedCluster_,rechits_,topology_); }
00041 float e2x5Left() const { return EcalClusterTools::e2x5Left(*seedCluster_,rechits_,topology_); }
00042 float e2x5Right() const { return EcalClusterTools::e2x5Right(*seedCluster_,rechits_,topology_); }
00043 float r9() const {
00044 return e3x3()/theSuperCluster_->rawEnergy();}
00045 float spp();
00046 float sep();
00047 float seedEta() const { return seedCluster_->eta(); }
00048 float seedPhi() const { return seedCluster_->phi(); }
00049 float seedEnergy()const { return seedCluster_->energy();}
00050 int ietaSeed() { localCoordinates(); return ietaSeed_;}
00051 int iphiSeed() { localCoordinates(); return iphiSeed_;}
00052 float etaCrySeed() { localCoordinates(); return etaCrySeed_;}
00053 float phiCrySeed() { localCoordinates(); return phiCrySeed_;}
00054 float thetaTilt() { localCoordinates(); return thetaTilt_;}
00055 float phiTilt() {localCoordinates(); return phiTilt_;}
00056
00057
00058 float subClusterEnergy(unsigned i) const;
00059 float subClusterEta(unsigned i) const;
00060 float subClusterPhi(unsigned i) const;
00061 float subClusterEmax(unsigned i) const;
00062 float subClusterE3x3(unsigned i) const;
00063
00064 float eSubClusters() const {return eSubClusters_;}
00065
00066 float esClusterEnergy(unsigned i) const;
00067 float esClusterEta(unsigned i) const;
00068 float esClusterPhi(unsigned i) const;
00069
00070 float nPreshowerClusters() const { return nESClusters_;}
00071 float eESClusters() const { return eESClusters_;}
00072
00073 private:
00074 const reco::GsfElectron * theElectron_;
00075 const reco::SuperCluster * theSuperCluster_;
00076 std::vector<const reco::CaloCluster*> theBasicClusters_;
00077 std::vector<const reco::CaloCluster*> theESClusters_;
00078 const reco::CaloCluster * seedCluster_;
00079 const EcalRecHitCollection * rechits_;
00080 const CaloTopology* topology_;
00081 const CaloGeometry* geometry_;
00082 EcalClusterLocal local_;
00083 bool barrel_;
00084
00085
00088 bool covComputed_;
00089 std::vector<float> vCov_;
00090 float spp_;
00091 float sep_;
00093 bool localCoordinatesComputed_;
00094 int ietaSeed_;
00095 int iphiSeed_;
00096 float etaCrySeed_;
00097 float phiCrySeed_;
00098 float thetaTilt_;
00099 float phiTilt_;
00100 unsigned nBasicClusters_;
00101 unsigned nESClusters_;
00102 float eSubClusters_;
00103 float eESClusters_;
00104
00105 private:
00106 void computeLocalCovariances();
00107 void localCoordinates();
00108
00109 static bool sortClusters(const reco::CaloCluster* c1, const reco::CaloCluster* c2)
00110 {
00111 return (c1->energy()>c2->energy());
00112 }
00113 };
00114
00115
00116 #endif