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 
16 class PFResolutionMap : public TH2D {
17 public:
19  PFResolutionMap() : TH2D() {}
20 
22  PFResolutionMap(const char* name, const char* mapfile);
23 
25  PFResolutionMap(const char* name,
26  unsigned nbinseta,
27  double mineta,
28  double maxeta,
29  unsigned nbinse,
30  double mine,
31  double maxe,
32  double value = -1);
33 
35  PFResolutionMap(const TH2D& h) : TH2D(h) {}
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
def rm(path, rec=False)
Definition: eostools.py:363
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)
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)
bool IsInAPhiCrack(double phi, double eta)
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
PFResolutionMap()
default constructor
int FindBin(double eta, double e, double z=0) override
extrapolation requires overloading of this function
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)
const char * GetMapFile() const