CMS 3D CMS Logo

PFResolutionMap.h
Go to the documentation of this file.
1 #ifndef DataFormats_ParticleFlowReco_PFResolutionMap_h
2 #define DataFormats_ParticleFlowReco_PFResolutionMap_h
3 
4 #include <iostream>
5 #include <string>
6 #include <stdexcept>
7 
8 #include <TH2.h>
9 
10 
11 
18 class PFResolutionMap : public TH2D {
19 
20  public:
21 
23  PFResolutionMap() : TH2D() {}
24 
26  PFResolutionMap(const char* name, const char* mapfile);
27 
29  PFResolutionMap(const char* name,
30  unsigned nbinseta, double mineta, double maxeta,
31  unsigned nbinse, double mine, double maxe, double value=-1);
32 
34  PFResolutionMap(const TH2D& h) : TH2D(h) {}
35 
36 
38  bool ReadMapFile(const char* mapfile);
39 
42  bool WriteMapFile(const char* mapfile);
43 
45  int FindBin(double eta, double e, double z = 0 ) override;
46 
47  double getRes(double eta, double phi, double e,int MapEta = -1);
48 
49  const char* GetMapFile() const {return mapFile_.c_str();}
50 
52  friend std::ostream& operator<<(std::ostream& out, const PFResolutionMap& rm);
53 
54  private:
55  bool IsInAPhiCrack(double phi, double eta);
56  double minimum(double a,double b);
57  double dCrackPhi(double phi, double eta);
58  static const unsigned lineSize_;
60 };
61 
62 #endif
friend std::ostream & operator<<(std::ostream &out, const PFResolutionMap &rm)
print this map
double minimum(double a, double b)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool ReadMapFile(const char *mapfile)
read text file
double dCrackPhi(double phi, double eta)
static const unsigned lineSize_
bool WriteMapFile(const char *mapfile)
std::string mapFile_
PFResolutionMap(const TH2D &h)
create a map from a 2d histogram
Definition: value.py:1
double getRes(double eta, double phi, double e, int MapEta=-1)
const char * GetMapFile() const
bool IsInAPhiCrack(double phi, double eta)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
PFResolutionMap()
default constructor
int FindBin(double eta, double e, double z=0) override
extrapolation requires overloading of this function
rm
Definition: submit.py:77
Resolution Map (resolution as a function of eta and E)