11 double energyMeanHcal = 0.0;
12 double energySigmaHcal = 0.0;
14 if(showerType == 0 || showerType == 1 || showerType == 4 || showerType == 5) {
22 r1 = CLHEP::RandGaussQ::shoot();
24 if(showerType == 0 || showerType == 1) {
28 r2 = CLHEP::RandGaussQ::shoot();
35 exp(energyMeanHcal+energySigmaHcal*(energyRho*r1 +
sqrt(1.0- energyRho*energyRho)*r2 )));
41 r2 = CLHEP::RandGaussQ::shoot();
49 exp(energyMeanHcal+energySigmaHcal*(energyRho*r1 +
sqrt(1.0- energyRho*energyRho)*r2 )));
52 else if(showerType == 2 || showerType == 6 || showerType == 3 || showerType == 7) {
59 if(showerType == 2 || showerType == 3) {
61 exp(energyMeanHcal+energySigmaHcal*CLHEP::RandGaussQ::shoot()));
68 else if(showerType == 6 || showerType == 7) {
70 exp(energyMeanHcal+energySigmaHcal*CLHEP::RandGaussQ::shoot()));
84 bool isEndcap =
false;
90 if(showerType==0) showerType = 1;
101 for (
int i = 0;
i <
Gflash::NPar ;
i++) normalZ[
i] = CLHEP::RandGaussQ::shoot();
104 double correlationSum = 0.0;
105 for(
int j = 0 ;
j <
i+1 ;
j++) {
106 correlationSum += correlationVectorHcal[i*(i+1)/2+
j]*normalZ[
j];
113 delete [] correlationVectorHcal;
124 if(showerType == 1) {
132 double *correlationVectorEcal =
new double [Gflash::NPar*(Gflash::NPar+1)/2];
137 for(
int i = 0 ; i <
Gflash::NPar ; i++) normalZ[i] = CLHEP::RandGaussQ::shoot();
139 double correlationSum = 0.0;
140 for(
int j = 0 ;
j < i+1 ;
j++) {
141 correlationSum += correlationVectorEcal[i*(i+1)/2+
j]*normalZ[
j];
148 delete [] correlationVectorEcal;
const double ZFrontCrystalEE
double fTanh(double einc, const double *par)
double longHcal[Gflash::NPar]
double lateralPar[Gflash::kNumberCalorimeter][Gflash::Nrpar]
const double pbar_par[8 *NPar][4]
const double pbar_rho[8 *NPar][4]
GflashShowino * theShowino
const double correl_hadem[4]
const double emcorr_pid[10][4]
Exp< T >::type exp(const T &t)
static int position[TOTALCHAMBERS][3]
const double hadcorr_pid[10][4]
const double pbar_hadscale[7][4]
const double mipcorr_pid[10][4]
double longEcal[Gflash::NPar]
const T & max(const T &a, const T &b)
double fLnE1(double einc, const double *par)
const double LengthCrystalEE
const double LengthCrystalEB
Gflash3Vector & getPositionAtShower()
const double pbar_emscale[2][4]
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
CLHEP::Hep3Vector Gflash3Vector
const double pbar_rpar[4 *Nrpar][2]
void getFluctuationVector(double *lowTriangle, double *correlationVector)
double depthScale(double ssp, double ssp0, double length)
const double Rmin[kNumberCalorimeter]
double energyScale[Gflash::kNumberCalorimeter]