25 RespPar[
HCAL][0][1] = pset.
getParameter<
double>(
"HadronBarrelResolution_Constant");
26 RespPar[
HCAL][0][2] = pset.
getParameter<
double>(
"HadronBarrelResolution_Noise");
28 RespPar[
HCAL][1][0] = pset.
getParameter<
double>(
"HadronEndcapResolution_Stochastic");
29 RespPar[
HCAL][1][1] = pset.
getParameter<
double>(
"HadronEndcapResolution_Constant");
30 RespPar[
HCAL][1][2] = pset.
getParameter<
double>(
"HadronEndcapResolution_Noise");
32 RespPar[
VFCAL][0][0] = pset.
getParameter<
double>(
"HadronForwardResolution_Stochastic");
33 RespPar[
VFCAL][0][1] = pset.
getParameter<
double>(
"HadronForwardResolution_Constant");
34 RespPar[
VFCAL][0][2] = pset.
getParameter<
double>(
"HadronForwardResolution_Noise");
36 RespPar[
VFCAL][1][0] = pset.
getParameter<
double>(
"ElectronForwardResolution_Stochastic");
37 RespPar[
VFCAL][1][1] = pset.
getParameter<
double>(
"ElectronForwardResolution_Constant");
38 RespPar[
VFCAL][1][2] = pset.
getParameter<
double>(
"ElectronForwardResolution_Noise");
41 eResponseScale[1] = pset.
getParameter<
double>(
"eResponseScaleHE");
42 eResponseScale[2] = pset.
getParameter<
double>(
"eResponseScaleHF");
45 eResponsePlateau[1] = pset.
getParameter<
double>(
"eResponsePlateauHE");
46 eResponsePlateau[2] = pset.
getParameter<
double>(
"eResponsePlateauHF");
82 for(
int m = 0;
m < 3;
m++){
83 for(
int d = 0; d < 3; d++){
91 for(
int i = 0;
i < maxHDe[d];
i++){
115 double _barrelMUeta = pset.
getParameter<
double>(
"barrelMUeta");
116 double _endcapMUeta = pset.
getParameter<
double>(
"endcapMUeta");
119 if(fabs(_barrelMUeta) <= etaGridMU[
i]) { barrelMUeta =
i;
break; }
122 if(fabs(_endcapMUeta) <= etaGridMU[
i]) {
endcapMUeta =
i;
break; }
140 responseMU[
i][
j][
k] = _responseMU[loc][
i*maxMUetas[loc]*maxMUbin + (
j-eta_loc)*maxMUbin +
k];
144 LogInfo(
"FastCalorimetry") <<
" responseMU " <<
i <<
" " <<
j <<
" " <<
k <<
" = "
191 else if(ieta < 0) ieta = 0;
201 if(ie == -1) ie = maxEMe - 2;
204 mean =
interEM(energy, ie, ieta);
208 else if(partype == 1) {
211 int deta = ieta -
HDeta[det];
213 else if(deta < 0 ) deta = 0;
223 if(ie == -1) ie = maxHDe[det] - 2;
226 mean =
interHD(mip, energy, ie, deta, det);
231 else if(partype == 2) {
240 if(ieta < 0) ieta = 0;
242 if(ieta < maxMUeta) {
251 if(ie == -1) ie = maxMUe - 2;
254 mean =
interMU(energy, ie, ieta);
255 if(mean > energy) mean =
energy;
262 LogInfo(
"FastCalorimetry") << std::endl
263 <<
" HCALResponse::responseHCAL, partype = " << partype
264 <<
" E, eta = " << energy <<
" " << eta
265 <<
" mean = " << mean << std::endl;
296 LogInfo(
"FastCalorimetry") << std::endl
297 <<
" HCALResponse::interMU " << std::endl
298 <<
" x, x1-x2, y1-y2 = "
299 << e <<
", " << x1 <<
"-" << x2 <<
" " << y1 <<
"-" << y2 << std::endl;
304 double mean = (y1*(x2-
e) + y2*(e-x1))/(x2-x1);
308 LogInfo(
"FastCalorimetry") << std::endl
309 <<
" HCALResponse::interMU " << std::endl
310 <<
" e, ie, ieta = " << e <<
" " << ie <<
" " << ieta << std::endl
311 <<
" response = " << mean << std::endl;
321 double x2 =
eGridHD[det][ie+1];
332 bool use_custom =
false;
336 if((
p==0 ||
p==1) && e < x1){
337 double tmp = (y1*x2-y2*x1)/(x2-x1);
344 else if((
p==2 ||
p==3 ||
p==4 ||
p==5)){
345 if(e < x1 && y1 < y2){
349 else if(e > x2 && y2 < y1){
356 if(use_custom) pars[
p] = custom;
357 else pars[
p] = (y1*(x2-
e) + y2*(e-x1))/(x2-x1);
370 double y1 =
meanEM[ie][ieta];
371 double y2 =
meanEM[ie+1][ieta];
377 LogInfo(
"FastCalorimetry") << std::endl
378 <<
" HCALResponse::interEM mean " << std::endl
379 <<
" x, x1-x2, y1-y2 = "
380 << e <<
", " << x1 <<
"-" << x2 <<
" " << y1 <<
"-" << y2 << std::endl;
384 double mean = (y1*(x2-
e) + y2*(e-x1))/(x2-x1);
391 LogInfo(
"FastCalorimetry") << std::endl
392 <<
" HCALResponse::interEM sigma" << std::endl
393 <<
" x, x1-x2, y1-y2 = "
394 << e <<
", " << x1 <<
"-" << x2 <<
" " << y1 <<
"-" << y2 << std::endl;
398 double sigma = (y1*(x2-
e) + y2*(e-x1))/(x2-x1);
414 double response = e * p / (1+c*
exp(n *
log(s/e)));
416 if(response<0.) response = 0.;
434 for(d = 0; d < 2; d++){
435 if(ieta <
HDeta[d+1]){
457 while (out < 0.) out =
cball.
shoot(mu,sigma,aL,nL,aR,nR);
double getHCALEnergyResponse(double e, int hit)
T getParameter(std::string const &) const
HCALResponse(const edm::ParameterSet &pset, const RandomEngine *engine)
const RandomEngine * random
double interHD(int mip, double e, int ie, int ieta, int det)
double eResponseCoefficient
std::vector< std::string > parNames
double gaussShoot(double mean=0.0, double sigma=1.0) const
double gaussShootNoNegative(double e, double sigma)
double interEM(double e, int ie, int ieta)
double interMU(double e, int ie, int ieta)
std::vector< double > vec1
double flatShoot(double xmin=0.0, double xmax=1.0) const
double cballShootNoNegative(double mu, double sigma, double aL, double nL, double aR, double nR)
std::vector< std::vector< double > > tmp
double responseHCAL(int _mip, double energy, double eta, int partype)
DoubleCrystalBallGenerator cball
double shoot(double mu, double sigma, double aL, double nL, double aR, double nR)
double eResponsePlateau[3]