Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorConstruction.cc,v 1.21 2004/11/14 10:12:08 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: ExN03DetectorConstruction.cc,v 1.22 2005/11/14 16:17:20 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -196,7 +196,7 @@ steam->AddMaterial(H2O, fractionmass=1.);
|
||||
|
||||
G4Material* Vacuum =
|
||||
new G4Material("Galactic", z=1., a=1.01*g/mole,density= universe_mean_density,
|
||||
kStateGas, 3.e-18*pascal, 2.73*kelvin);
|
||||
kStateGas, 2.73*kelvin, 3.e-18*pascal);
|
||||
|
||||
G4Material* beam =
|
||||
new G4Material("Beam", density= 1.e-5*g/cm3, ncomponents=1,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03DetectorMessenger.cc,v 1.9 2003/09/15 15:38:18 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventAction.cc,v 1.24 2005/05/30 14:24:31 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: ExN03EventAction.cc,v 1.26 2005/12/06 10:48:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "ExN03EventAction.hh"
|
||||
|
||||
#include "ExN03RunAction.hh"
|
||||
#include "ExN03EventActionMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
@@ -43,8 +45,8 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
ExN03EventAction::ExN03EventAction()
|
||||
:drawFlag("all"),printModulo(1),eventMessenger(0)
|
||||
ExN03EventAction::ExN03EventAction(ExN03RunAction* run)
|
||||
:runAct(run),drawFlag("all"),printModulo(1),eventMessenger(0)
|
||||
{
|
||||
eventMessenger = new ExN03EventActionMessenger(this);
|
||||
}
|
||||
@@ -63,7 +65,7 @@ void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0) {
|
||||
G4cout << "\n---> Begin of event: " << evtNb << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
CLHEP::HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
// initialisation per event
|
||||
@@ -75,8 +77,13 @@ void ExN03EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
|
||||
void ExN03EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
//accumulates statistic
|
||||
//
|
||||
runAct->fillPerEvent(EnergyAbs, EnergyGap, TrackLAbs, TrackLGap);
|
||||
|
||||
//print per event (modulo n)
|
||||
//
|
||||
G4int evtNb = evt->GetEventID();
|
||||
|
||||
if (evtNb%printModulo == 0) {
|
||||
G4cout << "---> End of event: " << evtNb << G4endl;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03EventActionMessenger.cc,v 1.9 2002/12/16 16:37:27 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PhysicsList.cc,v 1.18 2004/03/19 14:58:21 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: ExN03PhysicsList.cc,v 1.19 2005/10/15 14:58:34 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -159,105 +159,40 @@ void ExN03PhysicsList::ConstructEM()
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
// gamma
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering);
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion);
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeminusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeminusMultipleScattering);
|
||||
pmanager->AddProcess(theeminusIonisation);
|
||||
pmanager->AddProcess(theeminusBremsstrahlung);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
|
||||
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxAlongStep,3);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
|
||||
//electron
|
||||
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
|
||||
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* theeplusIonisation = new G4eIonisation();
|
||||
G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(theeplusMultipleScattering);
|
||||
pmanager->AddProcess(theeplusIonisation);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung);
|
||||
pmanager->AddProcess(theeplusAnnihilation);
|
||||
//
|
||||
// set ordering for AtRestDoIt
|
||||
pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
|
||||
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxAlongStep,3);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
|
||||
pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
|
||||
//positron
|
||||
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
|
||||
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
|
||||
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
|
||||
|
||||
} else if( particleName == "mu+" ||
|
||||
} else if( particleName == "mu+" ||
|
||||
particleName == "mu-" ) {
|
||||
//muon
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
|
||||
G4VProcess* aPairProduction = new G4MuPairProduction();
|
||||
G4VProcess* anIonisation = new G4MuIonisation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
pmanager->AddProcess(aBremsstrahlung);
|
||||
pmanager->AddProcess(aPairProduction);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
|
||||
pmanager->SetProcessOrdering(aBremsstrahlung, idxAlongStep,3);
|
||||
pmanager->SetProcessOrdering(aPairProduction, idxAlongStep,4);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
|
||||
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
|
||||
pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
|
||||
|
||||
//muon
|
||||
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
|
||||
pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
|
||||
pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
|
||||
pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
|
||||
|
||||
} else if ((!particle->IsShortLived()) &&
|
||||
(particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")) {
|
||||
// all others charged particles except geantino
|
||||
G4VProcess* aMultipleScattering = new G4MultipleScattering();
|
||||
G4VProcess* anIonisation = new G4hIonisation();
|
||||
//
|
||||
// add processes
|
||||
pmanager->AddProcess(anIonisation);
|
||||
pmanager->AddProcess(aMultipleScattering);
|
||||
//
|
||||
// set ordering for AlongStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
|
||||
//
|
||||
// set ordering for PostStepDoIt
|
||||
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
|
||||
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
|
||||
//all others charged particles except geantino
|
||||
pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
|
||||
pmanager->AddProcess(new G4hIonisation, -1, 2,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorAction.cc,v 1.7 2003/09/15 15:38:18 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03PrimaryGeneratorMessenger.cc,v 1.8 2002/12/16 16:37:27 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: ExN03RunAction.cc,v 1.15 2003/11/25 16:50:13 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: ExN03RunAction.cc,v 1.16 2005/07/22 15:27:33 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include "G4Run.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -50,10 +51,70 @@ void ExN03RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
|
||||
//inform the runManager to save random number seed
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
|
||||
//initialize cumulative quantities
|
||||
//
|
||||
sumEAbs = sum2EAbs =sumEGap = sum2EGap = 0.;
|
||||
sumLAbs = sum2LAbs =sumLGap = sum2LGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03RunAction::EndOfRunAction(const G4Run* ) {}
|
||||
void ExN03RunAction::fillPerEvent(G4double EAbs, G4double EGap,
|
||||
G4double LAbs, G4double LGap)
|
||||
{
|
||||
//accumulate statistic
|
||||
//
|
||||
sumEAbs += EAbs; sum2EAbs += EAbs*EAbs;
|
||||
sumEGap += EGap; sum2EGap += EGap*EGap;
|
||||
|
||||
sumLAbs += LAbs; sum2LAbs += LAbs*LAbs;
|
||||
sumLGap += LGap; sum2LGap += LGap*LGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void ExN03RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4int NbOfEvents = aRun->GetNumberOfEvent();
|
||||
if (NbOfEvents == 0) return;
|
||||
|
||||
//compute statistics: mean and rms
|
||||
//
|
||||
sumEAbs /= NbOfEvents; sum2EAbs /= NbOfEvents;
|
||||
G4double rmsEAbs = sum2EAbs - sumEAbs*sumEAbs;
|
||||
if (rmsEAbs >0.) rmsEAbs = std::sqrt(rmsEAbs); else rmsEAbs = 0.;
|
||||
|
||||
sumEGap /= NbOfEvents; sum2EGap /= NbOfEvents;
|
||||
G4double rmsEGap = sum2EGap - sumEGap*sumEGap;
|
||||
if (rmsEGap >0.) rmsEGap = std::sqrt(rmsEGap); else rmsEGap = 0.;
|
||||
|
||||
sumLAbs /= NbOfEvents; sum2LAbs /= NbOfEvents;
|
||||
G4double rmsLAbs = sum2LAbs - sumLAbs*sumLAbs;
|
||||
if (rmsLAbs >0.) rmsLAbs = std::sqrt(rmsLAbs); else rmsLAbs = 0.;
|
||||
|
||||
sumLGap /= NbOfEvents; sum2LGap /= NbOfEvents;
|
||||
G4double rmsLGap = sum2LGap - sumLGap*sumLGap;
|
||||
if (rmsLGap >0.) rmsLGap = std::sqrt(rmsLGap); else rmsLGap = 0.;
|
||||
|
||||
//print
|
||||
//
|
||||
G4cout << "\n--------------------End of Run------------------------------\n";
|
||||
G4cout
|
||||
<< "\n mean Energy in Absorber : " << G4BestUnit(sumEAbs,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEAbs,"Energy")
|
||||
<< "\n mean Energy in Gap : " << G4BestUnit(sumEGap,"Energy")
|
||||
<< " +- " << G4BestUnit(rmsEGap,"Energy")
|
||||
<< G4endl;
|
||||
|
||||
G4cout
|
||||
<< "\n mean trackLength in Absorber : " << G4BestUnit(sumLAbs,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLAbs,"Length")
|
||||
<< "\n mean trackLength in Gap : " << G4BestUnit(sumLGap,"Length")
|
||||
<< " +- " << G4BestUnit(rmsLGap,"Length")
|
||||
<< G4endl;
|
||||
|
||||
G4cout << "\n------------------------------------------------------------\n";
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingAction.cc,v 1.9 2005/02/02 17:11:11 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: ExN03SteppingVerbose.cc,v 1.12 2003/09/15 15:38:18 maire Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user