CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoParticleFlow/PFClusterTools/interface/PFResolutionMap.h

Go to the documentation of this file.
00001 #ifndef DataFormats_ParticleFlowReco_PFResolutionMap_h
00002 #define DataFormats_ParticleFlowReco_PFResolutionMap_h
00003 
00004 #include <iostream>
00005 #include <string>
00006 #include <stdexcept>
00007 
00008 #include <TH2.h>
00009 
00010 
00011 
00018 class PFResolutionMap : public TH2D {
00019 
00020  public:
00021 
00023   PFResolutionMap() : TH2D() {}
00024   
00026   PFResolutionMap(const char* name, const char* mapfile);
00027   
00029   PFResolutionMap(const char* name, 
00030                   unsigned nbinseta, double mineta, double maxeta,
00031                   unsigned nbinse, double mine, double maxe, double value=-1);
00032   
00034   PFResolutionMap(const TH2D& h) : TH2D(h) {}
00035  
00036 
00038   bool ReadMapFile(const char* mapfile);
00039 
00042   bool WriteMapFile(const char* mapfile);
00043 
00045   int  FindBin(double eta, double e);
00046 
00047   double getRes(double eta, double phi, double e,int MapEta = -1); 
00048 
00049   const char* GetMapFile() const {return mapFile_.c_str();}
00050 
00052   friend std::ostream& operator<<(std::ostream& out, const PFResolutionMap& rm);
00053   
00054  private:
00055   bool IsInAPhiCrack(double phi, double eta);
00056   double minimum(double a,double b);
00057   double dCrackPhi(double phi, double eta);
00058   static const unsigned lineSize_;
00059   std::string           mapFile_;
00060 };
00061 
00062 #endif