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
PFResolutionMap::mapFile_
std::string mapFile_
Definition: PFResolutionMap.h:59
PFResolutionMap::PFResolutionMap
PFResolutionMap(const TH2D &h)
create a map from a 2d histogram
Definition: PFResolutionMap.h:35
PFResolutionMap::WriteMapFile
bool WriteMapFile(const char *mapfile)
Definition: PFResolutionMap.cc:49
PFResolutionMap::dCrackPhi
double dCrackPhi(double phi, double eta)
Definition: PFResolutionMap.cc:216
PFResolutionMap::PFResolutionMap
PFResolutionMap()
default constructor
Definition: PFResolutionMap.h:19
PFResolutionMap::ReadMapFile
bool ReadMapFile(const char *mapfile)
read text file
Definition: PFResolutionMap.cc:70
PFResolutionMap::getRes
double getRes(double eta, double phi, double e, int MapEta=-1)
Definition: PFResolutionMap.cc:138
PFResolutionMap::lineSize_
static const unsigned lineSize_
Definition: PFResolutionMap.h:58
PFResolutionMap::minimum
double minimum(double a, double b)
Definition: PFResolutionMap.cc:205
PFResolutionMap::GetMapFile
const char * GetMapFile() const
Definition: PFResolutionMap.h:49
PFResolutionMap::operator<<
friend std::ostream & operator<<(std::ostream &out, const PFResolutionMap &rm)
print this map
PVValHelper::eta
Definition: PVValidationHelpers.h:69
DDAxes::z
submit.rm
rm
Definition: submit.py:77
h
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
a
double a
Definition: hdecay.h:119
value
Definition: value.py:1
PFResolutionMap::FindBin
int FindBin(double eta, double e, double z=0) override
extrapolation requires overloading of this function
Definition: PFResolutionMap.cc:168
DDAxes::phi
PFResolutionMap::IsInAPhiCrack
bool IsInAPhiCrack(double phi, double eta)
Definition: PFResolutionMap.cc:198
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
PFResolutionMap
Resolution Map (resolution as a function of eta and E)
Definition: PFResolutionMap.h:16
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37