Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: XrayFluoPrimaryGeneratorAction.cc
|
||||
// GEANT4 tag $Name: xray_fluo-V04-01-03
|
||||
// GEANT4 tag $Name: xray_fluo-V03-02-00
|
||||
//
|
||||
// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
//
|
||||
@@ -47,11 +47,12 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
XrayFluoPrimaryGeneratorAction::XrayFluoPrimaryGeneratorAction(
|
||||
XrayFluoDetectorConstruction* XrayFluoDC)
|
||||
:XrayFluoDetector(XrayFluoDC),rndmFlag("off"),
|
||||
beam("off"),spectrum("off"),isoVert("off")
|
||||
XrayFluoPrimaryGeneratorAction::XrayFluoPrimaryGeneratorAction(XrayFluoDetectorConstruction* XrayFluoDC)
|
||||
:rndmFlag("off"),beam("off"),spectrum("off"),isoVert("off")
|
||||
{
|
||||
|
||||
XrayFluoDetector = XrayFluoDC;
|
||||
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
@@ -68,9 +69,12 @@ XrayFluoPrimaryGeneratorAction::XrayFluoPrimaryGeneratorAction(
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
|
||||
particleGun->SetParticleEnergy(6.*keV);
|
||||
|
||||
particleGun->SetParticleEnergy(10.*keV);
|
||||
G4double position = -0.5*(XrayFluoDetector->GetWorldSizeZ());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,position));
|
||||
|
||||
G4cout << "XrayFluoPrimaryGeneratorAction created" << G4endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -82,6 +86,9 @@ XrayFluoPrimaryGeneratorAction::~XrayFluoPrimaryGeneratorAction()
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
delete runManager;
|
||||
|
||||
G4cout << "XrayFluoPrimaryGeneratorAction deleted" << G4endl;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -93,8 +100,8 @@ void XrayFluoPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4double z0 = -0.5*(XrayFluoDetector->GetWorldSizeZ());
|
||||
G4double y0 = 0.*cm, x0 = 0.*cm;
|
||||
if (rndmFlag == "on")
|
||||
{y0 = (XrayFluoDetector->GetSampleSizeXY())*(G4UniformRand()-0.5);
|
||||
x0 = (XrayFluoDetector->GetSampleSizeXY())*(G4UniformRand()-0.5);
|
||||
{y0 = (XrayFluoDetector->GetDia3SizeXY())/sqrt(2.)*(G4UniformRand()-0.5); // it was GetSampleSizeXY(),
|
||||
x0 = (XrayFluoDetector->GetDia3SizeXY())/sqrt(2.)*(G4UniformRand()-0.5); // not divided by sqrt(2.)
|
||||
}
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
|
||||
@@ -149,9 +156,9 @@ void XrayFluoPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
G4double random = G4UniformRand();
|
||||
|
||||
G4double randomNum = G4UniformRand()*5.0E6;
|
||||
G4double randomNum = G4UniformRand(); //*5.0E6;
|
||||
|
||||
particleEnergy = random * energyRange;
|
||||
particleEnergy = (random*energyRange) + minEnergy;
|
||||
|
||||
if ((dataSet->FindValue(particleEnergy,id)) > randomNum)
|
||||
{
|
||||
@@ -198,3 +205,11 @@ void XrayFluoPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user