32#include "G4PrimaryParticle.hh"
33#include "G4UnitsTable.hh"
34#include "G4SystemOfUnits.hh"
35#include "G4TransportationManager.hh"
36#include "G4FieldManager.hh"
37#include "G4UniformMagField.hh"
47 time_t seed = time( NULL );
68 G4double aResolution ) {
75 G4double aResolution ) {
77 while ( newE < 0.0 ) {
80 if ( aResolution != -1.0 ) {
81 newE = aTrackOriginal->GetKineticEnergy() *
Gauss( 1.0, aResolution );
83 newE = aTrackOriginal->GetKineticEnergy();
92 G4double aResolution ) {
93 G4ThreeVector originP = aTrackOriginal->GetMomentum();
94 G4ThreeVector originPos = aTrackOriginal->GetPosition();
95 G4double rdm =
Gauss( 1.0, aResolution );
96 G4ThreeVector smearedMom( originP.x()*rdm, originP.y()*rdm, originP.z()*rdm );
Definition of the Par02PrimaryParticleInformation class.
Definition of the Par02Smearer class.
Smearing of the particle momentum or energy.
static Par02Smearer * Instance()
Allows the access to the unique Par02Smearer class object.
G4ThreeVector SmearMomentum(const G4Track *aTrack, G4double aResolution=-1)
Smears the momentum with a given resolution.
static Par02Smearer * fPar02Smearer
A pointer to Par02Smearer object.
CLHEP::RandGauss * fRandomGauss
CLHEP random engine used in gaussian smearing.
Par02Smearer()
A default constructor.
G4double SmearEnergy(const G4Track *aTrack, G4double aResolution=-1)
Smears the energy deposit with a given resolution.
G4ThreeVector SmearGaussian(const G4Track *aTrackOriginal, G4double aResolution)
First possible type of smearing.
CLHEP::HepRandomEngine * fRandomEngine
CLHEP random engine.
G4double Gauss(G4double aMean, G4double aStandardDeviation)
Returns a random number from a Gaussian distribution.