Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: DetectorConstruction.cc,v 1.13 2006/09/25 17:06:29 maire Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: DetectorMessenger.cc,v 1.4 2006/06/29 16:55:32 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: EventAction.cc,v 1.6 2006/06/29 16:55:34 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: EventMessenger.cc,v 1.5 2006/06/29 16:55:36 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: HistoManager.cc,v 1.16 2006/06/29 16:55:38 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: HistoManager.cc,v 1.21 2007/11/28 12:37:56 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -61,6 +61,7 @@ HistoManager::HistoManager()
exist[k] = false;
Unit[k] = 1.0;
Width[k] = 1.0;
ascii[k] = false;
}
histoMessenger = new HistoMessenger(this);
@@ -127,6 +128,7 @@ void HistoManager::save()
{
#ifdef G4ANALYSIS_USE
if (factoryOn) {
saveAscii(); // Write ascii file, if any
tree->commit(); // Writing the histograms to the file
tree->close(); // and closing the tree (and the file)
G4cout << "\n----> Histogram Tree is saved in " << fileName[1] << G4endl;
@@ -155,7 +157,7 @@ void HistoManager::FillHisto(G4int ih, G4double e, G4double weight)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::SetHisto(G4int ih,
G4int nbins, G4double valmin, G4double valmax, const G4String& unit)
G4int nbins, G4double valmin, G4double valmax, const G4String& unit)
{
if (ih > MaxHisto) {
G4cout << "---> warning from HistoManager::SetHisto() : histo " << ih
@@ -164,25 +166,42 @@ void HistoManager::SetHisto(G4int ih,
}
const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10","11","12","13","14","15","16"};
"10","11","12","13","14","15","16","17","18","19",
"20","21","22","23","24","25","26","27","28","29",
"30","31","32","33","34","35","36","37","38","39",
"40","41","42","43","44","45","46","47","48","49"
};
const G4String title[] =
{ "dummy", //0
"energy deposit in absorber", //1
"energy of charged secondaries at creation", //2
"energy of gammas at creation (std::log10(ekin/MeV))",//3
"(transmit, charged) : kinetic energy at exit", //4
"(transmit, charged) : space angle at exit", //5
"(transmit, charged) : projected angle at exit", //6
"(transmit, charged) : projected position at exit", //7
"(transmit, neutral) : kinetic energy at exit", //8
"(transmit, neutral) : space angle at exit", //9
"(transmit, neutral) : projected angle at exit", //10
"(reflect , charged) : kinetic energy at exit", //11
"(reflect , charged) : space angle at exit", //12
"(reflect , charged) : projected angle at exit", //13
"(reflect , neutral) : kinetic energy at exit", //14
"(reflect , neutral) : space angle at exit", //15
"(reflect , neutral) : projected angle at exit" //16
"x_vertex of charged secondaries (all)", //4
"x_vertex of charged secondaries (not absorbed)", //5
"dummy","dummy","dummy","dummy", //6-9
"(transmit, charged) : kinetic energy at exit", //10
"(transmit, charged) : ener fluence: dE(MeV)/dOmega", //11
"(transmit, charged) : space angle: dN/dOmega", //12
"(transmit, charged) : projected angle at exit", //13
"(transmit, charged) : projected position at exit", //14
"(transmit, charged) : radius at exit", //15
"dummy","dummy","dummy","dummy", //16-19
"(transmit, neutral) : kinetic energy at exit", //20
"(transmit, neutral) : ener fluence: dE(MeV)/dOmega", //21
"(transmit, neutral) : space angle: dN/dOmega", //22
"(transmit, neutral) : projected angle at exit", //23
"dummy","dummy","dummy","dummy","dummy","dummy", //24-29
"(reflect , charged) : kinetic energy at exit", //30
"(reflect , charged) : ener fluence: dE(MeV)/dOmega", //31
"(reflect , charged) : space angle: dN/dOmega", //32
"(reflect , charged) : projected angle at exit", //33
"dummy","dummy","dummy","dummy","dummy","dummy", //34-39
"(reflect , neutral) : kinetic energy at exit", //40
"(reflect , neutral) : ener fluence: dE(MeV)/dOmega" //41
"(reflect , neutral) : space angle: dN/dOmega", //42
"(reflect , neutral) : projected angle at exit", //43
"dummy","dummy","dummy","dummy","dummy","dummy" //44-49
};
G4String titl = title[ih];
@@ -225,3 +244,43 @@ void HistoManager::RemoveHisto(G4int ih)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::PrintHisto(G4int ih)
{
if (ih < MaxHisto) ascii[ih] = true;
else
G4cout << "---> warning from HistoManager::PrintHisto() : histo " << ih
<< "does not exist" << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include <fstream>
void HistoManager::saveAscii()
{
#ifdef G4ANALYSIS_USE
G4String name = fileName[0] + ".ascii";
std::ofstream File(name, std::ios::out);
File.setf( std::ios::scientific, std::ios::floatfield );
//write selected histograms
for (G4int ih=0; ih<MaxHisto; ih++) {
if (exist[ih] && ascii[ih]) {
File << "\n 1D histogram " << ih << ": " << Title[ih]
<< "\n \n \t X \t\t Y" << G4endl;
for (G4int iBin=0; iBin<Nbins[ih]; iBin++) {
File << " " << iBin << "\t"
<< histo[ih]->binMean(iBin) << "\t"
<< histo[ih]->binHeight(iBin)
<< G4endl;
}
}
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: HistoMessenger.cc,v 1.7 2006/06/29 16:55:40 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: HistoMessenger.cc,v 1.8 2007/11/12 17:48:16 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -85,6 +85,11 @@ HistoMessenger::HistoMessenger(HistoManager* manager)
unit->SetDefaultValue("none");
histoCmd->SetParameter(unit);
prhistoCmd = new G4UIcmdWithAnInteger("/testem/histo/printHisto",this);
prhistoCmd->SetGuidance("print histo #id on ascii file");
prhistoCmd->SetParameterName("id",false);
prhistoCmd->SetRange("id>0");
rmhistoCmd = new G4UIcmdWithAnInteger("/testem/histo/removeHisto",this);
rmhistoCmd->SetGuidance("desactivate histo #id");
rmhistoCmd->SetParameterName("id",false);
@@ -96,6 +101,7 @@ HistoMessenger::HistoMessenger(HistoManager* manager)
HistoMessenger::~HistoMessenger()
{
delete rmhistoCmd;
delete prhistoCmd;
delete histoCmd;
delete optionCmd;
delete typeCmd;
@@ -126,6 +132,9 @@ void HistoMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
histoManager->SetHisto (ih,nbBins,vmin*vUnit,vmax*vUnit,unit);
}
if (command == prhistoCmd)
histoManager->PrintHisto(prhistoCmd->GetNewIntValue(newValues));
if (command == rmhistoCmd)
histoManager->RemoveHisto(rmhistoCmd->GetNewIntValue(newValues));
@@ -25,7 +25,7 @@
//
//
// $Id: PhysListEmLivermore.cc,v 1.2 2006/06/29 16:55:51 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -25,7 +25,7 @@
//
//
// $Id: PhysListEmPenelope.cc,v 1.3 2006/06/29 16:55:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PhysListEmStandard.cc,v 1.12 2007/06/22 10:48:01 maire Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: PhysListEmStandard.cc,v 1.14 2007/11/21 17:41:19 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -124,7 +124,14 @@ void PhysListEmStandard::ConstructProcess()
//coulomb scattering
//
emOptions.SetMscStepLimitation(fUseDistanceToBoundary);
emOptions.SetSkin(2.);
emOptions.SetSkin(4.);
//physics tables
//
emOptions.SetMinEnergy(100*eV);
emOptions.SetMaxEnergy(100*TeV);
emOptions.SetDEDXBinning(1200);
emOptions.SetLambdaBinning(1200);
//energy loss
//
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: PhysListEmStandardIG.cc,v 1.1 2007/11/13 14:41:28 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysListEmStandardIG.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4hMultipleScattering.hh"
#include "G4MuMultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
#include "G4ionGasIonisation.hh"
#include "G4CoulombScattering.hh"
#include "G4EmProcessOptions.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmStandardIG::PhysListEmStandardIG(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysListEmStandardIG::~PhysListEmStandardIG()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysListEmStandardIG::ConstructProcess()
{
G4double thetamin = 0.05;
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
pmanager->AddDiscreteProcess(new G4ComptonScattering);
pmanager->AddDiscreteProcess(new G4GammaConversion);
} else if (particleName == "e-") {
//electron
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
pmanager->AddDiscreteProcess(cs);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
pmanager->AddDiscreteProcess(cs);
} else if (particleName == "mu+" ||
particleName == "mu-" ) {
//muon
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
pmanager->AddDiscreteProcess(cs);
} else if (particleName == "alpha" || particleName == "He3") {
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4ionGasIonisation, -1, 2,2);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
pmanager->AddDiscreteProcess(cs);
// pmanager->AddDiscreteProcess(nucr);
} else if (particleName == "GenericIon" ) {
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4ionGasIonisation, -1, 2,2);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
cs->SetBuildTableFlag(false);
pmanager->AddDiscreteProcess(cs);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddProcess(new G4MuMultipleScattering(thetamin), -1, 1,1);
pmanager->AddProcess(new G4hIonisation, -1, 2,2);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetThetaMin(thetamin);
pmanager->AddDiscreteProcess(cs);
}
}
G4EmProcessOptions opt;
opt.SetSubCutoff(true);
opt.SetMinEnergy(0.1*keV);
opt.SetMaxEnergy(100.*GeV);
opt.SetDEDXBinning(360);
opt.SetLambdaBinning(360);
opt.SetLinearLossLimit(1.e-6);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PhysListEmStandardSS.cc,v 1.2 2007/05/16 12:02:54 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: PhysListEmStandardSS.cc,v 1.3 2007/07/31 16:51:29 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -82,42 +82,42 @@ void PhysListEmStandardSS::ConstructProcess()
} else if (particleName == "e-") {
//electron
pmanager->AddDiscreteProcess(new G4CoulombScattering);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eIonisation, -1, 1,1);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);
pmanager->AddDiscreteProcess(new G4CoulombScattering);
} else if (particleName == "e+") {
//positron
pmanager->AddDiscreteProcess(new G4CoulombScattering);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
pmanager->AddProcess(new G4eIonisation, -1, 1,1);
pmanager->AddProcess(new G4eBremsstrahlung, -1, 2,2);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,3);
pmanager->AddDiscreteProcess(new G4CoulombScattering);
} else if (particleName == "mu+" ||
particleName == "mu-" ) {
//muon
pmanager->AddDiscreteProcess(new G4CoulombScattering);
pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
pmanager->AddProcess(new G4MuIonisation, -1, 1,1);
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 2,2);
pmanager->AddProcess(new G4MuPairProduction, -1, 3,3);
pmanager->AddDiscreteProcess(new G4CoulombScattering);
} else if (particleName == "alpha" || particleName == "He3") {
pmanager->AddDiscreteProcess(new G4CoulombScattering);
pmanager->AddProcess(new G4ionIonisation, -1, 2,2);
pmanager->AddProcess(new G4ionIonisation, -1, 1,1);
pmanager->AddDiscreteProcess(new G4CoulombScattering);
} else if (particleName == "GenericIon" ) {
pmanager->AddProcess(new G4ionIonisation, -1, 1,1);
G4CoulombScattering* cs = new G4CoulombScattering();
cs->SetBuildTableFlag(false);
pmanager->AddDiscreteProcess(cs);
pmanager->AddProcess(new G4ionIonisation, -1, 2,2);
} else if ((!particle->IsShortLived()) &&
(particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
//all others charged particles except geantino
pmanager->AddDiscreteProcess(new G4CoulombScattering);
pmanager->AddProcess(new G4hIonisation, -1,2,2);
pmanager->AddProcess(new G4hIonisation, -1,1,1);
pmanager->AddDiscreteProcess(new G4CoulombScattering);
}
}
}
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PhysicsList.cc,v 1.19 2007/05/16 12:02:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: PhysicsList.cc,v 1.21 2007/11/19 14:57:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -34,6 +34,7 @@
#include "PhysListEmStandard.hh"
#include "PhysListEmStandardSS.hh"
#include "PhysListEmStandardIG.hh"
#include "PhysListEmLivermore.hh"
#include "PhysListEmPenelope.hh"
@@ -42,6 +43,7 @@
#include "G4EmStandardPhysics_option2.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4HadronDElasticPhysics.hh"
#include "G4HadronHElasticPhysics.hh"
#include "G4HadronQElasticPhysics.hh"
#include "G4HadronInelasticQBBC.hh"
@@ -244,6 +246,12 @@ void PhysicsList::AddPhysicsList(const G4String& name)
delete emPhysicsList;
emPhysicsList = new PhysListEmStandardSS(name);
} else if (name == "standardIG") {
emName = name;
delete emPhysicsList;
emPhysicsList = new PhysListEmStandardIG(name);
} else if (name == "livermore") {
emName = name;
@@ -257,15 +265,19 @@ void PhysicsList::AddPhysicsList(const G4String& name)
emPhysicsList = new PhysListEmPenelope(name);
} else if (name == "elastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronElasticPhysics(name));
hadronPhys.push_back( new G4HadronElasticPhysics());
helIsRegisted = true;
} else if (name == "DElastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronDElasticPhysics());
helIsRegisted = true;
} else if (name == "HElastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronHElasticPhysics(name));
hadronPhys.push_back( new G4HadronHElasticPhysics());
helIsRegisted = true;
} else if (name == "QElastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronQElasticPhysics(name));
hadronPhys.push_back( new G4HadronQElasticPhysics());
helIsRegisted = true;
} else if (name == "binary" && !bicIsRegisted) {
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PhysicsListMessenger.cc,v 1.6 2006/06/29 16:56:07 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PrimaryGeneratorAction.cc,v 1.4 2006/06/29 16:56:09 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: PrimaryGeneratorMessenger.cc,v 1.4 2006/06/29 16:56:12 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RunAction.cc,v 1.23 2006/06/29 16:56:14 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: RunAction.cc,v 1.25 2007/11/21 17:41:19 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -74,6 +74,8 @@ void RunAction::BeginOfRunAction(const G4Run* aRun)
Transmit[0] = Transmit[1] = Reflect[0] = Reflect[1] = 0;
MscEntryCentral = 0;
EnergyLeak[0] = EnergyLeak[1] = EnergyLeak2[0] = EnergyLeak2[1] = 0.;
histoManager->book();
@@ -90,6 +92,9 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
//
G4int TotNbofEvents = aRun->GetNumberOfEvent();
if (TotNbofEvents == 0) return;
G4double EnergyBalance = EnergyDeposit + EnergyLeak[0] + EnergyLeak[1];
EnergyBalance /= TotNbofEvents;
EnergyDeposit /= TotNbofEvents; EnergyDeposit2 /= TotNbofEvents;
G4double rmsEdep = EnergyDeposit2 - EnergyDeposit*EnergyDeposit;
@@ -133,10 +138,20 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
MscProjecTheta /= MscEntryCentral; MscProjecTheta2 /= MscEntryCentral;
rmsMsc = MscProjecTheta2 - MscProjecTheta*MscProjecTheta;
if (rmsMsc > 0.) rmsMsc = std::sqrt(rmsMsc);
tailMsc = 100.- (100.*MscEntryCentral)/(2*Transmit[1]);
tailMsc = 100.- (100.*MscEntryCentral)/(2*Transmit[1]);
}
EnergyLeak[0] /= TotNbofEvents; EnergyLeak2[0] /= TotNbofEvents;
G4double rmsEl0 = EnergyLeak2[0] - EnergyLeak[0]*EnergyLeak[0];
if (rmsEl0>0.) rmsEl0 = std::sqrt(rmsEl0/TotNbofEvents);
else rmsEl0 = 0.;
EnergyLeak[1] /= TotNbofEvents; EnergyLeak2[1] /= TotNbofEvents;
G4double rmsEl1 = EnergyLeak2[1] - EnergyLeak[1]*EnergyLeak[1];
if (rmsEl1>0.) rmsEl1 = std::sqrt(rmsEl1/TotNbofEvents);
else rmsEl1 = 0.;
//Stopping Power from input Table.
//
G4Material* material = detector->GetAbsorberMaterial();
@@ -173,12 +188,13 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
<< G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
G4cout.precision(4);
G4cout << "\n Total energy deposit in absorber per event = "
<< G4BestUnit(EnergyDeposit,"Energy") << " +- "
<< G4BestUnit(rmsEdep, "Energy")
<< G4endl;
G4cout << " -----> Mean dE/dx = " << meandEdx/(MeV/cm) << " MeV/cm"
G4cout << "\n -----> Mean dE/dx = " << meandEdx/(MeV/cm) << " MeV/cm"
<< "\t(" << stopPower/(MeV*cm2/g) << " MeV*cm2/g)"
<< G4endl;
@@ -190,7 +206,19 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
G4cout << " full dEdx = " << dEdxFull/(MeV/cm) << " MeV/cm"
<< "\t(" << stopFull/(MeV*cm2/g) << " MeV*cm2/g)"
<< G4endl;
G4cout << "\n Leakage : primary = "
<< G4BestUnit(EnergyLeak[0],"Energy") << " +- "
<< G4BestUnit(rmsEl0, "Energy")
<< " secondaries = "
<< G4BestUnit(EnergyLeak[1],"Energy") << " +- "
<< G4BestUnit(rmsEl1, "Energy")
<< G4endl;
G4cout << " Energy balance : edep + eleak = "
<< G4BestUnit(EnergyBalance,"Energy")
<< G4endl;
G4cout << "\n Total track length (charged) in absorber per event = "
<< G4BestUnit(TrakLenCharged,"Length") << " +- "
<< G4BestUnit(rmsTLCh, "Length") << G4endl;
@@ -223,7 +251,7 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
// compute width of the Gaussian central part of the MultipleScattering
//
if (histoManager->HistoExist(6)) {
if (histoManager->HistoExist(13)) {
G4cout << "\n MultipleScattering:"
<< "\n rms proj angle of transmit primary particle = "
<< rmsMsc/mrad << " mrad (central part only)" << G4endl;
@@ -234,7 +262,7 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
G4cout << " central part defined as +- "
<< MscThetaCentral/mrad << " mrad; "
<< " Tail ratio = " << tailMsc << " %" << G4endl;
}
}
G4cout.precision(prec);
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: StackingAction.cc,v 1.7 2006/09/25 17:06:29 maire Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: StackingMessenger.cc,v 1.5 2006/09/25 17:06:29 maire Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: StepMax.cc,v 1.2 2006/06/29 16:56:21 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: StepMaxMessenger.cc,v 1.3 2006/06/29 16:56:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: SteppingAction.cc,v 1.7 2006/06/29 16:56:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,7 +24,7 @@
// ********************************************************************
//
// $Id: SteppingVerbose.cc,v 1.3 2006/06/29 16:56:27 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: TrackingAction.cc,v 1.11 2006/06/29 16:56:29 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: TrackingAction.cc,v 1.16 2007/11/28 12:37:57 maire Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -68,6 +68,7 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
G4bool transmit = (position.x() >= xendAbs);
G4bool reflect = (position.x() <= xstartAbs);
G4bool notabsor = (transmit || reflect);
//transmitted + reflected particles counter
//
@@ -76,7 +77,7 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (aTrack->GetTrackID() == 1) flag = 2;
if (transmit) eventaction->SetTransmitFlag(flag);
if (reflect) eventaction->SetReflectFlag(flag);
//
//histograms
//
@@ -86,35 +87,62 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
//energy spectrum at exit
//
if (transmit && charged) id = 4;
else if (transmit && neutral) id = 8;
else if (reflect && charged) id = 11;
else if (reflect && neutral) id = 14;
if (transmit && charged) id = 10;
else if (transmit && neutral) id = 20;
else if (reflect && charged) id = 30;
else if (reflect && neutral) id = 40;
histoManager->FillHisto(id, aTrack->GetKineticEnergy());
//space angle distribution at exit
//energy leakage
//
if (transmit && charged) id = 5;
else if (transmit && neutral) id = 9;
else if (reflect && charged) id = 12;
else if (reflect && neutral) id = 15;
if (notabsor) {
G4int trackID = aTrack->GetTrackID();
G4int index = 0; if (trackID > 1) index = 1; //primary=0, secondaries=1
G4double eleak = aTrack->GetKineticEnergy();
if ((aTrack->GetDefinition() == G4Positron::Positron()) && (trackID > 1))
eleak += 2*electron_mass_c2;
runaction->AddEnergyLeak(eleak,index);
}
G4ThreeVector direction = aTrack->GetMomentumDirection();
//space angle distribution at exit : dN/dOmega
//
if (transmit && charged) id = 12;
else if (transmit && neutral) id = 22;
else if (reflect && charged) id = 32;
else if (reflect && neutral) id = 42;
G4ThreeVector direction = aTrack->GetMomentumDirection();
if (histoManager->HistoExist(id)) {
G4double theta = std::acos(direction.x());
G4double dteta = histoManager->GetBinWidth(id);
G4double weight = 1./(twopi*std::sin(theta)*dteta);
G4double unit = histoManager->GetHistoUnit(id);
histoManager->FillHisto(id,theta,weight*unit*unit);
G4double unit = histoManager->GetHistoUnit(id);
G4double weight = (unit*unit)/(twopi*std::sin(theta)*dteta);
histoManager->FillHisto(id,theta,weight);
}
//energy fluence at exit : dE(MeV)/dOmega
//
if (transmit && charged) id = 11;
else if (transmit && neutral) id = 21;
else if (reflect && charged) id = 31;
else if (reflect && neutral) id = 41;
if (histoManager->HistoExist(id)) {
G4double theta = std::acos(direction.x());
G4double dteta = histoManager->GetBinWidth(id);
G4double unit = histoManager->GetHistoUnit(id);
G4double weight = (unit*unit)/(twopi*std::sin(theta)*dteta);
weight *= (aTrack->GetKineticEnergy()/MeV);
histoManager->FillHisto(id,theta,weight);
}
//projected angles distribution at exit
//
if (transmit && charged) id = 6;
else if (transmit && neutral) id = 10;
else if (reflect && charged) id = 13;
else if (reflect && neutral) id = 16;
if (transmit && charged) id = 13;
else if (transmit && neutral) id = 23;
else if (reflect && charged) id = 33;
else if (reflect && neutral) id = 43;
if(id>0) {
G4double tet = std::atan(direction.y()/std::fabs(direction.x()));
@@ -126,11 +154,24 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (transmit && (flag == 2)) runaction->AddMscProjTheta(tet);
}
//projected position at exit
//projected position and radius at exit
//
if (transmit && charged) {
histoManager->FillHisto(7, position.y());
histoManager->FillHisto(7, position.z());
if (transmit && charged) id = 14;
if (id>0) {
G4double y = position.y(), z = position.z();
G4double r = std::sqrt(y*y + z*z);
histoManager->FillHisto(id, y);
histoManager->FillHisto(id, z);
histoManager->FillHisto(id+1, r);
}
//x-vertex of charged secondaries
//
if ((aTrack->GetParentID() == 1) && charged) {
G4double xVertex = (aTrack->GetVertexPosition()).x();
histoManager->FillHisto(4, xVertex);
if (notabsor) histoManager->FillHisto(5, xVertex);
}
}