2 #include <CLHEP/Random/Randomize.h>
5 : theShowerType(-1), theEnergy(0), thePositionAtShower(0,0,0), thePathLengthAtShower(0),
6 thePathLengthOnEcal(0), theStepLengthToHcal(0), theStepLengthToOut(0),
7 thePathLength(0), theGlobalTime(0), thePosition(0,0,0), theEnergyDeposited(0)
19 double magneticField) {
74 double zsign = (eta > 0) ? 1.0 : -1.0 ;
95 double depthAtShower = 0.0;
100 double effectiveLambda = 0.0;
110 double frac_ssp2 = 2.8310e+00+2.6766e+00*tanh(-4.8068e-01*(
std::log(
theEnergy)+3.4857e+00));
112 if(fastSimShowerType == 100 ) {
129 depthAtShower = - effectiveLambda*
log(CLHEP::HepUniformRand());
131 if(depthAtShower > (pathLengthAt2 - thePathLengthOnEcal) ) {
133 if(CLHEP::HepUniformRand() < frac_ssp2 ) {
134 depthAtShower = (pathLengthAt2 -
thePathLengthOnEcal) + (pathLengthAt3-pathLengthAt2)*CLHEP::HepUniformRand();
141 if(depthAtShower > (pathLengthAt4 - thePathLengthOnEcal)) {
142 depthAtShower = (pathLengthAt4 - pathLengthAt3)*CLHEP::HepUniformRand();
148 else if(fastSimShowerType == 101 ) {
151 double zsign = (position.getEta() > 0) ? 1.0 : -1.0 ;
164 depthAtShower = -effectiveLambda*
std::log(CLHEP::HepUniformRand());
167 if(CLHEP::HepUniformRand() < frac_ssp2 ) {
168 depthAtShower = (pathLengthAt2 -
thePathLengthOnEcal) +(pathLengthAt3 - pathLengthAt2)*CLHEP::HepUniformRand();
171 depthAtShower = (pathLengthAt3 -
thePathLengthOnEcal)-effectiveLambda*std::log(CLHEP::HepUniformRand());
175 depthAtShower = (pathLengthAt4 - pathLengthAt3)*CLHEP::HepUniformRand();
const double ZFrontCrystalEE
double getPathLengthAtZ(double z) const
const double Zmax[kNumberCalorimeter]
double thePathLengthAtShower
GflashTrajectory * theHelix
Sin< T >::type sin(const T &t)
Gflash3Vector & simulateFirstInteractionPoint(int showType, Gflash3Vector &pos)
const double EtaMax[kNumberCalorimeter]
static int position[TOTALCHAMBERS][3]
double theStepLengthToHcal
int findShowerType(const Gflash3Vector position)
const double LengthCrystalEE
Gflash3Vector thePosition
const double LengthCrystalEB
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
Log< T >::type log(const T &t)
Gflash3Vector thePositionAtShower
CLHEP::Hep3Vector Gflash3Vector
double thePathLengthOnEcal
double theEnergyDeposited
Gflash3Vector & getPosition()
double theStepLengthToOut
const double Rmax[kNumberCalorimeter]
const double Rmin[kNumberCalorimeter]
double getPathLengthAtRhoEquals(double rho) const
void initialize(int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum, double magneticField)
void initializeTrajectory(const HepGeom::Vector3D< double > &, const HepGeom::Point3D< double > &, double q, double Field)
void updateShowino(double deltaStep)