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);