Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -26,11 +26,8 @@
|
||||
/// \file hadronic/Hadr03/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
|
||||
// $Id: DetectorConstruction.cc 77251 2013-11-22 10:06:41Z gcosmo $
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -53,10 +50,16 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
:fPBox(0), fLBox(0), fMaterial(0), fMagField(0)
|
||||
:G4VUserDetectorConstruction(),
|
||||
fPBox(0), fLBox(0), fMaterial(0), fMagField(0), fDetectorMessenger(0)
|
||||
{
|
||||
fBoxSize = 10*m;
|
||||
DefineMaterials();
|
||||
@@ -82,16 +85,7 @@ void DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
// define a Material from isotopes
|
||||
//
|
||||
MaterialWithSingleIsotope("Boron10", "B10", 2.46*g/cm3, 5, 10);
|
||||
MaterialWithSingleIsotope("Boron11", "B11", 2.46*g/cm3, 5, 11);
|
||||
MaterialWithSingleIsotope("Oxygen16", "O16", 1.43*g/cm3, 8, 16);
|
||||
MaterialWithSingleIsotope("Cacium40", "Ca40", 1.55*g/cm3, 20, 40);
|
||||
MaterialWithSingleIsotope("Zirconium90", "Zr90", 6.51*g/cm3, 40, 90);
|
||||
MaterialWithSingleIsotope("Molybdenum98", "Mo98", 10.28*g/cm3, 42, 98);
|
||||
MaterialWithSingleIsotope("Molybdenum100","Mo100", 10.28*g/cm3, 42, 100);
|
||||
MaterialWithSingleIsotope("Lead208", "Pb208", 11.34*g/cm3, 82, 208);
|
||||
MaterialWithSingleIsotope("Uranium235", "U235", 19.05*g/cm3, 92, 235);
|
||||
MaterialWithSingleIsotope("Uranium238", "U238", 19.05*g/cm3, 92, 238);
|
||||
|
||||
// or use G4-NIST materials data base
|
||||
//
|
||||
@@ -142,7 +136,7 @@ G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
|
||||
|
||||
fPBox = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLBox, //its logical volume
|
||||
fLBox, //its logical volume
|
||||
fMaterial->GetName(), //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
@@ -169,12 +163,16 @@ void DetectorConstruction::PrintParameters()
|
||||
void DetectorConstruction::SetMaterial(G4String materialChoice)
|
||||
{
|
||||
// search the material by its name
|
||||
////G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
|
||||
G4Material* pttoMaterial =
|
||||
G4NistManager::Instance()->FindOrBuildMaterial(materialChoice);
|
||||
|
||||
if (pttoMaterial) { fMaterial = pttoMaterial;
|
||||
} else {
|
||||
if (pttoMaterial) {
|
||||
if(fMaterial != pttoMaterial) {
|
||||
fMaterial = pttoMaterial;
|
||||
if(fLBox) { fLBox->SetMaterial(pttoMaterial); }
|
||||
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
|
||||
}
|
||||
} else {
|
||||
G4cout << "\n--> warning from DetectorConstruction::SetMaterial : "
|
||||
<< materialChoice << " not found" << G4endl;
|
||||
}
|
||||
@@ -185,13 +183,11 @@ void DetectorConstruction::SetMaterial(G4String materialChoice)
|
||||
void DetectorConstruction::SetSize(G4double value)
|
||||
{
|
||||
fBoxSize = value;
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
void DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
{
|
||||
//apply a global uniform magnetic field along Z axis
|
||||
@@ -215,11 +211,3 @@ void DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
void DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr03/src/DetectorMessenger.cc
|
||||
/// \brief Implementation of the DetectorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: DetectorMessenger.cc 77251 2013-11-22 10:06:41Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
@@ -42,7 +44,9 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
:fDetector(Det)
|
||||
:G4UImessenger(),
|
||||
fDetector(Det), fTestemDir(0), fDetDir(0), fMaterCmd(0), fSizeCmd(0),
|
||||
fMagFieldCmd(0), fIsotopeCmd(0)
|
||||
{
|
||||
fTestemDir = new G4UIdirectory("/testhadr/");
|
||||
fTestemDir->SetGuidance("commands specific to this example");
|
||||
@@ -54,6 +58,7 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fMaterCmd->SetGuidance("Select material of the box.");
|
||||
fMaterCmd->SetParameterName("choice",false);
|
||||
fMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fMaterCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fSizeCmd = new G4UIcmdWithADoubleAndUnit("/testhadr/det/setSize",this);
|
||||
fSizeCmd->SetGuidance("Set size of the box");
|
||||
@@ -61,19 +66,47 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
fSizeCmd->SetRange("Size>0.");
|
||||
fSizeCmd->SetUnitCategory("Length");
|
||||
fSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fSizeCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testhadr/det/setField",this);
|
||||
fMagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
fMagFieldCmd->SetParameterName("Bz",false);
|
||||
fMagFieldCmd->SetUnitCategory("Magnetic flux density");
|
||||
fMagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fMagFieldCmd->SetToBeBroadcasted(false);
|
||||
|
||||
fUpdateCmd = new G4UIcmdWithoutParameter("/testhadr/det/update",this);
|
||||
fUpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
fUpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
fUpdateCmd->AvailableForStates(G4State_Idle);
|
||||
fIsotopeCmd = new G4UIcommand("/testhadr/det/setIsotopeMat",this);
|
||||
fIsotopeCmd->SetGuidance("Build and select a material with single isotope");
|
||||
fIsotopeCmd->SetGuidance(" symbol of isotope, Z, A, density of material");
|
||||
//
|
||||
G4UIparameter* symbPrm = new G4UIparameter("isotope",'s',false);
|
||||
symbPrm->SetGuidance("isotope symbol");
|
||||
fIsotopeCmd->SetParameter(symbPrm);
|
||||
//
|
||||
G4UIparameter* ZPrm = new G4UIparameter("Z",'i',false);
|
||||
ZPrm->SetGuidance("Z");
|
||||
ZPrm->SetParameterRange("Z>0");
|
||||
fIsotopeCmd->SetParameter(ZPrm);
|
||||
//
|
||||
G4UIparameter* APrm = new G4UIparameter("A",'i',false);
|
||||
APrm->SetGuidance("A");
|
||||
APrm->SetParameterRange("A>0");
|
||||
fIsotopeCmd->SetParameter(APrm);
|
||||
//
|
||||
G4UIparameter* densityPrm = new G4UIparameter("density",'d',false);
|
||||
densityPrm->SetGuidance("density of material");
|
||||
densityPrm->SetParameterRange("density>0.");
|
||||
fIsotopeCmd->SetParameter(densityPrm);
|
||||
//
|
||||
G4UIparameter* unitPrm = new G4UIparameter("unit",'s',false);
|
||||
unitPrm->SetGuidance("unit of density");
|
||||
G4String unitList = G4UIcommand::UnitsList(G4UIcommand::CategoryOf("g/cm3"));
|
||||
unitPrm->SetParameterCandidates(unitList);
|
||||
fIsotopeCmd->SetParameter(unitPrm);
|
||||
//
|
||||
fIsotopeCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
fIsotopeCmd->SetToBeBroadcasted(false);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -83,7 +116,7 @@ DetectorMessenger::~DetectorMessenger()
|
||||
delete fMaterCmd;
|
||||
delete fSizeCmd;
|
||||
delete fMagFieldCmd;
|
||||
delete fUpdateCmd;
|
||||
delete fIsotopeCmd;
|
||||
delete fDetDir;
|
||||
delete fTestemDir;
|
||||
}
|
||||
@@ -100,9 +133,17 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
|
||||
if( command == fMagFieldCmd )
|
||||
{ fDetector->SetMagField(fMagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == fUpdateCmd )
|
||||
{ fDetector->UpdateGeometry(); }
|
||||
|
||||
if (command == fIsotopeCmd)
|
||||
{
|
||||
G4int Z; G4int A; G4double dens;
|
||||
G4String name, unt;
|
||||
std::istringstream is(newValue);
|
||||
is >> name >> Z >> A >> dens >> unt;
|
||||
dens *= G4UIcommand::ValueOf(unt);
|
||||
fDetector->MaterialWithSingleIsotope (name,name,dens,Z,A);
|
||||
fDetector->SetMaterial(name);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr03/src/EventAction.cc
|
||||
/// \brief Implementation of the EventAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: EventAction.cc 70759 2013-06-05 12:26:43Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,7 +41,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction()
|
||||
:fPrintModulo(10000),fEventMessenger(0)
|
||||
:G4UserEventAction(),
|
||||
fPrintModulo(10000),fEventMessenger(0)
|
||||
{
|
||||
fEventMessenger = new EventActionMessenger(this);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr03/src/EventActionMessenger.cc
|
||||
/// \brief Implementation of the EventActionMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: EventActionMessenger.cc 70759 2013-06-05 12:26:43Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,7 +41,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventActionMessenger::EventActionMessenger(EventAction* EvAct)
|
||||
:fEventAction(EvAct)
|
||||
:G4UImessenger(),
|
||||
fEventAction(EvAct),fEventDir(0), fPrintCmd(0)
|
||||
{
|
||||
fEventDir = new G4UIdirectory("/testhadr/event/");
|
||||
fEventDir ->SetGuidance("event control");
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
/// \file hadronic/Hadr03/src/GammaPhysics.cc
|
||||
/// \brief Implementation of the GammaPhysics class
|
||||
//
|
||||
// $Id: GammaPhysics.cc 66587 2012-12-21 11:06:44Z ihrivnac $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file hadronic/Hadr03/src/HistoManager.cc
|
||||
/// \brief Implementation of the HistoManager class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: HistoManager.cc 72245 2013-07-12 08:51:51Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -44,7 +46,7 @@ HistoManager::HistoManager()
|
||||
|
||||
HistoManager::~HistoManager()
|
||||
{
|
||||
delete G4AnalysisManager::Instance();
|
||||
// delete G4AnalysisManager::Instance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -88,7 +90,7 @@ void HistoManager::Book()
|
||||
// as we have not yet set nbins, vmin, vmax
|
||||
for (G4int k=0; k<kMaxHisto; k++) {
|
||||
G4int ih = analysisManager->CreateH1(id[k], title[k], nbins, vmin, vmax);
|
||||
analysisManager->SetActivation(G4VAnalysisManager::kH1, ih, false);
|
||||
analysisManager->SetH1Activation(ih, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
//
|
||||
/// \file hadronic/Hadr03/src/PhysicsList.cc
|
||||
/// \brief Implementation of the PhysicsList class
|
||||
//
|
||||
// $Id: PhysicsList.cc 70319 2013-05-29 07:53:09Z gcosmo $
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -34,9 +36,11 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include "G4HadronElasticPhysics.hh"
|
||||
#include "HadronPhysicsQGSP_BERT_HP.hh"
|
||||
#include "G4HadronInelasticQBBC.hh"
|
||||
#include "G4HadronPhysicsFTFP_BERT_HP.hh"
|
||||
#include "G4HadronPhysicsINCLXX.hh"
|
||||
#include "G4IonPhysics.hh"
|
||||
#include "G4IonINCLXXPhysics.hh"
|
||||
#include "GammaPhysics.hh"
|
||||
|
||||
// particles
|
||||
@@ -59,21 +63,23 @@ PhysicsList::PhysicsList()
|
||||
|
||||
//add new units for cross sections
|
||||
//
|
||||
new G4UnitDefinition( "mm2/g", "mm2/g","Surface/Mass", mm2/g);
|
||||
new G4UnitDefinition( "mm2/g", "mm2/g", "Surface/Mass", mm2/g);
|
||||
new G4UnitDefinition( "um2/mg", "um2/mg","Surface/Mass", um*um/mg);
|
||||
|
||||
// Hadron Elastic scattering
|
||||
RegisterPhysics( new G4HadronElasticPhysics(verb) );
|
||||
|
||||
// Hadron Physics
|
||||
////RegisterPhysics( new HadronPhysicsQGSP_BERT_HP(verb));
|
||||
RegisterPhysics( new G4HadronInelasticQBBC(verb));
|
||||
|
||||
// Hadron Inelastic Physics
|
||||
////RegisterPhysics( new G4HadronInelasticQBBC(verb));
|
||||
RegisterPhysics( new G4HadronPhysicsFTFP_BERT_HP(verb));
|
||||
////RegisterPhysics( new G4HadronPhysicsINCLXX(verb));
|
||||
|
||||
// Ion Physics
|
||||
RegisterPhysics( new G4IonPhysics(verb));
|
||||
////RegisterPhysics( new G4IonINCLXXPhysics(verb));
|
||||
|
||||
// Gamma Physics
|
||||
RegisterPhysics( new GammaPhysics("gamma"));
|
||||
RegisterPhysics( new GammaPhysics("gamma"));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr03/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PrimaryGeneratorAction.cc 70759 2013-06-05 12:26:43Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -44,7 +44,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
|
||||
:fDetector(det)
|
||||
:G4VUserPrimaryGeneratorAction(),
|
||||
fParticleGun(0), fDetector(det)
|
||||
{
|
||||
fParticleGun = new G4ParticleGun(1);
|
||||
G4ParticleDefinition* particle
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file hadronic/Hadr03/src/RunAction.cc
|
||||
/// \brief Implementation of the RunAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: RunAction.cc 70759 2013-06-05 12:26:43Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -49,7 +49,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim)
|
||||
: fDetector(det), fPrimary(prim)
|
||||
: G4UserRunAction(),
|
||||
fDetector(det), fPrimary(prim), fHistoManager(0)
|
||||
{
|
||||
fHistoManager = new HistoManager();
|
||||
}
|
||||
@@ -183,29 +184,59 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
<< " +- " << G4BestUnit( rms,"Length")
|
||||
<< "\tmassic: " << G4BestUnit(massicMFP, "Mass/Surface")
|
||||
<< "\n CrossSection:\t" << CrossSection*cm << " cm^-1 "
|
||||
<< "\t\tmassic: " << G4BestUnit(massicCS, "Surface/Mass")
|
||||
<< "\t\tmassic: " << G4BestUnit(massicCS, "Surface/Mass")
|
||||
<< G4endl;
|
||||
|
||||
//cross section per atom (only for single material)
|
||||
//
|
||||
if (material->GetNumberOfElements() == 1) {
|
||||
G4double nbAtoms = material->GetTotNbOfAtomsPerVolume();
|
||||
G4double crossSection = CrossSection/nbAtoms;
|
||||
G4cout << " crossSection per atom:\t"
|
||||
<< G4BestUnit(crossSection,"Surface") << G4endl;
|
||||
}
|
||||
//check cross section from G4HadronicProcessStore
|
||||
//
|
||||
G4cout << "\n Verification : "
|
||||
<< "crossSections from G4HadronicProcessStore:";
|
||||
|
||||
G4HadronicProcessStore* store = G4HadronicProcessStore::Instance();
|
||||
G4double sumc = 0.0;
|
||||
for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
|
||||
const G4VProcess* process = it->first;
|
||||
G4double xs =
|
||||
store->GetCrossSectionPerVolume(particle,energy,process,material);
|
||||
G4double massSigma = xs/density;
|
||||
sumc += massSigma;
|
||||
G4String procName = process->GetProcessName();
|
||||
G4cout << "\n " << procName << "= "
|
||||
<< G4BestUnit(massSigma, "Surface/Mass");
|
||||
}
|
||||
G4cout << "\n total = "
|
||||
<< G4BestUnit(sumc, "Surface/Mass") << G4endl;
|
||||
|
||||
G4double sumc1 = 0.0, sumc2 = 0.0;
|
||||
if (material->GetNumberOfElements() == 1) {
|
||||
const G4Element* element = material->GetElement(0);
|
||||
for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
|
||||
const G4VProcess* process = it->first;
|
||||
G4double xs1 =
|
||||
store->GetCrossSectionPerVolume(particle,energy,process,material);
|
||||
G4double massSigma = xs1/density;
|
||||
sumc1 += massSigma;
|
||||
G4double xs2 =
|
||||
store->GetCrossSectionPerAtom(particle,energy,process,element,material);
|
||||
sumc2 += xs2;
|
||||
G4String procName = process->GetProcessName();
|
||||
G4cout << "\n" << std::setw(20) << procName << "= "
|
||||
<< G4BestUnit(massSigma, "Surface/Mass") << "\t"
|
||||
<< G4BestUnit(xs2, "Surface");
|
||||
|
||||
}
|
||||
G4cout << "\n" << std::setw(20) << "total" << "= "
|
||||
<< G4BestUnit(sumc1, "Surface/Mass") << "\t"
|
||||
<< G4BestUnit(sumc2, "Surface") << G4endl;
|
||||
} else {
|
||||
for (it = fProcCounter.begin(); it != fProcCounter.end(); it++) {
|
||||
const G4VProcess* process = it->first;
|
||||
G4double xs =
|
||||
store->GetCrossSectionPerVolume(particle,energy,process,material);
|
||||
G4double massSigma = xs/density;
|
||||
sumc1 += massSigma;
|
||||
G4String procName = process->GetProcessName();
|
||||
G4cout << "\n" << std::setw(20) << procName << "= "
|
||||
<< G4BestUnit(massSigma, "Surface/Mass");
|
||||
}
|
||||
G4cout << "\n" << std::setw(20) << "total" << "= "
|
||||
<< G4BestUnit(sumc1, "Surface/Mass") << G4endl;
|
||||
}
|
||||
|
||||
//nuclear channel count
|
||||
//
|
||||
G4cout << "\n List of nuclear reactions: \n" << G4endl;
|
||||
@@ -227,7 +258,11 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
G4cout << "\n" << std::setw(58) << "Number of gamma: N = "
|
||||
<< fNbGamma[1] << " --> " << fNbGamma[2] << G4endl;
|
||||
}
|
||||
|
||||
|
||||
G4cout
|
||||
<< "\n --> NOTE: XXXX because neutronHP is unable to return target nucleus"
|
||||
<< G4endl;
|
||||
|
||||
//particles count
|
||||
//
|
||||
G4cout << "\n List of generated particles: \n" << G4endl;
|
||||
@@ -270,7 +305,9 @@ void RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
fEmean.clear(); fEmin.clear(); fEmax.clear();
|
||||
|
||||
//save histograms
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
////G4double factor = 1./NbOfEvents;
|
||||
////analysisManager->ScaleH1(3,factor);
|
||||
if ( analysisManager->IsActive() ) {
|
||||
analysisManager->Write();
|
||||
analysisManager->CloseFile();
|
||||
|
||||
@@ -26,24 +26,23 @@
|
||||
/// \file hadronic/Hadr03/src/SteppingAction.cc
|
||||
/// \brief Implementation of the SteppingAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: SteppingAction.cc 73011 2013-08-15 08:48:30Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "SteppingAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4HadronicProcess.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingAction::SteppingAction(PrimaryGeneratorAction* prim, RunAction* RuAct)
|
||||
:fPrimary(prim),fRunAction(RuAct)
|
||||
SteppingAction::SteppingAction(RunAction* RuAct)
|
||||
: G4UserSteppingAction(),fRunAction(RuAct)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -105,7 +104,8 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
|
||||
//secondaries
|
||||
//
|
||||
const G4TrackVector* secondary = fpSteppingManager->GetSecondary();
|
||||
const std::vector<const G4Track*>* secondary
|
||||
= aStep->GetSecondaryInCurrentStep();
|
||||
for (size_t lp=0; lp<(*secondary).size(); lp++) {
|
||||
particle = (*secondary)[lp]->GetDefinition();
|
||||
G4String name = particle->GetParticleName();
|
||||
|
||||
@@ -23,24 +23,26 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file hadronic/Hadr03/src/SteppingVerbose.cc
|
||||
/// \file radioactivedecay/rdecay01/src/SteppingVerbose.cc
|
||||
/// \brief Implementation of the SteppingVerbose class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: SteppingVerbose.cc 71661 2013-06-20 08:26:18Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "SteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingVerbose::SteppingVerbose()
|
||||
{}
|
||||
: G4SteppingVerbose()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,10 +51,46 @@ SteppingVerbose::~SteppingVerbose()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::StepInfo()
|
||||
{
|
||||
void SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
//Step zero
|
||||
//
|
||||
if( verboseLevel > 0 ){
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
@@ -89,30 +127,27 @@ void SteppingVerbose::StepInfo()
|
||||
G4cout << " " << std::setw(10) << procName;
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << "\n :----- List of secondaries ----------------"
|
||||
<< G4endl;
|
||||
if (verboseLevel == 2) {
|
||||
const std::vector<const G4Track*>* secondary
|
||||
= fStep->GetSecondaryInCurrentStep();
|
||||
size_t nbtrk = (*secondary).size();
|
||||
if (nbtrk) {
|
||||
G4cout << "\n :----- List of secondaries ----------------" << G4endl;
|
||||
G4cout.precision(4);
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++){
|
||||
for (size_t lp=0; lp<(*secondary).size(); lp++) {
|
||||
G4cout << " "
|
||||
<< std::setw(13)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
|
||||
<< (*secondary)[lp]->GetDefinition()->GetParticleName()
|
||||
<< ": energy ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy")
|
||||
<< " time ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
|
||||
<< G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time");
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :------------------------------------------\n"
|
||||
<< G4endl;
|
||||
G4cout << " :------------------------------------------\n" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,37 +156,3 @@ void SteppingVerbose::StepInfo()
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user