Import Geant4 9.5.0 source tree
This commit is contained in:
@@ -422,7 +422,7 @@ void XrayFluoAnalysisManager::analyseStepping(const G4Step* aStep)
|
||||
|
||||
G4String particleType="";
|
||||
G4String parentProcess="";
|
||||
G4ThreeVector momentum=0;
|
||||
G4ThreeVector momentum(0.,0.,0.);
|
||||
G4double particleEnergy=0;
|
||||
G4String sampleMaterial="";
|
||||
G4double particleDepth=0;
|
||||
|
||||
@@ -157,8 +157,10 @@ G4bool XrayFluoDataSet::LoadData(const G4String& fileName)
|
||||
|
||||
if (! (lsdp->is_open()) )
|
||||
{
|
||||
G4String excep = "XrayFluoDataSet - data file: " + dirFile + " not found";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << "XrayFluoDataSet - data file: " + dirFile + " not found"<<G4endl;
|
||||
G4Exception("XrayFluoDataSet::LoadData()","example-xray_fluorescence01",
|
||||
FatalException, execp);
|
||||
}
|
||||
G4double a = 0;
|
||||
G4int k = 1;
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
#include "XrayFluoNistMaterials.hh"
|
||||
|
||||
|
||||
//#include "G4Region.hh"
|
||||
//#include "G4RegionStore.hh"
|
||||
// #include "G4Region.hh"
|
||||
// #include "G4RegionStore.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -91,7 +91,7 @@ XrayFluoDetectorConstruction::XrayFluoDetectorConstruction()
|
||||
NbOfPixelRows = 1; // should be 1
|
||||
NbOfPixelColumns = 1; // should be 1
|
||||
NbOfPixels = NbOfPixelRows*NbOfPixelColumns;
|
||||
PixelSizeXY = std::sqrt(40) * mm;
|
||||
PixelSizeXY = std::sqrt(40.) * mm;
|
||||
PixelThickness = 2.7 * mm; //should be 3.5 mm
|
||||
|
||||
G4cout << "PixelThickness(mm): "<< PixelThickness/mm << G4endl;
|
||||
@@ -135,8 +135,8 @@ XrayFluoDetectorConstruction::XrayFluoDetectorConstruction()
|
||||
G4String defaultDetectorType = "sili";
|
||||
ComputeApparateParameters();
|
||||
|
||||
// G4String regName = "SampleRegion";
|
||||
//sampleRegion = new G4Region(regName);
|
||||
// G4String regName = "SampleRegion";
|
||||
// sampleRegion = new G4Region(regName);
|
||||
|
||||
if (!phaseSpaceFlag) SetDetectorType(defaultDetectorType);
|
||||
|
||||
@@ -178,8 +178,10 @@ void XrayFluoDetectorConstruction::SetDetectorType(G4String type)
|
||||
}*/
|
||||
else
|
||||
{
|
||||
G4String excep = type + "detector type unknown";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << type + "detector type unknown";
|
||||
G4Exception("XrayFluoDataSet::LoadData()","example-xray_fluorescence06",
|
||||
FatalException, execp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -649,8 +651,8 @@ G4VPhysicalVolume* XrayFluoDetectorConstruction::ConstructApparate()
|
||||
}
|
||||
// cut per region
|
||||
|
||||
//logicSample->SetRegion(sampleRegion);
|
||||
//sampleRegion->AddRootLogicalVolume(logicSample);
|
||||
// logicSample->SetRegion(sampleRegion);
|
||||
// sampleRegion->AddRootLogicalVolume(logicSample);
|
||||
|
||||
|
||||
|
||||
@@ -749,7 +751,7 @@ void XrayFluoDetectorConstruction::UpdateGeometry()
|
||||
if (logicHPGe) delete logicHPGe;
|
||||
if (physiHPGe) delete physiHPGe;
|
||||
|
||||
//if (sampleRegion) sampleRegion->RemoveRootLogicalVolume(logicSample);
|
||||
if (sampleRegion) sampleRegion->RemoveRootLogicalVolume(logicSample);
|
||||
if (solidSample) delete solidSample;
|
||||
if (logicSample) delete logicSample;
|
||||
if (physiSample) delete physiSample;
|
||||
|
||||
@@ -260,8 +260,10 @@ void XrayFluoHPGeDetectorType::LoadResponseData(G4String fileName)
|
||||
|
||||
if (! (lsdp->is_open()) )
|
||||
{
|
||||
G4String excep = "XrayFluoHPGeDetectorType - data file: " + dirFile + " not found";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << "XrayFluoHPGeDetectorType - data file: " + dirFile + " not found";
|
||||
G4Exception("XrayFluoHPGeDetectorType::LoadResponseData()","example-xray_fluorescence02",
|
||||
FatalException, execp);
|
||||
}
|
||||
G4double a = 0;
|
||||
G4int k = 1;
|
||||
|
||||
@@ -151,8 +151,10 @@ void XrayFluoMercuryDetectorConstruction::SetDetectorType(G4String type)
|
||||
}
|
||||
else
|
||||
{
|
||||
G4String excep = type + "detector type unknown";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << type + "detector type unknown";
|
||||
G4Exception("XrayFluoMercuryDetectorConstruction::SetDetectorType()","example-xray_fluorescence05",
|
||||
FatalException, execp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ void XrayFluoNistMaterials::CreateMaterials()
|
||||
elements.push_back("P"); fractionMass.push_back(0.0006);
|
||||
|
||||
|
||||
G4Material* dolorite = nistMan->ConstructNewMaterial("Dolorite", elements, fractionMass, density);
|
||||
G4Material* doloriteMain = nistMan->ConstructNewMaterial("Dolorite", elements, fractionMass, density);
|
||||
|
||||
elements.clear();
|
||||
natoms.clear();
|
||||
@@ -296,7 +296,7 @@ void XrayFluoNistMaterials::CreateMaterials()
|
||||
density = 3*g/cm3;
|
||||
dolorite = new G4Material("Dolorite", density, 2);
|
||||
dolorite->AddMaterial(tracesOfDolorite, 0.0027842352);
|
||||
dolorite->AddMaterial(dolorite, 0.9972157648);
|
||||
dolorite->AddMaterial(doloriteMain, 0.9972157648);
|
||||
|
||||
///////////////////////
|
||||
// Mars1 //
|
||||
|
||||
@@ -24,475 +24,310 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: XrayFluoPhysicsList.cc
|
||||
// GEANT4 tag $Name: xray_fluo-V03-02-00
|
||||
// History
|
||||
// 14/01/11 Alf re-adapt this file from Physiclist of testEm18
|
||||
//
|
||||
// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// 28 Nov 2001 Elena Guardincerri Created
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "XrayFluoPhysicsList.hh"
|
||||
#include "XrayFluoPhysicsListMessenger.hh"
|
||||
#include "XrayFluoDetectorConstruction.hh"
|
||||
#include "XrayFluoPlaneDetectorConstruction.hh"
|
||||
#include "XrayFluoMercuryDetectorConstruction.hh"
|
||||
|
||||
/////////////////////////////////////////
|
||||
#include "G4LeptonConstructor.hh"
|
||||
#include "G4BosonConstructor.hh"
|
||||
//#include "G4MesonConstructor.hh"
|
||||
#include "G4IonConstructor.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4EmProcessOptions.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
//#include "PhysListEmStandard.hh"
|
||||
|
||||
#include "G4EmStandardPhysics.hh"
|
||||
#include "G4EmStandardPhysics_option1.hh"
|
||||
#include "G4EmStandardPhysics_option2.hh"
|
||||
#include "G4EmStandardPhysics_option3.hh"
|
||||
//#include "XrayFluoPhysListEmStandardFLUO.hh"
|
||||
#include "G4EmLivermorePhysics.hh"
|
||||
#include "G4EmPenelopePhysics.hh"
|
||||
//#include "G4UAtomicDeexcitation.hh"
|
||||
|
||||
#include "G4Decay.hh"
|
||||
#include "XrayFluoStepMax.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
|
||||
// Bosons
|
||||
#include "G4ChargedGeantino.hh"
|
||||
#include "G4Geantino.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4OpticalPhoton.hh"
|
||||
|
||||
// leptons
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4MuonMinus.hh"
|
||||
#include "G4NeutrinoMu.hh"
|
||||
#include "G4AntiNeutrinoMu.hh"
|
||||
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4NeutrinoE.hh"
|
||||
#include "G4AntiNeutrinoE.hh"
|
||||
|
||||
// Hadrons
|
||||
#include "G4Proton.hh"
|
||||
#include "G4MesonConstructor.hh"
|
||||
#include "G4BaryonConstructor.hh"
|
||||
/////////////////////////////////////////
|
||||
#include "G4IonConstructor.hh"
|
||||
|
||||
#include "G4StepLimiter.hh"
|
||||
|
||||
//#include "G4Region.hh"
|
||||
//#include "G4RegionStore.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
XrayFluoPhysicsList::XrayFluoPhysicsList(XrayFluoDetectorConstruction* p)
|
||||
: G4VUserPhysicsList(),pDet(0),planeDet(0),mercuryDet(0)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoPhysicsList::XrayFluoPhysicsList() : G4VModularPhysicsList()
|
||||
{
|
||||
pDet = p;
|
||||
pMessenger = new XrayFluoPhysicsListMessenger(this);
|
||||
|
||||
// EM physics
|
||||
G4LossTableManager::Instance()->SetVerbose(1);
|
||||
|
||||
defaultCutValue = 1.*mm;
|
||||
|
||||
SetGELowLimit(250*eV);
|
||||
cutForGamma = defaultCutValue;
|
||||
cutForElectron = defaultCutValue;
|
||||
cutForPositron = defaultCutValue;
|
||||
cutForProton = defaultCutValue;
|
||||
|
||||
defaultCutValue = 10e-6*mm;
|
||||
|
||||
cutForGamma = defaultCutValue;
|
||||
cutForElectron = defaultCutValue;
|
||||
cutForProton = 0.00001*mm;
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new XrayFluoPhysicsListMessenger(this);
|
||||
|
||||
/*
|
||||
G4String regName = "SampleRegion";
|
||||
G4double cutValue = 0.000001 * mm;
|
||||
G4Region* reg = G4RegionStore::GetInstance()->GetRegion(regName);
|
||||
|
||||
G4ProductionCuts* cuts = new G4ProductionCuts;
|
||||
cuts->SetProductionCut(cutValue);
|
||||
reg->SetProductionCuts(cuts);
|
||||
*/
|
||||
|
||||
// EM physics
|
||||
emName = G4String("emlivermore");
|
||||
emPhysicsList = new G4EmLivermorePhysics;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
XrayFluoPhysicsList::XrayFluoPhysicsList(XrayFluoPlaneDetectorConstruction* p)
|
||||
: G4VUserPhysicsList(),pDet(0),planeDet(0),mercuryDet(0)
|
||||
{
|
||||
planeDet = p;
|
||||
|
||||
// SetGELowLimit(250*eV);
|
||||
|
||||
defaultCutValue = 0.000001*mm;
|
||||
|
||||
cutForGamma = defaultCutValue;
|
||||
cutForElectron = defaultCutValue;
|
||||
cutForProton = 0.001*mm;
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new XrayFluoPhysicsListMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
XrayFluoPhysicsList::XrayFluoPhysicsList(XrayFluoMercuryDetectorConstruction* p)
|
||||
: G4VUserPhysicsList(),pDet(0),planeDet(0),mercuryDet(0)
|
||||
{
|
||||
mercuryDet = p;
|
||||
|
||||
// SetGELowLimit(250*eV);
|
||||
|
||||
defaultCutValue = 0.000001*mm;
|
||||
|
||||
cutForGamma = defaultCutValue;
|
||||
cutForElectron = defaultCutValue;
|
||||
cutForProton = 0.001*mm;
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new XrayFluoPhysicsListMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoPhysicsList::~XrayFluoPhysicsList()
|
||||
{
|
||||
delete physicsListMessenger;
|
||||
delete emPhysicsList;
|
||||
delete pMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructBarions();
|
||||
ConstructIons();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void XrayFluoPhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void XrayFluoPhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
void XrayFluoPhysicsList::ConstructBarions()
|
||||
{
|
||||
G4BaryonConstructor baryon;
|
||||
baryon.ConstructParticle();
|
||||
G4Proton::ProtonDefinition();
|
||||
}
|
||||
void XrayFluoPhysicsList::ConstructIons()
|
||||
{
|
||||
// Ions
|
||||
G4IonConstructor ions;
|
||||
ions.ConstructParticle();
|
||||
// G4Alpha::AlphaDefinition();
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
|
||||
// mesons
|
||||
G4MesonConstructor mConstructor;
|
||||
mConstructor.ConstructParticle();
|
||||
|
||||
// barions
|
||||
G4BaryonConstructor bConstructor;
|
||||
bConstructor.ConstructParticle();
|
||||
|
||||
// ions
|
||||
G4IonConstructor iConstructor;
|
||||
iConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
emPhysicsList->ConstructProcess();
|
||||
AddDecay();
|
||||
AddStepMax();
|
||||
|
||||
// Em options
|
||||
//
|
||||
G4EmProcessOptions emOptions;
|
||||
emOptions.SetBuildCSDARange(true);
|
||||
emOptions.SetDEDXBinningForCSDARange(10*10);
|
||||
//emOptions.SetDeexcitationActiveRegion(true); //TBC
|
||||
emOptions.SetFluo(true);
|
||||
emOptions.SetAuger(true);
|
||||
emOptions.SetPIXE(true);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
// gamma from standard
|
||||
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4RayleighScattering.hh"
|
||||
|
||||
// gamma from Lowenergy
|
||||
|
||||
#include "G4LivermorePhotoElectricModel.hh"
|
||||
#include "G4LivermoreComptonModel.hh"
|
||||
#include "G4LivermorePolarizedComptonModel.hh" // alternative for polarized photons
|
||||
#include "G4LivermoreGammaConversionModel.hh"
|
||||
#include "G4LivermoreRayleighModel.hh"
|
||||
#include "G4LivermorePolarizedRayleighModel.hh" // alternative for polarized photons
|
||||
|
||||
|
||||
// e+ - e- from standard
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4UniversalFluctuation.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
// e+ - e- from Lowenergy
|
||||
|
||||
#include "G4LivermoreIonisationModel.hh"
|
||||
#include "G4LivermoreBremsstrahlungModel.hh"
|
||||
|
||||
|
||||
// protons from standard
|
||||
|
||||
#include "G4hLowEnergyIonisation.hh"
|
||||
#include "G4hMultipleScattering.hh"
|
||||
|
||||
// options
|
||||
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4EmProcessOptions.hh"
|
||||
|
||||
//#include "G4hIonisation.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void XrayFluoPhysicsList::ConstructEM()
|
||||
void XrayFluoPhysicsList::AddDecay()
|
||||
{
|
||||
// Add Decay Process
|
||||
|
||||
G4Decay* fDecayProcess = new G4Decay();
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
|
||||
// gamma
|
||||
|
||||
G4ComptonScattering* theComptonScattering = new G4ComptonScattering();
|
||||
G4LivermoreComptonModel* theLivermoreComptonModel = new G4LivermoreComptonModel();
|
||||
theComptonScattering->SetModel(theLivermoreComptonModel);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
|
||||
G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theLivermorePhotoElectricModel = new G4LivermorePhotoElectricModel();
|
||||
theLivermorePhotoElectricModel->ActivateAuger(true);
|
||||
thePhotoElectricEffect->SetModel(theLivermorePhotoElectricModel);
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
|
||||
if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
|
||||
|
||||
G4GammaConversion* theGammaConversion = new G4GammaConversion();
|
||||
G4LivermoreGammaConversionModel* theLivermoreGammaConversionModel = new G4LivermoreGammaConversionModel();
|
||||
theGammaConversion->SetModel(theLivermoreGammaConversionModel);
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
pmanager ->AddProcess(fDecayProcess);
|
||||
|
||||
G4RayleighScattering* theRayleigh = new G4RayleighScattering();
|
||||
G4LivermoreRayleighModel* theRayleighModel = new G4LivermoreRayleighModel();
|
||||
theRayleigh->SetModel(theRayleighModel);
|
||||
pmanager->AddDiscreteProcess(theRayleigh);
|
||||
|
||||
pmanager->AddProcess(new G4StepLimiter(), -1, -1, 5);
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
|
||||
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc->SetStepLimitType(fUseDistanceToBoundary);
|
||||
pmanager->AddProcess(msc, -1, 1, 1);
|
||||
|
||||
G4eIonisation* eIoni = new G4eIonisation();
|
||||
G4LivermoreIonisationModel* theLivermoreIonisationModel = new G4LivermoreIonisationModel();
|
||||
theLivermoreIonisationModel->ActivateAuger(true);
|
||||
// theLivermoreIonisationModel->SetUseAtomicDeexcitation(true);
|
||||
eIoni->SetEmModel(theLivermoreIonisationModel);
|
||||
// eIoni->SetStepFunction(0.2, 100*um); //
|
||||
pmanager->AddProcess(eIoni, -1, 2, 2);
|
||||
|
||||
G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
|
||||
eBrem->SetEmModel(new G4LivermoreBremsstrahlungModel());
|
||||
pmanager->AddProcess(eBrem, -1,-3, 3);
|
||||
pmanager->AddProcess(new G4StepLimiter(), -1, -1, 4);
|
||||
|
||||
// Ionisation
|
||||
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc->SetStepLimitType(fUseDistanceToBoundary);
|
||||
pmanager->AddProcess(msc, -1, 1, 1);
|
||||
|
||||
pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
|
||||
|
||||
|
||||
|
||||
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
|
||||
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
|
||||
|
||||
}
|
||||
else if (particleName == "proton") {
|
||||
//proton
|
||||
G4hLowEnergyIonisation* hIoni = new G4hLowEnergyIonisation();
|
||||
hIoni->SetFluorescence(true);
|
||||
hIoni->SelectShellIonisationCS("analytical");
|
||||
pmanager->AddProcess(new G4hMultipleScattering,-1,1,1);
|
||||
pmanager->AddProcess(hIoni,-1, 2,2);
|
||||
}
|
||||
else if ( particleName == "alpha" )
|
||||
{
|
||||
|
||||
pmanager->AddProcess(new G4hMultipleScattering,-1,1,1);
|
||||
G4hLowEnergyIonisation* hIoni = new G4hLowEnergyIonisation();
|
||||
hIoni->SetFluorescence(true);
|
||||
pmanager->AddProcess(hIoni,-1,2,2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::AddStepMax()
|
||||
{
|
||||
// Step limitation seen as a process
|
||||
XrayFluoStepMax* stepMaxProcess = new XrayFluoStepMax();
|
||||
|
||||
theParticleIterator->reset();
|
||||
while ((*theParticleIterator)()){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
|
||||
{
|
||||
pmanager ->AddDiscreteProcess(stepMaxProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::AddPhysicsList(const G4String& name)
|
||||
{
|
||||
if (verboseLevel>-1) {
|
||||
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
|
||||
}
|
||||
|
||||
if (name == emName) return;
|
||||
|
||||
if (name == "emlivermore") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmLivermorePhysics;
|
||||
|
||||
} else if (name == "emstandard") {
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics();
|
||||
|
||||
} else if (name == "emstandard_opt1") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option1();
|
||||
|
||||
} else if (name == "emstandard_opt2") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option2();
|
||||
|
||||
} else if (name == "emstandard_opt3") {
|
||||
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmStandardPhysics_option3();
|
||||
|
||||
} else if (name == "empenelope"){
|
||||
emName = name;
|
||||
delete emPhysicsList;
|
||||
emPhysicsList = new G4EmPenelopePhysics();
|
||||
|
||||
} else {
|
||||
|
||||
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
|
||||
<< " is not defined"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::SetGELowLimit(G4double lowcut)
|
||||
void XrayFluoPhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "XrayFluoPhysicsList::SetCuts:";
|
||||
G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
|
||||
}
|
||||
G4cout << "PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
|
||||
}
|
||||
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5);
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
SetCutValue(cutForGamma, "gamma");
|
||||
SetCutValue(cutForElectron, "e-");
|
||||
SetCutValue(cutForPositron, "e+");
|
||||
|
||||
|
||||
}
|
||||
|
||||
void XrayFluoPhysicsList::SetGammaLowLimit(G4double lowcut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "XrayFluoPhysicsList::SetCuts:";
|
||||
G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
|
||||
}
|
||||
|
||||
SetGELowLimit(lowcut);
|
||||
|
||||
// G4Gamma::SetEnergyRange(lowcut,1e5);
|
||||
|
||||
}
|
||||
|
||||
void XrayFluoPhysicsList::SetElectronLowLimit(G4double lowcut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
|
||||
G4cout << "XrayFluoPhysicsList::SetCuts:";
|
||||
G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
|
||||
|
||||
}
|
||||
|
||||
SetGELowLimit(lowcut);
|
||||
|
||||
// G4Electron::SetEnergyRange(lowcut,1e5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void XrayFluoPhysicsList::SetGammaCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForGamma = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
void XrayFluoPhysicsList::SetElectronCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForElectron = val;
|
||||
}
|
||||
|
||||
void XrayFluoPhysicsList::SetCuts(){
|
||||
|
||||
G4double lowlimit=20*eV;
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowlimit, 100.*GeV);
|
||||
SetCutValue(cutForGamma,"gamma");
|
||||
SetCutValue(cutForElectron,"e-");
|
||||
SetCutValue(cutForElectron,"e+");
|
||||
SetCutValue(cutForProton, "proton");
|
||||
//SetCutValueForOthers(cutForProton);
|
||||
if (verboseLevel>0) DumpCutValuesTable();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::SetLowEnSecPhotCut(G4double cut){
|
||||
|
||||
cut=0;
|
||||
|
||||
G4cout<<"Low energy secondary photons cut is now set to: "<<cut/MeV<<" (MeV)"<<G4endl;
|
||||
G4cout<<"for processes LowEnergyBremsstrahlung, LowEnergyPhotoElectric, LowEnergyIonisation"<<G4endl;
|
||||
// LeBrprocess->SetCutForLowEnSecPhotons(cut);
|
||||
// theLivermorePhotoElectricModel->SetCutForLowEnSecPhotons(cut);
|
||||
// LeIoprocess->SetCutForLowEnSecPhotons(cut);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
void XrayFluoPhysicsList::SetLowEnSecElecCut(G4double cut){
|
||||
|
||||
G4cout<<"Low energy secondary electrons cut is now set to: "<<cut/MeV<<" (MeV)"<<G4endl;
|
||||
|
||||
G4cout<<"for processes LowEnergyIonisation"<<G4endl;
|
||||
|
||||
LeIoprocess->SetCutForLowEnSecElectrons(cut);
|
||||
|
||||
}
|
||||
*/
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void XrayFluoPhysicsList::SetProtonCut(G4double val)
|
||||
void XrayFluoPhysicsList::SetCutForGamma(G4double cut)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForProton = val;
|
||||
cutForGamma = cut;
|
||||
SetParticleCuts(cutForGamma, G4Gamma::Gamma());
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::SetCutsByEnergy(G4double val)
|
||||
void XrayFluoPhysicsList::SetCutForElectron(G4double cut)
|
||||
{
|
||||
G4ParticleTable* theXrayFluoParticleTable = G4ParticleTable::GetParticleTable();
|
||||
|
||||
G4Material* currMat = 0;
|
||||
|
||||
if(pDet){
|
||||
currMat = pDet->XrayFluoDetectorConstruction::GetSampleMaterial();
|
||||
}
|
||||
else if(planeDet){
|
||||
currMat = planeDet->XrayFluoPlaneDetectorConstruction::GetPlaneMaterial();
|
||||
}
|
||||
|
||||
else if(mercuryDet){
|
||||
currMat = mercuryDet->GetMercuryMaterial();
|
||||
}
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
|
||||
part = theXrayFluoParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e-");
|
||||
|
||||
part = theXrayFluoParticleTable->FindParticle("proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "proton");
|
||||
|
||||
part = theXrayFluoParticleTable->FindParticle("gamma");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "gamma");
|
||||
|
||||
cutForElectron = cut;
|
||||
SetParticleCuts(cutForElectron, G4Electron::Electron());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::SetCutForPositron(G4double cut)
|
||||
{
|
||||
cutForPositron = cut;
|
||||
SetParticleCuts(cutForPositron, G4Positron::Positron());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoPhysicsList::SetCutForProton(G4double cut)
|
||||
{
|
||||
cutForProton = cut;
|
||||
SetParticleCuts(cutForProton, G4Proton::Proton());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
//void XrayFluoPhysicsList::SetFluorescence(G4bool value)
|
||||
//{
|
||||
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
|
||||
// if(de) { de->SetFluo(value); }
|
||||
//}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
//void XrayFluoPhysicsList::SetPIXE(G4bool value)
|
||||
//{
|
||||
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
|
||||
// if(de) { de->SetPIXE(value); }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,154 +23,121 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: XrayFluoPhysicsListMessenger.cc
|
||||
// GEANT4 tag $Name: xray_fluo-V03-02-00
|
||||
//
|
||||
// Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// 28 Nov 2001 Elena Guardincerri Created
|
||||
// 18 Jan 2011 Alf Adapted from TestEm18
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "XrayFluoPhysicsListMessenger.hh"
|
||||
|
||||
#include "XrayFluoPhysicsList.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoPhysicsListMessenger::XrayFluoPhysicsListMessenger(XrayFluoPhysicsList * List)
|
||||
:XrayFluoList(List)
|
||||
XrayFluoPhysicsListMessenger::XrayFluoPhysicsListMessenger(XrayFluoPhysicsList* pPhys)
|
||||
:pPhysicsList(pPhys)
|
||||
{
|
||||
physDir = new G4UIdirectory("/phys/");
|
||||
physDir->SetGuidance("physics list commands");
|
||||
|
||||
pListCmd = new G4UIcmdWithAString("/phys/addPhysics",this);
|
||||
pListCmd->SetGuidance("Add modules physics list.");
|
||||
pListCmd->SetParameterName("PList",false);
|
||||
pListCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setGCut",this);
|
||||
gammaCutCmd->SetGuidance("Set gamma cut.");
|
||||
gammaCutCmd->SetParameterName("Gcut",false);
|
||||
gammaCutCmd->SetUnitCategory("Length");
|
||||
gammaCutCmd->SetRange("Gcut>0.0");
|
||||
gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
lowEnDir = new G4UIdirectory("/lowenergy/");
|
||||
lowEnDir->SetGuidance("LowEnergy commands");
|
||||
electCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setECut",this);
|
||||
electCutCmd->SetGuidance("Set electron and positron cuts.");
|
||||
electCutCmd->SetParameterName("Ecut",false);
|
||||
electCutCmd->SetUnitCategory("Length");
|
||||
electCutCmd->SetRange("Ecut>0.0");
|
||||
electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setPCut",this);
|
||||
protoCutCmd->SetGuidance("Set proton cut.");
|
||||
protoCutCmd->SetParameterName("Pcut",false);
|
||||
protoCutCmd->SetUnitCategory("Length");
|
||||
protoCutCmd->SetRange("Pcut>0.0");
|
||||
protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
cutGLowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimG",this);
|
||||
cutGLowLimCmd->SetGuidance("Set ENERGY low limit for Gamma.");
|
||||
cutGLowLimCmd->SetParameterName("energy",true);
|
||||
cutGLowLimCmd->SetDefaultValue(1e-3);
|
||||
cutGLowLimCmd->SetDefaultUnit("MeV");
|
||||
cutGLowLimCmd->AvailableForStates(G4State_Idle);
|
||||
allCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setCuts",this);
|
||||
allCutCmd->SetGuidance("Set cut for all.");
|
||||
allCutCmd->SetParameterName("cut",false);
|
||||
allCutCmd->SetUnitCategory("Length");
|
||||
allCutCmd->SetRange("cut>0.0");
|
||||
allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
cutELowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimE",this);
|
||||
cutELowLimCmd->SetGuidance("Set ENERGY low limit for e-.");
|
||||
cutELowLimCmd->SetParameterName("energy",true);
|
||||
cutELowLimCmd->SetDefaultValue(1e-3);
|
||||
cutELowLimCmd->SetDefaultUnit("MeV");
|
||||
cutELowLimCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
cutGELowLimCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/lowlimGE",this);
|
||||
cutGELowLimCmd->SetGuidance("Set ENERGY low limit for e- and Gamma.");
|
||||
cutGELowLimCmd->SetParameterName("energy",true);
|
||||
cutGELowLimCmd->SetDefaultValue(1e-3);
|
||||
cutGELowLimCmd->SetDefaultUnit("MeV");
|
||||
cutGELowLimCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
cutSecPhotCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/secphotcut",this);
|
||||
cutSecPhotCmd->SetGuidance("Set production threshold for secondary Gamma.");
|
||||
cutSecPhotCmd->SetParameterName("energy",true);
|
||||
cutSecPhotCmd->SetDefaultValue(5e-5);
|
||||
cutSecPhotCmd->SetDefaultUnit("MeV");
|
||||
cutSecPhotCmd->AvailableForStates(G4State_Idle);
|
||||
/*
|
||||
cutSecElecCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/seceleccut",this);
|
||||
cutSecElecCmd->SetGuidance("Set production threshold for secondary e-");
|
||||
cutSecElecCmd->SetParameterName("energy",true);
|
||||
cutSecElecCmd->SetDefaultValue(5e-5);
|
||||
cutSecElecCmd->SetDefaultUnit("MeV");
|
||||
cutSecElecCmd->AvailableForStates(G4State_Idle);
|
||||
*/
|
||||
cutGCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutG",this);
|
||||
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
|
||||
cutGCmd->SetParameterName("range",true);
|
||||
cutGCmd->SetDefaultValue(1.);
|
||||
cutGCmd->SetDefaultUnit("mm");
|
||||
cutGCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
cutECmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutE",this);
|
||||
cutECmd->SetGuidance("Set cut values by RANGE for e-.");
|
||||
cutECmd->SetParameterName("range",true);
|
||||
cutECmd->SetDefaultValue(1.);
|
||||
cutECmd->SetDefaultUnit("mm");
|
||||
cutECmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
cutPCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutP",this);
|
||||
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
|
||||
cutPCmd->SetParameterName("cutP",false);
|
||||
cutPCmd->SetRange("cutP>0.");
|
||||
cutPCmd->SetUnitCategory("Length");
|
||||
cutPCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
eCmd = new G4UIcmdWithADoubleAndUnit("/lowenergy/cutEnergy",this);
|
||||
eCmd->SetGuidance("Set cut values by ENERGY for all particles.");
|
||||
eCmd->SetParameterName("cutenergy",false);
|
||||
eCmd->SetRange("cutenergy>0.");
|
||||
eCmd->SetUnitCategory("Energy");
|
||||
eCmd->AvailableForStates(G4State_Idle);
|
||||
/*fluoCmd = new G4UIcmdWithABool("/phys/fluo",this);
|
||||
fluoCmd->SetGuidance("Set fluorescence on/off.");
|
||||
fluoCmd->SetParameterName("fluo",false);
|
||||
fluoCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
pixeCmd = new G4UIcmdWithABool("/phys/pixe",this);
|
||||
pixeCmd->SetGuidance("Set PIXE on/off.");
|
||||
pixeCmd->SetParameterName("pixe",false);
|
||||
pixeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
*/
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoPhysicsListMessenger::~XrayFluoPhysicsListMessenger()
|
||||
{
|
||||
|
||||
delete cutGLowLimCmd;
|
||||
delete cutELowLimCmd;
|
||||
delete cutGELowLimCmd;
|
||||
//delete cutSecElecCmd;
|
||||
delete cutSecPhotCmd;
|
||||
delete cutGCmd;
|
||||
delete cutECmd;
|
||||
delete cutPCmd;
|
||||
delete eCmd;
|
||||
|
||||
delete pListCmd;
|
||||
delete gammaCutCmd;
|
||||
delete electCutCmd;
|
||||
delete protoCutCmd;
|
||||
delete allCutCmd;
|
||||
delete physDir;
|
||||
// delete fluoCmd;
|
||||
// delete pixeCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void XrayFluoPhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == cutGLowLimCmd)
|
||||
{ XrayFluoList->SetGammaLowLimit(cutGLowLimCmd->GetNewDoubleValue(newValue));}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
if(command == cutELowLimCmd)
|
||||
{ XrayFluoList->SetElectronLowLimit(cutELowLimCmd->GetNewDoubleValue(newValue));}
|
||||
void XrayFluoPhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if( command == pListCmd )
|
||||
{ pPhysicsList->AddPhysicsList(newValue);}
|
||||
|
||||
if( command == gammaCutCmd )
|
||||
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == electCutCmd )
|
||||
{
|
||||
G4double cut = electCutCmd->GetNewDoubleValue(newValue);
|
||||
pPhysicsList->SetCutForElectron(cut);
|
||||
pPhysicsList->SetCutForPositron(cut);
|
||||
}
|
||||
|
||||
if( command == protoCutCmd )
|
||||
{ pPhysicsList->SetCutForProton(protoCutCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == cutGELowLimCmd)
|
||||
{ XrayFluoList->SetGELowLimit(cutGELowLimCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == cutSecPhotCmd)
|
||||
{ XrayFluoList->SetLowEnSecPhotCut(cutSecPhotCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
// if(command == cutSecElecCmd)
|
||||
// { XrayFluoList->SetLowEnSecElecCut(cutSecElecCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == cutGCmd)
|
||||
{ XrayFluoList->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == cutECmd)
|
||||
{ XrayFluoList->SetElectronCut(cutECmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == cutPCmd)
|
||||
{ XrayFluoList->SetProtonCut(cutPCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if(command == eCmd)
|
||||
{ XrayFluoList->SetCutsByEnergy(eCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == allCutCmd )
|
||||
{
|
||||
G4double cut = allCutCmd->GetNewDoubleValue(newValue);
|
||||
pPhysicsList->SetCutForGamma(cut);
|
||||
pPhysicsList->SetCutForElectron(cut);
|
||||
pPhysicsList->SetCutForPositron(cut);
|
||||
pPhysicsList->SetCutForProton(cut);
|
||||
}
|
||||
|
||||
// if( command == fluoCmd )
|
||||
// { pPhysicsList->SetFluorescence(fluoCmd->GetNewBoolValue(newValue));}
|
||||
//
|
||||
// if( command == pixeCmd )
|
||||
// { pPhysicsList->SetPIXE(fluoCmd->GetNewBoolValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -144,8 +144,10 @@ void XrayFluoPlaneDetectorConstruction::SetDetectorType(G4String type)
|
||||
}
|
||||
else
|
||||
{
|
||||
G4String excep = type + "detector type unknown";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << type + "detector type unknown";
|
||||
G4Exception("XrayFluoPlaneDetectorConstruction::SetDetectorType()","example-xray_fluorescence03",
|
||||
FatalException, execp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,10 +86,10 @@ XrayFluoPrimaryGeneratorAction::XrayFluoPrimaryGeneratorAction(XrayFluoDetectorC
|
||||
}
|
||||
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
void XrayFluoPrimaryGeneratorAction::ActivatePhaseSpace(G4String fileName) {
|
||||
|
||||
// load phase-space
|
||||
#ifdef G4ANALYSIS_USE
|
||||
phaseSpaceGunFlag = true;
|
||||
|
||||
// reads the data stored on disk form previous runs
|
||||
@@ -101,6 +101,8 @@ void XrayFluoPrimaryGeneratorAction::ActivatePhaseSpace(G4String fileName) {
|
||||
particleTypes = analysis->GetEmittedParticleTypes();
|
||||
detectorPosition = XrayFluoDetector->GetDetectorPosition();
|
||||
detectorPosition.setR(detectorPosition.r()-(5.*cm)); // 5 cm before the detector, so in front of it.
|
||||
#else
|
||||
void XrayFluoPrimaryGeneratorAction::ActivatePhaseSpace(G4String ) {
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -227,8 +227,10 @@ void XrayFluoRunAction::ReadData(G4double unitE, G4String fileName)
|
||||
|
||||
if (! (lsdp->is_open()) )
|
||||
{
|
||||
G4String excep = "XrayFluoRunAction - data file: " + name + " not found";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << "XrayFluoRunAction - data file: " + name + " not found";
|
||||
G4Exception("XrayFluoRunAction::ReadData()","example-xray_fluorescence04",
|
||||
FatalException, execp);
|
||||
}
|
||||
G4double a = 0;
|
||||
G4int k = 1;
|
||||
|
||||
@@ -324,8 +324,10 @@ void XrayFluoSiLiDetectorType::LoadResponseData(G4String fileName)
|
||||
|
||||
if (! (lsdp->is_open()) )
|
||||
{
|
||||
G4String excep = "XrayFluoSiLiDetectorType - data file: " + dirFile + " not found";
|
||||
G4Exception(excep);
|
||||
G4ExceptionDescription execp;
|
||||
execp << "XrayFluoSiLiDetectorType - data file: " + dirFile + " not found";
|
||||
G4Exception("XrayFluoSiLiDetectorType::LoadResponseData()","example-xray_fluorescence07",
|
||||
FatalException, execp);
|
||||
}
|
||||
G4double a = 0;
|
||||
G4int k = 1;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
// -----------
|
||||
// 28 Nov 2001 Elena Guardincerri Created
|
||||
// 24 Ago 2002 Splitted in a separet class Alfonso Mantero
|
||||
// 18 Jan 2011 adapted to new deexcitation design
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
#include "G4RunManager.hh"
|
||||
@@ -83,7 +84,7 @@ void XrayFluoSimulation::RunSimulation(int argc,char* argv[])
|
||||
|
||||
// set mandatory initialization
|
||||
|
||||
XrayFluoPhysicsList* xrayList = 0;
|
||||
XrayFluoPhysicsList* xrayList = new XrayFluoPhysicsList();
|
||||
|
||||
// chosing Geometry setup
|
||||
|
||||
@@ -116,17 +117,14 @@ void XrayFluoSimulation::RunSimulation(int argc,char* argv[])
|
||||
testBeamDetector->PhaseSpaceOn();
|
||||
}
|
||||
runManager->SetUserInitialization(testBeamDetector);
|
||||
xrayList = new XrayFluoPhysicsList(testBeamDetector);
|
||||
}
|
||||
else if (geometryNumber == 2) {
|
||||
planeDetector = XrayFluoPlaneDetectorConstruction::GetInstance();
|
||||
runManager->SetUserInitialization(planeDetector);
|
||||
xrayList = new XrayFluoPhysicsList(planeDetector);
|
||||
}
|
||||
else if (geometryNumber == 3) {
|
||||
mercuryDetector = XrayFluoMercuryDetectorConstruction::GetInstance();
|
||||
runManager->SetUserInitialization(mercuryDetector);
|
||||
xrayList = new XrayFluoPhysicsList(mercuryDetector);
|
||||
}
|
||||
|
||||
|
||||
@@ -166,28 +164,31 @@ void XrayFluoSimulation::RunSimulation(int argc,char* argv[])
|
||||
}
|
||||
|
||||
else if (geometryNumber == 3) {
|
||||
stepAction->SetMercuryFlag(true);
|
||||
eventAction = new XrayFluoEventAction(mercuryDetector);
|
||||
runManager->SetUserAction(new XrayFluoMercuryPrimaryGeneratorAction(mercuryDetector));
|
||||
}
|
||||
stepAction->SetMercuryFlag(true);
|
||||
eventAction = new XrayFluoEventAction(mercuryDetector);
|
||||
runManager->SetUserAction(new XrayFluoMercuryPrimaryGeneratorAction(mercuryDetector));
|
||||
}
|
||||
|
||||
runManager->SetUserAction(eventAction);
|
||||
runManager->SetUserAction(runAction);
|
||||
runManager->SetUserAction(stepAction);
|
||||
|
||||
//Initialize G4 kernel
|
||||
runManager->Initialize();
|
||||
//runManager->Initialize();
|
||||
|
||||
// get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
|
||||
if (getenv("G4VIS_USE")) {
|
||||
UImanager->ApplyCommand("/control/execute vis.mac");
|
||||
}
|
||||
|
||||
if (argc == 1) // Define UI session for interactive mode.
|
||||
{
|
||||
UImanager->ApplyCommand("/control/execute initInter.mac");
|
||||
#ifdef G4UI_USE
|
||||
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
|
||||
#ifdef G4VIS_USE
|
||||
UImanager->ApplyCommand("/control/execute initInter.mac");
|
||||
#endif
|
||||
|
||||
if (ui->IsGUI())
|
||||
UImanager->ApplyCommand("/control/execute gui.mac");
|
||||
ui->SessionStart();
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// History
|
||||
// 14/01/11 Alf re-adapt this file from Physiclist of testEm18
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "XrayFluoStepMax.hh"
|
||||
#include "XrayFluoStepMaxMessenger.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoStepMax::XrayFluoStepMax(const G4String& processName)
|
||||
: G4VDiscreteProcess(processName),MaxChargedStep(DBL_MAX)
|
||||
{
|
||||
pMess = new XrayFluoStepMaxMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoStepMax::~XrayFluoStepMax() { delete pMess; }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool XrayFluoStepMax::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
return (particle.GetPDGCharge() != 0.);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoStepMax::SetMaxStep(G4double step) {MaxChargedStep = step;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double XrayFluoStepMax::PostStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double,
|
||||
G4ForceCondition* condition )
|
||||
{
|
||||
// condition is set to "Not Forced"
|
||||
*condition = NotForced;
|
||||
|
||||
return MaxChargedStep;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VParticleChange* XrayFluoStepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&)
|
||||
{
|
||||
// do nothing
|
||||
aParticleChange.Initialize(aTrack);
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// History
|
||||
// 14/01/11 Alf re-adapt this file from Physiclist of testEm18
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "XrayFluoStepMaxMessenger.hh"
|
||||
|
||||
#include "XrayFluoStepMax.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoStepMaxMessenger::XrayFluoStepMaxMessenger(XrayFluoStepMax* stepM)
|
||||
:pStepMax(stepM)
|
||||
{
|
||||
StepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepMax",this);
|
||||
StepMaxCmd->SetGuidance("Set max allowed step length");
|
||||
StepMaxCmd->SetParameterName("mxStep",false);
|
||||
StepMaxCmd->SetRange("mxStep>0.");
|
||||
StepMaxCmd->SetUnitCategory("Length");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
XrayFluoStepMaxMessenger::~XrayFluoStepMaxMessenger()
|
||||
{
|
||||
delete StepMaxCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void XrayFluoStepMaxMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
|
||||
{
|
||||
if (command == StepMaxCmd)
|
||||
{ pStepMax->SetMaxStep(StepMaxCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
Reference in New Issue
Block a user