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