127 G4ThreeVector showerCenter;
129 distOut = fastTrack.GetEnvelopeSolid()->
130 DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
131 fastTrack.GetPrimaryTrackLocalDirection());
132 showerCenter = fastTrack.GetPrimaryTrackLocalPosition() +
133 (distOut/2.)*fastTrack.GetPrimaryTrackLocalDirection();
135 showerCenter = fastTrack.GetInverseAffineTransformation()->
136 TransformPoint(showerCenter);
139 G4ThreeVector xShower, yShower, zShower;
140 zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
141 xShower = zShower.orthogonal();
142 yShower = zShower.cross(xShower);
145 G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
147 G4double deposit = Energy/double(nSpot);
150 G4ThreeVector ePoint;
156 for (
int i = 0; i < nSpot; i++)
158 z = G4RandGauss::shoot(0,20*cm);
159 r = G4RandGauss::shoot(0,10*cm);
160 phi = G4UniformRand()*twopi;
161 ePoint = showerCenter +
163 r*std::cos(phi)*xShower + r*std::sin(phi)*yShower;