Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.1 2002/03/26 16:46:08 dressel Exp $
# $Id: GNUmakefile,v 1.7 2002/11/07 13:47:59 dressel Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -13,6 +13,8 @@ endif
.PHONY: all
all: lib bin
CPPFLAGS +=
CPPFLAGS +=
include $(G4INSTALL)/config/binmake.gmk
+40 -101
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: exampleB01.cc,v 1.10 2002/05/31 11:46:23 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: exampleB01.cc,v 1.16 2002/11/07 13:50:29 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
// --------------------------------------------------------------
@@ -31,34 +31,44 @@
// --------------------------------------------------------------
// Comments
//
// This example intends to show how to use importance sampling and scoring
// in the mass (tracking) geometry.
// A simple geometry consisting of a 180 cm high concrete cylinder
// divided into 18 slabs of 10cm each is created.
// Importance values are assigned to the 18 concrete slabs in the
// detector construction class for simplicity.
// Pairs of G4GeometryCell and importance values are stored in
// the importance store.
// The G4Scorer is used for the scoring. This is a top level
// class using the frame work provided for scoring.
//
// --------------------------------------------------------------
#include "g4std/set"
#include "g4std/iomanip"
#include "g4std/iostream"
#include "G4VPhysicalVolume.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "B01DetectorConstruction.hh"
#include "B01PhysicsList.hh"
#include "B01PrimaryGeneratorAction.hh"
// Files specific for scoring
#include "B01Scorer.hh"
#include "G4Sigma.hh"
#include "G4MassScoreSampler.hh"
// Files specific for biasing and scoring
#include "G4Scorer.hh"
#include "G4MassGeometrySampler.hh"
#include "G4IStore.hh"
// a score table
#include "G4ScoreTable.hh"
// helper function for print out
G4std::string FillString(const G4std::string &name, char c, G4int n, G4bool back = true);
int main(int argc, char **argv)
{
G4std::ostream *myout = &G4cout;
G4int numberOfEvent = 1000;
G4int numberOfEvent = 100;
G4String random_status_out_file, random_status_in_file;
G4long myseed = 345354;
HepRandom::setTheSeed(myseed);
@@ -66,102 +76,31 @@ int main(int argc, char **argv)
G4RunManager *runManager = new G4RunManager;
// create the detector ---------------------------
runManager->SetUserInitialization(new B01DetectorConstruction);
B01DetectorConstruction *detector = new B01DetectorConstruction();
runManager->SetUserInitialization(detector);
// ---------------------------------------------------
runManager->SetUserInitialization(new B01PhysicsList);
runManager->SetUserAction(new B01PrimaryGeneratorAction);
runManager->Initialize();
// create scorer and sampler to score neutrons in the detector
B01Scorer mScorer;
G4MassScoreSampler msm(mScorer, "neutron"); // to be don after
msm.Initialize(); // runManager->Initialize()
// the IStore is filled during detector construction
G4IStore &aIstore = *detector->GetIStore();
// create the importance and scoring sampler for biasing and scoring
// in the tracking world
G4Scorer scorer;
G4MassGeometrySampler mgs("neutron");
mgs.PrepareScoring(&scorer);
mgs.PrepareImportanceSampling(&aIstore, 0);
mgs.Configure();
runManager->BeamOn(numberOfEvent);
// ======= after running ============================
// print all the numbers calculated from the scorer
*myout << "output mScorer, mass geometry, neutron" << G4endl;
*myout << mScorer << G4endl;
*myout << "----------------------------------------------" << G4endl;
// print some exclusive numbers
// head line
G4int FieldName = 25;
G4int FieldValue = 12;
G4std::string vname = FillString("Volume name", ' ', FieldName+1);
*myout << vname << '|';
vname = FillString(" AV E/Track ", ' ', FieldValue+1, false);
*myout << vname << '|';
vname = FillString(" sigma", ' ', FieldValue+1);
*myout << vname << '|';
vname = FillString("Coll_Ent.Tr", ' ', FieldValue+1, false);
*myout << vname << '|';
*myout << G4endl;
const G4PMapPtkTallys &m = mScorer.GetMapPtkTallys();
for (G4PMapPtkTallys::const_iterator mit = m.begin();
mit != m.end(); mit++) {
G4PTouchableKey ptk = (*mit).first; // get a key identifying a volume
G4PMapNameTally mtallies = (*mit).second; // get tallies of the volume
G4String name(ptk.fVPhysiclaVolume->GetName()); // print volume name
G4int nEnteringTracks = 0;
G4double colli_EnteringTrack = 0;
G4double meanTrackEnergy = 0, sigmaTrackEnergy = 0;
for (G4PMapNameTally::iterator mt = mtallies.begin();
mt != mtallies.end(); mt++) {
G4String tmp((*mt).first);
if (tmp == "HistorysEntering") {
nEnteringTracks = G4int((*mt).second.GetXsum());
}
if (tmp == "EnergyEnteringHistory") {
meanTrackEnergy = (*mt).second.GetMean();
sigmaTrackEnergy = (*mt).second.GetSigma();
}
if (tmp == "Collisions") {
if (!nEnteringTracks) {
G4cout << "exampleB01: Error nEnteringTracks=0" <<G4endl;
}
else {
colli_EnteringTrack = (*mt).second.GetXsum() / nEnteringTracks;
}
}
}
// print values
G4std::string fname = FillString(name, '.', FieldName);
*myout << fname << " |";
*myout << G4std::setw(FieldValue) << meanTrackEnergy << " |";
*myout << G4std::setw(FieldValue) << sigmaTrackEnergy << " |";
*myout << G4std::setw(FieldValue) << colli_EnteringTrack << " |";
*myout << G4endl;
}
// print a table of the scores
G4ScoreTable sp(&aIstore);
sp.Print(scorer.GetMapGeometryCellCellScorer(), myout);
return 0;
}
G4std::string FillString(const G4std::string &name, char c, G4int n, bool back)
{
G4std::string fname;
G4int k = n - name.size();
if (k > 0) {
if (back) {
fname = name;
fname += G4std::string(k,c);
}
else {
fname = G4std::string(k,c);
fname += name;
}
}
else {
fname = name;
}
return fname;
}
@@ -1,247 +0,0 @@
**********************************************
Geant4 version $Name: geant4-04-01 $
(28-Feb-2002)
Copyright : Geant4 Collaboration
**********************************************
phot: Total cross sections from Sandia parametrisation.
B01PhysicsList::SetCuts:CutLength : 1 (mm)
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
e+e- energies according Bethe-Heitler
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
compt: Total cross sections from a parametrisation. Good description from 10 KeV to (100/Z) GeV.
Scattered gamma energy according Klein-Nishina.
PhysicsTables from 1 keV to 100 GeV in 80 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to 100 GeV.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
eBrem: Total cross sections from a NEW parametrisation based on the EEDL data library.
Good description from 1 KeV to 100 GeV.
log scale extrapolation above 100 GeV
Gamma energy sampled from a parametrised formula.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
annihil: Total cross section from Heilter formula(annihilation into 2 photons).
gamma energies sampled according Heitler
PhysicsTables from 10 keV to 10 TeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
MuIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
MuBrems: theoretical cross section
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
+++ G4ProcessPlacer::G4ProcessPlacer: for: neutron
=== G4ProcessPlacer::AddProcessAsSecondDoIt ===
ProcessName: MScoreProcess
The initial Vectors:
GPIL Vector:
Decay
LCapture
LFission
inelastic
LElastic
Transportation
DoIt Vector:
Transportation
LElastic
inelastic
LFission
LCapture
Decay
The final Vectors:
GPIL Vector:
Decay
LCapture
LFission
inelastic
LElastic
MScoreProcess
Transportation
DoIt Vector:
Transportation
MScoreProcess
LElastic
inelastic
LFission
LCapture
Decay
================================================
output mScorer, mass geometry, neutron
Volume name = worldCylinder_phys, Replica number = -1
HistorysEntering
entries : 331
Sum(w) : 331
Sum(w*x) : 331
Sum(w*x*x) : 331
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 331
Sum(x^2) : 331
EnergyEnteringHistory
entries : 331
Sum(w) : 331
Sum(w*x) : 2868.82
Sum(w*x*x) : 26144.9
mean=Sum(w*x) / Sum(w) : 8.66714
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 1.96678
Sum(x) : 2868.82
Sum(x^2) : 26144.9
Volume name = cell: 02, shield, Replica number = 0
HistorysEntering
entries : 1066
Sum(w) : 1066
Sum(w*x) : 1066
Sum(w*x*x) : 1066
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 1066
Sum(x^2) : 1066
EnergyEnteringHistory
entries : 1066
Sum(w) : 1066
Sum(w*x) : 10503.1
Sum(w*x*x) : 104013
mean=Sum(w*x) / Sum(w) : 9.85277
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0.704593
Sum(x) : 10503.1
Sum(x^2) : 104013
Collisions
entries : 1274
Sum(w) : 1274
Sum(w*x) : 1274
Sum(w*x*x) : 1274
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 1274
Sum(x^2) : 1274
Volume name = cell: 03, shield, Replica number = 0
HistorysEntering
entries : 665
Sum(w) : 665
Sum(w*x) : 665
Sum(w*x*x) : 665
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 665
Sum(x^2) : 665
EnergyEnteringHistory
entries : 665
Sum(w) : 665
Sum(w*x) : 6401.76
Sum(w*x*x) : 62732.9
mean=Sum(w*x) / Sum(w) : 9.62671
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 1.28905
Sum(x) : 6401.76
Sum(x^2) : 62732.9
Collisions
entries : 908
Sum(w) : 908
Sum(w*x) : 908
Sum(w*x*x) : 908
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 908
Sum(x^2) : 908
Volume name = cell: 04, shield, Replica number = 0
HistorysEntering
entries : 376
Sum(w) : 376
Sum(w*x) : 376
Sum(w*x*x) : 376
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 376
Sum(x^2) : 376
EnergyEnteringHistory
entries : 376
Sum(w) : 376
Sum(w*x) : 3528.31
Sum(w*x*x) : 34285
mean=Sum(w*x) / Sum(w) : 9.3838
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 1.76852
Sum(x) : 3528.31
Sum(x^2) : 34285
Collisions
entries : 522
Sum(w) : 522
Sum(w*x) : 522
Sum(w*x*x) : 522
mean=Sum(w*x) / Sum(w) : 1
sigma=sqrt(Sum(w*x*x)/Sum(w)-mean^2): 0
Sum(x) : 522
Sum(x^2) : 522
----------------------------------------------
Volume name | AV E/Track | sigma | Coll_Ent.Tr|
worldCylinder_phys....... | 8.66714 | 1.96678 | 0 |
cell: 02, shield......... | 9.85277 | 0.704593 | 1.19512 |
cell: 03, shield......... | 9.62671 | 1.28905 | 1.36541 |
cell: 04, shield......... | 9.3838 | 1.76852 | 1.3883 |
+++ G4ProcessPlacer::G4ProcessPlacer: for: neutron
ProcessName: MScoreProcess, will be removed!
The initial Vectors:
GPIL Vector:
Decay
LCapture
LFission
inelastic
LElastic
MScoreProcess
Transportation
DoIt Vector:
Transportation
MScoreProcess
LElastic
inelastic
LFission
LCapture
Decay
The final Vectors:
GPIL Vector:
Decay
LCapture
LFission
inelastic
LElastic
Transportation
DoIt Vector:
Transportation
LElastic
inelastic
LFission
LCapture
Decay
WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
@@ -21,17 +21,19 @@
// ********************************************************************
//
//
// $Id: B01DetectorConstruction.hh,v 1.2 2002/04/19 10:54:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: B01DetectorConstruction.hh,v 1.5 2002/11/07 13:47:59 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef B01DetectorConstruction_hh
#define B01DetectorConstruction_hh B01DetectorConstruction_hh
class G4VPhysicalVolume;
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
class G4VPhysicalVolume;
class G4IStore;
class B01DetectorConstruction : public G4VUserDetectorConstruction
{
public:
@@ -39,9 +41,13 @@ public:
~B01DetectorConstruction();
G4VPhysicalVolume* Construct();
G4VPhysicalVolume* GetWorldVolume(){return fWorldVolume;}
G4IStore* GetIStore();
G4String GetCellName(G4int i);
private:
G4VPhysicalVolume* fWorldVolume;
G4IStore *fIStore;
};
#endif
@@ -21,10 +21,6 @@
// ********************************************************************
//
//
// $Id: B01PhysicsList.hh,v 1.2 2002/04/19 10:54:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#ifndef B01PhysicsList_h
#define B01PhysicsList_h 1
@@ -65,3 +61,6 @@ class B01PhysicsList: public G4VUserPhysicsList
};
#endif
@@ -21,9 +21,6 @@
// ********************************************************************
//
//
// $Id: B01PrimaryGeneratorAction.hh,v 1.2 2002/04/19 10:54:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#ifndef B01PrimaryGeneratorAction_hh
#define B01PrimaryGeneratorAction_hh B01PrimaryGeneratorAction_hh
@@ -47,3 +44,5 @@ class B01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
};
#endif
@@ -1,53 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: B01Scorer.hh,v 1.3 2002/04/19 10:54:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#ifndef B01scorer_hh
#define B01scorer_hh B01scorer_hh
#include "g4std/iostream"
#include "G4VPScorer.hh"
#include "G4PMapPtkTallys.hh"
class G4Step;
class G4PStep;
class B01Scorer : public G4VPScorer
{
public:
B01Scorer();
~B01Scorer();
void Score(const G4Step &aStep, const G4PStep &aPStep);
const G4PMapPtkTallys &GetMapPtkTallys() const { return fPtkTallys; }
private:
G4PMapPtkTallys fPtkTallys;
};
G4std::ostream& operator<<(G4std::ostream &out, const B01Scorer &ps);
#endif
@@ -21,10 +21,13 @@
// ********************************************************************
//
//
// $Id: B01DetectorConstruction.cc,v 1.4 2002/04/19 10:54:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: B01DetectorConstruction.cc,v 1.7 2002/11/22 17:47:57 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "g4std/strstream"
#include "globals.hh"
#include "B01DetectorConstruction.hh"
#include "G4Material.hh"
@@ -35,22 +38,26 @@
#include "G4PVPlacement.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "g4std/strstream"
#include "PhysicalConstants.h"
#include "globals.hh"
// for importance biasing
#include "G4IStore.hh"
B01DetectorConstruction::B01DetectorConstruction()
: fWorldVolume(0)
: fIStore(0)
{;}
B01DetectorConstruction::~B01DetectorConstruction()
{;}
G4IStore* B01DetectorConstruction::GetIStore()
{
if (!fIStore) G4Exception("B01DetectorConstruction::fIStore empty!");
return fIStore;
}
G4VPhysicalVolume* B01DetectorConstruction::Construct()
{
char line[255];
G4double pos_x;
G4double pos_y;
G4double pos_z;
@@ -84,7 +91,6 @@ G4VPhysicalVolume* B01DetectorConstruction::Construct()
A = 28.09*g/mole;
G4Element* elSi = new G4Element(name="Silicon", symbol="Si", Z=14, A);
A = 39.1*g/mole;
G4Element* elK = new G4Element(name="K" ,symbol="K" , Z=19 , A);
@@ -113,21 +119,20 @@ G4VPhysicalVolume* B01DetectorConstruction::Construct()
Concrete->AddElement(elCa , fractionmass= 0.044);
Concrete->AddElement(elFe , fractionmass= 0.014);
Concrete->AddElement(elC , fractionmass= 0.001);
density = 0.0203*g/cm3;
G4Material* LightConcrete = new G4Material("LightConcrete", density, 10);
LightConcrete->AddElement(elH , fractionmass= 0.01);
LightConcrete->AddElement(elO , fractionmass= 0.529);
LightConcrete->AddElement(elNa , fractionmass= 0.016);
LightConcrete->AddElement(elHg , fractionmass= 0.002);
LightConcrete->AddElement(elAl , fractionmass= 0.034);
LightConcrete->AddElement(elSi , fractionmass= 0.337);
LightConcrete->AddElement(elK , fractionmass= 0.013);
LightConcrete->AddElement(elCa , fractionmass= 0.044);
LightConcrete->AddElement(elFe , fractionmass= 0.014);
LightConcrete->AddElement(elC , fractionmass= 0.001);
G4Material *WorldMaterial = Galactic;
/////////////////////////////
// world cylinder volume
@@ -136,40 +141,36 @@ G4VPhysicalVolume* B01DetectorConstruction::Construct()
// world solid
G4double innerRadiusCylinder = 0*cm;
G4double outerRadiusCylinder = 100*cm;
G4double hightCylinder = 15.001*cm;
G4double outerRadiusCylinder = 101*cm; // dont't have scoring
// cells coinside eith world volume boundary
G4double hightCylinder = 105*cm;
G4double startAngleCylinder = 0*deg;
G4double spanningAngleCylinder = 360*deg;
G4Tubs *worldCylinder = new G4Tubs("worldCylinder",
innerRadiusCylinder,
outerRadiusCylinder,
hightCylinder,
startAngleCylinder,
spanningAngleCylinder);
innerRadiusCylinder,
outerRadiusCylinder,
hightCylinder,
startAngleCylinder,
spanningAngleCylinder);
// logical world
G4LogicalVolume *worldCylinder_log =
new G4LogicalVolume(worldCylinder, WorldMaterial, "worldCylinder_log");
new G4LogicalVolume(worldCylinder, Galactic, "worldCylinder_log");
name = "shieldWorld";
G4VPhysicalVolume *pWorldVolume = new
G4PVPlacement(0, G4ThreeVector(0,0,0), worldCylinder_log,
name, 0, false, 0);
G4VisAttributes * WorldVisAtt
= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
WorldVisAtt->SetVisibility(true);
worldCylinder_log->SetVisAttributes(WorldVisAtt);
G4std::vector< G4VPhysicalVolume * > physvolumes;
physvolumes.push_back(pWorldVolume);
// physical world
name = "worldCylinder_phys";
G4VPhysicalVolume* worldCylinder_phys =
new G4PVPlacement(0, G4ThreeVector(0,0,0), worldCylinder_log,
name, 0, false, 0);
///////////////////////////////////////////////
// shield cylinder for (cells 2-4)
////////////////////////////////////////////////
// creating 18 slobs of 10 cm thick concrete
G4double innerRadiusShield = 0*cm;
G4double outerRadiusShield = 100*cm;
@@ -178,40 +179,117 @@ G4VPhysicalVolume* B01DetectorConstruction::Construct()
G4double spanningAngleShield = 360*deg;
G4Tubs *aShield = new G4Tubs("aShield",
innerRadiusShield,
outerRadiusShield,
hightShield,
startAngleShield,
spanningAngleShield);
innerRadiusShield,
outerRadiusShield,
hightShield,
startAngleShield,
spanningAngleShield);
// logical shield
G4LogicalVolume *aShield_log =
new G4LogicalVolume(aShield, Concrete, "aShield_log");
G4VisAttributes * shieldVisAtt
= new G4VisAttributes(G4Colour(0.0,1.0,1.0));
shieldVisAtt->SetVisibility(true);
shieldVisAtt->SetForceSolid(false);
aShield_log->SetVisAttributes(shieldVisAtt);
G4VisAttributes* pShieldVis = new
G4VisAttributes(G4Colour(0.0,0.0,1.0));
pShieldVis->SetForceSolid(true);
aShield_log->SetVisAttributes(pShieldVis);
// physical shields
// physical shields for cell 2 to 4
for(G4int i=0; i<3; i++)
{
if (i+2<10) sprintf(line,"cell: 0%d, shield",i+2);
else sprintf(line,"cell: %d, shield",i+2);
G4String name(line);
pos_x = 0*cm;
pos_y = 0*cm;
pos_z = -10*cm+(10*cm)*i;
new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z),
aShield_log, name, worldCylinder_log, false, 0);
G4int i;
G4double startz = -85*cm;
for (i=1; i<=18; i++) {
name = GetCellName(i);
G4double pos_x = 0*cm;
G4double pos_y = 0*cm;
G4double pos_z = startz + (i-1) * (2*hightShield);
G4VPhysicalVolume *pvol =
new G4PVPlacement(0,
G4ThreeVector(pos_x, pos_y, pos_z),
aShield_log,
name,
worldCylinder_log,
false,
0);
physvolumes.push_back(pvol);
}
// filling the rest of the world volumr behind the concrete with
// another slob which should get the same importance value as the
// last slob
innerRadiusShield = 0*cm;
outerRadiusShield = 100*cm;
hightShield = 7.5*cm;
startAngleShield = 0*deg;
spanningAngleShield = 360*deg;
fWorldVolume = worldCylinder_phys;
return worldCylinder_phys;
G4Tubs *aRest = new G4Tubs("Rest",
innerRadiusShield,
outerRadiusShield,
hightShield,
startAngleShield,
spanningAngleShield);
G4LogicalVolume *aRest_log =
new G4LogicalVolume(aRest, Galactic, "aRest_log");
name = "rest";
pos_x = 0*cm;
pos_y = 0*cm;
pos_z = 97.5*cm;
G4VPhysicalVolume *pvol_rest =
new G4PVPlacement(0,
G4ThreeVector(pos_x, pos_y, pos_z),
aRest_log,
name,
worldCylinder_log,
false,
0);
// creating and filling the importance store
fIStore = new G4IStore(*pWorldVolume);
// for the world volume repnum is -1 !
G4int n = 0;
G4double imp =1;
for (G4std::vector<G4VPhysicalVolume *>::iterator it =
physvolumes.begin();
it != physvolumes.end(); it++)
{
imp = pow(2., n++);
G4cout << "Going to assign importance: " << imp << ", to volume: "
<< (*it)->GetName() << G4endl;
if (*it == pWorldVolume)
{
// repnum -1
fIStore->AddImportanceGeometryCell(imp, **it, -1);
}
fIStore->AddImportanceGeometryCell(imp, **it);
}
// the remaining part pf the geometry (rest) gets the same
// importance as the last conrete cell
fIStore->AddImportanceGeometryCell(imp, *pvol_rest);
return pWorldVolume;
}
G4String B01DetectorConstruction::GetCellName(G4int i) {
char st[200];
G4std::ostrstream os(st,200);
os << "cell_";
if (i<10) {
os << "0";
}
os << i
<< '\0';
G4String name(st);
return name;
}
@@ -21,14 +21,15 @@
// ********************************************************************
//
//
// $Id: B01PhysicsList.cc,v 1.2 2002/04/19 10:54:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: B01PhysicsList.cc,v 1.4 2002/11/07 13:48:02 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "globals.hh"
#include "g4std/iomanip"
#include "B01PhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
@@ -44,7 +45,7 @@
#include "G4Material.hh"
#include "G4MaterialTable.hh"
B01PhysicsList::B01PhysicsList() : G4VUserPhysicsList()
B01PhysicsList::B01PhysicsList(): G4VUserPhysicsList()
{
SetVerboseLevel(1);
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: B01PrimaryGeneratorAction.cc,v 1.4 2002/05/15 02:48:42 asaim Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: B01PrimaryGeneratorAction.cc,v 1.7 2002/11/07 13:48:02 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "globals.hh"
@@ -40,7 +40,7 @@ B01PrimaryGeneratorAction::B01PrimaryGeneratorAction()
particleGun = new G4ParticleGun(n_particle);
particleGun->SetParticleDefinition(G4Neutron::NeutronDefinition());
particleGun->SetParticleEnergy(10.0*MeV);
particleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, -15.0005*cm));
particleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, -90.0005*cm));
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.0, 0.0, 1.0));
}
@@ -1,65 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: B01Scorer.cc,v 1.3 2002/04/19 10:54:26 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#include "B01Scorer.hh"
#include "G4Step.hh"
#include "G4PStep.hh"
#include "G4Sigma.hh"
#include "G4StateManager.hh"
B01Scorer::B01Scorer(){}
B01Scorer::~B01Scorer(){}
void B01Scorer::Score(const G4Step &aStep, const G4PStep &aPstep){
G4Track *track = aStep.GetTrack();
if (track->GetTrackStatus()==fStopAndKill) {
G4cout << " track status is StopAndKill -> do nothing" << G4endl;
}
// do the scoring
else {
// the map fPtkTallys, the map nametallys and the "G4Sigma" will
// be setup the first time they are accesed.
// the user may choos any other place to store the results e.g.
// histogramms
G4PTouchableKey post_ptk(aPstep.fPostTouchableKey);
if (aPstep.fCrossBoundary) {
// Pstep crosses boundary
fPtkTallys[post_ptk]["HistorysEntering"].Xin(1);
fPtkTallys[post_ptk]["EnergyEnteringHistory"].
Xin(track->GetKineticEnergy());
}
else {
fPtkTallys[post_ptk]["Collisions"].Xin(1);
}
}
}
G4std::ostream& operator<<(G4std::ostream &out, const B01Scorer &ps) {
out << ps.GetMapPtkTallys();
return out;
}