00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015 #ifndef EnergyRescaler_h
00016 #define EnergyRescaler_h
00017
00018 #include <vector>
00019 #include <string>
00020
00021 #include <TRandom3.h>
00022
00023
00024
00025 class EnergyRescaler {
00026
00027
00028
00029
00030 public:
00031
00032
00033
00034 EnergyRescaler();
00035 ~EnergyRescaler();
00036
00038 bool readCalibConstants(std::string fname);
00039
00040
00041
00042 typedef enum { NOMINAL=0, ERR_DOWN=1, ERR_UP=2 } CorrType;
00043
00044
00045
00046
00047
00048 double applyEnergyCorrection(double cl_eta, double cl_phi, double uncorr_energy, double et, int value=NOMINAL , std::string part_type="ELECTRON" );
00049
00050
00051
00052
00053
00054 bool useDefaultCalibConstants(std::string corr_version="2011");
00055
00056
00058
00059 void SetRandomSeed(unsigned seed=0 );
00060
00061
00063 double getSmearingCorrection(double eta, double energy, int value=NOMINAL, bool mc_withCT=true,std::string corr_version="2011" );
00064
00065
00067 bool printMap();
00068
00069
00070 void getError(double cl_eta,double cl_et, double &er_up, double &er_do, std::string part_type="ELECTRON",bool withXMAT=true,bool withPS=true);
00071
00072
00073 private:
00074
00075 std::string corr_version;
00076
00077 TRandom3 m_random3;
00078
00079 struct calibMap {
00080
00081 double eta;
00082 double phi;
00083 double etaBinSize;
00084 double phiBinSize;
00085 double alpha;
00086 double alphaErr;
00087 };
00088
00089
00090 std::vector< calibMap > corrVec;
00091
00092
00093 };
00094
00095 #endif
00096