Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06DetectorConstruction.cc
/// \brief Implementation of the F06DetectorConstruction class
//
//
//
//
@@ -48,6 +51,7 @@
#include "G4Colour.hh"
#include "G4UserLimits.hh"
#include "G4SystemOfUnits.hh"
#include "F06Field.hh"
@@ -95,20 +99,20 @@ G4VPhysicalVolume* F06DetectorConstruction::Construct()
G4double expHall_y = 1.0*m;
G4double expHall_z = 1.0*m;
solidWorld = new G4Box("World", //its name
expHall_x,expHall_y,expHall_z); //its size
solidWorld = new G4Box("World", //its name
expHall_x,expHall_y,expHall_z); //its size
logicWorld = new G4LogicalVolume(solidWorld, //its solid
Vacuum, //its material
"World"); //its name
logicWorld = new G4LogicalVolume(solidWorld, //its solid
Vacuum, //its material
"World"); //its name
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
G4double maxStep = 1.0*mm;
G4double maxTime = 41.*s;
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06EventAction.cc
/// \brief Implementation of the F06EventAction class
//
//
//
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06EventActionMessenger.cc
/// \brief Implementation of the F06EventActionMessenger class
//
//
//
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06ExtraPhysics.cc
/// \brief Implementation of the F06ExtraPhysics class
//
//
//
@@ -37,6 +40,7 @@
#include "G4UserSpecialCuts.hh"
#include "G4StepLimiter.hh"
#include "G4SystemOfUnits.hh"
#include "F06ExtraPhysics.hh"
@@ -65,42 +69,44 @@ void F06ExtraPhysics::ConstructProcess()
pmanager->AddDiscreteProcess(new G4StepLimiter());
pmanager->AddDiscreteProcess(new G4UserSpecialCuts());
if (particleName == "neutron") AddBetaDecay();
}
AddBetaDecay();
}
void F06ExtraPhysics::AddBetaDecay()
{
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while ((*theParticleIterator)()) {
G4ParticleDefinition* particle = theParticleIterator->value();
if(particle->GetParticleName() != "neutron") continue;
particle->SetPDGLifeTime(885.7*second);
particle->SetPDGStable(false);
G4DecayTable * table = new G4DecayTable();
G4VDecayChannel* mode = new G4NeutronBetaDecayChannel("neutron",1.00);
table->Insert(mode);
particle->SetDecayTable(table);
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (!pmanager) {
std::ostringstream o;
o << "Particle " << particleName << "without a Process Manager";
G4Exception("F06ExtraPhysics::ConstructProcess()","",
FatalException,o.str().c_str());
}
if (particleName == "neutron") {
pmanager= particle->GetProcessManager();
pmanager->AddProcess(theDecayProcess);
pmanager->SetProcessOrdering(theDecayProcess,idxPostStep);
pmanager->SetProcessOrdering(theDecayProcess,idxAtRest);
particle->SetPDGLifeTime(885.7*second);
particle->SetPDGStable(false);
G4DecayTable * table = new G4DecayTable();
G4VDecayChannel* mode = new G4NeutronBetaDecayChannel("neutron",1.00);
table->Insert(mode);
particle->SetDecayTable(table);
G4ProcessManager* pmanager = particle->GetProcessManager();
if (!pmanager) {
std::ostringstream o;
o << "Particle " << particleName << "without a Process Manager";
G4Exception("F06ExtraPhysics::ConstructProcess()","",
FatalException,o.str().c_str());
}
G4Decay* theDecayProcess = new G4Decay();
pmanager->AddProcess(theDecayProcess);
pmanager->SetProcessOrdering(theDecayProcess,idxPostStep);
pmanager->SetProcessOrdering(theDecayProcess,idxAtRest);
break;
}
}
}
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06Field.cc
/// \brief Implementation of the F06Field class
//
//
//
//
@@ -41,6 +44,8 @@
#include "G4ClassicalRK4.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
F06Field::F06Field() : G4UniformGravityField()
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06PhysicsList.cc
/// \brief Implementation of the F06PhysicsList class
//
//
//
//
@@ -23,6 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file field/field06/src/F06PrimaryGeneratorAction.cc
/// \brief Implementation of the F06PrimaryGeneratorAction class
//
//
//
//
@@ -39,6 +42,8 @@
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -74,12 +79,12 @@ void F06PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
particleGun->SetParticleEnergy(particleEnergy);
G4double theta = 2*pi*G4UniformRand();
G4double phi = acos(1-2*G4UniformRand());
G4double phi = std::acos(1-2*G4UniformRand());
if (phi > pi/2 && phi < pi) phi = pi-phi;
G4double z = sin(phi)*cos(theta);
G4double x = sin(phi)*sin(theta);
G4double y = cos(phi);
G4double z = std::sin(phi)*std::cos(theta);
G4double x = std::sin(phi)*std::sin(theta);
G4double y = std::cos(phi);
particleGun->SetParticleMomentumDirection(G4ThreeVector(x,y,z));