2 #include <CLHEP/Random/Randomize.h>
7 thePositionAtShower(0, 0, 0),
8 thePathLengthAtShower(0),
9 thePathLengthOnEcal(0),
10 theStepLengthToHcal(0),
11 theStepLengthToOut(0),
15 theEnergyDeposited(0) {
35 if (showerType < 100) {
76 if (pathLengthAtHcalBack > 0) {
84 double zsign = (
eta > 0) ? 1.0 : -1.0;
103 double depthAtShower = 0.0;
109 double effectiveLambda = 0.0;
119 double frac_ssp2 = 2.8310e+00 + 2.6766e+00 * tanh(-4.8068
e-01 * (
std::log(
theEnergy) + 3.4857
e+00));
121 if (fastSimShowerType == 100) {
141 depthAtShower = -effectiveLambda *
log(CLHEP::HepUniformRand());
145 if (CLHEP::HepUniformRand() < frac_ssp2) {
147 (pathLengthAt2 -
thePathLengthOnEcal) + (pathLengthAt3 - pathLengthAt2) * CLHEP::HepUniformRand();
155 depthAtShower = (pathLengthAt4 - pathLengthAt3) * CLHEP::HepUniformRand();
160 }
else if (fastSimShowerType == 101) {
163 double zsign = (
position.getEta() > 0) ? 1.0 : -1.0;
178 depthAtShower = -effectiveLambda *
std::log(CLHEP::HepUniformRand());
181 if (CLHEP::HepUniformRand() < frac_ssp2) {
183 (pathLengthAt2 -
thePathLengthOnEcal) + (pathLengthAt3 - pathLengthAt2) * CLHEP::HepUniformRand();
189 depthAtShower = (pathLengthAt4 - pathLengthAt3) * CLHEP::HepUniformRand();