52 #include "AIDA/AIDA.h"
57 :rndmFlag(
"off"),beam(
"off"),spectrum(
"off"),isoVert(
"off"),phaseSpaceGunFlag(false),
58 rayleighFlag(true), particleEnergies(0), particleTypes(0), detectorPosition(0)
61 XrayFluoDetector = XrayFluoDC;
85 G4cout <<
"XrayFluoPrimaryGeneratorAction created" <<
G4endl;
94 phaseSpaceGunFlag =
true;
99 XrayFluoAnalysisManager* analysis = XrayFluoAnalysisManager::getInstance();
100 analysis->LoadGunData(fileName, rayleighFlag);
101 particleEnergies = analysis->GetEmittedParticleEnergies();
102 particleTypes = analysis->GetEmittedParticleTypes();
104 detectorPosition.
setR(detectorPosition.
r()-(5.*
cm));
116 rayleighFlag =
value;
129 G4cout <<
"XrayFluoPrimaryGeneratorAction deleted" <<
G4endl;
141 if (rndmFlag ==
"on")
166 if(particle ==
"proton"|| particle ==
"alpha")
175 while (partSum<random)
177 partSum += (*data)[j];
184 else if (particle ==
"gamma")
193 G4double energyRange = maxEnergy - minEnergy;
201 particleEnergy = (random*energyRange) + minEnergy;
203 if ((dataSet->
FindValue(particleEnergy,
id)) > randomNum)
222 G4double x = rho*std::sin(theta)*std::sin(phi);
223 G4double y = rho*std::sin(theta)*std::cos(phi);
240 if (phaseSpaceGunFlag){
249 if (i < particleEnergies->size()) {
250 energy = (*particleEnergies)[i];
251 particle = particleTable->
FindParticle((*particleTypes)[i]);
265 #ifdef G4ANALYSIS_USE
268 XrayFluoAnalysisManager* analysis = XrayFluoAnalysisManager::getInstance();
269 analysis->analysePrimaryGenerator(partEnergy/
keV);
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
const XrayFluoDataSet * GetGammaSet()
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
const G4String & GetParticleName() const
XrayFluoPrimaryGeneratorAction(XrayFluoDetectorConstruction *)
void SetParticlePosition(G4ThreeVector aPosition)
G4GLOB_DLL std::ostream G4cout
G4double GetSampleSizeXY()
G4ThreeVector GetDetectorPosition()
void SetRayleighFlag(G4bool)
void GeneratePrimaries(G4Event *)
void SetParticleEnergy(G4double aKineticEnergy)
~XrayFluoPrimaryGeneratorAction()
static G4ParticleTable * GetParticleTable()
G4double FindValue(G4double e, G4int) const
G4ParticleDefinition * GetParticleDefinition() const
const XML_Char int const XML_Char * value
G4DataVector * GetEnergies()
void ActivatePhaseSpace(G4String)
const XML_Char const XML_Char * data
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
G4double GetParticleEnergy() const