Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -23,43 +23,48 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
// Author: Susanna Guatelli, guatelli@ge.infn.it
#include "RemSimPhysicsListMessenger.hh"
#include "RemSimPhysicsList.hh"
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "SteppingAction.hh"
#include "G4RunManager.hh"
#include "AnalysisManager.hh"
#include "RunAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
RemSimPhysicsListMessenger::RemSimPhysicsListMessenger(RemSimPhysicsList * List)
:RemSimList(List)
ActionInitialization::ActionInitialization(AnalysisManager* analysisMan):
G4VUserActionInitialization()
{
EnDir = new G4UIdirectory("/physics/");
EnDir -> SetGuidance("physics commands");
physicsListCmd = new G4UIcmdWithAString("/physics/addPhysics",this);
physicsListCmd -> SetGuidance("Add chunks of PhysicsList");
physicsListCmd -> SetParameterName("choice",false);
physicsListCmd -> AvailableForStates(G4State_PreInit);
analysis = analysisMan;
}
RemSimPhysicsListMessenger::~RemSimPhysicsListMessenger()
{
delete physicsListCmd;
delete EnDir;
}
void RemSimPhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
ActionInitialization::~ActionInitialization()
{}
void ActionInitialization::BuildForMaster() const
{
if (command == physicsListCmd)
{ RemSimList->AddPhysicsList(newValue); }
// In MT mode, to be clearer, the RunAction class for the master thread might be
// different than the one used for the workers.
// This RunAction will be called before and after starting the
// workers.
}
void ActionInitialization::Build() const
{
// Initialize the primary particles
PrimaryGeneratorAction* primary = new PrimaryGeneratorAction(analysis);
SetUserAction(primary);
RunAction* run = new RunAction(analysis);
SetUserAction(run);
SteppingAction* stepping = new SteppingAction(analysis);
SetUserAction(stepping);
}
@@ -0,0 +1,146 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
#include <stdlib.h>
#include "AnalysisManager.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
AnalysisManager::AnalysisManager()
{
factoryOn = false;
// Initialization
// histograms
//for (G4int k=0; k<MaxHisto; k++) fHistId[k] = 0;
// Initialization ntuple
for (G4int k=0; k<MaxNtCol; k++) fNtColId[k] = 0;
//h10 = 0;
//h20 = 0;
}
AnalysisManager::~AnalysisManager()
{
}
void AnalysisManager::book()
{
G4AnalysisManager* manager = G4AnalysisManager::Instance();
manager->SetVerboseLevel(2);
// Create a root file
G4String fileName = "radioprotection.root";
// Create directories
manager->SetNtupleDirectoryName("radioprotection_ntuple");
G4bool fileOpen = manager->OpenFile(fileName);
if (!fileOpen) {
G4cout << "\n---> HistoManager::book(): cannot open "
<< fileName[1]
<< G4endl;
return;
}
manager->SetFirstNtupleId(1);
//Create Primary Energy Ntuple
manager -> CreateNtuple("101", "Primary Energy");
fNtColId[0] = manager -> CreateNtupleDColumn("Ek");
manager -> FinishNtuple();
//Create Energy Deposition within SV Ntuple
manager -> CreateNtuple("102", "Edep");
fNtColId[1] = manager -> CreateNtupleDColumn("edep");
manager -> FinishNtuple();
//creating a ntuple, containing the information about secondary particles
manager -> CreateNtuple("103", "secondary");
fNtColId[2] = manager -> CreateNtupleDColumn("AA");
fNtColId[3] = manager -> CreateNtupleDColumn("ZZ");
fNtColId[4] = manager -> CreateNtupleDColumn("KE");
manager -> FinishNtuple();
factoryOn = true;
}
void AnalysisManager::SetPrimaryEnergy(G4double energy)
{
G4AnalysisManager* manager = G4AnalysisManager::Instance();
manager -> FillNtupleDColumn(1, fNtColId[0], energy);
manager -> AddNtupleRow(1);
}
void AnalysisManager::StoreEnergyDeposition(G4double edep)
{
G4AnalysisManager* manager = G4AnalysisManager::Instance();
manager -> FillNtupleDColumn(2, fNtColId[1], edep);
manager -> AddNtupleRow(2);
}
void AnalysisManager::FillSecondaries(G4int AA, G4double charge, G4double energy)
{
G4AnalysisManager* manager = G4AnalysisManager::Instance();
manager -> FillNtupleDColumn(3, fNtColId[2], AA);
manager -> FillNtupleDColumn(3, fNtColId[3], charge);
manager -> FillNtupleDColumn(3, fNtColId[4], energy);
manager -> AddNtupleRow(3);
}
void AnalysisManager::finish()
{
if (factoryOn)
{
G4AnalysisManager* manager = G4AnalysisManager::Instance();
manager -> Write();
manager -> CloseFile();
delete G4AnalysisManager::Instance();
factoryOn = false;
}
}
@@ -0,0 +1,332 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
#include "DetectorConstruction.hh"
#include "globals.hh"
#include "G4Element.hh"
#include "G4Material.hh"
#include "G4PVPlacement.hh"
#include "G4LogicalVolume.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
//#include "G4SubtractionSolid.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4ChordFinder.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "SensitiveDetector.hh"
#include "G4SDManager.hh"
#include "G4UserLimits.hh"
#include "Randomize.hh"
#include "G4ThreeVector.hh"
#include "G4GeometryTolerance.hh"
#include "G4GeometryManager.hh"
#include "G4SystemOfUnits.hh"
DetectorConstruction::DetectorConstruction(AnalysisManager* analysis_manager)
{
analysis = analysis_manager;
}
DetectorConstruction::~DetectorConstruction(){
}
G4VPhysicalVolume* DetectorConstruction::Construct()
{
//Define each individual element
//Define Nitrogen
G4double A = 14.01 * g/mole;
G4double Z = 7;
G4Element* elN = new G4Element ("Nitrogen", "N", Z, A);
//Define Oxygen
A = 16.0 * g/mole;
Z = 8;
G4Element* elO = new G4Element ("Oxygen", "O", Z, A);
//Define Hydrogen
A = 1.01 * g/mole;
Z = 1;
G4Element* elH = new G4Element ("Hydrogen", "H", Z, A);
//Define Boron
A = 10.8 * g/mole;
Z = 5;
G4Element* elB = new G4Element ("Boron", "B", Z, A);
//Define Carbon
A = 12.01 * g/mole;
Z = 6;
G4Element* elC = new G4Element ("Carbon", "C", Z, A);
//Define Air
G4Material* Air = new G4Material("Air", 1.29*mg/cm3, 2);
Air -> AddElement(elN, 70*perCent);
Air -> AddElement(elO, 30*perCent);
//Define diamond
A = 12.01 * g/mole;
Z = 6;
G4Material* diamond = new G4Material("diamond", Z, A, 3.515*g/cm3);
//Define dopant (boron doped diamond)
G4Material* dopant = new G4Material("dopant", 3.514*g/cm3, 2);
dopant -> AddElement(elC, 99.9994*perCent);
dopant -> AddElement(elB, 0.0006*perCent);
//Define Aluminium contacts (AlContact)
A = 26.981 * g/mole;
Z = 13;
G4Material* AlContact = new G4Material("AlContact", Z, A, 2.7 *g/cm3);
//Define Gold contact (AuContact)
A = 196.97 * g/mole;
Z = 79;
G4Material* AuContact = new G4Material("AuContact", Z, A, 19.3 *g/cm3);
//Define PMMA (C502H8)
// NIST reference
G4Material* PMMA = new G4Material("PMMA", 1.19*g/cm3, 3);
PMMA -> AddElement(elC, 5);
PMMA -> AddElement(elO, 2);
PMMA -> AddElement(elH, 8);
//define water
G4Material* water = new G4Material("water", 1*g/cm3, 2);
water -> AddElement(elH, 2);
water -> AddElement(elO, 1);
//Define Vacuum
G4double vacuumDensity = 1.e-25 *g/cm3;
G4double pressure = 3.e-18*pascal;
G4double temperature = 2.73*kelvin;
G4Material* vacuum = new G4Material("Galactic", Z=1., A=1.01*g/mole,
vacuumDensity,kStateGas,temperature,pressure);
//Define volumes
// World volume has size 1cm
G4double worldx = 0.5 * m; //half length!!!!
G4double worldy = 0.5 * m;
G4double worldz = 0.5 * m;
// World volume, containing all geometry
G4Box* world = new G4Box("world_box", worldx, worldy, worldz);
G4LogicalVolume* logical_world = new G4LogicalVolume(world, vacuum, "world_log", 0,0,0);
//set the logical world volume invisible
logical_world -> SetVisAttributes(G4VisAttributes::Invisible);
G4VPhysicalVolume* physical_world = new G4PVPlacement(0,
G4ThreeVector(),
logical_world,
"world_phys",
0,
false,
0);
// Define the geometry of the diamond microdosimeter
// mother volume of the detector components
G4double DiaVol_x = 300*micrometer;
G4double DiaVol_y = 240*micrometer;
G4double DiaVol_z = 150*micrometer;
G4Box* DiaVol_box = new G4Box("DiaVol_box",DiaVol_x,DiaVol_y,DiaVol_z);
G4LogicalVolume* logical_DiaVol = new G4LogicalVolume(DiaVol_box, diamond, "DiaVol_log", 0,0,0);
new G4PVPlacement(0, G4ThreeVector(0,0,0), logical_DiaVol,"DiaVol_phys",
logical_world,
false, 0, true);
//VacBlock for contact placement
G4double vacblock_x = 300*um;
G4double vacblock_y = 240*um;
G4double vacblock_z = 0.25*um;
G4Box* vacblock_box = new G4Box("vacblock_box",vacblock_x,vacblock_y,vacblock_z);
G4LogicalVolume* logical_vacblock = new G4LogicalVolume(vacblock_box, vacuum, "vacblock_log", 0,0,0);
new G4PVPlacement(0,
G4ThreeVector(0,0,DiaVol_z - vacblock_z),
logical_vacblock,
"vacblock_phys",
logical_DiaVol,
false,
0, true);
//Bdl in DiaVol
G4double Bdl_x = 300*micrometer;
G4double Bdl_y = 240*micrometer;
G4double Bdl_z = 0.69*micrometer;
G4Box* Bdl_box = new G4Box("Bdl_box",Bdl_x,Bdl_y,Bdl_z);
G4LogicalVolume* logical_Bdl = new G4LogicalVolume(Bdl_box, dopant, "Bdl_log", 0,0,0);
new G4PVPlacement(0,
G4ThreeVector(0,0,DiaVol_z - Bdl_z - vacblock_z- vacblock_z),
logical_Bdl,
"Bdl_phys",
logical_DiaVol, //mother volume
false,
0, true);
//Diamond SV
G4double SV_x = 75*um;
G4double SV_y = 75*um;
G4double SV_z = 0.69*um;
G4Box* SV_box = new G4Box("SV_box",SV_x,SV_y,SV_z);
G4LogicalVolume* logical_SV = new G4LogicalVolume(SV_box, diamond, "SV_log", 0,0,0);
new G4PVPlacement(0, G4ThreeVector(-45*um,105*um,0*um), logical_SV,"SV_phys1",
logical_Bdl,false, 0, true);
new G4PVPlacement(0, G4ThreeVector(165*um,105*um,0*um), logical_SV,"SV_phys2",
logical_Bdl, false, 0, true);
new G4PVPlacement(0, G4ThreeVector(-45*um,-105*um,0*um),logical_SV,"SV_phys3",
logical_Bdl, false, 0, true);
new G4PVPlacement(0, G4ThreeVector(165*um,-105*um,0*um),logical_SV,"SV_phys4",
logical_Bdl, false, 0, true);
//Al strips
//10 nm thickness
G4double AlStrip_x = 240*um;
G4double AlStrip_y = 240*um;
G4double AlStrip_z = vacblock_z;
G4Box* AlStrip = new G4Box("AlStrip",AlStrip_x,AlStrip_y,AlStrip_z);
G4LogicalVolume* logical_AlStrip = new G4LogicalVolume(AlStrip, AlContact, "AlStrip_log", 0,0,0);
new G4PVPlacement(0, G4ThreeVector(60*um,0,0), logical_AlStrip, "AlStrip_phys",
logical_vacblock, false, 0, true);
//gold cylinder in vacblock
G4double innerRadiusOfTheTube1 = 0.*um;
G4double outerRadiusOfTheTube1 = 45.*um;
G4double heightOfTheTube1 = 10*nm;
G4double startAngleOfTheTube1 = 0.*deg;
G4double spanningAngleOfTheTube1 = 360.*deg;
G4Tubs* GoldCylinder1 = new G4Tubs("GoldCylinder1", innerRadiusOfTheTube1,
outerRadiusOfTheTube1,
heightOfTheTube1,
startAngleOfTheTube1,
spanningAngleOfTheTube1);
G4LogicalVolume* logical_GoldCylinder1 = new G4LogicalVolume(GoldCylinder1, AuContact, "GoldCylinder1_log", 0,0,0);
new G4PVPlacement(0,G4ThreeVector(-245*um,0,-vacblock_z + heightOfTheTube1),
logical_GoldCylinder1,
"GoldCylinder1_phys",
logical_vacblock, false, 0, true);
//gold contacts
G4double innerRadiusOfTheTube2 = 0.*um;
G4double outerRadiusOfTheTube2 = 45.*um;
G4double heightOfTheTube2 = Bdl_z;
G4double startAngleOfTheTube2 = 0.*deg;
G4double spanningAngleOfTheTube2 = 360.*deg;
G4Tubs* GoldCylinder2 = new G4Tubs("GoldCylinder2",
innerRadiusOfTheTube2,
outerRadiusOfTheTube2,
heightOfTheTube2,
startAngleOfTheTube2,
spanningAngleOfTheTube2);
G4LogicalVolume* logical_GoldCylinder2 = new G4LogicalVolume(GoldCylinder2, AuContact, "GoldCylinder2_log", 0,0,0);
new G4PVPlacement(0, G4ThreeVector(-245*um,0,0), logical_GoldCylinder2, "GoldCylinder2_phys",
logical_Bdl, false, 0, true);
//gold cylinder in DiaVol
G4double innerRadiusOfTheTube3 = 0.*um;
G4double outerRadiusOfTheTube3 = 45.*um;
G4double heightOfTheTube3 = 75.*um -heightOfTheTube2 - heightOfTheTube1 ;
G4double startAngleOfTheTube3 = 0.*deg;
G4double spanningAngleOfTheTube3 = 360.*deg;
G4Tubs* GoldCylinder3 = new G4Tubs("GoldCylinder3",
innerRadiusOfTheTube3,
outerRadiusOfTheTube3,
heightOfTheTube3,
startAngleOfTheTube3,
spanningAngleOfTheTube3);
G4LogicalVolume* logical_GoldCylinder3 = new G4LogicalVolume(GoldCylinder3, AuContact, "GoldCylinder3_log", 0,0,0);
new G4PVPlacement(0, G4ThreeVector(-245*um,0,DiaVol_z - heightOfTheTube3 - Bdl_z - Bdl_z - vacblock_z- vacblock_z),
logical_GoldCylinder3,
"GoldCylinder3_phys",
logical_DiaVol,
false,
0, true);
// Visualisation attributes
logical_DiaVol -> SetVisAttributes(G4VisAttributes(G4Colour(255,255,255))); //white
logical_Bdl -> SetVisAttributes(G4VisAttributes(G4Colour(0,255,0))); //green
G4VisAttributes vis_SV(G4Colour(198, 226, 255));
vis_SV.SetForceSolid(true);
logical_SV -> SetVisAttributes(vis_SV);
logical_vacblock -> SetVisAttributes(G4VisAttributes::Invisible);
logical_AlStrip -> SetVisAttributes(G4VisAttributes(G4Colour(0, 255, 255)));//cyan
G4VisAttributes vis_GoldCylinder1(G4Colour(255, 255, 0));
vis_GoldCylinder1.SetForceAuxEdgeVisible(true);
logical_GoldCylinder1 -> SetVisAttributes(vis_GoldCylinder1);
G4VisAttributes vis_GoldCylinder2(G4Colour(255, 255, 0));
vis_GoldCylinder2.SetForceAuxEdgeVisible(true);
logical_GoldCylinder2 -> SetVisAttributes(vis_GoldCylinder2);
G4VisAttributes vis_GoldCylinder3(G4Colour(255, 255, 0));
vis_GoldCylinder3.SetForceAuxEdgeVisible(true);
logical_GoldCylinder3 -> SetVisAttributes(vis_GoldCylinder3);
return physical_world;
}
void DetectorConstruction::ConstructSDandField()
{
SensitiveDetector* SD = new SensitiveDetector("SD", "DetectorHitsCollection", analysis);
SetSensitiveDetector("SV_log", SD);
}
@@ -0,0 +1,263 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
// Code based on the hadrontherapy advanced example
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "G4PhysListFactory.hh"
#include "G4VPhysicsConstructor.hh"
// Physic lists (contained inside the Geant4 distribution)
#include "G4EmStandardPhysics_option3.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "G4DecayPhysics.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4HadronDElasticPhysics.hh"
#include "G4HadronElasticPhysicsHP.hh"
#include "G4IonBinaryCascadePhysics.hh"
#include "G4Decay.hh"
#include "G4StepLimiter.hh"
#include "G4LossTableManager.hh"
#include "G4UnitsTable.hh"
#include "G4ProcessManager.hh"
#include "G4IonFluctuations.hh"
#include "G4IonParametrisedLossModel.hh"
#include "G4EmProcessOptions.hh"
#include "G4HadronPhysicsQGSP_BIC_HP.hh"
#include "G4RadioactiveDecayPhysics.hh"
/////////////////////////////////////////////////////////////////////////////
PhysicsList::PhysicsList() : G4VModularPhysicsList()
{
G4LossTableManager::Instance();
defaultCutValue = 0.01*micrometer;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForPositron = defaultCutValue;
helIsRegisted = false;
bicIsRegisted = false;
biciIsRegisted = false;
locIonIonInelasticIsRegistered = false;
radioactiveDecayIsRegisted = false;
pMessenger = new PhysicsListMessenger(this);
SetVerboseLevel(1);
// EM physics
emPhysicsList = new G4EmStandardPhysics_option3(1);
emName = G4String("emstandard_opt3");
// Decay physics and all particles
decPhysicsList = new G4DecayPhysics();
}
/////////////////////////////////////////////////////////////////////////////
PhysicsList::~PhysicsList()
{
delete pMessenger;
delete emPhysicsList;
delete decPhysicsList;
for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
}
/////////////////////////////////////////////////////////////////////////////
void PhysicsList::AddPackage(const G4String& name)
{
G4PhysListFactory factory;
G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
G4int i=0;
const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
while (elem !=0)
{
RegisterPhysics(tmp);
elem= phys->GetPhysics(++i) ;
tmp = const_cast<G4VPhysicsConstructor*> (elem);
}
}
/////////////////////////////////////////////////////////////////////////////
void PhysicsList::ConstructParticle()
{
decPhysicsList->ConstructParticle();
}
/////////////////////////////////////////////////////////////////////////////
void PhysicsList::ConstructProcess()
{
// transportation
//
AddTransportation();
// electromagnetic physics list
//
emPhysicsList->ConstructProcess();
em_config.AddModels();
// decay physics list
//
decPhysicsList->ConstructProcess();
// hadronic physics lists
for(size_t i=0; i<hadronPhys.size(); i++) {
hadronPhys[i]->ConstructProcess();
}
// step limitation (as a full process)
//
// AddStepMax();
}
/////////////////////////////////////////////////////////////////////////////
void PhysicsList::AddPhysicsList(const G4String& name)
{
if (verboseLevel>1) {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
}
if (name == emName) return;
/////////////////////////////////////////////////////////////////////////////
// ELECTROMAGNETIC MODELS
/////////////////////////////////////////////////////////////////////////////
if (name == "standard_opt3") {
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmStandardPhysics_option3();
G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
} else if (name == "LowE_Livermore") {
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmLivermorePhysics();
G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
} else if (name == "LowE_Penelope") {
emName = name;
delete emPhysicsList;
emPhysicsList = new G4EmPenelopePhysics();
G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
/////////////////////////////////////////////////////////////////////////////
// HADRONIC MODELS
/////////////////////////////////////////////////////////////////////////////
} else if (name == "elastic" && !helIsRegisted) {
G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
hadronPhys.push_back( new G4HadronElasticPhysics());
helIsRegisted = true;
} else if (name == "DElastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronDElasticPhysics());
helIsRegisted = true;
} else if (name == "HPElastic" && !helIsRegisted) {
hadronPhys.push_back( new G4HadronElasticPhysicsHP());
helIsRegisted = true;
} else if (name == "binary" && !bicIsRegisted) {
hadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP());
bicIsRegisted = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: HadronPhysicsQGSP_BIC_HP()" << G4endl;
} else if (name == "binary_ion" && !biciIsRegisted) {
hadronPhys.push_back(new G4IonBinaryCascadePhysics());
biciIsRegisted = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4IonBinaryCascadePhysics()" << G4endl;
} else if (name == "radioactive_decay" && !radioactiveDecayIsRegisted ) {
hadronPhys.push_back(new G4RadioactiveDecayPhysics());
radioactiveDecayIsRegisted = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()" << G4endl;
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
}
}
void PhysicsList::AddStepMax()
{
// Step limitation seen as a process
theParticleIterator->reset();
while ((*theParticleIterator)())
{
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager -> AddProcess(new G4StepLimiter(), -1,-1,3);
}
}
void PhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
G4double lowLimit = 250. * eV;
G4double highLimit = 100. * GeV;
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowLimit, highLimit);
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForPositron, "e+");
if (verboseLevel>0) DumpCutValuesTable();
}
void PhysicsList::SetCutForGamma(G4double cut)
{
cutForGamma = cut;
SetParticleCuts(cutForGamma, G4Gamma::Gamma());
}
void PhysicsList::SetCutForElectron(G4double cut)
{
cutForElectron = cut;
SetParticleCuts(cutForElectron, G4Electron::Electron());
}
void PhysicsList::SetCutForPositron(G4double cut)
{
cutForPositron = cut;
SetParticleCuts(cutForPositron, G4Positron::Positron());
}
@@ -0,0 +1,121 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
// Code based on the hadrontherapy advanced example
#include "PhysicsListMessenger.hh"
#include "PhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithAString.hh"
/////////////////////////////////////////////////////////////////////////////
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:pPhysicsList(pPhys)
{
physDir = new G4UIdirectory("/physic/");
physDir->SetGuidance("Commands to activate physics models and set cuts");
gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setGCut",this);
gammaCutCmd->SetGuidance("Set gamma cut.");
gammaCutCmd->SetParameterName("Gcut",false);
gammaCutCmd->SetUnitCategory("Length");
gammaCutCmd->SetRange("Gcut>0.0");
gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
electCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setECut",this);
electCutCmd->SetGuidance("Set electron cut.");
electCutCmd->SetParameterName("Ecut",false);
electCutCmd->SetUnitCategory("Length");
electCutCmd->SetRange("Ecut>0.0");
electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
protoCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setPCut",this);
protoCutCmd->SetGuidance("Set positron cut.");
protoCutCmd->SetParameterName("Pcut",false);
protoCutCmd->SetUnitCategory("Length");
protoCutCmd->SetRange("Pcut>0.0");
protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
allCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setCuts",this);
allCutCmd->SetGuidance("Set cut for all.");
allCutCmd->SetParameterName("cut",false);
allCutCmd->SetUnitCategory("Length");
allCutCmd->SetRange("cut>0.0");
allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
pListCmd = new G4UIcmdWithAString("/physic/addPhysics",this);
pListCmd->SetGuidance("Add physics list.");
pListCmd->SetParameterName("PList",false);
pListCmd->AvailableForStates(G4State_PreInit);
packageListCmd = new G4UIcmdWithAString("/physic/addPackage",this);
packageListCmd->SetGuidance("Add physics package.");
packageListCmd->SetParameterName("package",false);
packageListCmd->AvailableForStates(G4State_PreInit);
}
PhysicsListMessenger::~PhysicsListMessenger()
{
delete gammaCutCmd;
delete electCutCmd;
delete protoCutCmd;
delete allCutCmd;
delete pListCmd;
delete physDir;
delete packageListCmd;
}
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == gammaCutCmd )
{ pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
if( command == electCutCmd )
{ pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
if( command == protoCutCmd )
{ pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
if( command == allCutCmd )
{
G4double cut = allCutCmd->GetNewDoubleValue(newValue);
pPhysicsList->SetCutForGamma(cut);
pPhysicsList->SetCutForElectron(cut);
pPhysicsList->SetCutForPositron(cut);
}
if( command == pListCmd )
{ pPhysicsList->AddPhysicsList(newValue);}
if( command == packageListCmd )
{ pPhysicsList->AddPackage(newValue);}
}
@@ -23,14 +23,34 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Code developed by: S.Guatelli, guatelli@ge.infn.it
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
#include"RemSimVGeometryComponent.hh"
RemSimVGeometryComponent::RemSimVGeometryComponent()
{;}
RemSimVGeometryComponent::~RemSimVGeometryComponent()
{;}
#include "PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"
PrimaryGeneratorAction::PrimaryGeneratorAction(AnalysisManager* pAnalysis)
{
gun = new G4GeneralParticleSource();
analysis = pAnalysis;
}
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete gun;
}
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
gun -> GeneratePrimaryVertex(anEvent);
#ifdef ANALYSIS_USE
G4double energy = gun -> GetParticleEnergy();
analysis -> SetPrimaryEnergy(energy);
#endif
}
@@ -1,131 +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. *
// ********************************************************************
//
// **********************************
// * *
// * RemSimAstronautDecorator.cc *
// * *
// **********************************
//
// $Id$
//
// Author:Susanna Guatelli, guatelli@ge.infn.it
#include "RemSimVGeometryComponent.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "RemSimAstronautDecorator.hh"
#include "RemSimDecorator.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "RemSimMoonHabitat.hh"
RemSimAstronautDecorator::RemSimAstronautDecorator(RemSimVGeometryComponent* comp, G4bool moon)
: RemSimDecorator(comp), phantom(0), phantomLog(0), phantomPhys(0)
{
flag = moon;
}
RemSimAstronautDecorator::~RemSimAstronautDecorator()
{
}
void RemSimAstronautDecorator::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
RemSimDecorator::ConstructComponent(motherVolume);
ConstructAstronaut(motherVolume);
}
void RemSimAstronautDecorator::DestroyComponent()
{
}
void RemSimAstronautDecorator::ConstructAstronaut(G4VPhysicalVolume* motherVolume)
{
// Astronaut definition: Box of water
// The Astronaut is the sensitive detector
RemSimMaterial* pMaterial = new RemSimMaterial();
G4Material* water = pMaterial -> GetMaterial("Water");
delete pMaterial;
// Phantom sizes
G4double phantomX = 3. *m;
G4double phantomY = 3. *m;
G4double phantomZ = 30. *cm;
phantom = new G4Box("phantom",phantomX/2.,phantomY/2.,phantomZ/2.);
phantomLog = new G4LogicalVolume(phantom,
water,
"phantom",
0,0,0);
G4double translation1 = 0.;
if (flag == true)
{
G4double thickShelter = 4.5 *m;
translation1 = 0.5*m + thickShelter/2.;
}
phantomPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,translation1),
"phantom",phantomLog,
motherVolume,false,0);
// Visualisation attributes
G4Colour lblue (0.0, 0.0,.75);
G4VisAttributes* phantomVisAtt = new G4VisAttributes(lblue);
phantomVisAtt -> SetVisibility(true);
phantomVisAtt -> SetForceSolid(true);
phantomLog -> SetVisAttributes(phantomVisAtt);
}
void RemSimAstronautDecorator::ChangeThickness(G4double)
{
G4cout << "It is not possible to change the sizes of the Astronaut"
<< G4endl;
}
void RemSimAstronautDecorator::PrintDetectorParameters()
{
G4cout << "-----------------------------------------------------------------------"
<< G4endl
<< "the astronaut is a box whose thickness is: " << G4endl
<< ((phantom -> GetZHalfLength())*2.)/cm
<< " cm along the Z axis"
<< G4endl
<< "material of the astronaut: "
<< phantomLog -> GetMaterial() -> GetName() <<G4endl
<< G4endl;
}
@@ -1,270 +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. *
// ********************************************************************
//
//
// **************************************
// * *
// * RemSimDetectorConstruction.cc *
// * *
// **************************************
//
// $Id$
//
// Author:Susanna Guatelli, susanna@uow.edu.au
//
#include "RemSimDetectorConstruction.hh"
#include "RemSimMaterial.hh"
#include "RemSimDetectorMessenger.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4RunManager.hh"
#include "G4Colour.hh"
#include "RemSimVGeometryComponent.hh"
#include "RemSimVehicle1.hh"
#include "RemSimMoonHabitat.hh"
#include "G4VisAttributes.hh"
#include "RemSimDecorator.hh"
#include "RemSimShieldingDecorator.hh"
#include "RemSimShelterSPEDecorator.hh"
#include "RemSimAstronautDecorator.hh"
#include "RemSimRoofDecorator.hh"
RemSimDetectorConstruction::RemSimDetectorConstruction()
: experimentalHall_log(0), experimentalHall_phys(0),
phantomPhys(0), detectorPhys(0), geometry(0)
{
pMaterial = new RemSimMaterial();
messenger = new RemSimDetectorMessenger(this);
decoratorValue ="Nothing";
astronautValue ="On";
decorator = 0; //pointing to shielding
decoratorSPE = 0; //pointing to SPE shelter
decorator1 = 0; //pointing to the phantom/astronaut
decoratorRoof = 0; //pointing to the roof of the Moon Habitat
moon = false; // moon = true: moon configuration selected
// moon = false: vehicle configuration selected
flag = false; // flag = true : the geometry configuration (vehicle/moon)
// has been chosen
// flag = false : the geometry configuration (vehicle/moon)
// has not been chosen}
}
RemSimDetectorConstruction::~RemSimDetectorConstruction()
{
delete decoratorRoof;
delete decorator1;
delete decoratorSPE;
delete decorator;
delete messenger;
delete geometry;
delete pMaterial;
}
G4VPhysicalVolume* RemSimDetectorConstruction::Construct()
{
pMaterial -> DefineMaterials();
G4Material* vacuum = pMaterial -> GetMaterial("Galactic");
// World definition
G4double expHall_x = 30.0*m;
G4double expHall_y = 30.0*m;
G4double expHall_z = 30.0*m;
G4Box* experimentalHall_box
= new G4Box("world",expHall_x,expHall_y,expHall_z);
experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
vacuum,"world",0,0,0);
experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),"world",
experimentalHall_log,0,
false,0);
return experimentalHall_phys;
}
void RemSimDetectorConstruction::ConstructVolume()
{
if (moon == true)
{
geometry = new RemSimMoonHabitat();
geometry -> ConstructComponent(experimentalHall_phys);
decorator1 = new RemSimAstronautDecorator(geometry, moon);
decorator1 -> ConstructComponent(experimentalHall_phys);
}
else
{
geometry = new RemSimVehicle1();
geometry -> ConstructComponent(experimentalHall_phys);
decorator1 = new RemSimAstronautDecorator(geometry, moon);
decorator1 -> ConstructComponent(experimentalHall_phys);
}
}
void RemSimDetectorConstruction::AddShielding(G4String value)
{
if (moon == false)
{
decoratorValue = value;
if (decoratorValue == "On")
{
if (decorator == 0)
{
decorator = new RemSimShieldingDecorator(geometry);
decorator -> ConstructComponent(experimentalHall_phys);
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
}
else G4cout<<" The shielding alread exists!"<<G4endl;
}
if (decoratorValue == "Off")
{
if (decorator != 0)
{
decorator -> DestroyComponent();
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
decorator = 0;
}
else G4cout<<" The shielding does not exist!"<<G4endl;
}
}
else G4cout << " The shielding is not available in moon habitat configuration"<<G4endl;
}
void RemSimDetectorConstruction::AddShelterSPE(G4String value)
{
if (moon == false)
{
if (value == "On")
{
if (decoratorSPE == 0)
{
decoratorSPE = new RemSimShelterSPEDecorator(geometry);
decoratorSPE -> ConstructComponent(experimentalHall_phys);
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
}
else G4cout<<" The SPE shelter alread exists!"<<G4endl;
}
if (value == "Off")
{
if (decoratorSPE != 0)
{
decoratorSPE -> DestroyComponent();
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
decoratorSPE = 0;
}
else G4cout<<" The SPE shelter does not exist!"<<G4endl;
}
}
else G4cout<< " It is not possible to select SPE shelter in moon habitat configuration" << G4endl;
}
void RemSimDetectorConstruction::AddHabitatRoof(G4String value)
{
if (moon == true)
{
if (value == "On")
{
if (decoratorRoof == 0)
{
decoratorRoof = new RemSimRoofDecorator(geometry);
decoratorRoof -> ConstructComponent(experimentalHall_phys);
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
}
else G4cout<<" The roof alread exists!"<<G4endl;
}
if (value == "Off")
{
if (decoratorRoof != 0)
{
decoratorRoof -> DestroyComponent();
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
decoratorRoof = 0;
}
else G4cout<<" The roof does not exist!"<<G4endl;
}
}
else G4cout<< " It is not possible to select the roof in the vehicle configuration" << G4endl;
}
void RemSimDetectorConstruction::ChangeShieldingThickness(G4double thick)
{
if (moon == false)
{
if (decorator != 0)
{
decorator -> ChangeThickness(thick);
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
}
else G4cout<<" Define the shielding before!"<< G4endl;
}
}
void RemSimDetectorConstruction::ChangeRoofThickness(G4double thick)
{
if (moon == true)
{
if (decoratorRoof != 0)
{
decoratorRoof -> ChangeThickness(thick);
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
}
else G4cout<<" Define the roof before!"<< G4endl;
}
else G4cout<<"The roof can be selected in moon habitat configuration"<<G4endl;
}
void RemSimDetectorConstruction:: ChooseConfiguration(G4String value)
{
if (flag == false)
{
if (value == "vehicle") ConstructVolume();
else if (value == "moon")
{
moon = true;
ConstructVolume();
}
G4RunManager::GetRunManager() -> DefineWorldVolume(experimentalHall_phys);
flag = true;
}
else
G4cout<< "The configurations vehicle/moon can not be switched" << G4endl;
}
@@ -1,133 +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. *
// ********************************************************************
//
//
// Code developed by:
// S.Guatelli
//
// *********************************
// * *
// * RemSimDetectorMessenger.cc *
// * *
// *********************************
//
//
// $Id$
//
//
#include "RemSimDetectorMessenger.hh"
#include "RemSimDetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
RemSimDetectorMessenger::RemSimDetectorMessenger( RemSimDetectorConstruction* Det): detector(Det)
{
vehicleDir = new G4UIdirectory("/configuration/");
vehicleDir -> SetGuidance("geometry control.");
vehicleCmd = new G4UIcmdWithAString("/configuration/choose",this);
vehicleCmd -> SetGuidance("Assign the geometrical set-up to G4RunManager.");
vehicleCmd -> SetParameterName("choice",true);
vehicleCmd -> SetCandidates("vehicle moon");
vehicleCmd -> AvailableForStates(G4State_Idle);
shieldingCmd = new G4UIcmdWithAString("/configuration/AddShielding",this);
shieldingCmd -> SetGuidance("Add shielding layer in vehicle configuration.");
shieldingCmd -> SetParameterName("choice",true);
shieldingCmd -> SetCandidates("On Off");
shieldingCmd -> AvailableForStates(G4State_Idle);
SPECmd = new G4UIcmdWithAString("/configuration/AddSPE",this);
SPECmd -> SetGuidance("Add SPE shelter in vehicle configuration.");
SPECmd -> SetParameterName("choice",true);
SPECmd -> SetCandidates("On Off");
SPECmd -> AvailableForStates(G4State_Idle);
roofCmd = new G4UIcmdWithAString("/configuration/AddRoof",this);
roofCmd -> SetGuidance("Add the Roof to the moon habitat.");
roofCmd -> SetParameterName("choice",true);
roofCmd -> SetCandidates("On Off");
roofCmd -> AvailableForStates(G4State_Idle);
// Fix the parameters of the shielding: material and thickness
shieldingDir = new G4UIdirectory("/shielding/");
shieldingDir -> SetGuidance("shielding control.");
thicknessCmd = new G4UIcmdWithADoubleAndUnit("/shielding/thickness",this);
thicknessCmd -> SetGuidance("Set the thickness of the shielding.");
thicknessCmd -> SetParameterName("Size",true);
thicknessCmd -> SetRange("Size>=0.");
thicknessCmd -> SetUnitCategory("Length");
thicknessCmd -> AvailableForStates(G4State_Idle);
roofDir = new G4UIdirectory("/roof/");
roofDir -> SetGuidance("Roof control.");
thicknessRoofCmd = new G4UIcmdWithADoubleAndUnit("/roof/thickness",this);
thicknessRoofCmd -> SetGuidance("Set the thickness of the Roof.");
thicknessRoofCmd -> SetParameterName("Size",true);
thicknessRoofCmd -> SetRange("Size>=0.");
thicknessRoofCmd -> SetUnitCategory("Length");
thicknessRoofCmd -> AvailableForStates(G4State_Idle);
}
RemSimDetectorMessenger::~RemSimDetectorMessenger()
{
delete thicknessRoofCmd;
delete roofDir;
delete thicknessCmd;
delete shieldingDir;
delete roofCmd;
delete SPECmd;
delete shieldingCmd;
delete vehicleCmd;
delete vehicleDir;
}
void RemSimDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if(command == vehicleCmd)
detector -> ChooseConfiguration(newValue);
if(command == shieldingCmd)
detector -> AddShielding(newValue);
if(command == SPECmd)
detector -> AddShelterSPE(newValue);
if(command == roofCmd)
detector -> AddHabitatRoof(newValue);
if(command == thicknessCmd)
detector -> ChangeShieldingThickness
(thicknessCmd -> GetNewDoubleValue(newValue));
if(command == thicknessRoofCmd)
detector -> ChangeRoofThickness
(thicknessRoofCmd -> GetNewDoubleValue(newValue));
}
@@ -1,253 +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. *
// ********************************************************************
//
// Code developed by:
// S.Guatelli
//
// *******************************
// * *
// * RemSimMaterial.cc *
// * *
// *******************************
//
// $Id$
//
#include "RemSimMaterial.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4MaterialPropertyVector.hh"
#include "G4MaterialTable.hh"
#include "G4RunManager.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
RemSimMaterial::RemSimMaterial():
matPb(0), matAir(0), matH2O(0), Al(0), nylon(0), mylar(0),
beta(0), nextel(0), kevlar(0),
vacuum(0), betaCloth(0), eterogeneousNextel(0), kevlarVacuum(0),
polyethylene(0), polyacrylate(0), evoh(0), nomex(0), nomexAir(0),
kevlarAir(0), moon(0)
{;}
RemSimMaterial::~RemSimMaterial()
{
delete moon;
delete kevlarAir;
delete nomexAir;
delete nomex;
delete evoh;
delete polyacrylate;
delete polyethylene;
delete kevlarVacuum;
delete eterogeneousNextel;
delete betaCloth;
delete vacuum;
delete kevlar;
delete nextel;
delete beta;
delete mylar;
delete nylon;
delete Al;
delete matH2O;
delete matAir;
delete matPb;
}
void RemSimMaterial::DefineMaterials()
{
// Define required materials
G4double A; // atomic mass
G4double Z; // atomic number
G4double d; // density
// General elements
A = 1.01*g/mole;
G4Element* elH = new G4Element ("Hydrogen","H",Z = 1.,A);
A = 10.811*g/mole;
G4Element* elB = new G4Element ("Boro","B",Z = 5.,A);
A = 14.01*g/mole;
G4Element* elN = new G4Element("Nitrogen","N",Z = 7.,A);
A = 16.00*g/mole;
G4Element* elO = new G4Element("Oxygen","O",Z = 8.,A);
A=26.98*g/mole;
G4Element* elAl = new G4Element("Aluminum","Al", Z = 13.,A);
A = 12.011*g/mole;
G4Element* elC = new G4Element("Carbon","C",Z = 6.,A);
A = 24.305*g/mole;
G4Element* elMg = new G4Element("Magnesium","Mg",Z = 12.,A);
A = 35.453*g/mole;
G4Element* elCl = new G4Element("Chlorine","Cl",Z = 17.,A);
A = 40.08*g/mole;
G4Element* elCa = new G4Element("Calcium","Ca",Z = 20.,A);
A = 28.09*g/mole;
G4Element* elSi = new G4Element("Silicon","Si",Z = 14.,A);
A = 55.85*g/mole;
G4Element* elFe = new G4Element("Iron","Fe",Z = 26.,A);
//Lead material
A = 207.19*g/mole;
Z = 82;
d = 11.35*g/cm3;
matPb = new G4Material("Lead",Z,A,d);
// Air material
G4double airDensity = 1.290*mg/cm3;
matAir = new G4Material("Air",airDensity,2);
matAir -> AddElement(elN,0.7);
matAir -> AddElement(elO,0.3);
// Water
d = 1.000*g/cm3;
matH2O = new G4Material("Water",d,2);
matH2O -> AddElement(elH,2);
matH2O -> AddElement(elO,1);
matH2O -> GetIonisation() -> SetMeanExcitationEnergy(75.0*eV);
Al = new G4Material("Aluminium", Z= 13., A= 26.98*g/mole, d = 2.7*g/cm3);
//nylon (alenia spazio)
d = 1.14 *g/cm3;
nylon = new G4Material("nylon",d,4);
nylon -> AddElement(elH,0.108);
nylon -> AddElement(elC,0.68);
nylon -> AddElement(elN,0.099);
nylon -> AddElement(elO,0.113);
//mylar (alenia spazio)
d= 1.4 *g/cm3;
mylar = new G4Material("mylar",d,3);
mylar -> AddElement(elH,0.042);
mylar -> AddElement(elC,0.625);
mylar -> AddElement(elO,0.333);
//beta cloth
G4double betaDensity = 2.3 *g/cm3;
beta = new G4Material("beta",betaDensity,2);
beta -> AddElement(elO,0.53);
beta -> AddElement(elSi,0.47);
G4double nextelDensity = 2.7 * g/cm3;
nextel = new G4Material("nextel",nextelDensity,4);
nextel -> AddElement(elB,0.04);
nextel -> AddElement(elO,0.52);
nextel -> AddElement(elAl,0.33);
nextel -> AddElement(elSi,0.11);
//kevlar
G4double kevlarDensity = 1.44 *g/cm3;
kevlar = new G4Material("kevlar",d,4);
kevlar -> AddElement(elH,0.04);
kevlar -> AddElement(elC,0.71);
kevlar -> AddElement(elO,0.12);
kevlar -> AddElement(elN,0.13);
//vacuum
G4double vacuumDensity = 1.e-25 *g/cm3;
G4double pressure = 3.e-18*pascal;
G4double temperature = 2.73*kelvin;
vacuum = new G4Material("Galactic", Z=1., A=1.01*g/mole,
vacuumDensity,kStateGas,temperature,pressure);
d = (vacuumDensity*0.44)+ (betaDensity*0.56);
betaCloth = new G4Material("betacloth",d,2);
betaCloth -> AddMaterial (beta, 0.56);
betaCloth -> AddMaterial (vacuum,0.44);
d = (vacuumDensity*0.73)+ (nextelDensity*0.27);
eterogeneousNextel = new G4Material("Nextel312AF62",d,2);
eterogeneousNextel -> AddMaterial (vacuum, 0.73);
eterogeneousNextel -> AddMaterial (nextel, 0.27);
d = (vacuumDensity*0.44)+ (kevlarDensity*0.56);
kevlarVacuum = new G4Material("kevlarVacuum",d,2);
kevlarVacuum -> AddMaterial (vacuum, 0.44);
kevlarVacuum -> AddMaterial (kevlar, 0.56);
d = 0.94 * g/cm3;
polyethylene = new G4Material("polyethylene",d,2);
polyethylene -> AddElement(elH,0.14);
polyethylene -> AddElement(elC,0.86);
d = 1.19 * g/cm3;
polyacrylate = new G4Material("polyacrylate",d,3);
polyacrylate -> AddElement(elH,0.08);
polyacrylate -> AddElement(elC,0.60);
polyacrylate -> AddElement(elO,0.32);
d = 1.17 * g/cm3;
evoh = new G4Material("evoh",d,3);
evoh -> AddElement(elH,0.11);
evoh -> AddElement(elC,0.67);
evoh -> AddElement(elO,0.22);
G4double nomexDensity = 0.98 * g/cm3;
nomex = new G4Material("nomex",nomexDensity,5);
nomex -> AddElement(elH,0.04);
nomex -> AddElement(elC,0.54);
nomex -> AddElement(elN,0.09);
nomex -> AddElement(elO,0.10);
nomex -> AddElement(elCl,0.23);
d = 0.45*(nomexDensity)+ 0.55*(airDensity);
nomexAir = new G4Material("nomexAir",d,2);
nomexAir -> AddMaterial(nomex,0.45);
nomexAir -> AddMaterial(matAir,0.55);
d =0.56*(kevlarDensity)+ 0.44*(airDensity);
kevlarAir = new G4Material("kevlarAir",d,2);
kevlarAir -> AddMaterial(kevlar,0.56);
kevlarAir -> AddMaterial(matAir,0.44);
d = 1.5*g/cm3;
moon = new G4Material("moon",d,6);
moon -> AddElement(elO,0.45);
moon -> AddElement(elMg,0.05);
moon -> AddElement(elAl,0.13);
moon -> AddElement(elSi,0.21);
moon -> AddElement(elCa,0.10);
moon -> AddElement(elFe,0.06);
}
G4Material* RemSimMaterial::GetMaterial(G4String material)
{
G4Material* pttoMaterial = G4Material::GetMaterial(material);
return pttoMaterial;
}
@@ -1,101 +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. *
// ********************************************************************
//
//
// **************************************
// * *
// * RemSimMoonHabitat.cc *
// * *
// **************************************
//
// $Id$
//
// Author:Susanna Guatelli, guatelli@ge.infn.it
//
#include "RemSimMoonHabitat.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4UserLimits.hh"
#include "RemSimDecorator.hh"
#include "RemSimAstronautDecorator.hh"
#include "G4SubtractionSolid.hh"
RemSimMoonHabitat::RemSimMoonHabitat()
{
pMaterial = new RemSimMaterial();
moonPhys = 0;
}
RemSimMoonHabitat::~RemSimMoonHabitat()
{
delete pMaterial;
}
void RemSimMoonHabitat::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
pMaterial -> DefineMaterials();
G4Material* moonMaterial = pMaterial->GetMaterial("moon");
// Moon Surface definition
G4double sizeX = 30.*m;
G4double sizeY = 30.*m;
G4double sizeZ = 15.*m;
G4Box* moon = new G4Box("moon",sizeX,sizeY,sizeZ);
G4double thick = 4.5 *m;
G4Box* shelter = new G4Box("shelter",5.*m,5.*m,thick/2.);
G4ThreeVector translation(0, 0, -sizeZ + 0.5 * m + thick/2.);
G4SubtractionSolid* solid = new G4SubtractionSolid ("moon-shelter", moon,
shelter, 0, translation);
G4LogicalVolume* moonLogical = new G4LogicalVolume(solid,
moonMaterial,
"moon",0,0,0);
moonPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,sizeZ), "moon",moonLogical,
motherVolume,
false,0);
G4Colour red (1.0,0.0,0.0);
G4VisAttributes* moonVisAtt = new G4VisAttributes(red);
moonVisAtt -> SetVisibility(true);
moonVisAtt -> SetForceWireframe(true);
moonLogical -> SetVisAttributes(moonVisAtt);
}
void RemSimMoonHabitat::DestroyComponent()
{}
@@ -1,187 +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. *
// ********************************************************************
//
// $Id$
//
// Author: Susanna Guatelli, susanna@uow.edu.au
#include "RemSimPhysicsList.hh"
#include "RemSimPhysicsListMessenger.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleDefinition.hh"
#include "G4PhysListFactory.hh"
#include "G4VPhysicsConstructor.hh"
// Physic lists (contained inside the Geant4 distribution)
#include "G4EmStandardPhysics_option3.hh"
#include "G4DecayPhysics.hh"
#include "G4HadronElasticPhysics.hh"
#include "G4HadronDElasticPhysics.hh"
#include "G4HadronHElasticPhysics.hh"
#include "G4HadronQElasticPhysics.hh"
#include "G4HadronInelasticQBBC.hh"
#include "G4IonBinaryCascadePhysics.hh"
#include "G4Decay.hh"
#include "G4LossTableManager.hh"
#include "G4UnitsTable.hh"
#include "G4ProcessManager.hh"
#include "G4IonFluctuations.hh"
#include "G4IonParametrisedLossModel.hh"
#include "G4EmProcessOptions.hh"
#include "HadronPhysicsQGSP_BIC_HP.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "HadronPhysicsQGSP_BIC.hh"
// The electromagnetic physics and the decay are
// registered by default. The user has to execute the
// macro physics.mac to activate the hadronic component of the physics.
// Look vehicle1.mac, vehicle2.mac and moon.mac for example
RemSimPhysicsList::RemSimPhysicsList(): G4VModularPhysicsList()
{
defaultCutValue = 0.1* mm;
// SetVerboseLevel(1);
helIsRegistered = false;
bicIsRegistered = false;
bicIonIsRegistered = false;
radioactiveDecayIsRegistered = false;
messenger = new RemSimPhysicsListMessenger(this);
SetVerboseLevel(1);
// EM physics
emPhysicsList = new G4EmStandardPhysics_option3(1);
// Decay physics
decPhysicsList = new G4DecayPhysics();
G4cout<< ">> PhysicsList:: G4EmStandardPhysics_option3 activated << "<<G4endl;
G4cout<< ">> PhysicsList:: Decay activated << "<<G4endl;
}
RemSimPhysicsList::~RemSimPhysicsList()
{
delete messenger;
delete emPhysicsList;
delete decPhysicsList;
for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
}
/////////////////////////////////////////////////////////////////////////////
void RemSimPhysicsList::ConstructParticle()
{
decPhysicsList->ConstructParticle();
}
void RemSimPhysicsList::ConstructProcess()
{
// transportation
//
AddTransportation();
// electromagnetic physics list
//
emPhysicsList->ConstructProcess();
em_config.AddModels();
// decay physics list
//
decPhysicsList->ConstructProcess();
// hadronic physics lists
for(size_t i=0; i<hadronPhys.size(); i++) {
hadronPhys[i]->ConstructProcess();
}
}
void RemSimPhysicsList::AddPhysicsList(const G4String& name)
{
if (verboseLevel>1) {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
}
if (name == "elastic" && !helIsRegistered) {
G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
hadronPhys.push_back( new G4HadronElasticPhysics());
helIsRegistered = true;
} else if (name == "DElastic" && !helIsRegistered) {
G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronDElasticPhysics()" << G4endl;
hadronPhys.push_back( new G4HadronDElasticPhysics());
helIsRegistered = true;
} else if (name == "HElastic" && !helIsRegistered) {
G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronHElasticPhysics()" << G4endl;
hadronPhys.push_back( new G4HadronHElasticPhysics());
helIsRegistered = true;
} else if (name == "QElastic" && !helIsRegistered) {
G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronQElasticPhysics()" << G4endl;
hadronPhys.push_back( new G4HadronQElasticPhysics());
helIsRegistered = true;
} else if (name == "binary" && !bicIsRegistered) {
hadronPhys.push_back(new HadronPhysicsQGSP_BIC);
bicIsRegistered = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: QGSP_BIC" << G4endl;
} else if (name == "binary_ion" && !bicIonIsRegistered) {
hadronPhys.push_back(new G4IonBinaryCascadePhysics());
bicIonIsRegistered = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4IonBinaryCascadePhysics()" << G4endl;
} else if (name == "radioactive_decay" && !radioactiveDecayIsRegistered ) {
hadronPhys.push_back(new G4RadioactiveDecayPhysics());
radioactiveDecayIsRegistered = true;
G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()" << G4endl;
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
}
}
void RemSimPhysicsList::SetCuts()
{
G4VUserPhysicsList::SetCutsWithDefault();
if (verboseLevel>0) DumpCutValuesTable();
}
@@ -1,209 +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. *
// ********************************************************************
//
//
// $Id: RemSimPrimaryGeneratorAction.cc,v 1.17 2006-06-29 16:24:09 gunter Exp $// Author: Susanna Guatelli, guatelli@ge.infn.it
#include <fstream>
#include <cmath>
#include "RemSimPrimaryGeneratorAction.hh"
#include "RemSimPrimaryGeneratorMessenger.hh"
#include "G4SystemOfUnits.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
#include "G4DataVector.hh"
RemSimPrimaryGeneratorAction::RemSimPrimaryGeneratorAction()
{
readFile = false;
particleGun = new G4ParticleGun(1);
messenger = new RemSimPrimaryGeneratorMessenger(this);
energies = new G4DataVector;
data = new G4DataVector;
size = 0;
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String ParticleName = "proton";
G4ParticleDefinition* particle = particleTable->FindParticle(ParticleName);
particleGun->SetParticleDefinition(particle);
// Default values of the primary generator
G4ThreeVector position(0,0,-25. *m);
particleGun -> SetParticlePosition(position);
G4ThreeVector direction(0., 0., 1.);
particleGun -> SetParticleMomentumDirection(direction);
particleGun -> SetParticleEnergy(250. * MeV);
}
RemSimPrimaryGeneratorAction::~RemSimPrimaryGeneratorAction()
{
delete data;
delete energies;
delete [] cumulate;
delete [] energy;
delete messenger;
delete particleGun;
}
G4double RemSimPrimaryGeneratorAction::GetInitialEnergy()
{
G4double primaryParticleEnergy = particleGun -> GetParticleEnergy();
return primaryParticleEnergy;
}
void RemSimPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4int baryon = particleGun -> GetParticleDefinition() -> GetBaryonNumber();
// Generate the energy spectrum of primary particles according to
// the flux reported in the .txt file (firt column = Energy (MeV/nucl),
// second column = differnetila flux). The fluxes are derived from CREME96
if (readFile == true)
{
// Uniform number between 0. and 1.
G4double random = G4UniformRand();
G4int nbelow = 0; // largest k such that I[k] is known to be <= rand
G4int nabove = size; // largest k such that I[k] is known to be > rand
G4int middle;
while (nabove > nbelow+1) {
middle = (nabove + nbelow+1)>>1;
if (random >= cumulate[middle]) {
nbelow = middle;
} else {
nabove = middle;
}
}
// Linear interpolation
G4double energy_gun = 0. * MeV;
G4double binMeasure = cumulate[nabove] - cumulate[nbelow];
if ( binMeasure == 0 ) {
energy_gun = (energy[nbelow] + random*(energy[nabove] - energy[nbelow]))* baryon;
G4cout<<"BinMeasure is zero !!!!!"<<G4endl;
}
else
{
G4double binFraction = (random - cumulate[nbelow]) / binMeasure;
energy_gun = energy[nbelow] + binFraction *(energy[nabove] - energy[nbelow]);
}
particleGun -> SetParticleEnergy(energy_gun * baryon);
}
particleGun -> GeneratePrimaryVertex(anEvent);
}
void RemSimPrimaryGeneratorAction::ReadProbability(G4String fileName)
{
// This method allows to read the .txt files containing the
// fluxes of the galactic cosmic rays derived form CREME96
readFile = true;
std::ifstream file(fileName, std::ios::in);
std::filebuf* lsdp = file.rdbuf();
if (! (lsdp->is_open()) )
{
G4String excep = "RemSimPrimaryGenerator - data file: "
+ fileName + " not found";
G4Exception("RemSimPrimaryGeneratorAction::ReadProbability()",
"RadioP001",FatalException,excep);
}
G4double a = 0;
G4int index = 0;
G4int k = 1;
do
{
file >> a;
G4int nColumns = 2;
// The file is organized into two columns:
// column contains the probability distribution
// The file terminates with the pattern: -1
// -2
if (a == -1 || a == -2)
{
}
else
{
if (k%nColumns != 0)
{
G4double ene = a *MeV;
energies -> push_back(ene);
// G4cout << "energy: " << ene << G4endl;
k++;
}
else if (k%nColumns == 0)
{
G4double data_value = a;
data -> push_back(data_value);
//G4cout<< "probability: "<< data_value << G4endl;
k=1;
index++;
}
}
} while (a != -2); // end of file
file.close();
size = index -1 ;
cumulate = new G4double[size+1];
energy = new G4double[size+1];
cumulate[0] = 0;
energy [0] = (*energies)[0];
for (G4int ptn = 0; ptn <size; ptn++ ) {
G4double yy = ((*data)[ptn+1] + (*data)[ptn])/2.;
G4double weight = yy *((*energies)[ptn +1] - (*energies)[ptn]);
cumulate[ptn +1] = cumulate[ptn] + weight;
energy[ptn+1] = (*energies)[ptn+1];
}
// Normalise the cumulate to 1 (that corresponds to the last value)
for ( G4int ptn= 0; ptn < size + 1; ptn++ )
{
cumulate[ptn] /= cumulate[size];
}
}
@@ -1,67 +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. *
// ********************************************************************
//
//
// Code developed by: S.Guatelli, guatelli@ge.infn.it
//
// *****************************************
// * *
// * RemSimPrimaryGeneratorMessenger.cc *
// * *
// *****************************************
//
//
// $Id$
//
//
#include "RemSimPrimaryGeneratorMessenger.hh"
#include "RemSimPrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithoutParameter.hh"
RemSimPrimaryGeneratorMessenger::RemSimPrimaryGeneratorMessenger( RemSimPrimaryGeneratorAction* prim): primary(prim)
{
gunDir = new G4UIdirectory("/gun/");
gunDir->SetGuidance("Select the generation configuration of primary particles.");
dataCmd = new G4UIcmdWithAString("/gun/data",this);
dataCmd -> SetGuidance("Primary particle spectrum");
dataCmd -> SetParameterName("choice",true);
dataCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
}
RemSimPrimaryGeneratorMessenger::~RemSimPrimaryGeneratorMessenger()
{
delete dataCmd;
delete gunDir;
}
void RemSimPrimaryGeneratorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if (command == dataCmd) primary -> ReadProbability(newValue);
}
@@ -1,127 +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. *
// ********************************************************************
//
// ************************************
// * *
// * RemSimRoofDecorator.cc *
// * *
// ************************************
//
// Code developed by: S.Guatelli, susanna@uow.edu.au
//
//
// $Id$
//
#include "RemSimRoofDecorator.hh"
#include "RemSimDecorator.hh"
#include "RemSimVGeometryComponent.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Trd.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4RunManager.hh"
RemSimRoofDecorator::RemSimRoofDecorator(RemSimVGeometryComponent* comp)
: RemSimDecorator(comp)
{
pMaterial = new RemSimMaterial();
roofVisAtt = 0;
roof = 0;
roofLog = 0;
roofPhys = 0;
}
RemSimRoofDecorator::~RemSimRoofDecorator()
{
delete pMaterial;
}
void RemSimRoofDecorator::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
pMaterial -> DefineMaterials();
RemSimDecorator::ConstructComponent(motherVolume);
ConstructRoof(motherVolume);
}
void RemSimRoofDecorator::DestroyComponent()
{
delete roofVisAtt;
roofVisAtt = 0;
delete roofPhys;
roofPhys = 0;
delete roofLog;
roofLog = 0;
delete roof;
roof = 0;
}
void RemSimRoofDecorator::ConstructRoof(G4VPhysicalVolume* motherVolume)
{
// Geometry definition
pMaterial -> DefineMaterials();
G4Material* moonMaterial = pMaterial -> GetMaterial("moon");
roof = new G4Trd("roof",2.25*m,7.*m,5.*m, 8.*m, 0.5 *m);
roofLog = new G4LogicalVolume(roof,
moonMaterial,
"roof",
0,0,0);
roofPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0., - 0.5 *m),
"roof",roofLog,
motherVolume,false,0);
//Visualisation attributes
G4Colour red (1.0,0.0,0.0);
roofVisAtt = new G4VisAttributes(red);
roofVisAtt -> SetVisibility(true);
roofVisAtt -> SetForceSolid(true);
roofLog -> SetVisAttributes(roofVisAtt);
PrintDetectorParameters();
}
void RemSimRoofDecorator::ChangeThickness(G4double thick)
{
PrintDetectorParameters();
roof -> SetZHalfLength(thick/2.);
roofPhys -> SetTranslation(G4ThreeVector
(0.,0., - thick/2.));
}
void RemSimRoofDecorator::PrintDetectorParameters()
{
;
}
@@ -1,93 +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. *
// ********************************************************************
//
//
// *******************************
// * *
// * RemSimRunAction.cc *
// * *
// *******************************
//
// Code developed by: S.Guatelli, susanna@uow.edu.au
// $Id$
//
#include "RemSimRunAction.hh"
#include "RemSimDetectorConstruction.hh"
#include "RemSimPrimaryGeneratorAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4ios.hh"
#include "RemSimRunAction.hh"
#include "RemSimAnalysis.hh"
RemSimRunAction::RemSimRunAction()
{
// Create analysis manager
G4AnalysisManager::Instance();
}
RemSimRunAction::~RemSimRunAction()
{
delete G4AnalysisManager::Instance();
}
void RemSimRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
// Get analysis manager
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// Open a ROOT output file
//
G4String fileName = "remsim.root";
analysisManager -> OpenFile(fileName);
analysisManager -> SetFirstHistoId(1);
// Create the histograms
analysisManager -> CreateH1("1","Energy of secondary p reaching the phantom",1000, 0., 10000.);
analysisManager -> CreateH1("2","Energy of secondary n reaching the phantom", 1000, 0., 10000.);
analysisManager -> CreateH1("3","Energy of secondary pions reaching the phantom",1000, 0., 10000.);
analysisManager -> CreateH1("4","Energy of secondary alpha reaching the phantom",100, 0., 100.);
analysisManager -> CreateH1("5","Energy of secondary p produced in the phantom",100, 0., 1000.);
analysisManager -> CreateH1("6","Energy of secondary n produced in the phantom", 100, 0., 1000.);
analysisManager -> CreateH1("7","Energy of secondary pions produced in the phantom",200, 0., 2000.);
analysisManager -> CreateH1("8","Energy of secondary alpha produced in the phantom", 100, 0.,100.);
}
void RemSimRunAction::EndOfRunAction(const G4Run* aRun)
{
G4double numberEvents = aRun -> GetNumberOfEvent();
G4cout<< "Number of events:" << numberEvents << G4endl;
// Get analysis manager
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// Save the histograms and close the ROOT file
analysisManager -> Write();
analysisManager -> CloseFile();
}
@@ -1,122 +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. *
// ********************************************************************
//
// $Id$
//
// Code developed by: S.Guatelli, susanna@uow.edu.au
//
#include "RemSimShelterSPEDecorator.hh"
#include "RemSimDecorator.hh"
#include "RemSimVGeometryComponent.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4RunManager.hh"
RemSimShelterSPEDecorator::RemSimShelterSPEDecorator(RemSimVGeometryComponent* comp)
: RemSimDecorator(comp)
{
shelterSPEX = 5.*m;
shelterSPEY = 5.*m;
shelterSPEZ = 75.*cm;
translation = - 2.* m;
pMaterial = new RemSimMaterial();
shelterSPEVisAtt = 0;
}
RemSimShelterSPEDecorator::~RemSimShelterSPEDecorator()
{
delete pMaterial;
}
void RemSimShelterSPEDecorator::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
pMaterial -> DefineMaterials();
RemSimDecorator::ConstructComponent(motherVolume);
ConstructShelterSPE(motherVolume);
}
void RemSimShelterSPEDecorator::DestroyComponent()
{
delete shelterSPEVisAtt;
shelterSPEVisAtt = 0;
delete shelterSPEPhys;
shelterSPEPhys = 0;
delete shelterSPELog;
shelterSPELog = 0;
delete shelterSPE;
shelterSPE = 0;
}
void RemSimShelterSPEDecorator::ConstructShelterSPE(G4VPhysicalVolume* motherVolume)
{
// Geometry definition
pMaterial -> DefineMaterials();
G4Material* water = pMaterial -> GetMaterial("Water");
shelterSPE = new G4Box("shelterSPE",shelterSPEX/2.,shelterSPEY/2.,shelterSPEZ/2.);
shelterSPELog = new G4LogicalVolume(shelterSPE, water,
"shelterSPELog",0,0,0);
shelterSPEPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,translation + shelterSPEZ/2.),
"shelterSPEPhys", shelterSPELog, motherVolume,false,0);
//Visualisation attributes
G4Colour red (1.0,0.0,0.0);
shelterSPEVisAtt = new G4VisAttributes(red);
shelterSPEVisAtt -> SetVisibility(true);
shelterSPEVisAtt -> SetForceSolid(true);
shelterSPELog -> SetVisAttributes(shelterSPEVisAtt);
PrintDetectorParameters();
}
void RemSimShelterSPEDecorator::ChangeThickness(G4double)
{
;
}
void RemSimShelterSPEDecorator::PrintDetectorParameters()
{
G4cout << "-----------------------------------------------------------------------"
<< G4endl
<< "the shelterSPE is a box whose thickness is: " << G4endl
<< ((shelterSPE -> GetZHalfLength())*2.)/cm
<< " cm along the Z axis"
<< G4endl
<< "material of the shelterSPE: "
<< shelterSPELog -> GetMaterial() -> GetName() <<G4endl
<< G4endl;
}
@@ -1,126 +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. *
// ********************************************************************
//
// $Id$
//
// Code developed by: S.Guatelli, susanna@uow.edu.au
//
#include "RemSimShieldingDecorator.hh"
#include "RemSimDecorator.hh"
#include "RemSimVGeometryComponent.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4RunManager.hh"
#include "G4VisAttributes.hh"
RemSimShieldingDecorator::RemSimShieldingDecorator(RemSimVGeometryComponent* comp)
: RemSimDecorator(comp)
{
shieldingX = 5.*m;
shieldingY = 5.*m;
shieldingZ = 10.*cm;
translation = -4.4* m;
pMaterial = new RemSimMaterial();
shieldingVisAtt = 0;
}
RemSimShieldingDecorator::~RemSimShieldingDecorator()
{
delete pMaterial;
}
void RemSimShieldingDecorator::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
pMaterial -> DefineMaterials();
RemSimDecorator::ConstructComponent(motherVolume);
ConstructShielding(motherVolume);
}
void RemSimShieldingDecorator::DestroyComponent()
{
delete shieldingVisAtt;
shieldingVisAtt = 0;
delete shieldingPhys;
shieldingPhys = 0;
delete shieldingLog;
shieldingLog = 0;
delete shielding;
shielding = 0;
}
void RemSimShieldingDecorator::ConstructShielding(G4VPhysicalVolume* motherVolume)
{
// Geometry definition
pMaterial -> DefineMaterials();
G4Material* water = pMaterial -> GetMaterial("Water");
shielding = new G4Box("shielding",shieldingX/2.,shieldingY/2.,shieldingZ/2.);
shieldingLog = new G4LogicalVolume(shielding, water,
"shieldingLog",0,0,0);
shieldingPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,translation + shieldingZ/2.),
"shieldingPhys", shieldingLog, motherVolume,false,0);
//Visualisation attributes
G4Colour red (1.0,0.0,0.0);
shieldingVisAtt = new G4VisAttributes(red);
shieldingVisAtt -> SetVisibility(true);
shieldingVisAtt -> SetForceSolid(true);
shieldingLog -> SetVisAttributes(shieldingVisAtt);
PrintDetectorParameters();
}
void RemSimShieldingDecorator::ChangeThickness(G4double thick)
{
PrintDetectorParameters();
shielding -> SetZHalfLength(thick/2.);
shieldingPhys -> SetTranslation(G4ThreeVector
(0.,0.,translation + thick/2.));
}
void RemSimShieldingDecorator::PrintDetectorParameters()
{
G4cout << "-----------------------------------------------------------------------"
<< G4endl
<< "the shielding is a box whose thickness is: " << G4endl
<< ((shielding -> GetZHalfLength())*2.)/cm
<< " cm along the Z axis"
<< G4endl
<< "material of the shielding: "
<< shieldingLog -> GetMaterial() -> GetName() <<G4endl
<< G4endl;
}
@@ -1,185 +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. *
// ********************************************************************
//
//
// $Id$
//
//
// Author: Susanna Guatelli (susanna@uow.edu.au)
//
#include "RemSimSteppingAction.hh"
#include "RemSimPrimaryGeneratorAction.hh"
#include "RemSimSteppingActionMessenger.hh"
#include "RemSimAnalysis.hh"
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
#include "G4SteppingManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4StepPoint.hh"
#include "G4ParticleDefinition.hh"
#include "G4VPhysicalVolume.hh"
#include "G4TrackStatus.hh"
RemSimSteppingAction::RemSimSteppingAction(RemSimPrimaryGeneratorAction* primary):
primaryAction(primary)
{
hadronic = "Off";
messenger = new RemSimSteppingActionMessenger(this);
}
RemSimSteppingAction::~RemSimSteppingAction()
{
delete messenger;
}
void RemSimSteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4String oldVolumeName = aStep -> GetPreStepPoint()->
GetPhysicalVolume()-> GetName();
// Store in histograms useful information concerning secondary particles
G4VPhysicalVolume* volume = aStep -> GetPostStepPoint() -> GetPhysicalVolume();
// Get analysis manager
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// Secondary particles reaching the astronaut
if(oldVolumeName != "phantom")
{
if (volume)
{
G4String volumeName = volume -> GetName();
if (volumeName == "phantom")
{
G4String particleName = (aStep -> GetTrack() -> GetDynamicParticle()
-> GetDefinition() -> GetParticleName());
G4double particleEnergy = aStep -> GetTrack() -> GetKineticEnergy();
if(aStep -> GetTrack() -> GetTrackID()!= 1)
// analysis of secondary particles reaching the astronaut
{
if (particleName == "proton") analysisManager -> FillH1(1, particleEnergy/MeV);
else{
if (particleName == "neutron") analysisManager -> FillH1(2, particleEnergy/MeV);
else{
if (particleName == "pi+" || particleName == "pi-" ||particleName == "pi0" )
analysisManager -> FillH1(3,particleEnergy/MeV);
else{
if (particleName == "alpha") analysisManager -> FillH1(4, particleEnergy/MeV);
}
}
}
}
}
}
}
// Analysis of the secondary particles generated in the phantom
G4SteppingManager* steppingManager = fpSteppingManager;
G4Track* theTrack = aStep -> GetTrack();
// check if it is alive
if(theTrack-> GetTrackStatus() == fAlive) { return; }
// Retrieve the secondary particles
G4TrackVector* fSecondary = steppingManager -> GetfSecondary();
for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++)
{
// Retrieve the info about the generation of secondary particles in the phantom and
// in the vehicle
G4String volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName();
G4String secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName();
G4double secondaryParticleKineticEnergy = (*fSecondary)[lp1] -> GetKineticEnergy();
G4String process = (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName();
// If the secondaries are originated in the phantom....
if (volumeName == "phantom")
{
if (secondaryParticleName == "proton") analysisManager -> FillH1(5, secondaryParticleKineticEnergy/MeV);
else
{
if (secondaryParticleName == "neutron") analysisManager -> FillH1(6, secondaryParticleKineticEnergy/MeV);
else{
if (secondaryParticleName == "pi+" ||
secondaryParticleName == "pi-"||secondaryParticleName == "pi0")
analysisManager -> FillH1(7, secondaryParticleKineticEnergy/MeV);
else{
if (secondaryParticleName == "alpha")
analysisManager -> FillH1(8, secondaryParticleKineticEnergy/MeV);
}
}
}
}
}
//analysis of hadronic physics
if (hadronic == "On")
{
if(aStep -> GetPostStepPoint() -> GetProcessDefinedStep() != NULL)
{
G4String process = aStep -> GetPostStepPoint() ->
GetProcessDefinedStep() ->GetProcessName();
if ((process != "Transportation") &&
(process != "msc") &&
(process != "LowEnergyIoni") &&
(process != "LowEnergyBrem") &&
(process != "eIoni") &&
(process != "hIoni") &&
(process != "eBrem") &&
(process != "compt") &&
(process != "phot") &&
(process != "conv") &&
(process != "annihil") &&
(process != "hLowEIoni") &&
(process != "LowEnBrem") &&
(process != "LowEnCompton") &&
(process != "LowEnPhotoElec") &&
(process != "LowEnRayleigh") &&
(process != "LowEnConversion"))
G4cout << "Hadronic Process:" << process << G4endl;
}
}
}
void RemSimSteppingAction::SetHadronicAnalysis(G4String value)
{
hadronic = value;
}
@@ -1,65 +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. *
// ********************************************************************
//
//
//$Id: RemSimSteppingActionMessenger.cc,v 1.5 2006-06-29 16:24:27 gunter Exp $// GEANT4 tag $Name: not supported by cvs2svn $
//
// Code developed by: S.Guatelli, guatelli@ge.infn.it
//
#include "RemSimSteppingActionMessenger.hh"
#include "RemSimSteppingAction.hh"
#include "globals.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
RemSimSteppingActionMessenger::RemSimSteppingActionMessenger(RemSimSteppingAction* SA)
:steppingAction(SA)
{
stepDirectory = new G4UIdirectory("/step/");
stepDirectory -> SetGuidance("Step control command.");
hadronicCmd = new G4UIcmdWithAString("/step/hadronicVerbose",this);
hadronicCmd -> SetGuidance("Set the verbose level of hadronic processes");
hadronicCmd -> SetParameterName("choice", true);
hadronicCmd -> SetCandidates("On Off");
hadronicCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
}
RemSimSteppingActionMessenger::~RemSimSteppingActionMessenger()
{
delete hadronicCmd;
delete stepDirectory;
}
void RemSimSteppingActionMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if(command == hadronicCmd)
{
steppingAction -> SetHadronicAnalysis(newValue);
G4cout<< " The stepping verbose is switched on" << G4endl;
}
}
@@ -1,460 +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. *
// ********************************************************************
//
// $Id$
//
// Code developed by: S.Guatelli, guatelli@ge.infn.it
//
#include "RemSimVGeometryComponent.hh"
#include "RemSimMaterial.hh"
#include "G4SystemOfUnits.hh"
#include "G4Material.hh"
#include "RemSimVehicle1.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4UserLimits.hh"
RemSimVehicle1::RemSimVehicle1():
layervacuumPhys(0), layer1Phys(0), layer2Phys(0), layer3Phys(0),
layer4Phys(0), layer5Phys(0), layer6Phys(0), layer7Phys(0), layer8Phys(0),
layer9Phys(0), layer10Phys(0), layer11Phys(0), layer12Phys(0),
layer13Phys(0), layer14Phys(0), layer15Phys(0), layerPhys(0),
layer16Phys(0), layer17Phys(0), layer18Phys(0), layer19Phys(0),
layer20Phys(0), layer21Phys(0), layer22Phys(0), layer23Phys(0),
layer24Phys(0), layer25Phys(0), layer26Phys(0), layer27Phys(0)
{
pMaterial = new RemSimMaterial();
}
RemSimVehicle1::~RemSimVehicle1()
{
delete pMaterial;
}
void RemSimVehicle1::ConstructComponent(G4VPhysicalVolume* motherVolume)
{
G4double sizeX = 5.*m;
G4double sizeY = 5.*m;
G4Material* betacloth = pMaterial -> GetMaterial("betacloth");
//layer of betacloth
G4double translation = - 5.*m;
G4double thick = 0.03 *cm;
G4Box* layer1 = new G4Box("layer1",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer1Log = new G4LogicalVolume(layer1,
betacloth,
"layer1Log",
0,0,0);
layer1Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,translation+thick/2.),
"layer1Phys",
layer1Log,
motherVolume,
false,
0);
translation = translation + thick;
thick = 0.01*cm;
// Mylar layer
G4Material* mylar = pMaterial -> GetMaterial("mylar");
G4Box* layer2 = new G4Box("layer2",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer2Log = new G4LogicalVolume(layer2,
mylar,
"layer2Log",
0,0,0);
layer2Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer2Phys",
layer2Log,
motherVolume,
false,0);
// Nextel layer
G4Material* nextel = pMaterial -> GetMaterial("Nextel312AF62");
translation = translation + thick;
thick = 0.1*cm;
G4Box* layer3 = new G4Box("layer3",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer3Log = new G4LogicalVolume(layer3,
nextel,
"layer3Log",
0,0,0);
layer3Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer3Phys",
layer3Log,
motherVolume,
false,0);
translation = translation + thick;
thick = 10.06*cm;
G4Material* vacuum = pMaterial -> GetMaterial("Galactic") ;
G4Box* layer4 = new G4Box("layer4",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer4Log = new G4LogicalVolume(layer4,
vacuum,
"layer4Log",
0,0,0);
layer4Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer4Phys",
layer4Log,
motherVolume,
false,0);
// Nextel layer
thick = 0.1*cm;
translation = translation + 10.06*cm;
layer5Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer5Phys",
layer3Log,
motherVolume,
false,0);
//Vacuum layer
translation = translation + thick;
thick = 10.06 * cm;
layer6Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer6Phys",
layer4Log,
motherVolume,
false,0);
// Nextel layer
translation = translation + thick;
thick = 0.2*cm;
layer7Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+ translation),
"layer7Phys",
layer3Log,
motherVolume,
false,0);
// mylar layer
translation = translation + thick;
thick = 0.20 *cm;
G4Box* layer8 = new G4Box("layer8",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer8Log = new G4LogicalVolume(layer8,
mylar,
"layer8Log",
0,0,0);
layer8Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer8Phys",
layer8Log,
motherVolume,
false,0);
//Vacuum layer
translation = translation + thick;
thick = 10.06 * cm;
layer9Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer6Phys",
layer4Log,
motherVolume,
false,0);
// mylar layer
translation = translation + thick;
thick = 0.2 *cm;
G4Box* layer10 = new G4Box("layer10",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer10Log = new G4LogicalVolume(layer10,
mylar,
"layer10Log",
0,0,0);
layer10Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer10Phys",
layer10Log,
motherVolume,
false,0);
//Redundant Bladder
//Polyethylene
G4Material* polyethilene = pMaterial -> GetMaterial("polyethylene");
translation = translation + thick;
thick = 0.0028*cm;
G4Box* layer11 = new G4Box("layer11", sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer11Log = new G4LogicalVolume(layer11,
polyethilene,
"layer11Log",
0,0,0);
layer11Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer11Phys",
layer11Log,
motherVolume,
false,0);
//ployacrylate
translation = translation + thick;
thick = 0.0028*cm;
G4Material* polyacrylate = pMaterial ->GetMaterial("polyacrylate");
G4LogicalVolume* layer12Log = new G4LogicalVolume(layer11,
polyacrylate,
"layer12Log",
0,0,0);
layer12Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer12Phys",
layer12Log,
motherVolume,
false,0);
//evoh layer
translation = translation + thick;
thick = 0.0028*cm;
G4Material* evoh = pMaterial ->GetMaterial("evoh");
G4LogicalVolume* layer13Log = new G4LogicalVolume(layer11,
evoh,
"layer13Log",
0,0,0);
layer13Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer13Phys",
layer13Log,
motherVolume,
false,0);
//polyacrylate
translation = translation + thick;
thick = 0.0028*cm;
layer14Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer14Phys",
layer12Log,
motherVolume,
false,0);
//polyethilene
translation = translation + thick;
thick = 0.0028*cm;
layer15Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer15Phys",
layer11Log,
motherVolume,
false,0);
//kevlar layer
translation = translation + thick;
thick = 0.026*cm;
G4Material* kevlarAir = pMaterial -> GetMaterial("kevlarAir");
G4Box* layer = new G4Box("layer",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layerLog = new G4LogicalVolume(layer,
kevlarAir,
"layerLog",
0,0,0);
layerPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layerPhys",
layerLog,
motherVolume,
false,0);
//polyethilene layer
translation = translation + thick;
thick = 0.0028*cm;
layer16Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer16Phys",
layer11Log,
motherVolume,
false,0);
//polyacrylate layer
translation = translation + thick;
thick = 0.0028*cm;
layer17Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer17Phys",
layer12Log,
motherVolume,
false,0);
//evoh
translation = translation + thick;
thick = 0.0028*cm;
layer18Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer18Phys",
layer13Log,
motherVolume,
false,0);
//polyacrylate layer
translation = translation + thick;
thick = 0.0028*cm;
layer19Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer19Phys",
layer12Log,
motherVolume,
false,0);
//polyethilene layer
translation = translation + thick;
thick = 0.0028*cm;
layer20Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer20Phys",
layer11Log,
motherVolume,
false,0);
//kevlar layer
translation = translation + thick;
thick = 0.026*cm;
layer21Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer21Phys",
layerLog,
motherVolume,
false,0);
//polyethilene layer
translation = translation + thick;
thick = 0.0028*cm;
layer22Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer22Phys",
layer11Log,
motherVolume,
false,0);
//polyacrylate layer
translation = translation + thick;
thick = 0.0028*cm;
layer23Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer23Phys",
layer12Log,
motherVolume,
false,0);
//evoh layer
translation = translation + thick;
thick = 0.0028*cm;
layer24Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer24Phys",
layer13Log,
motherVolume,
false,0);
//polyacrylate layer
translation = translation + thick;
thick = 0.0028*cm;
layer25Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer25Phys",
layer12Log,
motherVolume,
false,0);
//polyethilene layer
translation = translation + thick;
thick = 0.0028*cm;
layer26Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer26Phys",
layer11Log,
motherVolume,
false,0);
//nomex layer
translation = translation + thick;
thick = 0.03*cm;
G4Material* nomex= pMaterial ->GetMaterial("nomexAir");
G4Box* layer27 = new G4Box("layer27",sizeX/2.,sizeY/2.,thick/2.);
G4LogicalVolume* layer27Log = new G4LogicalVolume(layer27,
nomex,
"layer27Log",
0,0,0);
layer27Phys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,thick/2.+translation),
"layer27Phys",
layer27Log,
motherVolume,
false,0);
translation = translation + thick;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Colour green (0.0,1.0,0.0);
G4VisAttributes* layer1VisAtt = new G4VisAttributes(green);
layer1VisAtt -> SetVisibility(true);
layer1VisAtt -> SetForceSolid(true);
layer1Log -> SetVisAttributes(layer1VisAtt);
layer3Log -> SetVisAttributes(layer1VisAtt);
layer8Log -> SetVisAttributes(layer1VisAtt);
layer11Log -> SetVisAttributes(layer1VisAtt);
layer13Log -> SetVisAttributes(layer1VisAtt);
G4VisAttributes* layer2VisAtt = new G4VisAttributes(magenta);
layer2VisAtt -> SetVisibility(true);
layer2VisAtt -> SetForceSolid(true);
layer2Log -> SetVisAttributes(layer2VisAtt);
layer4Log -> SetVisAttributes(layer2VisAtt);
layer10Log -> SetVisAttributes(layer2VisAtt);
layer12Log -> SetVisAttributes(layer2VisAtt);
layer27Log -> SetVisAttributes(layer2VisAtt);
}
void RemSimVehicle1::DestroyComponent()
{
}
@@ -23,37 +23,45 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// **********************************
// * *
// * RemSimEventAction.cc *
// * *
// **********************************
//
//
// $Id$
//
// Author : Susanna Guatelli, guatelli@ge.infn.it
// Authors: S. Guatelli and J. Davis, CMPR, UOW
//
#include "RemSimEventAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "RunAction.hh"
#include "AnalysisManager.hh"
#include "G4SystemOfUnits.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
//##include "Randomize.hh"
//#include "CLHEP/Random/RandEngine.h"
RemSimEventAction::RemSimEventAction():evtNo(-1)
{}
RemSimEventAction::~RemSimEventAction()
{}
void RemSimEventAction::BeginOfEventAction(const G4Event* evt)
#include "G4Run.hh"
RunAction::RunAction(AnalysisManager* analysis)
:analysisMan(analysis)
{
evtNo = evt -> GetEventID();
G4int printModul = 500;
if (evtNo%printModul == 0)
G4cout << "\n---> Begin Of Event: " << evtNo << G4endl;
}
void RemSimEventAction::EndOfEventAction(const G4Event*)
RunAction::~RunAction()
{
}
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4int run_number = aRun->GetRunID();
G4cout << "### Run " << run_number << " start." << G4endl;
#ifdef ANALYSIS_USE
// Create ROOT file, histograms and ntuple
analysisMan -> book();
#endif
}
void RunAction::EndOfRunAction(const G4Run* aRun)
{
G4cout << "Number of events = " << aRun->GetNumberOfEvent() << G4endl;
#ifdef ANALYSIS_USE
// Close the output ROOT file with the results
analysisMan -> finish();
#endif
}
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
// code based on the basic example B2
//
#include "SensitiveDetector.hh"
#include "G4HCofThisEvent.hh"
#include "G4Step.hh"
#include "G4ThreeVector.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
#include "G4SystemOfUnits.hh"
SensitiveDetector::SensitiveDetector(const G4String& name,
const G4String& hitsCollectionName, AnalysisManager* analysis_manager)
: G4VSensitiveDetector(name),
fHitsCollection(NULL)
{
collectionName.insert(hitsCollectionName);
analysis = analysis_manager;
}
SensitiveDetector::~SensitiveDetector()
{}
void SensitiveDetector::Initialize(G4HCofThisEvent* hce)
{
// Create hits collection
fHitsCollection
= new SensitiveDetectorHitsCollection(SensitiveDetectorName, collectionName[0]);
// Add this collection in hce
G4int hcID
= G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
hce->AddHitsCollection( hcID, fHitsCollection );
}
G4bool SensitiveDetector::ProcessHits(G4Step* aStep,
G4TouchableHistory*)
{
// energy deposit
G4double edep = aStep->GetTotalEnergyDeposit();
if (edep==0.) return false;
G4String volumeName = aStep -> GetPreStepPoint() -> GetPhysicalVolume()-> GetName();
if(volumeName != "SV_phys1")
return false;
SensitiveDetectorHit* newHit = new SensitiveDetectorHit();
newHit -> SetEdep(edep);
fHitsCollection -> insert( newHit );
return true;
}
void SensitiveDetector::EndOfEvent(G4HCofThisEvent*)
{
#ifdef ANALYSIS_USE
// Initialisation of total energy deposition per event to zero
G4double totalEdepInOneEvent =0;
G4int NbHits = fHitsCollection->entries();
//G4cout << "number of hits " <<NbHits << G4endl;
for (G4int i=0;i<NbHits;i++)
{
G4double edep = (*fHitsCollection)[i]->GetEdep();
totalEdepInOneEvent = totalEdepInOneEvent + edep;
}
if (totalEdepInOneEvent!=0)analysis-> StoreEnergyDeposition(totalEdepInOneEvent/keV);
#endif
}
@@ -23,35 +23,58 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
// ***************************
// * *
// * RemSimDecorator.cc *
// * *
// ***************************
// Code based on basic example B02
//
// $Id$
//
// Author:Susanna Guatelli, guatelli@ge.infn.it
//
#include "RemSimVGeometryComponent.hh"
#include "RemSimDecorator.hh"
#include "SensitiveDetectorHit.hh"
#include "G4UnitsTable.hh"
#include "G4VVisManager.hh"
#include "G4Circle.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
RemSimDecorator::RemSimDecorator(RemSimVGeometryComponent* geoComponent)
: component(geoComponent)
#include <iomanip>
// THIS IS NECESSARY FOR MT MODE
G4ThreadLocal G4Allocator<SensitiveDetectorHit>* SensitiveDetectorHitAllocator=0;
SensitiveDetectorHit::SensitiveDetectorHit()
: G4VHit(),
fEdep(0.)
{}
SensitiveDetectorHit::~SensitiveDetectorHit() {}
SensitiveDetectorHit::SensitiveDetectorHit(const SensitiveDetectorHit& right)
: G4VHit()
{
fEdep = right.fEdep;
}
RemSimDecorator::~RemSimDecorator()
{;}
void RemSimDecorator::ConstructComponent(G4VPhysicalVolume* motherVolume)
const SensitiveDetectorHit& SensitiveDetectorHit::operator=(const SensitiveDetectorHit& right)
{
component -> ConstructComponent(motherVolume) ;
}
fEdep = right.fEdep;
void RemSimDecorator::DestroyComponent()
{
component -> DestroyComponent();
return *this;
}
G4int SensitiveDetectorHit::operator==(const SensitiveDetectorHit& right) const
{
return ( this == &right ) ? 1 : 0;
}
void SensitiveDetectorHit::Draw()
{
}
void SensitiveDetectorHit::Print()
{
G4cout
<< "HIT: Edep: "
<< std::setw(7) << G4BestUnit(fEdep,"Energy")
<< G4endl;
}
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: Susanna Guatelli, susanna@uow.edu.au,
// Authors: Jeremy Davis, jad028@uowmail.edu.au
//
#include "G4ios.hh"
#include "G4SteppingManager.hh"
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4StepPoint.hh"
#include "G4VPhysicalVolume.hh"
#include "SteppingAction.hh"
#include "AnalysisManager.hh"
#include "G4SystemOfUnits.hh"
SteppingAction::SteppingAction(AnalysisManager* pAnalysis)
{
analysis = pAnalysis;
fSecondary = 0;
}
SteppingAction::~SteppingAction()
{
}
void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4SteppingManager* steppingManager = fpSteppingManager;
G4Track* theTrack = aStep -> GetTrack();
// check if it is alive
if(theTrack-> GetTrackStatus() == fAlive) { return; }
// Retrieve the secondary particles
fSecondary = steppingManager -> GetfSecondary();
#ifdef ANALYSIS_USE
for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++)
{
// Retrieve the info about the generation of secondary particles
G4String volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName(); // volume where secondary was generated
G4String secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName(); // name of the secondary
G4double secondaryParticleKineticEnergy = (*fSecondary)[lp1] -> GetKineticEnergy(); // kinetic energy
// G4String process = (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName(); // process creating it
G4double charge = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetPDGCharge();
G4int AA = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetBaryonNumber();
if (volumeName == "SV_phys1")
//Testing with larger volume!
//if (volumeName == "DiaVol_phys")
{
if ((secondaryParticleName == "proton") ||
(secondaryParticleName == "neutron")||
(secondaryParticleName == "alpha") ||
(secondaryParticleName == "deuton") ||
(secondaryParticleName == "triton") ||
(secondaryParticleName == "He3") ||
(secondaryParticleName =="GenericIon"))
analysis -> FillSecondaries(AA, charge, secondaryParticleKineticEnergy/MeV);
}
}
#endif
}