Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file GammaNuclearPhysics.cc
|
||||
/// \file hadronic/Hadr03/src/GammaNuclearPhysics.cc
|
||||
/// \brief Implementation of the GammaNuclearPhysics class
|
||||
//
|
||||
//
|
||||
@@ -38,6 +38,7 @@
|
||||
// Processes
|
||||
|
||||
#include "G4PhotoNuclearProcess.hh"
|
||||
#include "G4LowEGammaNuclearModel.hh"
|
||||
#include "G4CascadeInterface.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
@@ -57,14 +58,26 @@ GammaNuclearPhysics::~GammaNuclearPhysics()
|
||||
|
||||
void GammaNuclearPhysics::ConstructProcess()
|
||||
{
|
||||
G4ProcessManager* pManager = G4Gamma::Gamma()->GetProcessManager();
|
||||
//
|
||||
G4PhotoNuclearProcess* process = new G4PhotoNuclearProcess();
|
||||
//
|
||||
G4CascadeInterface* bertini = new G4CascadeInterface();
|
||||
bertini->SetMaxEnergy(10*GeV);
|
||||
process->RegisterMe(bertini);
|
||||
//
|
||||
|
||||
// to not register a model, set Emax=0; eg. Emax1 = 0.
|
||||
const G4double Emax1 = 200*MeV, Emax2 = 10*GeV;
|
||||
|
||||
if (Emax1 > 0.) { // model 1
|
||||
G4LowEGammaNuclearModel* model1 = new G4LowEGammaNuclearModel();
|
||||
model1->SetMaxEnergy(Emax1);
|
||||
process->RegisterMe(model1);
|
||||
}
|
||||
|
||||
if (Emax2 > 0.) { // model 2
|
||||
G4CascadeInterface* model2 = new G4CascadeInterface();
|
||||
G4double Emin2 = std::max(Emax1-1*MeV, 0.);
|
||||
model2->SetMinEnergy(Emin2);
|
||||
model2->SetMaxEnergy(Emax2);
|
||||
process->RegisterMe(model2);
|
||||
}
|
||||
|
||||
G4ProcessManager* pManager = G4Gamma::Gamma()->GetProcessManager();
|
||||
pManager->AddDiscreteProcess(process);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,24 +61,35 @@ void HistoManager::Book()
|
||||
analysisManager->SetActivation(true); //enable inactivation of histograms
|
||||
|
||||
// Define histograms start values
|
||||
const G4int kMaxHisto = 14;
|
||||
const G4int kMaxHisto = 24;
|
||||
const G4String id[] = {"0","1","2","3","4","5","6","7","8","9",
|
||||
"10","11","12","13"};
|
||||
"10","11","12","13","14","15","16","17","18","19",
|
||||
"20","21","22","23" };
|
||||
const G4String title[] =
|
||||
{ "dummy", //0
|
||||
"total energy deposit", //1
|
||||
"Edep (MeV/mm) along absorber", //2
|
||||
"total kinetic energy flow", //3
|
||||
"energy spectrum of emerging gamma", //4
|
||||
"energy spectrum of emerging e+-", //5
|
||||
"energy spectrum of emerging neutrons", //6
|
||||
"energy spectrum of emerging protons", //7
|
||||
"energy spectrum of emerging deuterons", //8
|
||||
"energy spectrum of emerging alphas", //9
|
||||
"energy spectrum of all others emerging ions", //10
|
||||
"energy spectrum of all others emerging baryons", //11
|
||||
"energy spectrum of all others emerging mesons", //12
|
||||
"energy spectrum of all others emerging leptons (neutrinos)" //13
|
||||
"energy spectrum of gamma at creation", //4
|
||||
"energy spectrum of e+- at creation", //5
|
||||
"energy spectrum of neutrons at creation", //6
|
||||
"energy spectrum of protons at creation", //7
|
||||
"energy spectrum of deuterons at creation", //8
|
||||
"energy spectrum of alphas at creation", //9
|
||||
"energy spectrum of all others ions at creation", //10
|
||||
"energy spectrum of all others baryons at creation", //11
|
||||
"energy spectrum of all others mesons at creation", //12
|
||||
"energy spectrum of all others leptons (neutrinos) at creation", //13
|
||||
"energy spectrum of emerging gamma", //14
|
||||
"energy spectrum of emerging e+-", //15
|
||||
"energy spectrum of emerging neutrons", //16
|
||||
"energy spectrum of emerging protons", //17
|
||||
"energy spectrum of emerging deuterons", //18
|
||||
"energy spectrum of emerging alphas", //19
|
||||
"energy spectrum of all others emerging ions", //20
|
||||
"energy spectrum of all others emerging baryons", //21
|
||||
"energy spectrum of all others emerging mesons", //22
|
||||
"energy spectrum of all others emerging leptons (neutrinos)" //23
|
||||
};
|
||||
|
||||
// Default values (to be reset via /analysis/h1/set command)
|
||||
|
||||
@@ -61,6 +61,28 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
|
||||
Run* run = static_cast<Run*>(
|
||||
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
run->ParticleCount(name,energy);
|
||||
|
||||
// histograms: energy at creation
|
||||
//
|
||||
G4AnalysisManager* analysis = G4AnalysisManager::Instance();
|
||||
|
||||
G4int ih = 0;
|
||||
const G4ParticleDefinition* particle = track->GetParticleDefinition();
|
||||
G4String type = particle->GetParticleType();
|
||||
G4double charge = particle->GetPDGCharge();
|
||||
if (charge > 3.) ih = 10;
|
||||
else if (particle == G4Gamma::Gamma()) ih = 4;
|
||||
else if (particle == G4Electron::Electron()) ih = 5;
|
||||
else if (particle == G4Positron::Positron()) ih = 5;
|
||||
else if (particle == G4Neutron::Neutron()) ih = 6;
|
||||
else if (particle == G4Proton::Proton()) ih = 7;
|
||||
else if (particle == G4Deuteron::Deuteron()) ih = 8;
|
||||
else if (particle == G4Alpha::Alpha()) ih = 9;
|
||||
else if (type == "nucleus") ih = 10;
|
||||
else if (type == "baryon") ih = 11;
|
||||
else if (type == "meson") ih = 12;
|
||||
else if (type == "lepton") ih = 13;
|
||||
if (ih > 0) analysis->FillH1(ih,energy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -81,25 +103,25 @@ void TrackingAction::PostUserTrackingAction(const G4Track* track)
|
||||
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
run->ParticleFlux(name,energy);
|
||||
|
||||
// histograms: enery flow
|
||||
// histograms: energy at exit
|
||||
//
|
||||
G4AnalysisManager* analysis = G4AnalysisManager::Instance();
|
||||
|
||||
G4int ih = 0;
|
||||
G4String type = particle->GetParticleType();
|
||||
G4double charge = particle->GetPDGCharge();
|
||||
if (charge > 3.) ih = 10;
|
||||
else if (particle == G4Gamma::Gamma()) ih = 4;
|
||||
else if (particle == G4Electron::Electron()) ih = 5;
|
||||
else if (particle == G4Positron::Positron()) ih = 5;
|
||||
else if (particle == G4Neutron::Neutron()) ih = 6;
|
||||
else if (particle == G4Proton::Proton()) ih = 7;
|
||||
else if (particle == G4Deuteron::Deuteron()) ih = 8;
|
||||
else if (particle == G4Alpha::Alpha()) ih = 9;
|
||||
else if (type == "nucleus") ih = 10;
|
||||
else if (type == "baryon") ih = 11;
|
||||
else if (type == "meson") ih = 12;
|
||||
else if (type == "lepton") ih = 13;
|
||||
if (charge > 3.) ih = 20;
|
||||
else if (particle == G4Gamma::Gamma()) ih = 14;
|
||||
else if (particle == G4Electron::Electron()) ih = 15;
|
||||
else if (particle == G4Positron::Positron()) ih = 15;
|
||||
else if (particle == G4Neutron::Neutron()) ih = 16;
|
||||
else if (particle == G4Proton::Proton()) ih = 17;
|
||||
else if (particle == G4Deuteron::Deuteron()) ih = 18;
|
||||
else if (particle == G4Alpha::Alpha()) ih = 19;
|
||||
else if (type == "nucleus") ih = 20;
|
||||
else if (type == "baryon") ih = 21;
|
||||
else if (type == "meson") ih = 22;
|
||||
else if (type == "lepton") ih = 23;
|
||||
if (ih > 0) analysis->FillH1(ih,energy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user