Import Geant4 4.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:39:52 +02:00
parent 921d3b1cda
commit 330b82b769
4524 changed files with 178689 additions and 43575 deletions
@@ -33,19 +33,21 @@
// 28 Nov 2001 Elena Guardincerri Created
//
// -------------------------------------------------------------------
#ifdef G4ANALYSIS_USE
#include <AIDA/IAnalysisFactory.h>
#include <AIDA/ITreeFactory.h>
#include <AIDA/ITree.h>
#include <AIDA/IHistogramFactory.h>
#include <AIDA/IHistogram1D.h>
#include <AIDA/ITupleFactory.h>
#include <AIDA/ITuple.h>
#endif
#include <stdlib.h>
#include "g4std/fstream"
#include "G4ios.hh"
#include "AIDA/IManagedObject.h"
#include "AIDA/IAnalysisFactory.h"
#include "AIDA/ITreeFactory.h"
#include "AIDA/ITree.h"
#include "AIDA/IHistogramFactory.h"
#include "AIDA/IHistogram1D.h"
#include "AIDA/ITupleFactory.h"
#include "AIDA/ITuple.h"
#include "XrayFluoAnalysisManager.hh"
#include "XrayFluoAnalysisMessenger.hh"
#include "G4Step.hh"
XrayFluoAnalysisManager* XrayFluoAnalysisManager::instance = 0;
@@ -53,22 +55,11 @@ XrayFluoAnalysisManager* XrayFluoAnalysisManager::instance = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XrayFluoAnalysisManager::XrayFluoAnalysisManager()
:analysisMessenger(0)
,analysisFactory(0)
,histo_1(0)
,histo_2(0)
,histo_3(0)
,histo_4(0)
,histo_5(0)
,histo_6(0)
,histo_7(0)
,histo_8(0)
,histo_9(0)
,tuple(0)
:analysisFactory(0), tree(0),histogramFactory(0) ,tupleFactory(0)
{
analysisMessenger = new XrayFluoAnalysisMessenger(this);
// pEvent=new XrayFluoEventAction();
#ifdef G4ANALYSIS_USE
// Hooking an AIDA compliant analysis system.
analysisFactory = AIDA_createAnalysisFactory();
if(analysisFactory) {
@@ -76,9 +67,11 @@ XrayFluoAnalysisManager::XrayFluoAnalysisManager()
ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
if(treeFactory) {
// tree = treeFactory->create(); // Tree in memory.
tree = treeFactory->create("XrayFluo.root",false,false,"ROOT");
tree = treeFactory->create("XrayFluo.hbk",false,false,"hbook");
delete treeFactory; // Will not delete the ITree.
histogramFactory = analysisFactory->createHistogramFactory(*tree);
tupleFactory = analysisFactory->createTupleFactory(*tree);
}
/*
@@ -98,7 +91,6 @@ XrayFluoAnalysisManager::XrayFluoAnalysisManager()
}
*/
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -106,13 +98,17 @@ XrayFluoAnalysisManager::XrayFluoAnalysisManager()
XrayFluoAnalysisManager::~XrayFluoAnalysisManager()
{
delete analysisMessenger;
analysisMessenger = 0;
delete histogramFactory;
histogramFactory=0;
#ifdef G4ANALYSIS_USE
delete analysisFactory;
analysisFactory = 0;
#endif
delete tupleFactory;
tupleFactory=0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -127,65 +123,67 @@ XrayFluoAnalysisManager* XrayFluoAnalysisManager::getInstance()
void XrayFluoAnalysisManager::book()
{
IHistogramFactory* histogramFactory =
analysisFactory->createHistogramFactory(*tree);
if(histogramFactory) {
// Book histograms
histo_1 = histogramFactory->create1D
("1","Energy Deposit", 100,0.,10.);
histo_2 = histogramFactory->create1D
("2","Gamma born in the sample", 100,0.,10.);
histo_3 = histogramFactory->create1D
("3","Electrons born in the sample", 100,0.,10.);
histo_4 = histogramFactory->create1D
("4","Gammas leaving the sample", 100,0.,10.);
histo_5 = histogramFactory->create1D
("5","Electrons leaving the sample ", 100,0.,10.);
histo_6 = histogramFactory->create1D
("6","Gammas reaching the detector", 100,0.,10.);
histo_7 = histogramFactory->create1D
("7","Spectrum of the incident particles", 100,0.,10.);
histo_8 = histogramFactory->create1D
("8","Protons reaching the detector", 100,0.,10.);
histo_9 = histogramFactory->create1D
("9","Protons leaving the sample", 100,0.,10.);
delete histogramFactory;
}
// Book histograms
IHistogram1D* histo_1 = histogramFactory->create1D
("1","Energy Deposit", 100,0.,10.);
IHistogram1D* histo_2 = histogramFactory->create1D
("2","Gamma born in the sample", 100,0.,10.);
IHistogram1D* histo_3 = histogramFactory->create1D
("3","Electrons born in the sample", 100,0.,10.);
IHistogram1D* histo_4 = histogramFactory->create1D
("4","Gammas leaving the sample", 100,0.,10.);
IHistogram1D* histo_5 = histogramFactory->create1D
("5","Electrons leaving the sample ", 100,0.,10.);
IHistogram1D* histo_6 = histogramFactory->create1D
("6","Gammas reaching the detector", 100,0.,10.);
IHistogram1D* histo_7 = histogramFactory->create1D
("7","Spectrum of the incident particles", 100,0.,10.);
IHistogram1D* histo_8 = histogramFactory->create1D
("8","Protons reaching the detector", 100,0.,10.);
IHistogram1D* histo_9 = histogramFactory->create1D
("9","Protons leaving the sample", 100,0.,10.);
IHistogram1D* histo_10 = histogramFactory->create1D
("10","Gammas leaving the sample smeared", 100,0.,10.);
// Get a tuple factory :
ITupleFactory* tupleFactory = analysisFactory->createTupleFactory(*tree);
if(tupleFactory) {
// Create a tuple :
// tuple = tupleFactory->create("XrayFluo","XrayFluo","energy counts");
// Create a tuple :
tuple = tupleFactory->create
("XrayFluo","XrayFluo","energy counts");
delete tupleFactory;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::finish()
{
#ifdef G4ANALYSIS_USE
if(tree) tree->commit(); // Write histos and tuple in file.
#endif
if(tree) {tree->commit(); // Write histos and tuple in file.
tree->close();}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analyseStepping(const G4Step* aStep)
{
#ifdef G4ANALYSIS_USE
IHistogram1D* histo_2 =dynamic_cast<IHistogram1D *> ( tree->find("2") );
IHistogram1D* histo_3 =dynamic_cast<IHistogram1D *> ( tree->find("3") );
IHistogram1D* histo_4 =dynamic_cast<IHistogram1D *> ( tree->find("4") );
IHistogram1D* histo_5 =dynamic_cast<IHistogram1D *> ( tree->find("5") );
IHistogram1D* histo_6 =dynamic_cast<IHistogram1D *> ( tree->find("6") );
IHistogram1D* histo_8 =dynamic_cast<IHistogram1D *> ( tree->find("8") );
IHistogram1D* histo_10 =dynamic_cast<IHistogram1D *> ( tree->find("10") );
G4double gammaAtTheDetPre=0;
G4double protonsAtTheDetPre=0;
G4double gammaLeavingSample=0;
G4double gammaLeavingSampleSmeared=0;
G4double eleLeavingSample=0;
G4double protonsLeavSam=0;
G4double gammaBornInSample=0;
@@ -197,14 +195,19 @@ void XrayFluoAnalysisManager::analyseStepping(const G4Step* aStep)
if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "gamma" )
{
gammaLeavingSample =
(aStep->GetPreStepPoint()->GetKineticEnergy());
/*gammaLeavingSampleSmeared =
ResponseFunction(aStep->GetPreStepPoint()->GetKineticEnergy());
if(histo_10) {
histo_10->fill(gammaLeavingSampleSmeared/keV);*/
gammaLeavingSample =(aStep->GetPreStepPoint()->GetKineticEnergy());
if(histo_4) {
histo_4->fill(gammaLeavingSample/keV);
}
histo_4->fill(gammaLeavingSample/keV);}
}
}
}
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Sample"){
if(aStep->GetTrack()->GetNextVolume()->GetName() == "World" )
@@ -293,31 +296,34 @@ void XrayFluoAnalysisManager::analyseStepping(const G4Step* aStep)
}
}
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analyseEnergyDep(G4double energyDep)
{
#ifdef G4ANALYSIS_USE
if(histo_1) {
IHistogram1D* histo_1 =dynamic_cast<IHistogram1D *> ( tree->find("1") );
histo_1->fill(energyDep/keV);
}
if(tuple) {
/*
if(tuple) {
tuple->fill(0,energyDep);
tuple->fill(1,1);
tuple->addRow();
}
#endif
*/
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analysePrimaryGenerator(G4double energy)
{
#ifdef G4ANALYSIS_USE
if(histo_7) histo_7->fill(energy/keV);
#endif
IHistogram1D* histo_7 =dynamic_cast<IHistogram1D *> ( tree->find("1") );
histo_7->fill(energy/keV);
}
@@ -1,257 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: XrayFluoAnalysisManager.cc
// GEANT4 tag $Name: xray_fluo-V03-02-00
//
// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
//
// History:
// -----------
// 28 Nov 2001 Elena Guardincerri Created
//
// -------------------------------------------------------------------
#ifdef G4ANALYSIS_USE
#include "XrayFluoAnalysisManager.hh"
#include "XrayFluoAnalysisMessenger.hh"
#include "G4Step.hh"
XrayFluoAnalysisManager* XrayFluoAnalysisManager::instance = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XrayFluoAnalysisManager::XrayFluoAnalysisManager()
{
analysisMessenger = new XrayFluoAnalysisMessenger(this);
histoManager = createIHistoManager();
factory = Lizard::createNTupleFactory();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XrayFluoAnalysisManager::~XrayFluoAnalysisManager()
{
delete analysisMessenger;
analysisMessenger = 0;
delete histoManager;
histoManager = 0;
delete factory;
factory = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XrayFluoAnalysisManager* XrayFluoAnalysisManager::getInstance()
{
if (instance == 0) instance = new XrayFluoAnalysisManager;
return instance;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::book()
{
histoManager->selectStore("XrayFluo.his");
// Book histograms
histoManager->create1D("1","Energy Deposit", 100,0.,10.);
histoManager->create1D("2","Gamma born in the sample", 100,0.,10.);
histoManager->create1D("3","Electrons born in the sample", 100,0.,10.);
histoManager->create1D("4","Gammas leaving the sample", 100,0.,10.);
histoManager->create1D("5","Electrons leaving the sample ", 100,0.,10.);
histoManager->create1D("6","Gammas reaching the detector", 100,0.,10.);
histoManager->create1D("7","Spectrum of the incident particles", 100,0.,10.);
histoManager->create1D("8","Protons reaching the detector", 100,0.,10.);
histoManager->create1D("9","Protons leaving the sample", 100,0.,10.);
// Book ntuples
ntuple = factory->createC("XrayFluo.his::1");
// Add and bind the attributes to the ntuple
if ( !( ntuple->addAndBind( "energy", eDep) &&
ntuple->addAndBind( "counts" , counts ) ) )
{
delete ntuple;
G4Exception("XrayFluoAnalysisManager::book - Could not addAndBind ntuple");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::finish()
{
histoManager->store("1");
histoManager->store("3");
histoManager->store("2");
histoManager->store("4");
histoManager->store("5");
histoManager->store("6");
histoManager->store("7");
histoManager->store("8");
histoManager->store("9");
delete ntuple;
ntuple = 0;
G4cout << "Deleted ntuple" << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analyseStepping(const G4Step* aStep)
{
G4double gammaAtTheDetPre=0;
G4double protonsAtTheDetPre=0;
G4double gammaLeavingSample=0;
G4double eleLeavingSample=0;
G4double protonsLeavSam=0;
G4double gammaBornInSample=0;
G4double eleBornInSample=0;
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Sample"){
if(aStep->GetTrack()->GetNextVolume()->GetName() == "World" )
{
if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "gamma" )
{
gammaLeavingSample = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h1 = histoManager->retrieveHisto1D("4");
h1->fill(gammaLeavingSample/keV);
}
}
}
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Sample"){
if(aStep->GetTrack()->GetNextVolume()->GetName() == "World" )
{
if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "e-" )
{
eleLeavingSample = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h2 = histoManager->retrieveHisto1D("5");
h2->fill(eleLeavingSample/keV);
}
else if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "proton" )
{
protonsLeavSam = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h3 = histoManager->retrieveHisto1D("9");
h3->fill(protonsLeavSam/keV);
}
}
}
if((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "gamma" )
{if(1== (aStep->GetTrack()->GetCurrentStepNumber()))
{if(0 != aStep->GetTrack()->GetParentID())
{if(aStep->GetTrack()->GetVolume()->GetName() == "Sample")
{
gammaBornInSample = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h4 = histoManager->retrieveHisto1D("2");
h4->fill(gammaBornInSample);
}
}
}
}
if((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "e-" )
{if(1== (aStep->GetTrack()->GetCurrentStepNumber()))
{if(0 != aStep->GetTrack()->GetParentID())
{if(aStep->GetTrack()->GetVolume()->GetName() == "Sample")
{
eleBornInSample = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h5 = histoManager->retrieveHisto1D("3");
h5->fill(eleBornInSample);
}
}
}
}
if(aStep->GetTrack()->GetNextVolume()){
if(aStep->GetTrack()->GetVolume()->GetName() == "World"){
if(aStep->GetTrack()->GetNextVolume()->GetName() == "HPGeDetector")
{
if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "gamma" )
{
gammaAtTheDetPre = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h6 = histoManager->retrieveHisto1D("6");
h6->fill( gammaAtTheDetPre);
}
else if ((aStep->GetTrack()->GetDynamicParticle()
->GetDefinition()-> GetParticleName()) == "proton" )
{
protonsAtTheDetPre = (aStep->GetPreStepPoint()->GetKineticEnergy());
IHistogram1D* h7 = histoManager->retrieveHisto1D("8");
h7->fill( protonsAtTheDetPre);
}
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analyseEnergyDep(G4double energyDep)
{
IHistogram1D* h8 = histoManager->retrieveHisto1D("1");
h8->fill(energyDep/keV);
counts = 1.;
ntuple->addRow();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void XrayFluoAnalysisManager::analysePrimaryGenerator(G4double energy)
{
IHistogram1D* h9 = histoManager->retrieveHisto1D("7");
h9->fill(energy/keV);
}
#endif
@@ -130,7 +130,7 @@ void XrayFluoDetectorConstruction::DefineMaterials()
a = 69.72* g/mole;
G4Element * Ga = new G4Element(name="gallium",symbol="Ga",z= 31.,a);
a = 55.85*g/mole;
a = 55.847*g/mole;
G4Element* Fe = new G4Element(name="Iron" ,symbol="Fe", z=26., a);
//define hydrogen
@@ -166,7 +166,7 @@ void XrayFluoDetectorConstruction::DefineMaterials()
//define silicon
density = 2.333*g/cm3;
a = 28.09*g/mole;
a = 28.0855*g/mole;
G4Material* Si = new G4Material(name="Silicon",z=14., a,density);
//define copper
@@ -178,7 +178,7 @@ void XrayFluoDetectorConstruction::DefineMaterials()
//define carbon
a = 12.01*g/mole;
a = 12.0107*g/mole;
G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
@@ -197,12 +197,12 @@ void XrayFluoDetectorConstruction::DefineMaterials()
//define titanium
density = 4.54 *g/cm3;
a = 47.867*g/mole;
G4Material* Ti = new G4Material(name="Titanium",z=22.,a,density);
a = 47.867*g/mole;
G4Material* Ti = new G4Material(name="Titanium",z=22.,a,density);
//define lead
//define lead
density = 11.35*g/cm3;
a=207.19*g/mole;
@@ -213,7 +213,7 @@ void XrayFluoDetectorConstruction::DefineMaterials()
a = 14.01*g/mole;
G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
a = 16.00*g/mole;
a = 15.9994*g/mole;
G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
G4double fractionmass;
@@ -229,12 +229,40 @@ void XrayFluoDetectorConstruction::DefineMaterials()
temperature = 2.73*kelvin;
G4Material * Vacuum = new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,
kStateGas,temperature,pressure);
// define Titanium
a = 47.88*g/mole;
G4Element* elTi = new G4Element(name="Titanium",symbol="Ti" , z= 22., a);
// define Calcium
a = 40.078*g/mole;
G4Element* Ca = new G4Element(name="Calcium",symbol="Ca" , z= 20., a);
// define silicon
a = 28.0855*g/mole;
G4Element* elSi = new G4Element(name="Silicon",symbol="Si" , z= 14., a);
a = 26.98154*g/mole;
G4Element* elAl = new G4Element(name="Aluminium",symbol="Al" , z= 13., a);
a = 24.305*g/mole;
G4Element* Mg = new G4Element(name="Magnesium",symbol="Mg" , z= 12., a);
//define basalt
density = 3.*g/cm3;
G4Material* Basalt = new G4Material(name="Basalt", density, ncomponents=7);
Basalt->AddElement(Fe, fractionmass=0.1200);
Basalt->AddElement(elTi, fractionmass=0.0160);
Basalt->AddElement(Ca, fractionmass=0.0750);
Basalt->AddElement(elSi, fractionmass=0.2160);
Basalt->AddElement(elAl, fractionmass=0.0710);
Basalt->AddElement(Mg, fractionmass=0.0590);
Basalt->AddElement(O , fractionmass=0.4430);
// end basalt
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
//default materials of the apparate
sampleMaterial = Ti;
sampleMaterial = Basalt;
Dia1Material = Pb;
Dia3Material = Pb;
pixelMaterial = HPGe;
@@ -37,9 +37,8 @@
#include "XrayFluoEventActionMessenger.hh"
#include "XrayFluoRunAction.hh"
#include "XrayFluoDataSet.hh"
#ifdef G4ANALYSIS_USE
#include "XrayFluoAnalysisManager.hh"
#endif
#include "G4Event.hh"
#include "G4EventManager.hh"
@@ -113,10 +112,9 @@ void XrayFluoEventAction::EndOfEventAction(const G4Event* evt)
totEnergy += (*HPGeHC)[i]->GetEdepTot();
energyD = ResponseFunction(totEnergy);
#ifdef G4ANALYSIS_USE
XrayFluoAnalysisManager* analysis = XrayFluoAnalysisManager::getInstance();
analysis->analyseEnergyDep(energyD);
#endif
totEnergyDetect += energyD;
@@ -242,3 +240,9 @@ G4double XrayFluoEventAction::ResponseFunction(G4double energy)
return value;
}
@@ -149,6 +149,9 @@ void XrayFluoPhysicsList::ConstructEM()
pmanager->AddDiscreteProcess(new G4LowEnergyCompton);
LePeprocess = new G4LowEnergyPhotoElectric();
//LePeprocess->ActivateAuger(false);
//LePeprocess->SetCutForLowEnSecPhotons(10000 * keV);
//LePeprocess->SetCutForLowEnSecElectrons(10000 * keV);
pmanager->AddDiscreteProcess(LePeprocess);
pmanager->AddDiscreteProcess(new G4LowEnergyRayleigh);
@@ -158,6 +161,9 @@ void XrayFluoPhysicsList::ConstructEM()
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
LeIoprocess = new G4LowEnergyIonisation();
//LeIoprocess->ActivateAuger(false);
//LeIoprocess->SetCutForLowEnSecPhotons(10000 keV);
//LeIoprocess->SetCutForLowEnSecElectrons(10000 keV);
pmanager->AddProcess(LeIoprocess, -1, 2, 2);
LeBrprocess = new G4LowEnergyBremsstrahlung();
@@ -64,11 +64,11 @@ XrayFluoPrimaryGeneratorAction::XrayFluoPrimaryGeneratorAction(
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="e-");
= particleTable->FindParticle(particleName="gamma");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
particleGun->SetParticleEnergy(50.*MeV);
particleGun->SetParticleEnergy(6.*keV);
G4double position = -0.5*(XrayFluoDetector->GetWorldSizeZ());
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,position));
@@ -52,7 +52,7 @@
XrayFluoRunAction::XrayFluoRunAction()
:dataSet(0),dataGammaSet(0),dataAlphaSet(0),efficiencySet(0)
{
XrayFluoNormalization* normalization = new XrayFluoNormalization();
XrayFluoNormalization normalization;
energies = new G4DataVector;
data = new G4DataVector;
@@ -65,13 +65,13 @@ XrayFluoRunAction::XrayFluoRunAction()
G4double maxGamma = 10. *keV;
G4int nBinsGamma = 100;
dataGammaSet = normalization->Normalize(minGamma, maxGamma, nBinsGamma,
dataGammaSet = normalization.Normalize(minGamma, maxGamma, nBinsGamma,
"/examples/advanced/xray_fluorescence/B_flare");
G4String fileName = "/examples/advanced/xray_fluorescence/efficienza";
G4VDataSetAlgorithm* interpolation4 = new G4LogLogInterpolation();
efficiencySet = new XrayFluoDataSet(1,fileName,interpolation4,keV,1);
delete interpolation4;
}
#else
@@ -100,7 +100,10 @@ XrayFluoRunAction::~XrayFluoRunAction()
dataSet = 0;
}
}
#else
XrayFluoRunAction::~XrayFluoRunAction()
{
@@ -132,15 +135,16 @@ void XrayFluoRunAction::BeginOfRunAction(const G4Run* aRun)
void XrayFluoRunAction::EndOfRunAction(const G4Run* aRun )
{
#ifdef G4ANALYSIS_USE
XrayFluoAnalysisManager* analysis = XrayFluoAnalysisManager::getInstance();
analysis->finish();
#endif
// Run ended, update the visualization
if (G4VVisManager::GetConcreteInstance()) {
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
analysis->finish();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -44,8 +44,8 @@
#include "G4GAGTree.hh"
#include "G4HepRepFile.hh"
#include "G4RayTracer.hh"
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
//#include "G4VRML1File.hh"
//#include "G4VRML2File.hh"
// Needing external packages or libraries...
@@ -80,12 +80,12 @@
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
/*
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
*/
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
XrayFluoVisManager::XrayFluoVisManager () {}
@@ -100,8 +100,8 @@ void XrayFluoVisManager::RegisterGraphicsSystems () {
RegisterGraphicsSystem (new G4GAGTree);
RegisterGraphicsSystem (new G4HepRepFile);
RegisterGraphicsSystem (new G4RayTracer);
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
// RegisterGraphicsSystem (new G4VRML1File);
//RegisterGraphicsSystem (new G4VRML2File);
// Graphics systems needing external packages or libraries...
@@ -136,12 +136,13 @@ void XrayFluoVisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
/*
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
*/
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."