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 private:
47 
48  // calculates interpolated-extrapolated response smearing factors
49  // for hadrons, muons, and e/gamma (the last in HF specifically)
50  double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const*);
51  double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const*);
52  double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const*);
53 
54  //random shooting functions w/ protection from negative energies
55  double gaussShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
56  double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR,RandomEngineAndDistribution const*);
57  double PoissonShootNoNegative(double e, double sigma,RandomEngineAndDistribution const*);
58 
59  //find subdet
60  int getDet(int ieta);
61 
62  //debugging and mip toggles
63  bool debug, usemip;
64 
65  //Default values for resolution parametrisation:
66  //stochastic, constant and noise.
67  //in the barrel and in the endcap
68  //in the ECAL, HCAL, VFCAL
69  double RespPar[3][2][3];
70 
71  //HCAL response parameters
72  double eResponseScale[3];
73  double eResponsePlateau[3];
76 
77  //max values
79  int maxHDe[4];
80  // eta step for eta index calc
81  double etaStep;
82  // eta index for different regions
84  // energy step of the tabulated muon data
85  double muStep;
86  // correction factor for HF EM
87  double respFactorEM;
88 
89  // Tabulated energy, et/pt and eta points
94 
95  // Tabulated response and mean for hadrons normalized to the energy
96  // indices: parameters[par][mip][det][energy][eta]
97  int nPar;
98  std::vector<std::string> parNames;
100 
101  // Tabulated response and mean for e/gamma in HF specifically (normalized)
102  // indices: meanEM[energy][eta]
104 
105  // muon histos
106  // indices: responseMU[energy][eta][bin]
110 
111  // crystal ball generator
113 
114 };
115 #endif
116 
double etaStep
Definition: HCALResponse.h:81
type
Definition: HCALResponse.h:21
double RespPar[3][2][3]
Definition: HCALResponse.h:69
double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const *)
int maxHDe[4]
Definition: HCALResponse.h:79
int HDeta[4]
Definition: HCALResponse.h:83
double eResponseCoefficient
Definition: HCALResponse.h:75
int getDet(int ieta)
double eResponseScale[3]
Definition: HCALResponse.h:72
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:98
double eResponseExponent
Definition: HCALResponse.h:74
T eta() const
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:109
vec1 eGridHD[3]
Definition: HCALResponse.h:90
std::vector< double > vec1
Definition: HCALResponse.h:15
double muStep
Definition: HCALResponse.h:85
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 *)
part
Definition: HCALResponse.h:20
double respFactorEM
Definition: HCALResponse.h:87
int maxHDetas[3]
Definition: HCALResponse.h:83
DoubleCrystalBallGenerator cball
Definition: HCALResponse.h:112
HCALResponse(const edm::ParameterSet &pset)
Definition: HCALResponse.cc:18
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
double eResponsePlateau[3]
Definition: HCALResponse.h:73
double gaussShootNoNegative(double e, double sigma, RandomEngineAndDistribution const *)
double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR, RandomEngineAndDistribution const *)