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
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
// $Id$
// $Id: DetectorConstruction.cc 68198 2013-03-18 16:39:51Z maire $
//
/////////////////////////////////////////////////////////////////////////
//
@@ -38,6 +38,7 @@
//
////////////////////////////////////////////////////////////////////////
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
@@ -69,11 +70,14 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
/////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
DetectorConstruction::DetectorConstruction(PrimaryGeneratorAction* p)
: fPhysWorld(0), fLogicWorld(0), fLogicWind(0), fLogicDet(0),
fTargetSD(0), fRegGasDet(0), fPrimaryGenerator(p)
: G4VUserDetectorConstruction(),
fGasMat(0), fWindowMat(0), fWorldMaterial(0),
fPhysWorld(0), fLogicWorld(0), fLogicWind(0), fLogicDet(0),
fDetectorMessenger(0), fTargetSD(0), fGasDetectorCuts(0),
fRegGasDet(0), fPrimaryGenerator(p)
{
fGasThickness = 23.0*mm;
fGasRadius = 10.*cm;
@@ -92,7 +96,7 @@ DetectorConstruction::DetectorConstruction(PrimaryGeneratorAction* p)
fGasDetectorCuts->SetProductionCut(cut,"proton");
}
//////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
DetectorConstruction::~DetectorConstruction()
{
@@ -100,7 +104,7 @@ DetectorConstruction::~DetectorConstruction()
delete fGasDetectorCuts;
}
//////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::DefineMaterials()
{
@@ -225,7 +229,7 @@ void DetectorConstruction::DefineMaterials()
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
}
/////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* DetectorConstruction::Construct()
{
@@ -258,22 +262,23 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
<< fWindowThick/mm << "mm of " << fWindowMat->GetName() << G4endl;
G4cout << " The TARGET is made of "
<< fGasThickness/mm << "mm of " << fGasMat->GetName() ;
G4cout << ", the transverse size (R) is " << fGasRadius/mm << " mm. " << G4endl;
G4cout << ", the transverse size (R) is " << fGasRadius/mm << " mm. "
<< G4endl;
G4cout << G4endl;
// World
G4Tubs* SolidWorld = new G4Tubs("World",
0.,worldSizeR,worldSizeZ/2.,0.,CLHEP::twopi);
fLogicWorld = new G4LogicalVolume(SolidWorld, fWorldMaterial, "World");
fLogicWorld = new G4LogicalVolume(SolidWorld, fWorldMaterial, "World");
fPhysWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(0.,0.,0.),
"World",
fLogicWorld,
0, //its mother volume
false, //no boolean operation
0); //copy number
0, //its mother volume
false, //no boolean operation
0); //copy number
// Window
G4Tubs* wind = new G4Tubs("Absorber",
@@ -281,15 +286,18 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
fLogicWind = new G4LogicalVolume(wind, fWindowMat, "Window");
G4PVPlacement* PhysWind = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "Window",
fLogicWind, fPhysWorld, false, 0);
G4PVPlacement* PhysWind = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
"Window", fLogicWind,
fPhysWorld, false, 0);
// Detector volume
G4Tubs* det = new G4Tubs("Gas", 0., fGasRadius, fGasThickness/2., 0., CLHEP::twopi);
G4Tubs* det = new G4Tubs("Gas", 0., fGasRadius, fGasThickness/2.,
0., CLHEP::twopi);
fLogicDet = new G4LogicalVolume(det, fGasMat, "Gas");
new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "Gas", fLogicDet, PhysWind, false, 0);
new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "Gas", fLogicDet, PhysWind,
false, 0);
fRegGasDet->AddRootLogicalVolume(fLogicDet);
@@ -315,7 +323,7 @@ G4VPhysicalVolume* DetectorConstruction::Construct()
return fPhysWorld;
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetGasMaterial(const G4String& name)
{
@@ -335,7 +343,7 @@ void DetectorConstruction::SetGasMaterial(const G4String& name)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetContainerMaterial(const G4String& name)
{
@@ -355,7 +363,7 @@ void DetectorConstruction::SetContainerMaterial(const G4String& name)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetWorldMaterial(const G4String& name)
{
@@ -375,7 +383,7 @@ void DetectorConstruction::SetWorldMaterial(const G4String& name)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetGasThickness(G4double val)
{
@@ -385,7 +393,7 @@ void DetectorConstruction::SetGasThickness(G4double val)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetGasRadius(G4double val)
{
@@ -395,7 +403,7 @@ void DetectorConstruction::SetGasRadius(G4double val)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetContainerThickness(G4double val)
{
@@ -405,7 +413,7 @@ void DetectorConstruction::SetContainerThickness(G4double val)
}
}
///////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorConstruction::SetPairEnergy(G4double val)
{
@@ -414,4 +422,4 @@ void DetectorConstruction::SetPairEnergy(G4double val)
}
}
////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/DetectorMessenger.cc
/// \brief Implementation of the DetectorMessenger class
//
// $Id$
// $Id: DetectorMessenger.cc 68198 2013-03-18 16:39:51Z maire $
//
/////////////////////////////////////////////////////////////////////////
//
@@ -47,10 +47,18 @@
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
///////////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
DetectorMessenger::DetectorMessenger(DetectorConstruction * det)
: fDetector(det)
: G4UImessenger(),fDetector(det),
fDetDir(0),
fGasMaterCmd(0),
fGasThickCmd(0),
fGasRadCmd(0),
fWinThickCmd(0),
fWindowMaterCmd(0),
fWorldMaterCmd(0),
fIonCmd(0)
{
fDetDir = new G4UIdirectory("/testem/");
fDetDir->SetGuidance("Detector control.");
@@ -101,13 +109,12 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * det)
fIonCmd->SetGuidance("Set energy per electron-ion pair for detector");
fIonCmd->SetParameterName("en",false,false);
fIonCmd->SetUnitCategory("Energy");
fIonCmd->SetDefaultUnit("eV");
fIonCmd->SetDefaultUnit("MeV");
fIonCmd->SetRange("en>0.");
fIonCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fIonCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
//////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
DetectorMessenger::~DetectorMessenger()
{
@@ -121,7 +128,7 @@ DetectorMessenger::~DetectorMessenger()
delete fDetDir;
}
//////////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
@@ -155,4 +162,4 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
}
}
/////////////////////////////////////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/EventAction.cc
/// \brief Implementation of the EventAction class
//
// $Id$
// $Id: EventAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//---------------------------------------------------------------------------
//
@@ -45,6 +45,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
EventAction::EventAction()
: G4UserEventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/Histo.cc
/// \brief Implementation of the Histo class
//
// $Id$
// $Id: Histo.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//---------------------------------------------------------------------------
//
@@ -49,8 +49,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Histo::Histo()
: fManager(0),
fMessenger(0)
{
fManager = 0;
fMessenger = new HistoMessenger(this);
fHistName = "test";
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/HistoManager.cc
/// \brief Implementation of the HistoManager class
//
// $Id$
// $Id: HistoManager.cc 78171 2013-12-04 13:22:18Z gunter $
//
//---------------------------------------------------------------------------
//
@@ -47,6 +47,7 @@
#include "G4LossTableManager.hh"
#include "G4ElectronIonPair.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -65,6 +66,8 @@ HistoManager* HistoManager::GetPointer()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
HistoManager::HistoManager()
: fHisto(0),
fElIonPair(0)
{
fNHisto = 2;
fVerbose = 1;
@@ -72,8 +75,25 @@ HistoManager::HistoManager()
fBinsE = 100;
fBinsCluster = 200;
// normalisation to PAI
fFactorALICE = 325;
// normalisation to Opt0
//fFactorALICE = 275;
fEvt = 0.0;
fTotStepGas = 0.0;
fTotCluster = 0.0;
fMeanCluster= 0.0;
fOverflow = 0.0;
fTotEdep = 0.0;
fStepGas = 0;
fCluster = 0;
fHistoBooked = false;
fHisto = new Histo();
bookHisto();
fElIonPair = G4LossTableManager::Instance()->ElectronIonPair();
}
@@ -86,27 +106,27 @@ HistoManager::~HistoManager()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void HistoManager::bookHisto()
{
fHisto->Add1D("10","Energy deposition in detector (keV)",
fBinsE,0.0,fMaxEnergy/keV,1.0);
fHisto->Add1D("11","Number of primary clusters",
fBinsCluster,-0.5,fBinsCluster-0.5,1.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void HistoManager::BeginOfRun()
{
// initilise scoring
fEvt = 0.0;
fTotStepGas = 0.0;
fTotCluster = 0.0;
fOverflow = 0.0;
fMeanCluster= 0.0;
fOverflow = 0.0;
if(fHisto->IsActive() && !fHistoBooked) {
fHisto->Add1D("10","Energy deposition in detector (keV)",
fBinsE,0.0,fMaxEnergy/keV,1.0);
fHisto->Add1D("11","Number of primary clusters",
fBinsCluster,-0.5,fBinsCluster-0.5,1.0);
fHisto->Add1D("12","Energy deposition in detector (ADC)",
200,0.0,2000,1.0);
if(fHisto->IsActive()) {
fHisto->Activate(0, true);
fHisto->Activate(1, true);
fHisto->Activate(2, true);
}
fHisto->Book();
@@ -127,9 +147,10 @@ void HistoManager::EndOfRun()
G4double norm = fEvt;
if(fEvt > 0.0) { norm = 1.0/norm; }
fTotStepGas *= norm;
fTotCluster *= norm;
fOverflow *= norm;
fTotStepGas *= norm;
fTotCluster *= norm;
fMeanCluster *= norm;
fOverflow *= norm;
G4double y1 = 0.0;
G4double y2 = 0.0;
@@ -152,15 +173,26 @@ void HistoManager::EndOfRun()
G4cout << " ================== run summary =====================" << G4endl;
G4int prec = G4cout.precision(5);
G4cout << " End of Run TotNbofEvents = " <<
G4int(fEvt) << G4endl ;
G4cout << " End of Run TotNbofEvents = "
<< G4int(fEvt) << G4endl;
G4cout << " Energy(keV) per ADC channel = "
<< 1.0/(keV*fFactorALICE) << G4endl;
/*
G4double p1 = 1*GeV;
G4double p2 = 3*GeV;
G4double mass = proton_mass_c2;
G4cout << std::sqrt(p1*p1 + mass*mass) - mass << " "
<< std::sqrt(p2*p2 + mass*mass) - mass << G4endl;
*/
G4cout << G4endl;
G4cout << " Mean energy deposit in absorber = " <<
y1/keV << " +- " << y2*std::sqrt(norm)/keV << " keV; ";
if(y1 > 0.0) { G4cout << " RMS/Emean = " << y2/y1; }
G4cout << G4endl;
G4cout << " Mean number of steps in absorber= "
<< fTotStepGas << "; mean number of ion-clusters = " << fTotCluster
<< fTotStepGas << "; mean number of ion-clusters = "
<< fTotCluster
<< " MeanCluster= " << fMeanCluster
<< G4endl;
G4cout << G4endl;
@@ -184,11 +216,15 @@ void HistoManager::EndOfRun()
x1 += de;
}
G4cout.precision(prec);
// normalise histograms
fHisto->ScaleH1(0,norm);
fHisto->ScaleH1(1,norm);
fHisto->Save();
if(fHisto->IsActive() && !fHistoBooked) {
fHisto->ScaleH1(0,norm);
fHisto->ScaleH1(1,norm);
// fHisto->ScaleH1(2,0.05);
fHisto->ScaleH1(2,0.1);
fHisto->Save();
}
G4cout << " ================== run end ==========================" << G4endl;
}
@@ -217,20 +253,24 @@ void HistoManager::EndOfEvent()
// fill histo
fHisto->Fill(0,fTotEdep/keV,1.0);
fHisto->Fill(1,fCluster,1.0);
fHisto->Fill(2,fTotEdep*fFactorALICE/keV,1.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::AddEnergy(G4double edep, G4Step* step)
void HistoManager::AddEnergy(G4double edep, const G4Step* step)
{
if(1 < fVerbose) {
G4cout << "HistoManager::AddEnergy: e(keV)= " << edep/keV
<< G4endl;
}
fTotEdep += edep;
if(step->GetTrack()->GetTrackID() == 1) { fStepGas += 1.0; }
if(step) {
if(1 == step->GetTrack()->GetTrackID()) { fStepGas += 1.0; }
fCluster += fElIonPair->SampleNumberOfIonsAlongStep(step);
fMeanCluster += fElIonPair->MeanNumberOfIonsAlongStep(step);
fCluster += fElIonPair->SampleNumberOfIonsAlongStep(step);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -27,7 +27,7 @@
/// \brief Implementation of the HistoMessenger class
//
//
// $Id$
// $Id: HistoMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,7 +45,11 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoMessenger::HistoMessenger(Histo* hist)
:fHisto(hist)
:G4UImessenger(),fHisto(hist),
fHistoDir(0),
fFactoryCmd(0),
fFileCmd(0),
fHistoCmd(0)
{
fHistoDir = new G4UIdirectory("/testem/histo/");
fHistoDir->SetGuidance("histograms control");
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
// $Id$
// $Id: PhysicsList.cc 77094 2013-11-21 10:51:54Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -55,7 +55,7 @@
#include "G4DecayPhysics.hh"
#include "G4PAIModel.hh"
#include "G4PAIPhotonModel.hh"
#include "G4PAIPhotModel.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
@@ -75,7 +75,12 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList() : G4VModularPhysicsList()
PhysicsList::PhysicsList() : G4VModularPhysicsList(),
fConfig(0),
fEmPhysicsList(0),
fDecayPhysicsList(0),
fStepMaxProcess(0),
fMessenger(0)
{
fConfig = G4LossTableManager::Instance()->EmConfigurator();
G4LossTableManager::Instance()->SetVerbose(1);
@@ -124,7 +129,8 @@ void PhysicsList::ConstructProcess()
AddTransportation();
fEmPhysicsList->ConstructProcess();
fDecayPhysicsList->ConstructProcess();
for(size_t i=0; i<fHadronPhys.size(); ++i) { fHadronPhys[i]->ConstructProcess(); }
for(size_t i=0; i<fHadronPhys.size(); ++i) {
fHadronPhys[i]->ConstructProcess(); }
AddStepMax();
}
@@ -262,7 +268,7 @@ void PhysicsList::SetCutForPositron(G4double cut)
void PhysicsList::SetCutForProton(G4double cut)
{
fCutForPositron = cut;
fCutForProton = cut;
SetParticleCuts(fCutForProton, G4Proton::Proton());
}
@@ -302,7 +308,7 @@ void PhysicsList::NewPAIModel(const G4ParticleDefinition* part,
fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
0.0,100.*TeV,pai);
} else if(modname == "pai_photon") {
G4PAIPhotonModel* pai = new G4PAIPhotonModel(part,"PAIPhotModel");
G4PAIPhotModel* pai = new G4PAIPhotModel(part,"PAIPhotModel");
fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
0.0,100.*TeV,pai);
}
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/PhysicsListMessenger.cc
/// \brief Implementation of the PhysicsListMessenger class
//
// $Id$
// $Id: PhysicsListMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//---------------------------------------------------------------------------
//
@@ -53,7 +53,12 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:fPhysicsList(pPhys)
:G4UImessenger(),fPhysicsList(pPhys),
fECmd(0),
fEBCmd(0),
fCBCmd(0),
fListCmd(0),
fADCCmd(0)
{
fECmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this);
fECmd->SetGuidance("Set max energy deposit");
@@ -78,6 +83,14 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
fListCmd->AvailableForStates(G4State_PreInit);
fADCCmd = new G4UIcmdWithADoubleAndUnit("/testem/setEnergyPerChannel",this);
fADCCmd->SetGuidance("Set energy per ADC channel");
fADCCmd->SetParameterName("enadc",false,false);
fADCCmd->SetUnitCategory("Energy");
fADCCmd->SetDefaultUnit("keV");
fADCCmd->SetRange("enadc>0.");
fADCCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -88,6 +101,7 @@ PhysicsListMessenger::~PhysicsListMessenger()
delete fEBCmd;
delete fCBCmd;
delete fListCmd;
delete fADCCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -107,6 +121,9 @@ void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
if( command == fListCmd )
{ fPhysicsList->AddPhysicsList(newValue); }
if( command == fADCCmd )
{ man->SetEnergyPerChannel(fADCCmd->GetNewDoubleValue(newValue)); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/PrimaryGeneratorAction.cc
/// \brief Implementation of the PrimaryGeneratorAction class
//
// $Id$
// $Id: PrimaryGeneratorAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
/////////////////////////////////////////////////////////////////////////
//
@@ -50,6 +50,8 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0)
{
fParticleGun = new G4ParticleGun(1);
fParticleGun->SetParticleDefinition(G4Electron::Electron());
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/RunAction.cc
/// \brief Implementation of the RunAction class
//
// $Id$
// $Id: RunAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//---------------------------------------------------------------------------
//
@@ -48,6 +48,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RunAction::RunAction()
: G4UserRunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file electromagnetic/TestEm5/src/StackingAction.cc
/// \brief Implementation of the StackingAction class
//
// $Id: StackingAction.cc,v 1.8 2009-03-06 18:04:23 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StackingAction.hh"
#include "HistoManager.hh"
#include "StackingMessenger.hh"
#include "G4Track.hh"
#include "G4Step.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::StackingAction()
: G4UserStackingAction(),
fKillSecondary(false),
fStackMessenger(0),
fHisto(HistoManager::GetPointer())
{
fStackMessenger = new StackingMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::~StackingAction()
{
delete fStackMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
StackingAction::ClassifyNewTrack(const G4Track* aTrack)
{
//stack or delete secondaries
G4ClassificationOfNewTrack status = fUrgent;
//keep primary particle
if (aTrack->GetParentID() == 0 || !fKillSecondary) { return status; }
// charged tracks are killed only inside sensitive volumes
if(aTrack->GetVolume()->GetLogicalVolume()->GetSensitiveDetector() &&
aTrack->GetDefinition()->GetPDGCharge() != 0.0)
{
fHisto->AddEnergy(aTrack->GetKineticEnergy(), 0);
status = fKill;
}
return status;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file electromagnetic/TestEm5/src/StackingMessenger.cc
/// \brief Implementation of the StackingMessenger class
//
// $Id: StackingMessenger.cc,v 1.5 2006-09-25 17:06:29 maire Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StackingMessenger.hh"
#include "StackingAction.hh"
#include "G4UIcmdWithABool.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingMessenger::StackingMessenger(StackingAction* stack)
:G4UImessenger(),fStackAction(stack),fKillCmd(0)
{
fKillCmd = new G4UIcmdWithABool("/testem/killSecondaries",this);
fKillCmd->SetGuidance("Kill secondary charged particles");
fKillCmd->SetParameterName("choice",true);
fKillCmd->SetDefaultValue(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingMessenger::~StackingMessenger()
{
delete fKillCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void StackingMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if(command == fKillCmd)
{fStackAction->SetKillStatus(fKillCmd->GetNewBoolValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/StepMax.cc
/// \brief Implementation of the StepMax class
//
// $Id$
// $Id: StepMax.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -39,7 +39,8 @@
StepMax::StepMax(const G4String& processName)
: G4VDiscreteProcess(processName),
fMaxChargedStep(DBL_MAX)
fMaxChargedStep(DBL_MAX),
fMessenger(0)
{
fMessenger = new StepMaxMessenger(this);
}
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/StepMaxMessenger.cc
/// \brief Implementation of the StepMaxMessenger class
//
// $Id$
// $Id: StepMaxMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,7 +40,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StepMaxMessenger::StepMaxMessenger(StepMax* stepM)
:fStepMax(stepM)
:G4UImessenger(),fStepMax(stepM),fStepMaxCmd(0)
{
fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepmax",this);
fStepMaxCmd->SetGuidance("Set max allowed step length");
@@ -26,7 +26,7 @@
/// \file electromagnetic/TestEm8/src/TargetSD.cc
/// \brief Implementation of the TargetSD class
//
// $Id$
// $Id: TargetSD.cc 66241 2012-12-13 18:34:42Z gunter $
//
/////////////////////////////////////////////////////////////////////////
//