/afs/hep.man.ac.uk/u/markowen/ATLAS/SFrameProof/2011EPS/topUtils/src/EnergyRescaler.h

00001 // copied from $SVNGRP/CombPerf/EGamma/Calibrations/EnergyRescalerTool/tags/EnergyRescalerTool-00-00-09
00003 //DATED: October 23, 2010 
00004 //V0.1
00005 //Author Ashfaq Ahmad <Ashfaq.Ahmad@cern.ch>
00006 //Class to rescale/weight energy of the cluster by applying 
00007 //Calibration Constants.
00008 //for more information please go here
00009 //https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EnergyRescaler
00010 // Jan 26, 2010
00011 //include Nikola Makovec smearing function
00012 //Feb 4, 2010
00013 // include systematics
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 //      typedef enum { NOMINAL=1, ERR_DOWN=2, ERR_UP=3 } CorrType;
00042       typedef enum { NOMINAL=0, ERR_DOWN=1, ERR_UP=2 } CorrType;
00043 
00044 
00045       //take eta/phi and uncorrected energy of electron, return  corrected energy, 
00046       //last argurment is to choose central/down/up energy corrections, default is nominal/central value
00047      
00048       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" );
00049 
00050 
00051       //if can't use the above method then use this method to read the default constants(note they are not egamma default constants
00052       //but for private use only!)
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       //get systematics error, user should not call this method. Use it via applyEnergyCorrection
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 

Generated on Thu Jun 30 11:40:04 2011 for manTreeSFrame by  doxygen 1.4.7