70 XrayFluoAnalysisManager::XrayFluoAnalysisManager()
71 :outputFileName(
"xrayfluo"), phaseSpaceFlag(false), physicFlag (false),
72 gunParticleEnergies(0), gunParticleTypes(0)
75 fParticleEnergyAndTypeIndex = 0;
81 G4AnalysisManager::Instance();
90 if ( gunParticleEnergies )
delete gunParticleEnergies;
91 gunParticleEnergies = 0;
92 if ( gunParticleTypes )
delete gunParticleTypes;
98 delete G4AnalysisManager::Instance();
124 G4cout <<
"Open output file: " << outputFileName <<
G4endl;
143 man->
CreateH1(
"h1",
"Energy Deposit", 500,0.,10.);
144 man->
CreateH1(
"h2",
"Gamma born in the sample", 100,0.,10.);
145 man->
CreateH1(
"h3",
"Electrons born in the sample", 100,0.,10.);
146 man->
CreateH1(
"h4",
"Gammas leaving the sample", 300,0.,10.);
147 man->
CreateH1(
"h5",
"Electrons leaving the sample ",200000 ,0.,10.0);
148 man->
CreateH1(
"h6",
"Gammas reaching the detector", 100,0.,10.);
149 man->
CreateH1(
"h7",
"Spectrum of the incident particles", 100,0.,10.);
150 man->
CreateH1(
"h8",
"Protons reaching the detector", 100,0.,10.);
151 man->
CreateH1(
"h9",
"Protons leaving the sample", 100,0.,10.);
174 gunParticleEnergies =
new std::vector<G4double>;
175 gunParticleTypes =
new std::vector<G4String>;
177 G4int particleID, processID;
185 if (raileighFlag ^ (!raileighFlag && (processID == 1 ||
188 gunParticleEnergies->push_back(energy*
MeV);
190 gunParticleTypes->push_back(
"gamma");
191 else if (particleID == 0)
192 gunParticleTypes->push_back(
"e-");
196 G4cout <<
"Maximum mumber of events: "<< gunParticleEnergies->size() <<
G4endl;
206 std::pair<G4double,G4String>
result;
208 if(fParticleEnergyAndTypeIndex < (
G4int) gunParticleEnergies->size())
210 G4double energy = gunParticleEnergies->at(fParticleEnergyAndTypeIndex);
211 G4String name = gunParticleTypes->at(fParticleEnergyAndTypeIndex);
213 result.second =
name;
216 fParticleEnergyAndTypeIndex++;
255 G4int isBornInTheSample=0;
269 if (physicFlag ^ (!physicFlag &&
277 if (creationPosVolume->
GetName() ==
"Sample" ) {
278 isBornInTheSample = 1;
294 if (parentProcess ==
"") parent = 0;
295 if (parentProcess ==
"ioni") parent = 1;
296 if (parentProcess ==
"LowEnPhotoElec") parent = 2;
297 if (parentProcess ==
"Transportation") parent = 3;
298 if (parentProcess ==
"initStep") parent = 4;
301 parentProcess =
"Not Known -- (primary generator + Rayleigh)";
307 if (sampleMaterial == (
"Dolorite" ||
"Anorthosite" ||
"Mars1" ||
"IceBasalt" ||
"HPGe")) sampleMat=1;
421 man->
FillH1(8,protonsAtTheDetPre);
458 outputFileName = newName;
G4double G4ParticleHPJENDLHEData::G4double result
G4int GetParentID() const
G4int CreateNtupleIColumn(const G4String &name)
G4bool SetFirstHistoId(G4int firstId)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
CLHEP::Hep3Vector G4ThreeVector
void SetPhysicFlag(G4bool)
const G4DynamicParticle * GetDynamicParticle() const
void analyseStepping(const G4Step *aStep)
G4StepStatus GetStepStatus() const
const G4String & GetName() const
void SetVerboseLevel(G4int verboseLevel)
static G4Electron * Definition()
G4VSolid * GetSolid() const
G4int CreateNtuple(const G4String &name, const G4String &title)
G4bool SetNtupleDColumn(const G4String &columnName, G4double &value)
G4ParticleDefinition * GetDefinition() const
const std::pair< G4double, G4String > GetEmittedParticleEnergyAndType()
virtual ~XrayFluoAnalysisManager()
static XrayFluoDetectorConstruction * GetInstance()
G4bool OpenFile(const G4String &fileName="")
#define G4MUTEX_INITIALIZER
void LoadGunData(G4String, G4bool)
G4bool SetNtupleIColumn(const G4String &columnName, G4int &value)
G4VPhysicalVolume * GetNextVolume() const
void analysePrimaryGenerator(G4double energy)
static G4Proton * Definition()
G4StepPoint * GetPreStepPoint() const
const G4VProcess * GetCreatorProcess() const
G4bool FillNtupleIColumn(G4int id, G4int value)
G4GLOB_DLL std::ostream G4cout
G4int GetCurrentStepNumber() const
G4VPhysicalVolume * GetPhysicalVolume() const
const G4String & GetName() const
G4bool FillNtupleDColumn(G4int id, G4double value)
static XrayFluoAnalysisManager * getInstance()
G4Navigator * GetGeometryNavigator() const
const G4String & GetProcessName() const
const G4ThreeVector & GetVertexPosition() const
G4Material * GetMaterial() const
G4bool SetFirstNtupleId(G4int firstId)
tools::rroot::ntuple * GetNtuple() const
G4LogicalVolume * GetLogicalVolume() const
G4double energy(const ThreeVector &p, const G4double m)
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
G4StepPoint * GetPostStepPoint() const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
G4VPhysicalVolume * GetVolume() const
void SetOutputFileName(G4String)
void SetVerboseLevel(G4int verboseLevel)
static constexpr double MeV
G4int CreateNtupleDColumn(const G4String &name)
void analyseEnergyDep(G4double eDep)
G4double GetKineticEnergy() const
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
G4Track * GetTrack() const
static constexpr double keV
static G4Gamma * Definition()
G4ThreeVector GetMomentum() const