Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# This script may be executed from a lizard session to display
|
||||
# the histogram in b02.hbook. To create the histogram and the file
|
||||
# b02.hbook run exampleB02 first.
|
||||
|
||||
tree = tf.create ("b02.hbook", "hbook",1,0)
|
||||
h = tree.findH1D("10")
|
||||
hplot(h)
|
||||
@@ -1,8 +1,15 @@
|
||||
# $Id: GNUmakefile,v 1.1 2002/03/26 16:46:08 dressel Exp $
|
||||
# $Id: GNUmakefile,v 1.7 2002/11/19 15:03:58 mdressel Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
|
||||
# this GNUmakefile shows how to use the example together with Anaphe
|
||||
# you may also chose another AIDA compliant analysis package.
|
||||
#
|
||||
# The environment variable ANAPHETOP has to be setup. See ../README
|
||||
#
|
||||
|
||||
name := exampleB02
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
@@ -13,6 +20,15 @@ endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
CPPFLAGS +=
|
||||
|
||||
|
||||
# set this variable to your Anaphe instalation.
|
||||
ANAPHE_SCRIPTS_PATH:=share/LHCXX/5.0.1/scripts
|
||||
|
||||
CPPFLAGS +=
|
||||
#LDFLAGS += -L/usr/local/lib
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
CPPFLAGS += `$(ANAPHETOP)/$(ANAPHE_SCRIPTS_PATH)/aida-config -i`
|
||||
LDFLAGS += `$(ANAPHETOP)/$(ANAPHE_SCRIPTS_PATH)/aida-config -l`
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: exampleB02.cc,v 1.9 2002/05/31 11:46:23 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: exampleB02.cc,v 1.13 2002/11/13 15:10:27 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -31,140 +31,159 @@
|
||||
// --------------------------------------------------------------
|
||||
// Comments
|
||||
//
|
||||
// This example intends to show how to use both importance sampling and a
|
||||
// customized scoring making use of the scoring framework
|
||||
// in a parallel geometry.
|
||||
//
|
||||
// A simple geometry consisting of a 180 cm high concrete cylinder
|
||||
// is constructed in the mass geometry.
|
||||
// A geometry is constructed in the parallel geometry
|
||||
// in order to assign importance values to slabs
|
||||
// of width 10cm and for scoring. The parallel world volume should
|
||||
// overlap the mass world volume and the radii of the slabs is larger
|
||||
// than the radius of the concrete cylinder in the mass geometry.
|
||||
// Pairs of G4GeometryCell and importance values are stored in
|
||||
// the importance store.
|
||||
// The scoring uses the G4CellSCorer and one customized scorer for
|
||||
// the last slab.
|
||||
//
|
||||
//
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "g4std/set"
|
||||
#include "g4std/iomanip"
|
||||
#include "g4std/iostream"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
#include "B02DetectorConstruction.hh"
|
||||
#include "B02PhysicsList.hh"
|
||||
#include "B02PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "B02ScoringDetectorConstruction.hh"
|
||||
// construction for the parallel geometry
|
||||
#include "B02ImportanceDetectorConstruction.hh"
|
||||
|
||||
// Files specific for biasing and scoring
|
||||
#include "G4Scorer.hh"
|
||||
#include "G4ParallelGeometrySampler.hh"
|
||||
#include "G4IStore.hh"
|
||||
|
||||
// customized scorer and store
|
||||
#include "B02CellScorer.hh"
|
||||
#include "B02CellScorerStore.hh"
|
||||
|
||||
// a score table
|
||||
#include "G4ScoreTable.hh"
|
||||
|
||||
// AIDA stuff
|
||||
|
||||
#include "AIDA/IAnalysisFactory.h"
|
||||
#include "AIDA/ITree.h"
|
||||
#include "AIDA/ITreeFactory.h"
|
||||
#include "AIDA/IHistogram1D.h"
|
||||
#include "AIDA/IHistogramFactory.h"
|
||||
|
||||
// Files specific for scoring
|
||||
#include "B02Scorer.hh"
|
||||
#include "G4Sigma.hh"
|
||||
#include "G4ParallelScoreSampler.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);
|
||||
|
||||
G4RunManager *runManager = new G4RunManager;
|
||||
|
||||
// create the "tracking" detector -----------------
|
||||
runManager->SetUserInitialization(new B02DetectorConstruction);
|
||||
// create the detector ---------------------------
|
||||
B02DetectorConstruction *detector = new B02DetectorConstruction();
|
||||
runManager->SetUserInitialization(detector);
|
||||
// ---------------------------------------------------
|
||||
runManager->SetUserInitialization(new B02PhysicsList);
|
||||
runManager->SetUserAction(new B02PrimaryGeneratorAction);
|
||||
runManager->Initialize();
|
||||
|
||||
// create the detector for scoring
|
||||
B02ScoringDetectorConstruction scoringdetector;
|
||||
|
||||
// create a parallel detector
|
||||
B02ImportanceDetectorConstruction *pdet =
|
||||
new B02ImportanceDetectorConstruction;
|
||||
|
||||
// create an importance
|
||||
G4IStore aIstore(pdet->GetWorldVolume());
|
||||
// create a geometry cell for the world volume replpicanumber is -1!
|
||||
G4GeometryCell gWorldVolumeCell(pdet->GetWorldVolume(), -1);
|
||||
// set world volume importance to 1
|
||||
aIstore.AddImportanceGeometryCell(1, gWorldVolumeCell);
|
||||
|
||||
// create a customized cell scorer store
|
||||
B02CellScorerStore b02store;
|
||||
|
||||
// set importance values and create scorers
|
||||
G4int cell(1);
|
||||
for (cell=1; cell<=18; cell++) {
|
||||
G4GeometryCell gCell = pdet->GetGeometryCell(cell);
|
||||
G4double imp = pow(2,cell-1);
|
||||
aIstore.AddImportanceGeometryCell(imp, gCell);
|
||||
// adding the standard G4CellScorer for 17 concrete cells
|
||||
if (cell<18) {
|
||||
b02store.AddG4CellScorer(gCell);
|
||||
}
|
||||
}
|
||||
|
||||
// create a histogram for a special scorer for the last cell
|
||||
AIDA::IAnalysisFactory *af = AIDA_createAnalysisFactory();
|
||||
AIDA::ITreeFactory *tf = af->createTreeFactory();
|
||||
AIDA::ITree *tree = tf->create("b02.hbook", "hbook",false,true);
|
||||
AIDA::IHistogramFactory *hf = af->createHistogramFactory( *tree );
|
||||
AIDA::IHistogram1D *h =
|
||||
hf->createHistogram1D("10","w*sl vs. e", 30, 0., 20*MeV);
|
||||
// create a special scorer for the last cell
|
||||
B02CellScorer b02scorer(h);
|
||||
|
||||
// create scorer and sampler to score neutrons in the "scoring" detector
|
||||
B02Scorer pScorer;
|
||||
G4ParallelScoreSampler pmgr(*(scoringdetector.Construct()),
|
||||
"neutron", pScorer);
|
||||
pmgr.Initialize();
|
||||
|
||||
|
||||
|
||||
// creating the geometry cell and add both to the store
|
||||
G4GeometryCell gCell = pdet->GetGeometryCell(18);
|
||||
b02store.AddB02CellScorer(&b02scorer, gCell);
|
||||
|
||||
// create importance geometry cell pair for the "rest"cell
|
||||
// with the same importance as the last concrete cell
|
||||
gCell = pdet->GetGeometryCell(19);
|
||||
G4double imp = pow(2,18);
|
||||
aIstore.AddImportanceGeometryCell(imp, gCell);
|
||||
|
||||
|
||||
// create the importance and scoring sampler for biasing and scoring
|
||||
// in the parallel world
|
||||
|
||||
G4CellStoreScorer scorer(b02store);
|
||||
|
||||
G4ParallelGeometrySampler mgs(pdet->GetWorldVolume(),
|
||||
"neutron");
|
||||
mgs.PrepareScoring(&scorer);
|
||||
mgs.PrepareImportanceSampling(&aIstore, 0);
|
||||
mgs.Configure();
|
||||
|
||||
runManager->BeamOn(numberOfEvent);
|
||||
|
||||
// ======= after running ============================
|
||||
// print a table of the scores
|
||||
G4ScoreTable sp(&aIstore);
|
||||
sp.Print(b02store.GetMapGeometryCellCellScorer(), myout);
|
||||
|
||||
// print all the numbers calculated from the scorer
|
||||
*myout << "output pScorer, scoring detector, neutron" << G4endl;
|
||||
*myout << pScorer << G4endl;
|
||||
*myout << "----------------------------------------------" << G4endl;
|
||||
|
||||
// print some exclusive numbers
|
||||
tree->commit();
|
||||
tree->close();
|
||||
|
||||
// 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;
|
||||
delete af;
|
||||
delete tf;
|
||||
delete tree;
|
||||
|
||||
const G4PMapPtkTallys &m = pScorer.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;
|
||||
}
|
||||
|
||||
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,6 +1,6 @@
|
||||
**********************************************
|
||||
Geant4 version $Name: geant4-04-01 $
|
||||
(28-Feb-2002)
|
||||
Geant4 version $Name: geant4-05-00 $
|
||||
(31-Jul-2002)
|
||||
Copyright : Geant4 Collaboration
|
||||
**********************************************
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02CellScorer.hh,v 1.1 2002/11/08 14:52:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class B02CellScorer
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class is an example how to build a customized cell scorer
|
||||
// derived from G4VCellScorer that also uses the G4CellScorer.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef B02CellScorer_hh
|
||||
#define B02CellScorer_hh B02CellScorer_hh
|
||||
|
||||
#include "G4VCellScorer.hh"
|
||||
#include "G4CellScoreComposer.hh"
|
||||
#include "G4CellScorer.hh"
|
||||
|
||||
#include "g4std/vector"
|
||||
|
||||
#include "AIDA/IHistogram1D.h"
|
||||
|
||||
class B02CellScorer : public G4VCellScorer {
|
||||
public:
|
||||
B02CellScorer(AIDA::IHistogram1D *h);
|
||||
virtual ~B02CellScorer();
|
||||
virtual void ScoreAnExitingStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
virtual void ScoreAnEnteringStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
virtual void ScoreAnInVolumeStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
|
||||
G4CellScorer &GetG4CellScorer(){
|
||||
return fG4CellScorer;
|
||||
}
|
||||
private:
|
||||
void FillHisto(const G4Step &aStep);
|
||||
|
||||
G4CellScorer fG4CellScorer;
|
||||
AIDA::IHistogram1D *fHisto;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02CellScorerStore.hh,v 1.1 2002/11/08 14:52:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class B02CellScorerStore
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class is a cell customized cell scorer store.
|
||||
// Nevertheless the standard G4CellScorer may be created with this class
|
||||
// simular to the G4CellScorerStore. In addition this class
|
||||
// stores B02CellScorer pointers.
|
||||
// This class delivers a map with the G4CellScorer objects
|
||||
// to be printed with the G4ScorerTable class.
|
||||
//
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef B02CellScorerStore_hh
|
||||
#define B02CellScorerStore_hh B02CellScorerStore_hh
|
||||
|
||||
#include "g4std/map"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "G4GeometryCellComp.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VCellScorerStore.hh"
|
||||
|
||||
class G4CellScorer;
|
||||
class B02CellScorer;
|
||||
class IHistogram1D;
|
||||
|
||||
typedef G4std::map<G4GeometryCell, G4CellScorer *, G4GeometryCellComp> G4MapGeometryCellCellScorer;
|
||||
|
||||
typedef G4std::map<G4GeometryCell,B02CellScorer *, G4GeometryCellComp> B02MapGeometryCellB02CellScorer;
|
||||
|
||||
class B02CellScorerStore : public G4VCellScorerStore {
|
||||
public:
|
||||
B02CellScorerStore();
|
||||
virtual ~B02CellScorerStore(){}
|
||||
|
||||
virtual G4VCellScorer *GetCellScore(const G4GeometryCell &gCell);
|
||||
|
||||
G4CellScorer *AddG4CellScorer(const G4GeometryCell &gCell);
|
||||
const G4MapGeometryCellCellScorer &GetMapGeometryCellCellScorer() ;
|
||||
|
||||
void AddB02CellScorer(B02CellScorer *b02cellScorer,
|
||||
const G4GeometryCell &gCell);
|
||||
const B02MapGeometryCellB02CellScorer &GetMapGeometryCellB02CellScorer() const ;
|
||||
|
||||
private:
|
||||
G4MapGeometryCellCellScorer fMapGeometryCellCellScorer;
|
||||
B02MapGeometryCellB02CellScorer fMapGeometryCellB02CellScorer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,17 +21,19 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02DetectorConstruction.hh,v 1.2 2002/04/19 10:54:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02DetectorConstruction.hh,v 1.3 2002/11/08 14:47:42 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef B02DetectorConstruction_hh
|
||||
#define B02DetectorConstruction_hh B02DetectorConstruction_hh
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4IStore;
|
||||
|
||||
class B02DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
@@ -39,9 +41,7 @@ public:
|
||||
~B02DetectorConstruction();
|
||||
|
||||
G4VPhysicalVolume* Construct();
|
||||
G4VPhysicalVolume* GetWorldVolume(){return fWorldVolume;}
|
||||
private:
|
||||
G4VPhysicalVolume* fWorldVolume;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+22
-17
@@ -21,33 +21,38 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02Scorer.hh,v 1.3 2002/04/19 10:54:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02ImportanceDetectorConstruction.hh,v 1.1 2002/11/08 14:52:16 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef B02scorer_hh
|
||||
#define B02scorer_hh B02scorer_hh
|
||||
#ifndef B02ImportanceDetectorConstruction_hh
|
||||
#define B02ImportanceDetectorConstruction_hh B02ImportanceDetectorConstruction_hh
|
||||
|
||||
#include "g4std/iostream"
|
||||
#include "globals.hh"
|
||||
#include "g4std/map"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "B02PVolumeStore.hh"
|
||||
|
||||
#include "G4VPScorer.hh"
|
||||
#include "G4PMapPtkTallys.hh"
|
||||
class G4VPhysicalVolume;
|
||||
|
||||
class G4Step;
|
||||
class G4PStep;
|
||||
|
||||
class B02Scorer : public G4VPScorer
|
||||
|
||||
class B02ImportanceDetectorConstruction
|
||||
{
|
||||
public:
|
||||
B02Scorer();
|
||||
~B02Scorer();
|
||||
void Score(const G4Step &aStep, const G4PStep &aPStep);
|
||||
const G4PMapPtkTallys &GetMapPtkTallys() const { return fPtkTallys; }
|
||||
B02ImportanceDetectorConstruction();
|
||||
~B02ImportanceDetectorConstruction();
|
||||
|
||||
const G4VPhysicalVolume &GetPhysicalVolumeByName(const G4String& name) const;
|
||||
G4VPhysicalVolume &GetWorldVolume() const;
|
||||
G4String ListPhysNamesAsG4String();
|
||||
G4String GetCellName(G4int i);
|
||||
G4GeometryCell GetGeometryCell(G4int i);
|
||||
|
||||
private:
|
||||
G4PMapPtkTallys fPtkTallys;
|
||||
void Construct();
|
||||
B02PVolumeStore fPVolumeStore;;
|
||||
G4VPhysicalVolume *fWorldVolume;
|
||||
};
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const B02Scorer &ps);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02PVolumeStore.hh,v 1.1 2002/11/08 14:52:16 dressel Exp $
|
||||
// GEANT4 tag
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class B02PVolumeStore
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// ...
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef B02PVolumeStore_hh
|
||||
#define B02PVolumeStore_hh B02PVolumeStore_hh
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/set"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "G4GeometryCellComp.hh"
|
||||
|
||||
typedef G4std::set< G4GeometryCell, G4GeometryCellComp > B02SetGeometryCell;
|
||||
|
||||
class B02PVolumeStore {
|
||||
public:
|
||||
B02PVolumeStore();
|
||||
~B02PVolumeStore();
|
||||
|
||||
void AddPVolume(const G4GeometryCell &cell);
|
||||
const G4VPhysicalVolume *GetPVolume(const G4String &name) const;
|
||||
G4String GetPNames() const;
|
||||
|
||||
private:
|
||||
B02SetGeometryCell fSetGeometryCell;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -21,17 +21,16 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02PhysicsList.hh,v 1.2 2002/04/19 10:54:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
|
||||
#ifndef B02PhysicsList_h
|
||||
#define B02PhysicsList_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class B02PhysicsList : public G4VUserPhysicsList
|
||||
|
||||
// taken from Tst12PhysicsList
|
||||
|
||||
class B02PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
B02PhysicsList();
|
||||
@@ -42,6 +41,7 @@ class B02PhysicsList : public G4VUserPhysicsList
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
|
||||
//
|
||||
virtual void SetCuts();
|
||||
|
||||
protected:
|
||||
@@ -61,3 +61,6 @@ class B02PhysicsList : public G4VUserPhysicsList
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02PrimaryGeneratorAction.hh,v 1.2 2002/04/19 10:54:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
|
||||
#ifndef B02PrimaryGeneratorAction_hh
|
||||
#define B02PrimaryGeneratorAction_hh B02PrimaryGeneratorAction_hh
|
||||
@@ -47,3 +44,5 @@ class B02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: B02ScoringDetectorConstruction.hh,v 1.2 2002/04/19 10:54:26 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef B02ScoringDetectorConstruction_hh
|
||||
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
#!/bin/tcsh -x
|
||||
|
||||
#set verbose = 0
|
||||
|
||||
set release = "5.0.1"
|
||||
set redHat72 = "redhat72"
|
||||
set redHat61 = "redhat61"
|
||||
set redhat73 = "redhat73"
|
||||
set gcc295 = "gcc-2.95.2"
|
||||
set gcc296 = "gcc-2.96"
|
||||
set gcc32 = "gcc-3.2"
|
||||
set platform = "$redHat72/$gcc295" # default
|
||||
set COMP = `g++ --version | tail -1`
|
||||
set os = `uname`
|
||||
set osVersion = `uname -r`
|
||||
set unavailable = "Sorry, Anaphe $release is not available for $os, compiler $COMP"
|
||||
|
||||
|
||||
|
||||
# deal with non-Linux (= Solaris CC 5.3) first
|
||||
if ($os != "Linux" && ) then
|
||||
if ($os == "SunOS" && $osVersion == "5.8") then
|
||||
set platform = "sun4x_58/CC-5.3"
|
||||
else
|
||||
echo $unavailable
|
||||
exit
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# Linux next. Find Redhat/SuSE flavours
|
||||
set is61 = "no"
|
||||
if { grep "6.1" /etc/issue > /dev/null } then
|
||||
set is61 = "yes"
|
||||
endif
|
||||
set is72 = "no"
|
||||
if { grep "7.2" /etc/issue > /dev/null } then
|
||||
set is72 = "yes"
|
||||
endif
|
||||
set is73 = "no"
|
||||
if { grep "7.3" /etc/issue > /dev/null } then
|
||||
set is73 = "yes"
|
||||
endif
|
||||
set isSuSE = "no"
|
||||
if { grep "SuSE" /etc/issue > /dev/null } then
|
||||
set isSuSE = "yes"
|
||||
endif
|
||||
# Constraint: all these vars are now "yes" or "no"
|
||||
|
||||
|
||||
# deal with SuSE
|
||||
if ($isSuSE == "yes") then
|
||||
echo "Found SuSE distribution"
|
||||
if ($is72 == "yes") then # SuSE 7.2 is compatible with RH61
|
||||
# use Red Hat 6.1 / gcc-2.95.2 for SuSE 7.2 (gcc-2.95.3)
|
||||
set platform = "$redHat61/$gcc295"
|
||||
else
|
||||
echo "Unknown version of SuSE - please report to HepLib.Support@cern.ch"
|
||||
echo "/etc/issue contains:"
|
||||
cat /etc/issue
|
||||
exit
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
# deal with non-SuSE - assumed to be Red Hat (but might be wrong..!)
|
||||
if ($isSuSE == "no") then
|
||||
# first deal with Red Hat 6.1
|
||||
if ($is61 == "yes") then
|
||||
if ($COMP == "gcc-2.96") then
|
||||
echo $unavailable
|
||||
exit
|
||||
else if ($COMP == "2.95.2") then
|
||||
set platform = "redhat61/gcc-2.95.2"
|
||||
else
|
||||
set platform = "redhat61/egcs_1.1.2" # assumption!
|
||||
endif
|
||||
endif
|
||||
# now deal with Red Hat 7.2
|
||||
if ($is72 == "yes") then
|
||||
if ($COMP == "gcc-2.96") then
|
||||
echo $unavailable
|
||||
exit
|
||||
else if ($COMP == "2.95.2") then
|
||||
set platform = "redhat72/gcc-2.95.2"
|
||||
else
|
||||
set platform = "redhat72/gcc-3.2" # assumption!
|
||||
endif
|
||||
endif
|
||||
# finally deal with Red Hat 7.3
|
||||
else if ($is73 == "yes") then
|
||||
if ( $COMP == "gcc-2.96" ) then
|
||||
echo $unavailable
|
||||
exit
|
||||
else if ( $COMP == "gcc-2.95.2" ) then
|
||||
set platform = "redhat73/gcc-2.95.2"
|
||||
else
|
||||
set platform = "redhat73/gcc-3.2" # assumption!
|
||||
endif
|
||||
endif
|
||||
else
|
||||
echo $unavailable
|
||||
endif
|
||||
|
||||
|
||||
|
||||
setenv PLATF $platform
|
||||
|
||||
|
||||
|
||||
if ($?AIDA_DIR == 0) then
|
||||
setenv AIDA_DIR /afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp
|
||||
endif
|
||||
|
||||
if ($?ANAPHETOP == 0) then
|
||||
setenv ANAPHETOP /afs/cern.ch/sw/lhcxx
|
||||
endif
|
||||
|
||||
# add to PATH and LD_LIBRARY_PATH, but only if not already present ...
|
||||
set pubDom = "${ANAPHETOP}/specific/${PLATF}/PublicDomainPackages/2.0.0"
|
||||
|
||||
if ( { echo $PATH | grep $pubDom } == 0 ) then
|
||||
setenv PATH "${pubDom}/bin:${PATH}"
|
||||
endif
|
||||
|
||||
if ( $?LD_LIBRARY_PATH == 0 ) then
|
||||
setenv LD_LIBRARY_PATH "${pubDom}/lib"
|
||||
else if ( { echo $LD_LIBRARY_PATH | grep $pubDom } == 0 ) then
|
||||
setenv LD_LIBRARY_PATH "${pubDom}/lib:${LD_LIBRARY_PATH}"
|
||||
endif
|
||||
|
||||
set releaseDirectory = "${ANAPHETOP}/specific/${PLATF}/${release}"
|
||||
|
||||
if ( { echo $PATH | grep $releaseDirectory } == 0 ) then
|
||||
setenv PATH "${releaseDirectory}/bin:${PATH}"
|
||||
endif
|
||||
|
||||
if ( { echo $LD_LIBRARY_PATH | grep $releaseDirectory } == 0 ) then
|
||||
setenv LD_LIBRARY_PATH "${releaseDirectory}/lib:${LD_LIBRARY_PATH}"
|
||||
endif
|
||||
|
||||
if ( $?GRACE_HOME == 0 ) then
|
||||
setenv GRACE_HOME "${pubDom}/grace"
|
||||
endif
|
||||
|
||||
if ( { echo $PATH | grep $GRACE_HOME } == 0 ) then
|
||||
setenv PATH "${GRACE_HOME}/bin:${PATH}"
|
||||
endif
|
||||
+46
-43
@@ -21,55 +21,58 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02Scorer.cc,v 1.3 2002/04/19 10:54:27 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02CellScorer.cc,v 1.1 2002/11/08 14:52:17 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// B02CellScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "B02Scorer.hh"
|
||||
#include "B02CellScorer.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4PStep.hh"
|
||||
#include "G4Sigma.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4StepPoint.hh"
|
||||
|
||||
B02Scorer::B02Scorer(){}
|
||||
B02Scorer::~B02Scorer(){}
|
||||
|
||||
void B02Scorer::Score(const G4Step &aStep, const G4PStep &aPstep)
|
||||
{
|
||||
G4Track *track = aStep.GetTrack();
|
||||
B02CellScorer::B02CellScorer(AIDA::IHistogram1D *h) :
|
||||
fHisto(h)
|
||||
{}
|
||||
|
||||
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
|
||||
{
|
||||
// this check is necessary in case of scoring in a parallel world
|
||||
if (aStep.GetPostStepPoint()->GetStepStatus() != fGeomBoundary)
|
||||
{
|
||||
fPtkTallys[post_ptk]["Collisions"].Xin(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
B02CellScorer::~B02CellScorer()
|
||||
{}
|
||||
|
||||
void B02CellScorer::ScoreAnExitingStep(const G4Step &aStep,
|
||||
const G4GeometryCell &pre_gCell){
|
||||
fG4CellScorer.ScoreAnExitingStep(aStep, pre_gCell);
|
||||
FillHisto(aStep);
|
||||
}
|
||||
|
||||
G4std::ostream& operator<<(G4std::ostream &out, const B02Scorer &ps)
|
||||
{
|
||||
out << ps.GetMapPtkTallys();
|
||||
return out;
|
||||
void B02CellScorer::ScoreAnEnteringStep(const G4Step &aStep,
|
||||
const G4GeometryCell &post_gCell){
|
||||
fG4CellScorer.ScoreAnEnteringStep(aStep, post_gCell);
|
||||
return;
|
||||
}
|
||||
|
||||
void B02CellScorer::ScoreAnInVolumeStep(const G4Step &aStep,
|
||||
const G4GeometryCell &post_gCell){
|
||||
fG4CellScorer.ScoreAnInVolumeStep(aStep, post_gCell);
|
||||
FillHisto(aStep);
|
||||
}
|
||||
|
||||
void B02CellScorer::FillHisto(const G4Step &aStep){
|
||||
|
||||
G4StepPoint *p = 0;
|
||||
p = aStep.GetPreStepPoint();
|
||||
G4double sl = aStep.GetStepLength();
|
||||
G4double slw = sl * p->GetWeight();
|
||||
|
||||
fHisto->fill(p->GetKineticEnergy(), slw);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02CellScorerStore.cc,v 1.1 2002/11/08 14:52:17 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// B02CellScorerStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "B02CellScorerStore.hh"
|
||||
|
||||
#include "G4CellScorer.hh"
|
||||
#include "B02CellScorer.hh"
|
||||
|
||||
B02CellScorerStore::B02CellScorerStore()
|
||||
{}
|
||||
|
||||
|
||||
G4CellScorer *B02CellScorerStore::
|
||||
AddG4CellScorer(const G4GeometryCell &g) {
|
||||
return fMapGeometryCellCellScorer[g] =
|
||||
new G4CellScorer;
|
||||
};
|
||||
|
||||
void B02CellScorerStore::
|
||||
AddB02CellScorer(B02CellScorer *b02scorer,
|
||||
const G4GeometryCell &g) {
|
||||
fMapGeometryCellB02CellScorer[g] = b02scorer;
|
||||
};
|
||||
|
||||
|
||||
const G4MapGeometryCellCellScorer &B02CellScorerStore::GetMapGeometryCellCellScorer() {
|
||||
for (B02MapGeometryCellB02CellScorer::iterator it = fMapGeometryCellB02CellScorer.begin();
|
||||
it != fMapGeometryCellB02CellScorer.end(); it++) {
|
||||
fMapGeometryCellCellScorer[(*it).first] =
|
||||
&((*it).second->GetG4CellScorer());
|
||||
}
|
||||
return fMapGeometryCellCellScorer;
|
||||
}
|
||||
|
||||
const B02MapGeometryCellB02CellScorer &B02CellScorerStore::GetMapGeometryCellB02CellScorer() const {
|
||||
return fMapGeometryCellB02CellScorer;
|
||||
}
|
||||
|
||||
G4VCellScorer *B02CellScorerStore::
|
||||
GetCellScore(const G4GeometryCell &gCell){
|
||||
B02MapGeometryCellB02CellScorer::iterator itb08 =
|
||||
fMapGeometryCellB02CellScorer.find(gCell);
|
||||
if (itb08 != fMapGeometryCellB02CellScorer.end()) {
|
||||
return (*itb08).second;
|
||||
}
|
||||
else {
|
||||
G4MapGeometryCellCellScorer::iterator it = fMapGeometryCellCellScorer.find(gCell);
|
||||
if (it != fMapGeometryCellCellScorer.end()) {
|
||||
return (*it).second;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,12 +21,12 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02DetectorConstruction.cc,v 1.4 2002/04/19 10:54:27 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02DetectorConstruction.cc,v 1.6 2002/11/22 17:47:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/strstream"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "B02DetectorConstruction.hh"
|
||||
|
||||
@@ -40,8 +40,10 @@
|
||||
#include "G4Colour.hh"
|
||||
#include "PhysicalConstants.h"
|
||||
|
||||
// for importance biasing
|
||||
#include "G4IStore.hh"
|
||||
|
||||
B02DetectorConstruction::B02DetectorConstruction()
|
||||
: fWorldVolume(0)
|
||||
{;}
|
||||
|
||||
B02DetectorConstruction::~B02DetectorConstruction()
|
||||
@@ -49,8 +51,6 @@ B02DetectorConstruction::~B02DetectorConstruction()
|
||||
|
||||
G4VPhysicalVolume* B02DetectorConstruction::Construct()
|
||||
{
|
||||
char line[255];
|
||||
|
||||
G4double pos_x;
|
||||
G4double pos_y;
|
||||
G4double pos_z;
|
||||
@@ -84,7 +84,6 @@ G4VPhysicalVolume* B02DetectorConstruction::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 +112,20 @@ G4VPhysicalVolume* B02DetectorConstruction::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,79 +134,72 @@ G4VPhysicalVolume* B02DetectorConstruction::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");
|
||||
|
||||
G4VisAttributes * WorldVisAtt
|
||||
= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
|
||||
WorldVisAtt->SetVisibility(true);
|
||||
worldCylinder_log->SetVisAttributes(WorldVisAtt);
|
||||
name = "shieldWorld";
|
||||
G4VPhysicalVolume *pWorldVolume = new
|
||||
G4PVPlacement(0, G4ThreeVector(0,0,0), worldCylinder_log,
|
||||
name, 0, false, 0);
|
||||
|
||||
// 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 1-2)
|
||||
////////////////////////////////////////////////
|
||||
// creating 18 slobs of 10 cm thick concrete
|
||||
|
||||
G4double innerRadiusShield = 0*cm;
|
||||
G4double outerRadiusShield = 100*cm;
|
||||
G4double hightShield = 5*cm;
|
||||
G4double hightShield = 90*cm;
|
||||
G4double startAngleShield = 0*deg;
|
||||
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);
|
||||
}
|
||||
fWorldVolume = worldCylinder_phys;
|
||||
name = "concreteShield";
|
||||
|
||||
return worldCylinder_phys;
|
||||
pos_x = 0*cm;
|
||||
pos_y = 0*cm;
|
||||
pos_z = 0;
|
||||
G4VPhysicalVolume *pvol =
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(pos_x, pos_y, pos_z),
|
||||
aShield_log,
|
||||
name,
|
||||
worldCylinder_log,
|
||||
false,
|
||||
0);
|
||||
|
||||
return pWorldVolume;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02ImportanceDetectorConstruction.cc,v 1.2 2002/11/22 17:47:58 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
#include "B02ImportanceDetectorConstruction.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "PhysicalConstants.h"
|
||||
|
||||
|
||||
B02ImportanceDetectorConstruction::B02ImportanceDetectorConstruction()
|
||||
{
|
||||
Construct();
|
||||
}
|
||||
|
||||
B02ImportanceDetectorConstruction::~B02ImportanceDetectorConstruction()
|
||||
{;}
|
||||
|
||||
void B02ImportanceDetectorConstruction::Construct()
|
||||
{
|
||||
G4String name;
|
||||
G4double A, density, temperature, pressure;
|
||||
G4int z;
|
||||
|
||||
G4Material *Galactic =
|
||||
new G4Material(name="Galactic", z=1, A=1.01*g/mole, density,
|
||||
kStateGas,temperature,pressure);
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
// parallel world cylinder volume
|
||||
//////////////////////////////////
|
||||
|
||||
// parallel world solid larger than in the mass geometry
|
||||
|
||||
G4double innerRadiusCylinder = 0*cm;
|
||||
G4double outerRadiusCylinder = 110*cm;
|
||||
G4double hightCylinder = 110*cm;
|
||||
G4double startAngleCylinder = 0*deg;
|
||||
G4double spanningAngleCylinder = 360*deg;
|
||||
|
||||
G4Tubs *worldCylinder = new G4Tubs("worldCylinder",
|
||||
innerRadiusCylinder,
|
||||
outerRadiusCylinder,
|
||||
hightCylinder,
|
||||
startAngleCylinder,
|
||||
spanningAngleCylinder);
|
||||
|
||||
// logical world
|
||||
|
||||
G4LogicalVolume *worldCylinder_log =
|
||||
new G4LogicalVolume(worldCylinder, Galactic, "worldCylinder_log");
|
||||
|
||||
name = "parallelWorld";
|
||||
fWorldVolume = new
|
||||
G4PVPlacement(0, G4ThreeVector(0,0,0), worldCylinder_log,
|
||||
name, 0, false, 0);
|
||||
|
||||
fPVolumeStore.AddPVolume(G4GeometryCell(*fWorldVolume, -1));
|
||||
|
||||
|
||||
|
||||
|
||||
// creating 18 slobs of 10 cm thicknes
|
||||
|
||||
G4double innerRadiusShield = 0*cm;
|
||||
G4double outerRadiusShield = 100*cm;
|
||||
G4double hightShield = 5*cm;
|
||||
G4double startAngleShield = 0*deg;
|
||||
G4double spanningAngleShield = 360*deg;
|
||||
|
||||
G4Tubs *aShield = new G4Tubs("aShield",
|
||||
innerRadiusShield,
|
||||
outerRadiusShield,
|
||||
hightShield,
|
||||
startAngleShield,
|
||||
spanningAngleShield);
|
||||
|
||||
// logical parallel cells
|
||||
|
||||
G4LogicalVolume *aShield_log =
|
||||
new G4LogicalVolume(aShield, Galactic, "aShield_log");
|
||||
|
||||
// physical parallel cells
|
||||
|
||||
G4int i = 1;
|
||||
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);
|
||||
G4GeometryCell cell(*pvol, 0);
|
||||
fPVolumeStore.AddPVolume(cell);
|
||||
}
|
||||
|
||||
// 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 = 110*cm;
|
||||
hightShield = 10*cm;
|
||||
startAngleShield = 0*deg;
|
||||
spanningAngleShield = 360*deg;
|
||||
|
||||
G4Tubs *aRest = new G4Tubs("Rest",
|
||||
innerRadiusShield,
|
||||
outerRadiusShield,
|
||||
hightShield,
|
||||
startAngleShield,
|
||||
spanningAngleShield);
|
||||
|
||||
G4LogicalVolume *aRest_log =
|
||||
new G4LogicalVolume(aRest, Galactic, "aRest_log");
|
||||
name = GetCellName(19);
|
||||
|
||||
G4double pos_x = 0*cm;
|
||||
G4double pos_y = 0*cm;
|
||||
G4double pos_z = 100*cm;
|
||||
G4VPhysicalVolume *pvol =
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(pos_x, pos_y, pos_z),
|
||||
aRest_log,
|
||||
name,
|
||||
worldCylinder_log,
|
||||
false,
|
||||
0);
|
||||
G4GeometryCell cell(*pvol, 0);
|
||||
fPVolumeStore.AddPVolume(cell);
|
||||
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume &B02ImportanceDetectorConstruction::
|
||||
GetPhysicalVolumeByName(const G4String& name) const {
|
||||
return *fPVolumeStore.GetPVolume(name);
|
||||
}
|
||||
|
||||
|
||||
G4String B02ImportanceDetectorConstruction::ListPhysNamesAsG4String(){
|
||||
G4String names(fPVolumeStore.GetPNames());
|
||||
return names;
|
||||
}
|
||||
|
||||
|
||||
G4String B02ImportanceDetectorConstruction::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;
|
||||
}
|
||||
|
||||
G4GeometryCell B02ImportanceDetectorConstruction::GetGeometryCell(G4int i){
|
||||
G4String name(GetCellName(i));
|
||||
const G4VPhysicalVolume *p=0;
|
||||
p = fPVolumeStore.GetPVolume(name);
|
||||
if (p) {
|
||||
return G4GeometryCell(*p,0);
|
||||
}
|
||||
else {
|
||||
G4cout << "B02ImportanceDetectorConstruction::GetGeometryCell: couldn't get G4GeometryCell" << G4endl;
|
||||
return G4GeometryCell(*fWorldVolume,-2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4VPhysicalVolume &B02ImportanceDetectorConstruction::GetWorldVolume() const{
|
||||
return *fWorldVolume;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: B02PVolumeStore.cc,v 1.1 2002/11/08 14:52:17 dressel Exp $
|
||||
// GEANT4 tag
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// B02PVolumeStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "B02PVolumeStore.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
B02PVolumeStore::B02PVolumeStore(){}
|
||||
B02PVolumeStore::~B02PVolumeStore(){}
|
||||
|
||||
void B02PVolumeStore::AddPVolume(const G4GeometryCell &cell){
|
||||
|
||||
B02SetGeometryCell::iterator it =
|
||||
fSetGeometryCell.find(cell);
|
||||
if (it != fSetGeometryCell.end()) {
|
||||
G4cout << "B02PVolumeStore::AddPVolume: cell already stored"
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
fSetGeometryCell.insert(cell);
|
||||
|
||||
|
||||
}
|
||||
|
||||
const G4VPhysicalVolume *B02PVolumeStore::
|
||||
GetPVolume(const G4String &name) const {
|
||||
const G4VPhysicalVolume *pvol = 0;
|
||||
for (B02SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
|
||||
it != fSetGeometryCell.end(); ++it) {
|
||||
const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
|
||||
if (vol.GetName() == name) {
|
||||
pvol = &vol;
|
||||
}
|
||||
}
|
||||
if (!pvol) {
|
||||
G4cout << "B02PVolumeStore::GetPVolume: no physical volume named: "
|
||||
<< name << ", found" << G4endl;
|
||||
}
|
||||
return pvol;
|
||||
}
|
||||
|
||||
G4String B02PVolumeStore::GetPNames() const {
|
||||
G4String NameString;
|
||||
for (B02SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
|
||||
it != fSetGeometryCell.end(); ++it) {
|
||||
const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
|
||||
char st[200];
|
||||
G4std::ostrstream os(st,200);
|
||||
os << vol.GetName() << "_" << it->GetReplicaNumber()
|
||||
<< "\n" << '\0';
|
||||
G4String cellname(st);
|
||||
|
||||
// G4String cellname(vol.GetName());
|
||||
// cellname += G4String("_");
|
||||
// cellname += G4std::str(it->GetReplicaNumber());
|
||||
|
||||
NameString += cellname;
|
||||
}
|
||||
return NameString;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02PhysicsList.cc,v 1.2 2002/04/19 10:54:27 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02PhysicsList.cc,v 1.3 2002/11/08 14:47:48 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
|
||||
B02PhysicsList::B02PhysicsList() : G4VUserPhysicsList()
|
||||
B02PhysicsList::B02PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
@@ -622,11 +622,12 @@ void B02PhysicsList::ConstructGeneral()
|
||||
|
||||
void B02PhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
if (verboseLevel >0)
|
||||
{
|
||||
G4cout << "B02PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << defaultCutValue/mm << " (mm)" << G4endl;
|
||||
}
|
||||
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// "G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02PrimaryGeneratorAction.cc,v 1.4 2002/05/15 02:48:43 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02PrimaryGeneratorAction.cc,v 1.5 2002/11/08 14:47:48 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -40,7 +40,7 @@ B02PrimaryGeneratorAction::B02PrimaryGeneratorAction()
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: B02ScoringDetectorConstruction.cc,v 1.4 2002/04/19 12:01:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: B02ScoringDetectorConstruction.cc,v 1.5 2002/07/11 08:12:22 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -76,7 +76,7 @@ G4VPhysicalVolume* B02ScoringDetectorConstruction::Construct()
|
||||
|
||||
// physical world
|
||||
|
||||
name = "score_worldCylinder_phys";
|
||||
name = "score_world_phys";
|
||||
G4VPhysicalVolume* score_worldCylinder_phys =
|
||||
new G4PVPlacement(0, G4ThreeVector(0,0,0), score_worldCylinder_log,
|
||||
name, 0, false, 0);
|
||||
|
||||
Reference in New Issue
Block a user