CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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);
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_;
59  std::string mapFile_;
60 };
61 
62 #endif
friend std::ostream & operator<<(std::ostream &out, const PFResolutionMap &rm)
print this map
double minimum(double a, double b)
bool ReadMapFile(const char *mapfile)
read text file
double dCrackPhi(double phi, double eta)
static const unsigned lineSize_
bool WriteMapFile(const char *mapfile)
int FindBin(double eta, double e)
extrapolation requires overloading of this function
T eta() const
std::string mapFile_
PFResolutionMap(const TH2D &h)
create a map from a 2d histogram
string rm
Definition: submit.py:76
double getRes(double eta, double phi, double e, int MapEta=-1)
tuple out
Definition: dbtoconf.py:99
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
Resolution Map (resolution as a function of eta and E)
Definition: DDAxes.h:10