Import Geant4 10.0.0 source tree
This commit is contained in:
+19
-61
@@ -23,77 +23,35 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field06/src/F06Field.cc
|
||||
/// \brief Implementation of the F06Field class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
/// \file F06ActionInitialization.cc
|
||||
/// \brief Implementation of the F04ActionInitialization class
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "F06Field.hh"
|
||||
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
#include "G4EqGravityField.hh"
|
||||
#include "G4ChordFinder.hh"
|
||||
#include "G4PropagatorInField.hh"
|
||||
|
||||
#include "G4ClassicalRK4.hh"
|
||||
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "F06ActionInitialization.hh"
|
||||
#include "F06PrimaryGeneratorAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06Field::F06Field() : G4UniformGravityField()
|
||||
F06ActionInitialization::F06ActionInitialization()
|
||||
: G4VUserActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06ActionInitialization::~F06ActionInitialization()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
fEquation = new G4EqGravityField(this);
|
||||
|
||||
G4FieldManager* fFieldManager
|
||||
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
|
||||
|
||||
fFieldManager->SetDetectorField(this);
|
||||
|
||||
fStepper = new G4ClassicalRK4(fEquation,8);
|
||||
|
||||
G4double minStep = 0.01*mm;
|
||||
|
||||
fChordFinder = new G4ChordFinder((G4MagneticField*)this,minStep,fStepper);
|
||||
|
||||
// Set accuracy parameters
|
||||
G4double deltaChord = 3.0*mm;
|
||||
fChordFinder->SetDeltaChord( deltaChord );
|
||||
|
||||
G4double deltaOneStep = 0.01*mm;
|
||||
fFieldManager->SetAccuraciesWithDeltaOneStep(deltaOneStep);
|
||||
|
||||
G4double deltaIntersection = 0.1*mm;
|
||||
fFieldManager->SetDeltaIntersection(deltaIntersection);
|
||||
|
||||
G4TransportationManager* fTransportManager =
|
||||
G4TransportationManager::GetTransportationManager();
|
||||
|
||||
fieldPropagator = fTransportManager->GetPropagatorInField();
|
||||
|
||||
G4double epsMin = 2.5e-7*mm;
|
||||
G4double epsMax = 0.05*mm;
|
||||
|
||||
fieldPropagator->SetMinimumEpsilonStep(epsMin);
|
||||
fieldPropagator->SetMaximumEpsilonStep(epsMax);
|
||||
|
||||
fFieldManager->SetChordFinder(fChordFinder);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06Field::~F06Field()
|
||||
void F06ActionInitialization::Build() const
|
||||
{
|
||||
if (fEquation) delete fEquation;
|
||||
if (fStepper) delete fStepper;
|
||||
if (fChordFinder) delete fChordFinder;
|
||||
}
|
||||
SetUserAction(new F06PrimaryGeneratorAction);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -23,12 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: F06DetectorConstruction.cc 75572 2013-11-04 11:46:08Z gcosmo $
|
||||
//
|
||||
/// \file field/field06/src/F06DetectorConstruction.cc
|
||||
/// \brief Implementation of the F06DetectorConstruction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -53,27 +52,33 @@
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
#include "F06Field.hh"
|
||||
#include "G4UniformGravityField.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
#include "G4RepleteEofM.hh"
|
||||
//#include "G4EqGravityField.hh"
|
||||
|
||||
#include "G4ClassicalRK4.hh"
|
||||
#include "G4MagIntegratorStepper.hh"
|
||||
#include "G4ChordFinder.hh"
|
||||
#include "G4PropagatorInField.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06DetectorConstruction::F06DetectorConstruction()
|
||||
: Vacuum(0), field(0)
|
||||
: fVacuum(0), fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0)
|
||||
{
|
||||
// materials
|
||||
DefineMaterials();
|
||||
|
||||
// ensure the global field is initialized
|
||||
field = new F06Field();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06DetectorConstruction::~F06DetectorConstruction()
|
||||
{
|
||||
delete field;
|
||||
if (fField) delete fField;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -82,7 +87,7 @@ void F06DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
G4NistManager* nistMan = G4NistManager::Instance();
|
||||
|
||||
Vacuum = nistMan->FindOrBuildMaterial("G4_Galactic");
|
||||
fVacuum = nistMan->FindOrBuildMaterial("G4_Galactic");
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
||||
}
|
||||
@@ -91,7 +96,7 @@ void F06DetectorConstruction::DefineMaterials()
|
||||
|
||||
G4VPhysicalVolume* F06DetectorConstruction::Construct()
|
||||
{
|
||||
//
|
||||
//
|
||||
// World
|
||||
//
|
||||
|
||||
@@ -99,37 +104,88 @@ G4VPhysicalVolume* F06DetectorConstruction::Construct()
|
||||
G4double expHall_y = 1.0*m;
|
||||
G4double expHall_z = 1.0*m;
|
||||
|
||||
solidWorld = new G4Box("World", //its name
|
||||
fSolidWorld = 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
|
||||
|
||||
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
|
||||
|
||||
|
||||
fLogicWorld = new G4LogicalVolume(fSolidWorld, //its solid
|
||||
fVacuum, //its material
|
||||
"World"); //its name
|
||||
|
||||
fPhysiWorld = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
fLogicWorld, //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;
|
||||
|
||||
G4UserLimits* stepLimit = new G4UserLimits(maxStep,DBL_MAX,maxTime);
|
||||
|
||||
logicWorld->SetUserLimits(stepLimit);
|
||||
fLogicWorld->SetUserLimits(stepLimit);
|
||||
|
||||
//
|
||||
//
|
||||
// Visualization attributes
|
||||
//
|
||||
// logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
// fLogicWorld->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
//
|
||||
return physiWorld;
|
||||
return fPhysiWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ThreadLocal G4UniformGravityField* F06DetectorConstruction::fField = 0;
|
||||
|
||||
void F06DetectorConstruction::ConstructSDandField()
|
||||
{
|
||||
if (!fField) {
|
||||
|
||||
fField = new G4UniformGravityField();
|
||||
|
||||
G4RepleteEofM* equation = new G4RepleteEofM(fField);
|
||||
// G4EqGravityField* equation = new G4EqGravityField(fField);
|
||||
|
||||
G4FieldManager* fieldManager
|
||||
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
|
||||
fieldManager->SetDetectorField(fField);
|
||||
|
||||
// G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,12);
|
||||
G4MagIntegratorStepper* stepper = new G4ClassicalRK4(equation,8);
|
||||
|
||||
G4double minStep = 0.01*mm;
|
||||
|
||||
G4ChordFinder* chordFinder =
|
||||
new G4ChordFinder((G4MagneticField*)fField,minStep,stepper);
|
||||
|
||||
// Set accuracy parameters
|
||||
G4double deltaChord = 3.0*mm;
|
||||
chordFinder->SetDeltaChord( deltaChord );
|
||||
|
||||
G4double deltaOneStep = 0.01*mm;
|
||||
fieldManager->SetAccuraciesWithDeltaOneStep(deltaOneStep);
|
||||
|
||||
G4double deltaIntersection = 0.1*mm;
|
||||
fieldManager->SetDeltaIntersection(deltaIntersection);
|
||||
|
||||
G4TransportationManager* transportManager =
|
||||
G4TransportationManager::GetTransportationManager();
|
||||
|
||||
G4PropagatorInField* fieldPropagator =
|
||||
transportManager->GetPropagatorInField();
|
||||
|
||||
G4double epsMin = 2.5e-7*mm;
|
||||
G4double epsMax = 0.05*mm;
|
||||
|
||||
fieldPropagator->SetMinimumEpsilonStep(epsMin);
|
||||
fieldPropagator->SetMaximumEpsilonStep(epsMax);
|
||||
|
||||
fieldManager->SetChordFinder(chordFinder);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field06/src/F06EventAction.cc
|
||||
/// \brief Implementation of the F06EventAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
#include "F06EventAction.hh"
|
||||
|
||||
#include "F06EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
F06EventAction::F06EventAction()
|
||||
: verboselevel(0), printModulo(10), drawFlag("all")
|
||||
{
|
||||
eventMessenger = new F06EventActionMessenger(this);
|
||||
}
|
||||
|
||||
F06EventAction::~F06EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
void F06EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
|
||||
|
||||
if(verboselevel>0)
|
||||
G4cout << "<<< Event " << evtNb << " started." << G4endl;
|
||||
}
|
||||
|
||||
void F06EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
|
||||
G4int n_trajectories = 0;
|
||||
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
|
||||
if(trj->GetParticleDefinition()->GetParticleName() != "neutron") continue;
|
||||
if (drawFlag == "all") trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
|
||||
if (verboselevel>0)
|
||||
G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
|
||||
|
||||
}
|
||||
|
||||
G4int F06EventAction::GetEventNo()
|
||||
{
|
||||
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID();
|
||||
return evno ;
|
||||
}
|
||||
|
||||
void F06EventAction::SetEventVerbose(G4int level)
|
||||
{
|
||||
verboselevel = level ;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file field/field06/src/F06EventActionMessenger.cc
|
||||
/// \brief Implementation of the F06EventActionMessenger class
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
#include "F06EventAction.hh"
|
||||
#include "F06EventActionMessenger.hh"
|
||||
|
||||
F06EventActionMessenger::F06EventActionMessenger(F06EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
setVerboseCmd = new G4UIcmdWithAnInteger("/event/setverbose",this);
|
||||
setVerboseCmd->SetGuidance("Set verbose level ." );
|
||||
setVerboseCmd->SetParameterName("level",true);
|
||||
setVerboseCmd->SetDefaultValue(0);
|
||||
|
||||
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged all");
|
||||
DrawCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(G4State_Idle);
|
||||
}
|
||||
|
||||
F06EventActionMessenger::~F06EventActionMessenger()
|
||||
{
|
||||
delete setVerboseCmd;
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
}
|
||||
|
||||
void F06EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if(command == setVerboseCmd)
|
||||
{eventAction->SetEventVerbose(setVerboseCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
@@ -23,12 +23,12 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: F06ExtraPhysics.cc 69762 2013-05-14 08:08:54Z gcosmo $
|
||||
//
|
||||
/// \file field/field06/src/F06ExtraPhysics.cc
|
||||
/// \brief Implementation of the F06ExtraPhysics class
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
@@ -44,19 +44,27 @@
|
||||
|
||||
#include "F06ExtraPhysics.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06ExtraPhysics::F06ExtraPhysics()
|
||||
: G4VPhysicsConstructor("Extra") {;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06ExtraPhysics::~F06ExtraPhysics() {;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06ExtraPhysics::ConstructParticle() {;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06ExtraPhysics::ConstructProcess()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
aParticleIterator->reset();
|
||||
|
||||
while ((*theParticleIterator)()) {
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
while ((*aParticleIterator)()) {
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
@@ -74,13 +82,15 @@ void F06ExtraPhysics::ConstructProcess()
|
||||
AddBetaDecay();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06ExtraPhysics::AddBetaDecay()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
aParticleIterator->reset();
|
||||
|
||||
while ((*theParticleIterator)()) {
|
||||
while ((*aParticleIterator)()) {
|
||||
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "neutron") {
|
||||
@@ -89,7 +99,8 @@ void F06ExtraPhysics::AddBetaDecay()
|
||||
particle->SetPDGStable(false);
|
||||
|
||||
G4DecayTable * table = new G4DecayTable();
|
||||
G4VDecayChannel* mode = new G4NeutronBetaDecayChannel("neutron",1.00);
|
||||
G4VDecayChannel* mode =
|
||||
new G4NeutronBetaDecayChannel("neutron",1.00);
|
||||
table->Insert(mode);
|
||||
particle->SetDecayTable(table);
|
||||
|
||||
|
||||
@@ -23,13 +23,12 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: F06PhysicsList.cc 75296 2013-10-30 09:34:21Z gcosmo $
|
||||
//
|
||||
/// \file field/field06/src/F06PhysicsList.cc
|
||||
/// \brief Implementation of the F06PhysicsList class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
#include "F06PhysicsList.hh"
|
||||
|
||||
#include "F06ExtraPhysics.hh"
|
||||
@@ -48,14 +47,19 @@
|
||||
#include "G4MuonDecayChannelWithSpin.hh"
|
||||
#include "G4MuonRadiativeDecayChannelWithSpin.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06PhysicsList::F06PhysicsList() : G4VModularPhysicsList()
|
||||
{
|
||||
RegisterPhysics(new G4DecayPhysics());
|
||||
RegisterPhysics(new F06ExtraPhysics());
|
||||
}
|
||||
|
||||
F06PhysicsList::~F06PhysicsList()
|
||||
{;}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06PhysicsList::~F06PhysicsList() {;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06PhysicsList::ConstructParticle()
|
||||
{
|
||||
@@ -63,13 +67,21 @@ void F06PhysicsList::ConstructParticle()
|
||||
G4Proton::ProtonDefinition();
|
||||
G4Electron::ElectronDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4GenericIon::GenericIonDefinition();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06PhysicsList::ConstructProcess()
|
||||
{
|
||||
G4VModularPhysicsList::ConstructProcess();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void F06PhysicsList::SetCuts()
|
||||
{
|
||||
SetCutsWithDefault();
|
||||
|
||||
@@ -23,12 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: F06PrimaryGeneratorAction.cc 75296 2013-10-30 09:34:21Z gcosmo $
|
||||
//
|
||||
/// \file field/field06/src/F06PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the F06PrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -50,19 +49,78 @@
|
||||
F06PrimaryGeneratorAction::F06PrimaryGeneratorAction(void)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle("neutron");
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle("proton");
|
||||
G4double mass_proton = particle->GetPDGMass();
|
||||
|
||||
G4double muN = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/
|
||||
(mass_proton/CLHEP::c_squared);
|
||||
|
||||
G4cout << " *** Neutron *** " << G4endl;
|
||||
|
||||
particle = particleTable->FindParticle("neutron");
|
||||
G4double mass_neutron = particle->GetPDGMass();
|
||||
|
||||
G4double magneticMoment = particle->GetPDGMagneticMoment();
|
||||
G4cout << " magneticMoment: " << magneticMoment/muN << G4endl;
|
||||
|
||||
// g_factor for spin 1/2
|
||||
|
||||
G4double g_factor = 2 * magneticMoment/muN;
|
||||
G4cout << " g_factor: " << g_factor << G4endl;
|
||||
|
||||
G4double charge = particle->GetPDGCharge();
|
||||
G4cout << " charge: " << charge << G4endl;
|
||||
|
||||
G4double anomaly = (g_factor - 2.)/2.;
|
||||
G4cout << " anomaly: " << anomaly << G4endl;
|
||||
|
||||
anomaly = (g_factor * (mass_neutron/mass_proton) - 2.)/2.;
|
||||
G4cout << " corrected anomaly: " << anomaly << G4endl;
|
||||
|
||||
muN = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/(mass_neutron/CLHEP::c_squared);
|
||||
g_factor = 2 * magneticMoment/muN;
|
||||
|
||||
anomaly = (g_factor - 2.)/2.;
|
||||
G4cout << " *** anomaly: " << anomaly << G4endl;
|
||||
|
||||
G4cout << " *** MuonPlus *** " << G4endl;
|
||||
|
||||
particle = particleTable->FindParticle("mu+");
|
||||
G4double mass_muon = particle->GetPDGMass();
|
||||
|
||||
G4double muB = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/
|
||||
(mass_muon/CLHEP::c_squared);
|
||||
|
||||
magneticMoment = particle->GetPDGMagneticMoment();
|
||||
G4cout << " magneticMoment: " << magneticMoment/muB << G4endl;
|
||||
|
||||
// g_factor for spin 1/2
|
||||
|
||||
g_factor = magneticMoment/muB;
|
||||
G4cout << " g_factor: " << g_factor << G4endl;
|
||||
|
||||
charge = particle->GetPDGCharge();
|
||||
G4cout << " charge: " << charge << G4endl;
|
||||
|
||||
anomaly = (g_factor - 2.)/2.;
|
||||
G4cout << " anomaly: " << anomaly << G4endl;
|
||||
|
||||
// anomaly = particle->CalculateAnomaly();
|
||||
// G4cout << " *** anomaly: " << anomaly << G4endl;
|
||||
|
||||
particle = particleTable->FindParticle("neutron");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
F06PrimaryGeneratorAction::~F06PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete fParticleGun;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -72,11 +130,11 @@ void F06PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
//this function is called at the begining of event
|
||||
//
|
||||
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0));
|
||||
particleGun->SetParticlePolarization(G4ThreeVector(0,1,0));
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0));
|
||||
fParticleGun->SetParticlePolarization(G4ThreeVector(0,1,0));
|
||||
|
||||
G4double particleEnergy = G4UniformRand()*1e-7*eV;
|
||||
particleGun->SetParticleEnergy(particleEnergy);
|
||||
fParticleGun->SetParticleEnergy(particleEnergy);
|
||||
|
||||
G4double theta = 2*pi*G4UniformRand();
|
||||
G4double phi = std::acos(1-2*G4UniformRand());
|
||||
@@ -86,9 +144,9 @@ void F06PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4double x = std::sin(phi)*std::sin(theta);
|
||||
G4double y = std::cos(phi);
|
||||
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(x,y,z));
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(x,y,z));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user