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;
20 enum part { hcbarrel = 0, hcendcap = 1, hcforward = 2 };
21 enum type { ECAL = 0, HCAL = 1, VFCAL = 2 };
22 
24 
25 namespace edm {
26  class ParameterSet;
27 }
28 
29 class HCALResponse {
30 public:
33 
34  // Get the response smearing factor
35  // for e/gamma = 0, hadron = 1, mu = 2, mip: 0/1/2
36  // mip = 2 means "mean" response regardless actual mip
37  double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const*);
38 
39  //Get the energy and eta dependent mip fraction
40  double getMIPfraction(double energy, double eta);
41 
42  // legacy methods using simple formulae
43  double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const*);
44 
45  // correct HF response for SL
46  void correctHF(double e, int type);
47  vec1& getCorrHFem() { return corrHFem; }
48  vec1& getCorrHFhad() { return corrHFhad; }
49 
50 private:
51  // calculates interpolated-extrapolated response smearing factors
52  // for hadrons, muons, and e/gamma (the last in HF specifically)
53  double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const*);
54  double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const*);
55  double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const*);
56 
57  //random shooting functions w/ protection from negative energies
58  double gaussShootNoNegative(double e, double sigma, RandomEngineAndDistribution const*);
59  double cballShootNoNegative(
60  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
82  int maxMUe, maxMUeta, maxMUbin, maxEMe, maxEMeta;
83  int maxHDe[4];
84  // eta step for eta index calc
85  double etaStep;
86  // eta index for different regions
87  int HDeta[4], maxHDetas[3], barrelMUeta, endcapMUeta;
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
94  vec1 eGridHD[4];
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  vec1 corrHFem, corrHFhad;
124 };
125 #endif
double etaStep
Definition: HCALResponse.h:85
type
Definition: HCALResponse.h:21
double eResponseCoefficient
Definition: HCALResponse.h:79
std::vector< std::string > parNames
Definition: HCALResponse.h:102
double eResponseExponent
Definition: HCALResponse.h:78
std::vector< vec4 > vec5
Definition: HCALResponse.h:19
std::vector< vec2 > vec3
Definition: HCALResponse.h:17
vec3 PoissonParameters
Definition: HCALResponse.h:113
std::vector< double > vec1
Definition: HCALResponse.h:15
double muStep
Definition: HCALResponse.h:89
vec1 & getCorrHFhad()
Definition: HCALResponse.h:48
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
vec1 & getCorrHFem()
Definition: HCALResponse.h:47
Definition: HCAL.py:1
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
double respFactorEM
Definition: HCALResponse.h:91
HLT enums.
DoubleCrystalBallGenerator cball
Definition: HCALResponse.h:116
std::vector< vec1 > vec2
Definition: HCALResponse.h:16