CMS 3D CMS Logo

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:
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 & getCorrHFem() {return corrHFem;}
49  vec1 & getCorrHFhad() {return corrHFhad;}
50 
51  private:
52 
53  // calculates interpolated-extrapolated response smearing factors
54  // for hadrons, muons, and e/gamma (the last in HF specifically)
55  double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const*);
56  double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const*);
57  double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const*);
58 
59  //random shooting functions w/ protection from negative energies
60  double gaussShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
61  double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR,RandomEngineAndDistribution const*);
62  double PoissonShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
63 
64  //find subdet
65  int getDet(int ieta);
66 
67  //debugging and mip toggles
68  bool debug, usemip;
69 
70  //Default values for resolution parametrisation:
71  //stochastic, constant and noise.
72  //in the barrel and in the endcap
73  //in the ECAL, HCAL, VFCAL
74  double RespPar[3][2][3];
75 
76  //HCAL response parameters
77  double eResponseScale[3];
78  double eResponsePlateau[3];
81 
82  //max values
83  int maxMUe, maxMUeta, maxMUbin, maxEMe, maxEMeta;
84  int maxHDe[4];
85  // eta step for eta index calc
86  double etaStep;
87  // eta index for different regions
88  int HDeta[4], maxHDetas[3], barrelMUeta, endcapMUeta;
89  // energy step of the tabulated muon data
90  double muStep;
91  // correction factor for HF EM
92  double respFactorEM;
93 
94  // Tabulated energy, et/pt and eta points
95  vec1 eGridHD[4];
99 
100  // Tabulated response and mean for hadrons normalized to the energy
101  // indices: parameters[par][mip][det][energy][eta]
102  int nPar;
103  std::vector<std::string> parNames;
105 
106  // Tabulated response and mean for e/gamma in HF specifically (normalized)
107  // indices: meanEM[energy][eta]
108  vec2 meanEM, sigmaEM;
109 
110  // muon histos
111  // indices: responseMU[energy][eta][bin]
115 
116  // crystal ball generator
118 
119  // HF correction for SL
122  vec2 corrHFgEm, corrHFgHad;
123  vec2 corrHFhEm, corrHFhHad;
124  vec1 corrHFem, corrHFhad;
125 };
126 #endif
127 
double etaStep
Definition: HCALResponse.h:86
type
Definition: HCALResponse.h:21
double eResponseCoefficient
Definition: HCALResponse.h:80
std::vector< std::string > parNames
Definition: HCALResponse.h:103
double eResponseExponent
Definition: HCALResponse.h:79
std::vector< vec4 > vec5
Definition: HCALResponse.h:19
std::vector< vec2 > vec3
Definition: HCALResponse.h:17
vec3 PoissonParameters
Definition: HCALResponse.h:114
std::vector< double > vec1
Definition: HCALResponse.h:15
double muStep
Definition: HCALResponse.h:90
vec1 & getCorrHFhad()
Definition: HCALResponse.h:49
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
const int mu
Definition: Constants.h:22
vec1 & getCorrHFem()
Definition: HCALResponse.h:48
Definition: HCAL.py:1
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
double respFactorEM
Definition: HCALResponse.h:92
HLT enums.
DoubleCrystalBallGenerator cball
Definition: HCALResponse.h:117
std::vector< vec1 > vec2
Definition: HCALResponse.h:16