• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/Users/jmonk/Physics/ForIA/ForIA/AnalysisTools/EnergyRescaler.hh

Go to the documentation of this file.
00001 
00002 //DATED: October 23, 2010 
00003 //V0.1
00004 //Author Ashfaq Ahmad <Ashfaq.Ahmad@cern.ch>
00005 //Class to rescale/weight energy of the cluster by applying 
00006 //Calibration Constants.
00007 //for more information please go here
00008 //https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EnergyRescaler
00009 // Jan 26, 2010
00010 //include Nikola Makovec smearing function
00011 //Feb 4, 2010
00012 // include systematics
00014 #ifndef EnergyRescaler_h
00015 #define EnergyRescaler_h
00016 
00017 #include <vector>
00018 #include <string>
00019 
00020 #include "TRandom3.h"
00021 //class TRandom3;
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 //      typedef enum { NOMINAL=1, ERR_DOWN=2, ERR_UP=3 } CorrType;
00040       typedef enum { NOMINAL=0, ERR_DOWN=1, ERR_UP=2 } CorrType;
00041 
00042 
00043       //take eta/phi and uncorrected energy of electron, return  corrected energy, 
00044       //last argurment is to choose central/down/up energy corrections, default is nominal/central value
00045      
00046       double applyEnergyCorrection(double cl_eta, double cl_phi, double uncorr_energy, double et, int value=NOMINAL /* NOMINAL=0, ERROR_DOWN==1, ERROR_UP==2*/, std::string part_type="ELECTRON" );
00047 
00048 
00049       //if can't use the above method then use this method to read the default constants(note they are not egamma default constants
00050       //but for private use only!)
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       //get systematics error, user should not call this method. Use it via applyEnergyCorrection
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 

Generated on Mon Jul 30 2012 16:56:35 for ForIA by  doxygen 1.7.2