CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoEcal/EgammaCoreTools/interface/ClusterShapeAlgo.h

Go to the documentation of this file.
00001 #ifndef RecoEcal_EgammaCoreTools_ClusterShapeAlgo_h
00002 #define RecoEcal_EgammaCoreTools_ClusterShapeAlgo_h
00003 
00014 #include <map>
00015 
00016 #include "FWCore/Framework/interface/ESHandle.h"
00017 
00018 #include "DataFormats/EgammaReco/interface/ClusterShape.h"
00019 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00020 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00021 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00022 #include "DataFormats/DetId/interface/DetId.h"
00023 #include "DataFormats/Math/interface/Point3D.h"
00024 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00025 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00027 
00028 class CaloSubdetectorTopology;
00029 
00030 struct EcalClusterEnergyDeposition
00031 { 
00032   double deposited_energy;
00033   double r;
00034   double phi;
00035 };
00036 
00037 class ClusterShapeAlgo
00038 {
00039 
00040  public:
00041   ClusterShapeAlgo(const edm::ParameterSet& par);
00042   ClusterShapeAlgo() { };
00043   reco::ClusterShape Calculate(const reco::BasicCluster &passedCluster,
00044                                const EcalRecHitCollection *hits,
00045                                const CaloSubdetectorGeometry * geometry,
00046                                const CaloSubdetectorTopology* topology);
00047 
00048   private:
00049   void Calculate_TopEnergy(const reco::BasicCluster &passedCluster,const EcalRecHitCollection *hits);
00050   void Calculate_2ndEnergy(const reco::BasicCluster &passedCluster,const EcalRecHitCollection *hits);
00051   void Create_Map(const EcalRecHitCollection *hits, const CaloSubdetectorTopology* topology);
00052   void Calculate_e2x2();
00053   void Calculate_e3x2();
00054   void Calculate_e3x3();
00055   void Calculate_e4x4();
00056   void Calculate_e5x5();
00057   void Calculate_e2x5Right();
00058   void Calculate_e2x5Left();
00059   void Calculate_e2x5Top();
00060   void Calculate_e2x5Bottom();
00061   void Calculate_Covariances(const reco::BasicCluster &passedCluster,
00062                              const EcalRecHitCollection* hits,
00063                              const CaloSubdetectorGeometry* geometry);
00064   void Calculate_BarrelBasketEnergyFraction(const reco::BasicCluster &passedCluster,const EcalRecHitCollection *hits,
00065                                             const int EtaPhi,const CaloSubdetectorGeometry * geometry);
00066   // defines a energy deposition topology in a reference system centered on the cluster
00067   void Calculate_EnergyDepTopology(const reco::BasicCluster &passedCluster,const EcalRecHitCollection *hits, const CaloSubdetectorGeometry * geometry, bool logW=true);
00068   void Calculate_Polynomials(double rho);
00069   double factorial(int n) const;
00070   void Calculate_lat(const reco::BasicCluster &passedCluster);
00071   void Calculate_ComplexZernikeMoments(const reco::BasicCluster &passedCluster);
00072   // explicit implementation of polynomial part of
00073   // Zernike-Functions for n<=5;
00074   double f00(double r);
00075   double f11(double r);
00076   double f20(double r);
00077   double f22(double r);
00078   double f31(double r);
00079   double f33(double r);
00080   double f40(double r);
00081   double f42(double r);
00082   double f44(double r);
00083   double f51(double r);
00084   double f53(double r);
00085   double f55(double r);
00086   double absZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0=6.6);
00087   double fast_AbsZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0);
00088   // Calculation of Zernike-Moments for general values of (n,m)
00089   double calc_AbsZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0);
00090 
00091   edm::ParameterSet parameterSet_;
00092 
00093   std::pair<DetId, double> energyMap_[5][5];
00094   int e2x2_Diagonal_X_, e2x2_Diagonal_Y_;
00095 
00096   double covEtaEta_, covEtaPhi_, covPhiPhi_;
00097   double eMax_, e2nd_, e2x2_, e3x2_, e3x3_, e4x4_, e5x5_;
00098   double e2x5Right_, e2x5Left_, e2x5Top_, e2x5Bottom_;
00099   double e3x2Ratio_;
00100   double lat_;
00101   double etaLat_ ;
00102   double phiLat_ ;
00103   double A20_, A42_;
00104   std::vector<double> energyBasketFractionEta_;
00105   std::vector<double> energyBasketFractionPhi_;
00106   DetId eMaxId_, e2ndId_;
00107   std::vector<EcalClusterEnergyDeposition> energyDistribution_;
00108   std::vector<double> fcn_;
00109 
00110   enum { Eta, Phi };
00111 
00112 };
00113 
00114 #endif