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
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
124 };
125 #endif
HCALResponse::eResponsePlateau
double eResponsePlateau[3]
Definition: HCALResponse.h:77
HCALResponse::parameters
vec5 parameters
Definition: HCALResponse.h:103
HCALResponse::eGridMU
vec1 eGridMU
Definition: HCALResponse.h:96
HCALResponse::gaussShootNoNegative
double gaussShootNoNegative(double e, double sigma, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:602
HCALResponse::eResponseScale
double eResponseScale[3]
Definition: HCALResponse.h:76
HCALResponse::cballShootNoNegative
double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:614
HCALResponse::getCorrHFem
vec1 & getCorrHFem()
Definition: HCALResponse.h:47
HCALResponse::responseMU
vec3 responseMU
Definition: HCALResponse.h:111
vec5
std::vector< vec4 > vec5
Definition: HCALResponse.h:19
HCALResponse::getHCALEnergyResponse
double getHCALEnergyResponse(double e, int hit, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:563
hcbarrel
Definition: HCALResponse.h:20
vec3
std::vector< vec2 > vec3
Definition: HCALResponse.h:17
HCALResponse::interHD
double interHD(int mip, double e, int ie, int ieta, int det, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:449
HCALResponse::corrHFhad
vec1 corrHFhad
Definition: HCALResponse.h:123
vec1
std::vector< double > vec1
Definition: HCALResponse.h:15
HCALResponse::maxEne
int maxEne
Definition: HCALResponse.h:119
HCALResponse::interEM
double interEM(double e, int ie, int ieta, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:525
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm
HLT enums.
Definition: AlignableModifier.h:19
HCALResponse::maxHDe
int maxHDe[4]
Definition: HCALResponse.h:83
HCALResponse::interMU
double interMU(double e, int ie, int ieta, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:404
vec4
std::vector< vec3 > vec4
Definition: HCALResponse.h:18
HCALResponse::mipfraction
vec3 mipfraction
Definition: HCALResponse.h:112
HCALResponse::respFactorEM
double respFactorEM
Definition: HCALResponse.h:91
HCALResponse::debug
bool debug
Definition: HCALResponse.h:67
HCALResponse::barrelMUeta
int barrelMUeta
Definition: HCALResponse.h:87
hcforward
Definition: HCALResponse.h:20
HCALResponse::getDet
int getDet(int ieta)
Definition: HCALResponse.cc:591
vec2
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
HCALResponse::maxMUe
int maxMUe
Definition: HCALResponse.h:82
HCALResponse::etaGridMU
vec1 etaGridMU
Definition: HCALResponse.h:97
ECAL
Definition: HCALResponse.h:21
part
part
Definition: HCALResponse.h:20
HCALResponse::maxEMeta
int maxEMeta
Definition: HCALResponse.h:82
HCALResponse::nPar
int nPar
Definition: HCALResponse.h:101
HCALResponse::eResponseExponent
double eResponseExponent
Definition: HCALResponse.h:78
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HCALResponse::maxMUbin
int maxMUbin
Definition: HCALResponse.h:82
HCALResponse::PoissonShootNoNegative
double PoissonShootNoNegative(double e, double sigma, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:625
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HCAL
Definition: HCAL.py:1
HCALResponse::sigmaEM
vec2 sigmaEM
Definition: HCALResponse.h:107
HCALResponse::eGridEM
vec1 eGridEM
Definition: HCALResponse.h:95
HCALResponse::PoissonParameters
vec3 PoissonParameters
Definition: HCALResponse.h:113
HCALResponse::RespPar
double RespPar[3][2][3]
Definition: HCALResponse.h:73
HCALResponse::etaStep
double etaStep
Definition: HCALResponse.h:85
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HCALResponse::corrHFgEm
vec2 corrHFgEm
Definition: HCALResponse.h:121
edm::ParameterSet
Definition: ParameterSet.h:47
HCALResponse::responseHCAL
double responseHCAL(int _mip, double energy, double eta, int partype, RandomEngineAndDistribution const *)
Definition: HCALResponse.cc:280
ParameterSet
Definition: Functions.h:16
HCALResponse::corrHFhHad
vec2 corrHFhHad
Definition: HCALResponse.h:122
HCALResponse::meanEM
vec2 meanEM
Definition: HCALResponse.h:107
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HCALResponse::corrHFhEm
vec2 corrHFhEm
Definition: HCALResponse.h:122
HCALResponse::maxEta
int maxEta
Definition: HCALResponse.h:119
HCALResponse::corrHFem
vec1 corrHFem
Definition: HCALResponse.h:123
hcendcap
Definition: HCALResponse.h:20
HCALResponse::getMIPfraction
double getMIPfraction(double energy, double eta)
Definition: HCALResponse.cc:247
HCALResponse::HDeta
int HDeta[4]
Definition: HCALResponse.h:87
HCALResponse::energyHF
vec1 energyHF
Definition: HCALResponse.h:120
HCALResponse::parNames
std::vector< std::string > parNames
Definition: HCALResponse.h:102
HCALResponse::eResponseCoefficient
double eResponseCoefficient
Definition: HCALResponse.h:79
HCALResponse::corrHFgHad
vec2 corrHFgHad
Definition: HCALResponse.h:121
HCALResponse::maxMUeta
int maxMUeta
Definition: HCALResponse.h:82
HCALResponse::maxHDetas
int maxHDetas[3]
Definition: HCALResponse.h:87
HCALResponse::correctHF
void correctHF(double e, int type)
Definition: HCALResponse.cc:634
HCALResponse::HCALResponse
HCALResponse(const edm::ParameterSet &pset)
Definition: HCALResponse.cc:18
HCALResponse::usemip
bool usemip
Definition: HCALResponse.h:67
HCALResponse::eGridHD
vec1 eGridHD[4]
Definition: HCALResponse.h:94
VFCAL
Definition: HCALResponse.h:21
HCALResponse::~HCALResponse
~HCALResponse()
Definition: HCALResponse.h:32
HCALResponse::maxEMe
int maxEMe
Definition: HCALResponse.h:82
HCALResponse
Definition: HCALResponse.h:29
HCALResponse::cball
DoubleCrystalBallGenerator cball
Definition: HCALResponse.h:116
HCALResponse::endcapMUeta
int endcapMUeta
Definition: HCALResponse.h:87
DoubleCrystalBallGenerator
Definition: DoubleCrystalBallGenerator.h:12
HCALResponse::getCorrHFhad
vec1 & getCorrHFhad()
Definition: HCALResponse.h:48
DoubleCrystalBallGenerator.h
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
HCALResponse::muStep
double muStep
Definition: HCALResponse.h:89
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18