CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/FastSimulation/Calorimetry/interface/HCALResponse.h

Go to the documentation of this file.
00001 #ifndef HCALResponse_h
00002 #define HCALResponse_h
00003 
00010 #include <map>
00011 #include <vector>
00012 
00013 typedef std::pair<double,double> response;
00014 enum part{hcbarrel=0, hcendcap=1, hcforward=2};
00015 enum type{ECAL=0, HCAL=1, VFCAL=2};
00016 
00017 class RandomEngine;
00018 
00019 namespace edm { 
00020   class ParameterSet;
00021 }
00022 
00023 class HCALResponse
00024 {
00025 public:
00026   HCALResponse(const edm::ParameterSet& pset,
00027                const RandomEngine* engine);
00028   ~HCALResponse(){;} 
00029 
00030   // Get the response in the for of pair 
00031   // parameters:  energy, eta, e/gamma = 0, hadron = 1, mu = 2, mip: 0/1/2
00032   // mip = 2 means "mean" response regardless actual mip
00033   response responseHCAL(int _mip, double energy, double eta, int partype);
00034 
00035   // legacy methods using simple furmulae
00036   double getHCALEnergyResponse   (double e, int hit);
00037   double getHCALEnergyResolution (double e, int hit);
00038   double getHFEnergyResolution   (double EGen);
00039   
00040 private:
00041 
00042   // calculates interpolated-extrapolated reponse (mean and sigma, see below)
00043   // for hadrons and e/gamma (the latter in HF specifically)
00044   void interHD(int mip, double e, int ie, int ieta);
00045   void interEM(double e, int ie, int ieta); 
00046   void interMU(double e, int ie, int ieta); 
00047 
00048   //debugging and mip toggles
00049   bool debug, usemip;
00050   
00051   //Default values for resolution parametrisation:
00052   //stochastic, constant and noise.
00053   //in the barrel and in the endcap
00054   //in the ECAL, HCAL, VFCAL
00055   double RespPar[3][2][3];
00056 
00057   //HCAL response parameters
00058   double eResponseScale[3];
00059   double eResponsePlateau[3];
00060   double eResponseExponent;
00061   double eResponseCoefficient;
00062   double eResponseCorrection;
00063   double eBias;
00064   
00065   //correction factors
00066   bool useAdHocCorrections_;
00067   std::vector<double> barrelCorrection;
00068   std::vector<double> endcapCorrection;
00069   std::vector<double> forwardCorrectionEnergyDependent;
00070   std::vector<double> forwardCorrectionEtaDependent;
00071 
00072   //max values
00073   int maxHDe, maxHDeta, maxMUe, maxMUeta, maxMUbin, maxEMe, maxEMeta;
00074 
00075   // eta step for eta index calc
00076   double etaStep;
00077   // eta index for different regions
00078   int  barrelHDeta, endcapHDeta, forwardHDeta, barrelMUeta, endcapMUeta;
00079   // energy step of the tabulated muon data
00080   double muStep;
00081   // correction factor for HF EM
00082   double respFactorEM;
00083   // mean and sigma
00084   double mean, sigma; 
00085 
00086   // Tabulated energy, et/pt and eta points
00087   std::vector<double> eGridHD;
00088   std::vector<double> eGridEM;
00089   std::vector<double> eGridMU;
00090   std::vector<double> etaGridMU;
00091 
00092   // Tabulated response and mean for hadrons normalized to the energy
00093   // indices: meanHD[energy][eta]
00094   std::vector<std::vector<double> > meanHD, sigmaHD;
00095   std::vector<std::vector<double> > meanHD_mip, sigmaHD_mip;
00096   std::vector<std::vector<double> > meanHD_nomip, sigmaHD_nomip;
00097   
00098   // Tabulated response and mean for e/gamma in HF specifically (normalized)
00099   // indices: meanEM[energy][eta]
00100   std::vector<std::vector<double> > meanEM, sigmaEM;
00101 
00102   // muon histos
00103   // indices: responseMU[energy][eta][bin]
00104   std::vector<std::vector<std::vector<double> > > responseMU; 
00105 
00106   // Famos random engine
00107   const RandomEngine* random;
00108 
00109 };
00110 #endif
00111