CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HCALResponse.h
Go to the documentation of this file.
1 #ifndef HCALResponse_h
2 #define HCALResponse_h
3 
11 #include <vector>
12 #include <string>
13 
14 //define multidimensional vector types
15 typedef std::vector<double> vec1;
16 typedef std::vector<vec1> vec2;
17 typedef std::vector<vec2> vec3;
18 typedef std::vector<vec3> vec4;
19 typedef std::vector<vec4> vec5;
21 enum type{ECAL=0, HCAL=1, VFCAL=2};
22 
24 
25 namespace edm {
26  class ParameterSet;
27 }
28 
30 {
31  public:
32  HCALResponse(const edm::ParameterSet& pset);
34 
35  // Get the response smearing factor
36  // for e/gamma = 0, hadron = 1, mu = 2, mip: 0/1/2
37  // mip = 2 means "mean" response regardless actual mip
38  double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const*);
39 
40  //Get the energy and eta dependent mip fraction
41  double getMIPfraction(double energy, double eta);
42 
43  // legacy methods using simple formulae
44  double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const*);
45 
46  // correct HF response for SL
47  void correctHF(double e, int type);
48  vec1 & getCorrHF() {return corrHF;}
49 
50  private:
51 
52  // calculates interpolated-extrapolated response smearing factors
53  // for hadrons, muons, and e/gamma (the last in HF specifically)
54  double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const*);
55  double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const*);
56  double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const*);
57 
58  //random shooting functions w/ protection from negative energies
59  double gaussShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
60  double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR,RandomEngineAndDistribution const*);
61  double PoissonShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
62 
63  //find subdet
64  int getDet(int ieta);
65 
66  //debugging and mip toggles
67  bool debug, usemip;
68 
69  //Default values for resolution parametrisation:
70  //stochastic, constant and noise.
71  //in the barrel and in the endcap
72  //in the ECAL, HCAL, VFCAL
73  double RespPar[3][2][3];
74 
75  //HCAL response parameters
76  double eResponseScale[3];
77  double eResponsePlateau[3];
80 
81  //max values
83  int maxHDe[4];
84  // eta step for eta index calc
85  double etaStep;
86  // eta index for different regions
88  // energy step of the tabulated muon data
89  double muStep;
90  // correction factor for HF EM
91  double respFactorEM;
92 
93  // Tabulated energy, et/pt and eta points
98 
99  // Tabulated response and mean for hadrons normalized to the energy
100  // indices: parameters[par][mip][det][energy][eta]
101  int nPar;
102  std::vector<std::string> parNames;
104 
105  // Tabulated response and mean for e/gamma in HF specifically (normalized)
106  // indices: meanEM[energy][eta]
108 
109  // muon histos
110  // indices: responseMU[energy][eta][bin]
114 
115  // crystal ball generator
117 
118  // HF correction for SL
123 };
124 #endif
125 
double etaStep
Definition: HCALResponse.h:85
type
Definition: HCALResponse.h:21
double RespPar[3][2][3]
Definition: HCALResponse.h:73
double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const *)
int maxHDe[4]
Definition: HCALResponse.h:83
int HDeta[4]
Definition: HCALResponse.h:87
double eResponseCoefficient
Definition: HCALResponse.h:79
int getDet(int ieta)
double eResponseScale[3]
Definition: HCALResponse.h:76
double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const *)
double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const *)
std::vector< std::string > parNames
Definition: HCALResponse.h:102
void correctHF(double e, int type)
double eResponseExponent
Definition: HCALResponse.h:78
double PoissonShootNoNegative(double e, double sigma, RandomEngineAndDistribution const *)
std::vector< vec4 > vec5
Definition: HCALResponse.h:19
std::vector< vec2 > vec3
Definition: HCALResponse.h:17
vec3 PoissonParameters
Definition: HCALResponse.h:113
vec1 & getCorrHF()
Definition: HCALResponse.h:48
std::vector< double > vec1
Definition: HCALResponse.h:15
double muStep
Definition: HCALResponse.h:89
double getMIPfraction(double energy, double eta)
double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const *)
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
const int mu
Definition: Constants.h:22
double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const *)
vec1 eGridHD[4]
Definition: HCALResponse.h:94
part
Definition: HCALResponse.h:20
double respFactorEM
Definition: HCALResponse.h:91
int maxHDetas[3]
Definition: HCALResponse.h:87
DoubleCrystalBallGenerator cball
Definition: HCALResponse.h:116
HCALResponse(const edm::ParameterSet &pset)
Definition: HCALResponse.cc:18
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double eResponsePlateau[3]
Definition: HCALResponse.h:77
double gaussShootNoNegative(double e, double sigma, RandomEngineAndDistribution const *)
double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR, RandomEngineAndDistribution const *)