Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -0,0 +1,87 @@
// 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: AnaEx01.cc,v 1.6 2000/11/15 13:46:23 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 - exampleN03
//
// For information related to this code contact:
// CERN, IT Division, ASD Group
// --------------------------------------------------------------
// Comments
//
// --------------------------------------------------------------
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "Randomize.hh"
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01PhysicsList.hh"
#include "AnaEx01PrimaryGeneratorAction.hh"
#include "AnaEx01RunAction.hh"
#include "AnaEx01EventAction.hh"
#include "AnaEx01SteppingAction.hh"
#include "AnaEx01SteppingVerbose.hh"
int main(int argc,char** argv) {
// choose the Random engine
HepRandom::setTheEngine(new RanecuEngine);
//my Verbose output class
G4VSteppingVerbose::SetInstance(new AnaEx01SteppingVerbose);
// Construct the default run manager
G4RunManager * runManager = new G4RunManager;
// set mandatory initialization classes
AnaEx01DetectorConstruction* detector = new AnaEx01DetectorConstruction;
runManager->SetUserInitialization(detector);
runManager->SetUserInitialization(new AnaEx01PhysicsList);
#ifdef G4ANALYSIS_USE
AnaEx01AnalysisManager* analysisManager =
new AnaEx01AnalysisManager(argc==1?"Lab":argv[1]);
runManager->SetUserAction(new AnaEx01PrimaryGeneratorAction(detector));
runManager->SetUserAction(new AnaEx01RunAction(analysisManager));
runManager->SetUserAction(new AnaEx01EventAction(analysisManager));
runManager->SetUserAction(new AnaEx01SteppingAction(analysisManager));
#else
runManager->SetUserAction(new AnaEx01PrimaryGeneratorAction(detector));
runManager->SetUserAction(new AnaEx01RunAction());
runManager->SetUserAction(new AnaEx01EventAction());
runManager->SetUserAction(new AnaEx01SteppingAction());
#endif
//Initialize G4 kernel
runManager->Initialize();
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
// Batch mode
UI->ApplyCommand("/control/execute run.mac");
// job termination
#ifdef G4ANALYSIS_USE
delete analysisManager;
#endif
delete runManager;
return 0;
}
@@ -0,0 +1,17 @@
# $Id: GNUmakefile,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := AnaEx01
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
@@ -0,0 +1,19 @@
$Id: History,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
--------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example AnaEx01 History file
----------------------------
This file should be used by the G4 example coordinator to briefly
summarize all major modifications introduced in the code and keep
track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
14 September 2000, Guy Barrand :
- Birth.
+68
View File
@@ -0,0 +1,68 @@
$Id: README,v 1.6 2000/12/06 13:08:13 barrand Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
AnaEx01
-------
This example shows the usage of histogramming with the
analysis category.
To use the G4AnalysisManager the source/analysis category
must have been reconstructed with one of the environment
variable setted :
G4ANALYSIS_BUILD_JAS
G4ANALYSIS_BUILD_LAB
G4ANALYSIS_BUILD_LIZARD
To use an analysis system with this example, the coresponding
environment variable must be setted :
G4ANALYSIS_USE_JAS
G4ANALYSIS_USE_LAB
G4ANALYSIS_USE_LIZARD
Then to cosntruct this example :
csh> cd $G4INSTALL/examples/extended/analysis/AnaEx01
csh> setenv G4ANALYSIS_USE_JAS 1
csh> setenv G4ANALYSIS_USE_LAB 1
csh> setenv G4ANALYSIS_USE_LIZARD 1
csh> gmake
Working with the Lab package :
----------------------------
If working with the Lab package run the program
from the analysis/Lab directory :
csh> cd analyis/Lab
csh> $G4WORKDIR/bin/$G4SYSTEM/AnaEx01 Lab
It must produce a g4osc.root file that contains
some histograms. You can visualize them with :
csh> source <path>/Lab/<version>/cmt/setup.csh
csh> oxm
and click in File/session to execute the session.tcl
file.
Working with jas :
--------------------------
If working with jas :
csh> cd $G4INSTALL/examples/extended/analysis/AnaEx01
csh> $G4WORKDIR/bin/$G4SYSTEM/AnaEx01 jas
The program will pend for a connection toward jas, then
spawn jas :
csh> <path_to_jas_bin>/jas
From jas panel, open a connection toward the AnaEx01 job :
- File/Reconnect
- Give no server name if running on same machine.
- Next to end the connect panel.
When connection is established, the tree widget
on the left of jas panel must display "G4Job".
Click on the tree items to access an histogram.
Double click on the histogram name to visualize it.
The histogram will update itself according time.
@@ -0,0 +1,19 @@
#
# Macro file for "AnEx01.cc"
#
# (can be run in batch, without graphic)
#
#/control/verbose 2
#/control/saveHistory
#
#/run/verbose 2
#/event/verbose 0
#/tracking/verbose 1
#
# muon 300 MeV to the direction (1.,0.,0.)
# 3 events
#
#/gun/particle mu+
/gun/particle e+
/gun/energy 300 MeV
/run/beamOn 100
@@ -0,0 +1,49 @@
#/////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////
#
# Example of tcl script using a root file.
#
#/////////////////////////////////////////////////////////////////////////////
# If reexecuted :
delete storage
delete v
#
# Get a SWIG handler over the current viewer :
IViewer v -this [ui getCurrentViewer]
v reset page
#
# 2x2 regions :
#v set page "2 2"
v set pageTitle "G4 analysis with Open Scientist"
#
RioStorage storage g4osc.root READ
storage ls
#
delete EAbs
#
#storage cd histograms
#storage ls
#
# Get some histograms with the H1Get
# builtin procedure defined in Lab/user/init.tcl :
# In the below the first "EAbs" is a variable and
# the second is the name of the object in the storage
# (the SID, storage identifier) :
# H1DGet <variable> <storage> <SID>
H1DGet EAbs storage EAbs
#
# Plot the histo :
EAbs vis
#
v set textContext "color black fontName TTF/couri"
v set histogramContext "color red modeling solid"
#
# Fit :
#delete fitExp
#
#Exponential fitExp 0. 1.
#fitExp fit [& EAbs]
#
#fitExp vis
#
@@ -0,0 +1,19 @@
#
# Macro file for "AnEx01.cc"
#
# (can be run in batch, without graphic)
#
#/control/verbose 2
#/control/saveHistory
#
#/run/verbose 2
#/event/verbose 0
#/tracking/verbose 1
#
# muon 300 MeV to the direction (1.,0.,0.)
# 3 events
#
#/gun/particle mu+
/gun/particle e+
/gun/energy 300 MeV
/run/beamOn 10000
@@ -0,0 +1,55 @@
// 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: AnaEx01AnalysisManager.hh,v 1.3 2000/10/31 13:10:00 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// Example Analysis Manager implementing virtual function
// RegisterAnalysisSystems. Exploits C-pre-processor variables
// G4ANALYSIS_USE_JAS, etc., which are set by the GNUmakefiles if
// environment variables of the same name are set.
// So all you have to do is set environment variables and compile and
// instantiate this in your main().
#ifndef AnaEx01AnalysisManager_h
#define AnaEx01AnalysisManager_h 1
#ifdef G4ANALYSIS_USE
#include "G4AnalysisManager.hh"
class G4Run;
class G4Event;
class G4Step;
class IHistogram1D;
//class ITuple;
class AnaEx01AnalysisManager: public G4AnalysisManager {
public:
AnaEx01AnalysisManager(const G4String&);
public:
virtual void BeginOfRun(const G4Run*);
virtual void EndOfRun(const G4Run*);
virtual void BeginOfEvent(const G4Event*);
virtual void EndOfEvent(const G4Event*);
virtual void Step(const G4Step*);
private:
G4int fCalorimeterCollID;
IHistogram1D* fEAbs;
IHistogram1D* fLAbs;
IHistogram1D* fEGap;
IHistogram1D* fLGap;
//ITuple* fTuple;
};
#endif
#endif
@@ -0,0 +1,82 @@
// 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: AnaEx01CalorHit.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorHit_h
#define AnaEx01CalorHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorHit : public G4VHit
{
public:
AnaEx01CalorHit();
~AnaEx01CalorHit();
AnaEx01CalorHit(const AnaEx01CalorHit&);
const AnaEx01CalorHit& operator=(const AnaEx01CalorHit&);
int operator==(const AnaEx01CalorHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
void Print();
public:
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
G4double GetEdepAbs() { return EdepAbs; };
G4double GetTrakAbs() { return TrackLengthAbs; };
G4double GetEdepGap() { return EdepGap; };
G4double GetTrakGap() { return TrackLengthGap; };
private:
G4double EdepAbs, TrackLengthAbs;
G4double EdepGap, TrackLengthGap;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
typedef G4THitsCollection<AnaEx01CalorHit> AnaEx01CalorHitsCollection;
extern G4Allocator<AnaEx01CalorHit> AnaEx01CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void* AnaEx01CalorHit::operator new(size_t)
{
void* aHit;
aHit = (void*) AnaEx01CalorHitAllocator.MallocSingle();
return aHit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void AnaEx01CalorHit::operator delete(void* aHit)
{
AnaEx01CalorHitAllocator.FreeSingle((AnaEx01CalorHit*) aHit);
}
#endif
@@ -0,0 +1,51 @@
// 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: AnaEx01CalorimeterSD.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01CalorimeterSD_h
#define AnaEx01CalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "globals.hh"
class AnaEx01DetectorConstruction;
class G4HCofThisEvent;
class G4Step;
#include "AnaEx01CalorHit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01CalorimeterSD : public G4VSensitiveDetector
{
public:
AnaEx01CalorimeterSD(G4String, AnaEx01DetectorConstruction* );
~AnaEx01CalorimeterSD();
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
void clear();
void DrawAll();
void PrintAll();
private:
AnaEx01CalorHitsCollection* CalCollection;
AnaEx01DetectorConstruction* Detector;
G4int* HitID;
};
#endif
@@ -0,0 +1,140 @@
// 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: AnaEx01DetectorConstruction.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01DetectorConstruction_h
#define AnaEx01DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class AnaEx01DetectorMessenger;
class AnaEx01CalorimeterSD;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
{
public:
AnaEx01DetectorConstruction();
~AnaEx01DetectorConstruction();
public:
void SetAbsorberMaterial (G4String);
void SetAbsorberThickness(G4double);
void SetGapMaterial (G4String);
void SetGapThickness(G4double);
void SetCalorSizeYZ(G4double);
void SetNbOfLayers (G4int);
void SetMagField(G4double);
G4VPhysicalVolume* Construct();
void UpdateGeometry();
public:
void PrintCalorParameters();
G4double GetWorldSizeX() {return WorldSizeX;};
G4double GetWorldSizeYZ() {return WorldSizeYZ;};
G4double GetCalorThickness() {return CalorThickness;};
G4double GetCalorSizeYZ() {return CalorSizeYZ;};
G4int GetNbOfLayers() {return NbOfLayers;};
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
G4double GetAbsorberThickness() {return AbsorberThickness;};
G4Material* GetGapMaterial() {return GapMaterial;};
G4double GetGapThickness() {return GapThickness;};
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
const G4VPhysicalVolume* GetGap() {return physiGap;};
private:
G4Material* AbsorberMaterial;
G4double AbsorberThickness;
G4Material* GapMaterial;
G4double GapThickness;
G4int NbOfLayers;
G4double LayerThickness;
G4double CalorSizeYZ;
G4double CalorThickness;
G4Material* defaultMaterial;
G4double WorldSizeYZ;
G4double WorldSizeX;
G4Box* solidWorld; //pointer to the solid World
G4LogicalVolume* logicWorld; //pointer to the logical World
G4VPhysicalVolume* physiWorld; //pointer to the physical World
G4Box* solidCalor; //pointer to the solid Calor
G4LogicalVolume* logicCalor; //pointer to the logical Calor
G4VPhysicalVolume* physiCalor; //pointer to the physical Calor
G4Box* solidLayer; //pointer to the solid Layer
G4LogicalVolume* logicLayer; //pointer to the logical Layer
G4VPhysicalVolume* physiLayer; //pointer to the physical Layer
G4Box* solidAbsorber; //pointer to the solid Absorber
G4LogicalVolume* logicAbsorber; //pointer to the logical Absorber
G4VPhysicalVolume* physiAbsorber; //pointer to the physical Absorber
G4Box* solidGap; //pointer to the solid Gap
G4LogicalVolume* logicGap; //pointer to the logical Gap
G4VPhysicalVolume* physiGap; //pointer to the physical Gap
G4UniformMagField* magField; //pointer to the magnetic field
AnaEx01DetectorMessenger* detectorMessenger; //pointer to the Messenger
AnaEx01CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
private:
void DefineMaterials();
void ComputeCalorParameters();
G4VPhysicalVolume* ConstructCalorimeter();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void AnaEx01DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
LayerThickness = AbsorberThickness + GapThickness;
CalorThickness = NbOfLayers*LayerThickness;
WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
}
#endif
@@ -0,0 +1,54 @@
// 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: AnaEx01DetectorMessenger.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01DetectorMessenger_h
#define AnaEx01DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class AnaEx01DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01DetectorMessenger: public G4UImessenger
{
public:
AnaEx01DetectorMessenger(AnaEx01DetectorConstruction* );
~AnaEx01DetectorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
AnaEx01DetectorConstruction* AnaEx01Detector;
G4UIdirectory* AnaEx01detDir;
G4UIcmdWithAString* AbsMaterCmd;
G4UIcmdWithAString* GapMaterCmd;
G4UIcmdWithADoubleAndUnit* AbsThickCmd;
G4UIcmdWithADoubleAndUnit* GapThickCmd;
G4UIcmdWithADoubleAndUnit* SizeYZCmd;
G4UIcmdWithAnInteger* NbLayersCmd;
G4UIcmdWithADoubleAndUnit* MagFieldCmd;
G4UIcmdWithoutParameter* UpdateCmd;
};
#endif
@@ -0,0 +1,33 @@
// 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: AnaEx01EventAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01EventAction_h
#define AnaEx01EventAction_h
#include "G4UserEventAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01EventAction : public G4UserEventAction {
public:
AnaEx01EventAction(AnaEx01AnalysisManager* = 0);
virtual ~AnaEx01EventAction();
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,68 @@
// 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: AnaEx01PhysicsList.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PhysicsList_h
#define AnaEx01PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PhysicsList: public G4VUserPhysicsList
{
public:
AnaEx01PhysicsList();
~AnaEx01PhysicsList();
protected:
// Construct particle and physics
void ConstructParticle();
void ConstructProcess();
void SetCuts();
public:
// Set/Get cut values
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForProton(G4double);
G4double GetCutForGamma() const;
G4double GetCutForElectron() const;
G4double GetCutForProton() const;
protected:
// these methods Construct particles
void ConstructBosons();
void ConstructLeptons();
void ConstructMesons();
void ConstructBaryons();
protected:
// these methods Construct physics processes and register them
void ConstructGeneral();
void ConstructEM();
private:
G4double cutForGamma;
G4double cutForElectron;
G4double cutForProton;
G4double currentDefaultCut;
};
#endif
@@ -0,0 +1,49 @@
// 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: AnaEx01PrimaryGeneratorAction.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PrimaryGeneratorAction_h
#define AnaEx01PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
class AnaEx01DetectorConstruction;
class AnaEx01PrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
AnaEx01PrimaryGeneratorAction(AnaEx01DetectorConstruction*);
~AnaEx01PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event*);
void SetRndmFlag(G4String val) { rndmFlag = val;}
private:
G4ParticleGun* particleGun; //pointer a to G4 service class
AnaEx01DetectorConstruction* AnaEx01Detector; //pointer to the geometry
AnaEx01PrimaryGeneratorMessenger* gunMessenger; //messenger of this class
G4String rndmFlag; //flag for a random impact point
};
#endif
@@ -0,0 +1,41 @@
// 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: AnaEx01PrimaryGeneratorMessenger.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01PrimaryGeneratorMessenger_h
#define AnaEx01PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class AnaEx01PrimaryGeneratorAction;
class G4UIcmdWithAString;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01PrimaryGeneratorMessenger: public G4UImessenger
{
public:
AnaEx01PrimaryGeneratorMessenger(AnaEx01PrimaryGeneratorAction*);
~AnaEx01PrimaryGeneratorMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
AnaEx01PrimaryGeneratorAction* AnaEx01Action;
G4UIcmdWithAString* RndmCmd;
};
#endif
@@ -0,0 +1,32 @@
// 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: AnaEx01RunAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01RunAction_h
#define AnaEx01RunAction_h
#include "G4UserRunAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01RunAction : public G4UserRunAction {
public:
AnaEx01RunAction(AnaEx01AnalysisManager* = 0);
~AnaEx01RunAction();
public:
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,29 @@
// 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: AnaEx01SteppingAction.hh,v 1.3 2000/11/10 14:12:07 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifndef AnaEx01SteppingAction_h
#define AnaEx01SteppingAction_h
#include "G4UserSteppingAction.hh"
class AnaEx01AnalysisManager;
class AnaEx01SteppingAction : public G4UserSteppingAction {
public:
AnaEx01SteppingAction(AnaEx01AnalysisManager* = 0);
virtual ~AnaEx01SteppingAction();
virtual void UserSteppingAction(const G4Step*);
private:
AnaEx01AnalysisManager* fAnalysisManager;
};
#endif
@@ -0,0 +1,42 @@
// 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: AnaEx01SteppingVerbose.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// AnaEx01SteppingVerbose.hh
//
// Description:
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose
//
//---------------------------------------------------------------
class AnaEx01SteppingVerbose;
#ifndef AnaEx01SteppingVerbose_h
#define AnaEx01SteppingVerbose_h 1
#include "G4SteppingVerbose.hh"
class AnaEx01SteppingVerbose : public G4SteppingVerbose {
public:
// Constructor/Destructor
AnaEx01SteppingVerbose();
~AnaEx01SteppingVerbose();
//
void StepInfo();
void TrackingStarted();
//
};
#endif
@@ -0,0 +1,54 @@
// 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: AnaEx01VisManager.hh,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
// Example Visualization Manager implementing virtual function
// RegisterGraphicsSystems. Exploits C-pre-processor variables
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
// environment variables of the same name are set.
// So all you have to do is set environment variables and compile and
// instantiate this in your main().
// Alternatively, you can implement an empty function here and just
// register the systems you want in your main(), e.g.:
// G4VisManager* myVisManager = new MyVisManager;
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef AnaEx01VisManager_h
#define AnaEx01VisManager_h 1
#ifdef G4VIS_USE
#include "G4VisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class AnaEx01VisManager: public G4VisManager {
public:
AnaEx01VisManager ();
private:
void RegisterGraphicsSystems ();
};
#endif
#endif
@@ -0,0 +1,107 @@
// 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: AnaEx01AnalysisManager.cc,v 1.9 2000/12/06 13:08:03 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// Guy Barrand 14th Septembre 2000.
#ifdef G4ANALYSIS_USE
#include "G4ios.hh"
#include "G4SDManager.hh"
#include "G4Run.hh"
#include "G4Event.hh"
#include "G4HCofThisEvent.hh"
#include <IHistogramFactory.h>
#ifdef G4ANALYSIS_USE_JAS
#include "G4JasSystem.hh"
#endif
#ifdef G4ANALYSIS_USE_LAB
#include "G4LabSystem.hh"
#endif
#ifdef G4ANALYSIS_USE_LIZARD
#include "G4LizardSystem.hh"
#endif
#include "AnaEx01CalorHit.hh"
#include "AnaEx01AnalysisManager.hh"
AnaEx01AnalysisManager::AnaEx01AnalysisManager(
const G4String& aSystem
)
:fCalorimeterCollID(-1)
,fEAbs(0)
,fLAbs(0)
,fEGap(0)
,fLGap(0)
{
#ifdef G4ANALYSIS_USE_JAS
RegisterAnalysisSystem(new G4JasSystem);
#endif
#ifdef G4ANALYSIS_USE_LAB
RegisterAnalysisSystem(new G4LabSystem);
#endif
#ifdef G4ANALYSIS_USE_LIZARD
RegisterAnalysisSystem(new G4LizardSystem);
#endif
// The factory and histograms will be deleted by the analysis manager.
IHistogramFactory* hfactory = GetHistogramFactory(aSystem);
if(!hfactory) return;
fEAbs = hfactory->create1D("EAbs",100,0,100);
fLAbs = hfactory->create1D("LAbs",100,0,100);
fEGap = hfactory->create1D("EGap",100,0,10);
fLGap = hfactory->create1D("LGap",100,0,100);
}
void AnaEx01AnalysisManager::BeginOfRun(const G4Run* aRun){
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
}
void AnaEx01AnalysisManager::EndOfRun(const G4Run*){
Store();
//if(fEAbs) Plot(fEAbs);
}
void AnaEx01AnalysisManager::BeginOfEvent(const G4Event*){
if(fCalorimeterCollID==-1) {
G4SDManager* SDman = G4SDManager::GetSDMpointer();
fCalorimeterCollID = SDman->GetCollectionID("CalCollection");
}
}
void AnaEx01AnalysisManager::EndOfEvent(const G4Event* aEvent){
if(!fEAbs) return; // No histo booked !
//if(!fTuple) return; // No tuple booked !
G4int evtNb = aEvent->GetEventID();
G4HCofThisEvent* HCE = aEvent->GetHCofThisEvent();
AnaEx01CalorHitsCollection* CHC =
HCE ? (AnaEx01CalorHitsCollection*)(HCE->GetHC(fCalorimeterCollID)) : 0;
if(CHC) {
G4int n_hit = CHC->entries();
//G4double totEAbs=0, totLAbs=0, totEGap=0, totLGap=0;
for (G4int i=0;i<n_hit;i++) {
//totEAbs += (*CHC)[i]->GetEdepAbs();
//totLAbs += (*CHC)[i]->GetTrakAbs();
//totEGap += (*CHC)[i]->GetEdepGap();
//totLGap += (*CHC)[i]->GetTrakGap();
fEAbs->fill((*CHC)[i]->GetEdepAbs());
fLAbs->fill((*CHC)[i]->GetTrakAbs());
fEGap->fill((*CHC)[i]->GetEdepGap());
fLGap->fill((*CHC)[i]->GetTrakGap());
}
}
}
void AnaEx01AnalysisManager::Step(const G4Step*){}
#endif
@@ -0,0 +1,68 @@
// 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: AnaEx01CalorHit.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01CalorHit.hh"
G4Allocator<AnaEx01CalorHit> AnaEx01CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorHit::AnaEx01CalorHit()
{
EdepAbs = 0.; TrackLengthAbs = 0.;
EdepGap = 0.; TrackLengthGap = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorHit::~AnaEx01CalorHit()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorHit::AnaEx01CalorHit(const AnaEx01CalorHit& right)
{
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const AnaEx01CalorHit& AnaEx01CalorHit::operator=(const AnaEx01CalorHit& right)
{
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int AnaEx01CalorHit::operator==(const AnaEx01CalorHit& right) const
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorHit::Draw()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorHit::Print()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,123 @@
// 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: AnaEx01CalorimeterSD.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01CalorimeterSD.hh"
#include "AnaEx01CalorHit.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorimeterSD::AnaEx01CalorimeterSD(G4String name,
AnaEx01DetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
collectionName.insert("CalCollection");
HitID = new G4int[500];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01CalorimeterSD::~AnaEx01CalorimeterSD()
{
delete [] HitID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
{
CalCollection = new AnaEx01CalorHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int j=0;j<Detector->GetNbOfLayers();j++) {HitID[j] = -1;};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool AnaEx01CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
G4double stepl = 0.;
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
stepl = aStep->GetStepLength();
if ((edep==0.)&&(stepl==0.)) return false;
G4TouchableHistory* theTouchable
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
//theTouchable->MoveUpHistory();
G4int LayerNumber = 0;
if (Detector->GetNbOfLayers()>1) LayerNumber=theTouchable->GetReplicaNumber(1);
if (HitID[LayerNumber]==-1)
{
AnaEx01CalorHit* calHit = new AnaEx01CalorHit();
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
if (physVol == Detector->GetGap ()) calHit->AddGap(edep,stepl);
HitID[LayerNumber] = CalCollection->insert(calHit) - 1;
if (verboseLevel>0)
G4cout << " New Calorimeter Hit on layer: " << LayerNumber << G4endl;
}
else
{
if (physVol == Detector->GetAbsorber())
(*CalCollection)[HitID[LayerNumber]]->AddAbs(edep,stepl);
if (physVol == Detector->GetGap())
(*CalCollection)[HitID[LayerNumber]]->AddGap(edep,stepl);
if (verboseLevel>0)
G4cout << " Energy added to Layer: " << LayerNumber << G4endl;
}
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
HCE->AddHitsCollection(HCID,CalCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::DrawAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01CalorimeterSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,466 @@
// 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: AnaEx01DetectorConstruction.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01DetectorMessenger.hh"
#include "AnaEx01CalorimeterSD.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4UniformMagField.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01DetectorConstruction::AnaEx01DetectorConstruction()
:solidWorld(NULL),logicWorld(NULL),physiWorld(NULL),
solidCalor(NULL),logicCalor(NULL),physiCalor(NULL),
solidLayer(NULL),logicLayer(NULL),physiLayer(NULL),
solidAbsorber(NULL),logicAbsorber(NULL),physiAbsorber(NULL),
solidGap (NULL),logicGap (NULL),physiGap (NULL),
AbsorberMaterial(NULL),GapMaterial(NULL),defaultMaterial(NULL),
magField(NULL),calorimeterSD(NULL)
{
// default parameter values of the calorimeter
AbsorberThickness = 10.*mm;
GapThickness = 5.*mm;
NbOfLayers = 10;
CalorSizeYZ = 10.*cm;
ComputeCalorParameters();
// create commands for interactive definition of the calorimeter
detectorMessenger = new AnaEx01DetectorMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01DetectorConstruction::~AnaEx01DetectorConstruction()
{ delete detectorMessenger;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* AnaEx01DetectorConstruction::Construct()
{
DefineMaterials();
return ConstructCalorimeter();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::DefineMaterials()
{
//This function illustrates the possible ways to define materials
G4String name, symbol; //a=mass of a mole;
G4double a, z, density; //z=mean number of protons;
G4int iz, n; //iz=number of protons in an isotope;
// n=number of nucleons in an isotope;
G4int ncomponents, natoms;
G4double abundance, fractionmass;
G4double temperature, pressure;
//
// define Elements
//
a = 1.01*g/mole;
G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
a = 12.01*g/mole;
G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
a = 14.01*g/mole;
G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
a = 16.00*g/mole;
G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
a = 28.09*g/mole;
G4Element* Si = new G4Element(name="Silicon",symbol="Si" , z= 14., a);
a = 55.85*g/mole;
G4Element* Fe = new G4Element(name="Iron" ,symbol="Fe", z=26., a);
//
// define an Element from isotopes, by relative abundance
//
G4Isotope* U5 = new G4Isotope(name="U235", iz=92, n=235, a=235.01*g/mole);
G4Isotope* U8 = new G4Isotope(name="U238", iz=92, n=238, a=238.03*g/mole);
G4Element* U = new G4Element(name="enriched Uranium", symbol="U", ncomponents=2);
U->AddIsotope(U5, abundance= 90.*perCent);
U->AddIsotope(U8, abundance= 10.*perCent);
//
// define simple materials
//
density = 2.700*g/cm3;
a = 26.98*g/mole;
G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
density = 1.390*g/cm3;
a = 39.95*g/mole;
G4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
density = 8.960*g/cm3;
a = 63.55*g/mole;
G4Material* Cu = new G4Material(name="Copper" , z=29., a, density);
density = 11.35*g/cm3;
a = 207.19*g/mole;
G4Material* Pb = new G4Material(name="Lead" , z=82., a, density);
//
// define a material from elements. case 1: chemical molecule
//
density = 1.000*g/cm3;
G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
H2O->AddElement(H, natoms=2);
H2O->AddElement(O, natoms=1);
density = 1.032*g/cm3;
G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
Sci->AddElement(C, natoms=9);
Sci->AddElement(H, natoms=10);
density = 2.200*g/cm3;
G4Material* SiO2 = new G4Material(name="quartz", density, ncomponents=2);
SiO2->AddElement(Si, natoms=1);
SiO2->AddElement(O , natoms=2);
//
// define a material from elements. case 2: mixture by fractional mass
//
density = 1.290*mg/cm3;
G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
Air->AddElement(N, fractionmass=0.7);
Air->AddElement(O, fractionmass=0.3);
//
// define a material from elements and/or others materials (mixture of mixtures)
//
density = 0.200*g/cm3;
G4Material* Aerog = new G4Material(name="Aerogel", density, ncomponents=3);
Aerog->AddMaterial(SiO2, fractionmass=62.5*perCent);
Aerog->AddMaterial(H2O , fractionmass=37.4*perCent);
Aerog->AddElement (C , fractionmass= 0.1*perCent);
//
// examples of gas in non STP conditions
//
density = 27.*mg/cm3;
pressure = 50.*atmosphere;
temperature = 325.*kelvin;
G4Material* CO2 = new G4Material(name="CarbonicGas", density, ncomponents=2,
kStateGas,temperature,pressure);
CO2->AddElement(C, natoms=1);
CO2->AddElement(O, natoms=2);
density = 0.3*mg/cm3;
pressure = 2.*atmosphere;
temperature = 500.*kelvin;
G4Material* steam = new G4Material(name="WaterSteam", density, ncomponents=1,
kStateGas,temperature,pressure);
steam->AddMaterial(H2O, fractionmass=1.);
//
// examples of vacuum
//
density = universe_mean_density; //from PhysicalConstants.h
pressure = 3.e-18*pascal;
temperature = 2.73*kelvin;
new G4Material(name="Galactic", z=1., a=1.01*g/mole, density,
kStateGas,temperature,pressure);
density = 1.e-5*g/cm3;
pressure = 2.e-2*bar;
temperature = STP_Temperature; //from PhysicalConstants.h
G4Material* beam = new G4Material(name="Beam", density, ncomponents=1,
kStateGas,temperature,pressure);
beam->AddMaterial(Air, fractionmass=1.);
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
//default materials of the calorimeter
AbsorberMaterial = Pb;
GapMaterial = lAr;
defaultMaterial = Air;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VPhysicalVolume* AnaEx01DetectorConstruction::ConstructCalorimeter()
{
// complete the Calor parameters definition
ComputeCalorParameters();
//
// World
//
solidWorld = new G4Box("World", //its name
WorldSizeX/2,WorldSizeYZ/2,WorldSizeYZ/2); //its size
logicWorld = new G4LogicalVolume(solidWorld, //its solid
defaultMaterial, //its material
"World"); //its name
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"World", //its name
logicWorld, //its logical volume
NULL, //its mother volume
false, //no boolean operation
0); //copy number
//
// Calorimeter
//
solidCalor=NULL; logicCalor=NULL; physiCalor=NULL;
solidLayer=NULL; logicLayer=NULL; physiLayer=NULL;
if (CalorThickness > 0.)
{ solidCalor = new G4Box("Calorimeter", //its name
CalorThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);//size
logicCalor = new G4LogicalVolume(solidCalor, //its solid
defaultMaterial, //its material
"Calorimeter"); //its name
physiCalor = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"Calorimeter", //its name
logicCalor, //its logical volume
physiWorld, //its mother volume
false, //no boolean operation
0); //copy number
//
// Layer
//
solidLayer = new G4Box("Layer", //its name
LayerThickness/2,CalorSizeYZ/2,CalorSizeYZ/2); //size
logicLayer = new G4LogicalVolume(solidLayer, //its solid
defaultMaterial, //its material
"Layer"); //its name
if (NbOfLayers > 1)
physiLayer = new G4PVReplica("Layer", //its name
logicLayer, //its logical volume
physiCalor, //its mother
kXAxis, //axis of replication
NbOfLayers, //number of replica
LayerThickness); //witdth of replica
else
physiLayer = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"Layer", //its name
logicLayer, //its logical volume
physiCalor, //its mother volume
false, //no boolean operation
0); //copy number
}
//
// Absorber
//
solidAbsorber=NULL; logicAbsorber=NULL; physiAbsorber=NULL;
if (AbsorberThickness > 0.)
{ solidAbsorber = new G4Box("Absorber", //its name
AbsorberThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);
logicAbsorber = new G4LogicalVolume(solidAbsorber, //its solid
AbsorberMaterial, //its material
"Absorber"); //its name
physiAbsorber = new G4PVPlacement(0, //no rotation
G4ThreeVector(-GapThickness/2,0.,0.), //its position
"Absorber", //its name
logicAbsorber, //its logical volume
physiLayer, //its mother
false, //no boulean operat
0); //copy number
}
//
// Gap
//
solidGap=NULL; logicGap=NULL; physiGap=NULL;
if (GapThickness > 0.)
{ solidGap = new G4Box("Gap",
GapThickness/2,CalorSizeYZ/2,CalorSizeYZ/2);
logicGap = new G4LogicalVolume(solidGap,
GapMaterial,
"Gap");
physiGap = new G4PVPlacement(0, //no rotation
G4ThreeVector(AbsorberThickness/2,0.,0.), //its position
"Gap", //its name
logicGap, //its logical volume
physiLayer, //its mother
false, //no boulean operat
0); //copy number
}
//
// Sensitive Detectors: Absorber and Gap
//
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(!calorimeterSD)
{
calorimeterSD = new AnaEx01CalorimeterSD("CalorSD",this);
SDman->AddNewDetector( calorimeterSD );
}
if (logicAbsorber)
logicAbsorber->SetSensitiveDetector(calorimeterSD);
if (logicGap)
logicGap ->SetSensitiveDetector(calorimeterSD);
//
// Visualization attributes
//
logicWorld->SetVisAttributes (G4VisAttributes::Invisible);
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
simpleBoxVisAtt->SetVisibility(true);
logicCalor->SetVisAttributes(simpleBoxVisAtt);
//
//always return the physical World
//
PrintCalorParameters();
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::PrintCalorParameters()
{
G4cout << "\n------------------------------------------------------------"
<< "\n---> The calorimeter is " << NbOfLayers << " layers of: [ "
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName()
<< " + "
<< GapThickness/mm << "mm of " << GapMaterial->GetName() << " ] "
<< "\n------------------------------------------------------------\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial)
{AbsorberMaterial = pttoMaterial;
logicAbsorber->SetMaterial(pttoMaterial);
PrintCalorParameters();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetGapMaterial(G4String materialChoice)
{
// search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
if (pttoMaterial)
{GapMaterial = pttoMaterial;
logicGap->SetMaterial(pttoMaterial);
PrintCalorParameters();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetAbsorberThickness(G4double val)
{
// change Absorber thickness and recompute the calorimeter parameters
AbsorberThickness = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetGapThickness(G4double val)
{
// change Gap thickness and recompute the calorimeter parameters
GapThickness = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetCalorSizeYZ(G4double val)
{
// change the transverse size and recompute the calorimeter parameters
CalorSizeYZ = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetNbOfLayers(G4int val)
{
NbOfLayers = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::SetMagField(G4double fieldValue)
{
//apply a global uniform magnetic field along Z axis
G4FieldManager* fieldMgr
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
if(magField) delete magField; //delete the existing magn field
if(fieldValue!=0.) // create a new one if non nul
{ magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue));
fieldMgr->SetDetectorField(magField);
fieldMgr->CreateChordFinder(magField);
} else {
magField = NULL;
fieldMgr->SetDetectorField(magField);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorConstruction::UpdateGeometry()
{
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,125 @@
// 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: AnaEx01DetectorMessenger.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01DetectorMessenger.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01DetectorMessenger::AnaEx01DetectorMessenger(AnaEx01DetectorConstruction * AnaEx01Det)
:AnaEx01Detector(AnaEx01Det)
{
AnaEx01detDir = new G4UIdirectory("/calor/");
AnaEx01detDir->SetGuidance("AnaEx01 detector control.");
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
AbsMaterCmd->SetParameterName("choice",false);
AbsMaterCmd->AvailableForStates(Idle);
GapMaterCmd = new G4UIcmdWithAString("/calor/setGapMat",this);
GapMaterCmd->SetGuidance("Select Material of the Gap.");
GapMaterCmd->SetParameterName("choice",false);
GapMaterCmd->AvailableForStates(Idle);
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
AbsThickCmd->SetParameterName("Size",false);
AbsThickCmd->SetRange("Size>=0.");
AbsThickCmd->SetUnitCategory("Length");
AbsThickCmd->AvailableForStates(Idle);
GapThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setGapThick",this);
GapThickCmd->SetGuidance("Set Thickness of the Gap");
GapThickCmd->SetParameterName("Size",false);
GapThickCmd->SetRange("Size>=0.");
GapThickCmd->SetUnitCategory("Length");
GapThickCmd->AvailableForStates(Idle);
SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setSizeYZ",this);
SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
SizeYZCmd->SetParameterName("Size",false);
SizeYZCmd->SetRange("Size>0.");
SizeYZCmd->SetUnitCategory("Length");
SizeYZCmd->AvailableForStates(Idle);
NbLayersCmd = new G4UIcmdWithAnInteger("/calor/setNbOfLayers",this);
NbLayersCmd->SetGuidance("Set number of layers.");
NbLayersCmd->SetParameterName("NbLayers",false);
NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
NbLayersCmd->AvailableForStates(Idle);
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
UpdateCmd->SetGuidance("Update calorimeter geometry.");
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
UpdateCmd->AvailableForStates(Idle);
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/calor/setField",this);
MagFieldCmd->SetGuidance("Define magnetic field.");
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
MagFieldCmd->SetParameterName("Bz",false);
MagFieldCmd->SetUnitCategory("Magnetic flux density");
MagFieldCmd->AvailableForStates(Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01DetectorMessenger::~AnaEx01DetectorMessenger()
{
delete NbLayersCmd;
delete AbsMaterCmd; delete GapMaterCmd;
delete AbsThickCmd; delete GapThickCmd;
delete SizeYZCmd; delete UpdateCmd;
delete MagFieldCmd;
delete AnaEx01detDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == AbsMaterCmd )
{ AnaEx01Detector->SetAbsorberMaterial(newValue);}
if( command == GapMaterCmd )
{ AnaEx01Detector->SetGapMaterial(newValue);}
if( command == AbsThickCmd )
{ AnaEx01Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
if( command == GapThickCmd )
{ AnaEx01Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
if( command == SizeYZCmd )
{ AnaEx01Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
if( command == NbLayersCmd )
{ AnaEx01Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
if( command == UpdateCmd )
{ AnaEx01Detector->UpdateGeometry(); }
if( command == MagFieldCmd )
{ AnaEx01Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,36 @@
// 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: AnaEx01EventAction.cc,v 1.3 2000/11/10 14:08:08 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01EventAction.hh"
AnaEx01EventAction::AnaEx01EventAction(
AnaEx01AnalysisManager* aAnalysisManager
):fAnalysisManager(aAnalysisManager){}
AnaEx01EventAction::~AnaEx01EventAction(){}
void AnaEx01EventAction::BeginOfEventAction(const G4Event* aEvent){
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->BeginOfEvent(aEvent);
#endif
}
void AnaEx01EventAction::EndOfEventAction(const G4Event* aEvent) {
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->EndOfEvent(aEvent);
#endif
}
@@ -0,0 +1,356 @@
// 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: AnaEx01PhysicsList.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01PhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PhysicsList::AnaEx01PhysicsList(): G4VUserPhysicsList()
{
currentDefaultCut = defaultCutValue = 1.0*mm;
cutForGamma = defaultCutValue;
cutForElectron = defaultCutValue;
cutForProton = defaultCutValue;
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PhysicsList::~AnaEx01PhysicsList()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructBaryons()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
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());
} 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);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,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);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
} 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);
//
// set ordering for PostStepDoIt
pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
} else if ((!particle->IsShortLived()) &&
(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);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4Decay.hh"
void AnaEx01PhysicsList::ConstructGeneral()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(theDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::SetCuts()
{
// reactualise cutValues
if (currentDefaultCut != defaultCutValue)
{
if(cutForGamma == currentDefaultCut) cutForGamma = defaultCutValue;
if(cutForElectron == currentDefaultCut) cutForElectron = defaultCutValue;
if(cutForProton == currentDefaultCut) cutForProton = defaultCutValue;
currentDefaultCut = defaultCutValue;
}
if (verboseLevel >0){
G4cout << "AnaEx01PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(cutForGamma, "gamma");
SetCutValue(cutForElectron, "e-");
SetCutValue(cutForElectron, "e+");
// set cut values for proton and anti_proton before all other hadrons
// because some processes for hadrons need cut values for proton/anti_proton
SetCutValue(cutForProton, "proton");
SetCutValue(cutForProton, "anti_proton");
SetCutValueForOthers(defaultCutValue);
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PhysicsList::SetCutForGamma(G4double cut)
{
ResetCuts();
cutForGamma = cut;
}
void AnaEx01PhysicsList::SetCutForElectron(G4double cut)
{
ResetCuts();
cutForElectron = cut;
}
void AnaEx01PhysicsList::SetCutForProton(G4double cut)
{
ResetCuts();
cutForProton = cut;
}
G4double AnaEx01PhysicsList::GetCutForGamma() const
{
return cutForGamma;
}
G4double AnaEx01PhysicsList::GetCutForElectron() const
{
return cutForElectron;
}
G4double AnaEx01PhysicsList::GetCutForProton() const
{
return cutForGamma;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,79 @@
// 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: AnaEx01PrimaryGeneratorAction.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01PrimaryGeneratorAction.hh"
#include "AnaEx01DetectorConstruction.hh"
#include "AnaEx01PrimaryGeneratorMessenger.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PrimaryGeneratorAction::AnaEx01PrimaryGeneratorAction(
AnaEx01DetectorConstruction* AnaEx01DC)
:AnaEx01Detector(AnaEx01DC),rndmFlag("off")
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new AnaEx01PrimaryGeneratorMessenger(this);
// default particle kinematic
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="e-");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
particleGun->SetParticleEnergy(30.*MeV);
G4double position = -0.5*(AnaEx01Detector->GetWorldSizeX());
particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PrimaryGeneratorAction::~AnaEx01PrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
G4double x0 = -0.5*(AnaEx01Detector->GetWorldSizeX());
G4double y0 = 0.*cm, z0 = 0.*cm;
if (rndmFlag == "on")
{y0 = (AnaEx01Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
z0 = (AnaEx01Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5);
}
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,51 @@
// 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: AnaEx01PrimaryGeneratorMessenger.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "AnaEx01PrimaryGeneratorMessenger.hh"
#include "AnaEx01PrimaryGeneratorAction.hh"
#include "G4UIcmdWithAString.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PrimaryGeneratorMessenger::AnaEx01PrimaryGeneratorMessenger(AnaEx01PrimaryGeneratorAction* AnaEx01Gun)
:AnaEx01Action(AnaEx01Gun)
{
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
RndmCmd->SetGuidance(" Choice : on(default), off");
RndmCmd->SetParameterName("choice",true);
RndmCmd->SetDefaultValue("on");
RndmCmd->SetCandidates("on off");
RndmCmd->AvailableForStates(PreInit,Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01PrimaryGeneratorMessenger::~AnaEx01PrimaryGeneratorMessenger()
{
delete RndmCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command == RndmCmd )
{ AnaEx01Action->SetRndmFlag(newValue);}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,36 @@
// 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: AnaEx01RunAction.cc,v 1.3 2000/11/10 14:08:09 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01RunAction.hh"
AnaEx01RunAction::AnaEx01RunAction(
AnaEx01AnalysisManager* aAnalysisManager
):fAnalysisManager(aAnalysisManager){}
AnaEx01RunAction::~AnaEx01RunAction(){}
void AnaEx01RunAction::BeginOfRunAction(const G4Run* aRun) {
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->BeginOfRun(aRun);
#endif
}
void AnaEx01RunAction::EndOfRunAction(const G4Run* aRun){
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->EndOfRun(aRun);
#endif
}
@@ -0,0 +1,31 @@
// 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: AnaEx01SteppingAction.cc,v 1.3 2000/11/10 14:08:10 gbarrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
#ifdef G4ANALYSIS_USE
#include "AnaEx01AnalysisManager.hh"
#endif
#include "AnaEx01SteppingAction.hh"
AnaEx01SteppingAction::AnaEx01SteppingAction(
AnaEx01AnalysisManager* aAnalysisManager
):fAnalysisManager(aAnalysisManager){}
AnaEx01SteppingAction::~AnaEx01SteppingAction(){}
void AnaEx01SteppingAction::UserSteppingAction(const G4Step* aStep){
#ifdef G4ANALYSIS_USE
if(fAnalysisManager) fAnalysisManager->Step(aStep);
#endif
}
@@ -0,0 +1,166 @@
// 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: AnaEx01SteppingVerbose.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// AnaEx01SteppingVerbose.cc
//
// Description:
// Implementation of the AnaEx01SteppingVerbose class
//
//---------------------------------------------------------------
#include "AnaEx01SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
////////////////////////////////////////////////
AnaEx01SteppingVerbose::AnaEx01SteppingVerbose()
////////////////////////////////////////////////
{
}
//////////////////////////////////////////////////
AnaEx01SteppingVerbose::~AnaEx01SteppingVerbose()
//////////////////////////////////////////////////
{
}
/////////////////////////////////////////
void AnaEx01SteppingVerbose::StepInfo()
/////////////////////////////////////////
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << G4std::setw( 5) << "#Step#" << " "
<< G4std::setw( 6) << "X" << " "
<< G4std::setw( 6) << "Y" << " "
<< G4std::setw( 6) << "Z" << " "
<< G4std::setw( 9) << "KineE" << " "
<< G4std::setw( 9) << "dEStep" << " "
<< G4std::setw(10) << "StepLeng"
<< G4std::setw(10) << "TrakLeng"
<< G4std::setw(10) << "NextVolu"
<< G4std::setw(10) << "Process" << G4endl;
}
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName();
} else {
G4cout << G4std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << G4std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << "User Limit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot
<< "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << G4std::setw(3) << (*fSecondary).entries()
<< " ---------------"
<< G4endl;
for(G4int lp1=(*fSecondary).entries()-tN2ndariesTot;
lp1<(*fSecondary).entries(); lp1++){
G4cout << " : "
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< G4std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
////////////////////////////////////////////////
void AnaEx01SteppingVerbose::TrackingStarted()
////////////////////////////////////////////////
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << G4std::setw( 5) << "Step#" << " "
<< G4std::setw( 6) << "X" << " "
<< G4std::setw( 6) << "Y" << " "
<< G4std::setw( 6) << "Z" << " "
<< G4std::setw( 9) << "KineE" << " "
<< G4std::setw( 9) << "dEStep" << " "
<< G4std::setw(10) << "StepLeng"
<< G4std::setw(10) << "TrakLeng"
<< G4std::setw(10) << "NextVolu"
<< G4std::setw(10) << "Process" << G4endl;
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
if(fTrack->GetNextVolume()){
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
} else {
G4cout << G4std::setw(10) << "OutOfWorld" << " ";
}
G4cout << G4std::setw(10) << "initStep" << G4endl;
}
G4cout.precision(prec);
}
@@ -0,0 +1,141 @@
// 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: AnaEx01VisManager.cc,v 1.1.1.1 2000/09/14 11:37:21 barrand Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// John Allison 24th January 1998.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifdef G4VIS_USE
#include "AnaEx01VisManager.hh"
// Supported drivers...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_DAWNFILE
#include "G4DAWNFILE.hh"
#endif
#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
#ifdef G4VIS_USE_OIX
#include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
#ifdef G4VIS_USE_VRMLFILE
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
#endif
#ifdef G4VIS_USE_RAYTRACER
#include "G4RayTracer.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
AnaEx01VisManager::AnaEx01VisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void AnaEx01VisManager::RegisterGraphicsSystems () {
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_DAWNFILE
RegisterGraphicsSystem (new G4DAWNFILE);
#endif
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
#ifdef G4VIS_USE_OIX
RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
#ifdef G4VIS_USE_VRMLFILE
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
#endif
#ifdef G4VIS_USE_RAYTRACER
RegisterGraphicsSystem (new G4RayTracer);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2000/05/17 10:55:09 maire Exp $
# $Id: GNUmakefile,v 1.4 2000/12/07 11:43:03 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -16,11 +16,4 @@ all: lib bin
include $(G4INSTALL)/config/architecture.gmk
ifdef G4NOHIST
CPPFLAGS += -DG4NOHIST
else
LDFLAGS += -L$(CERN)/pro/lib
LOADLIBS += -lpacklib $(FCLIBS)
endif
include $(G4INSTALL)/config/binmake.gmk
@@ -1,4 +1,4 @@
$Id: History,v 1.4 2000/06/17 12:44:26 stesting Exp $
$Id: History,v 1.7 2000/12/07 11:43:03 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,9 +14,25 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07-12-00 mma (testem1-V02-00-03 & testem-noHist)
remove hbook histograms: GNUmakefile,runAction,trackingAction,
steppingAction
06-12-00 mma (testem1-V02-00-02 & testem-withHist)
update of init.mac for new vis commands.
G4UItcsh in the main()
24-11-00 Steve O'Neale (tagset210) (testem1-V02-00-01)
Update test output Change in processes below ~ 5 per cent
eIoni and hIoni min.delta energy(keV) and energy cut table
June 17, 2000 John Allison (testem1-V01-00-00)
- Updated TestEm1.out for geant4-01-01-ref-06.
13-11-00 G.Cosmo (testem1-V02-00-00)
Fixed memory leak in Em1RunAction: added call to clearAndDestroy()
in EndOfRunAction() to clean ProcCounter vector.
17-06-00 J.Allison (testem1-V01-00-00)
Updated TestEm1.out for geant4-01-01-ref-06.
21-01-00 cppflag G4NOHIST to protect hbook histograms.
@@ -5,26 +5,18 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: TestEm1.cc,v 1.3 1999/12/15 14:48:48 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// $Id: TestEm1.cc,v 1.4 2000/12/06 13:21:48 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// --------------------------------------------------------------
// GEANT 4 - example Em1
//
// For information related to this code contact:
// CERN, IT Division, ASD Group
// --------------------------------------------------------------
// Comments
//
//
// --------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#define Em1NoOptimize 1
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"
#include "Em1DetectorConstruction.hh"
@@ -43,6 +35,8 @@
#endif
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
int main(int argc,char** argv) {
//choose the Random engine
@@ -85,7 +79,12 @@ int main(int argc,char** argv) {
if (argc==1) // Define UI terminal for interactive mode
{
G4UIsession * session = new G4UIterminal;
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
UI->ApplyCommand("/control/execute init.mac");
session->SessionStart();
delete session;
@@ -109,3 +108,4 @@ int main(int argc,char** argv) {
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -1,6 +1,6 @@
**********************************************
Geant4 version $Name: geant4-02-00 $
(10-Mar-2000)
Geant4 version $Name: geant4-03-00 $
(30-Jun-2000)
Copyright : Geant4 Collaboration
**********************************************
@@ -63,15 +63,16 @@ eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to
material min.delta energy(keV)
Air 0.99
H2liquid 28.677
Water 81.518
liquidArgon 78.381
Aluminium 125.07
Iron 224.12
Lead 229.66
Uranium 295.96
H2liquid 28.675
Water 81.507
liquidArgon 78.362
Aluminium 125.06
Iron 224.07
Lead 229.55
Uranium 296.06
eBrem: Total cross sections from a parametrisation. Good description from 10 KeV to 100 GeV.
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.
@@ -90,13 +91,13 @@ msc: Tables of transport mean free paths.
material min.delta energy(keV)
Air 0.99
H2liquid 28.677
Water 81.518
liquidArgon 78.381
Aluminium 125.07
Iron 224.12
Lead 229.66
Uranium 295.96
H2liquid 28.675
Water 81.507
liquidArgon 78.362
Aluminium 125.06
Iron 224.07
Lead 229.55
Uranium 296.06
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
@@ -121,19 +122,19 @@ MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
============= The cut Energy ==============================
gamma e- mu- proton neutron
Cut in range 1 mm 1 mm 1 mm 1 mm 1 mm
gamma e-
Cut in range 1 mm 1 mm
Cut in energy
Air 990 eV 990 eV 48.4 keV 83.2 keV 990 eV
H2liquid 990 eV 108 keV 1.23 MeV 3.18 MeV 990 eV
Water 2.9 keV 347 keV 3.39 MeV 8.95 MeV 990 eV
liquidArgon 6.18 keV 343 keV 3.24 MeV 8.32 MeV 990 eV
Aluminium 6.89 keV 597 keV 5.02 MeV 13.1 MeV 990 eV
Iron 20.8 keV 1.28 MeV 8.52 MeV 22 MeV 990 eV
Lead 101 keV 1.38 MeV 8.52 MeV 20.9 MeV 990 eV
Uranium 110 keV 1.92 MeV 10.5 MeV 26.1 MeV 990 eV
Air 990 eV 990 eV
H2liquid 990 eV 108 keV
Water 2.9 keV 347 keV
liquidArgon 6.18 keV 343 keV
Aluminium 6.89 keV 597 keV
Iron 20.8 keV 1.28 MeV
Lead 101 keV 1.38 MeV
Uranium 110 keV 1.92 MeV
===================================================
# $Id: TestEm1.out,v 1.4 2000/06/17 12:44:26 stesting Exp $
# $Id: TestEm1.out,v 1.7 2000/11/24 10:36:58 stesting Exp $
#
# Macro file for "TestEm1.cc"
# (can be run in batch, without graphic)
@@ -175,13 +176,14 @@ eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to
Air 0.99
H2liquid 0.99
Water 3.2733
liquidArgon 3.7298
Aluminium 6.301
Iron 10.426
Lead 8.9969
Uranium 11.567
liquidArgon 3.7293
Aluminium 6.3003
Iron 10.422
Lead 8.9769
Uranium 11.54
eBrem: Total cross sections from a parametrisation. Good description from 10 KeV to 100 GeV.
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.
@@ -202,11 +204,11 @@ msc: Tables of transport mean free paths.
Air 0.99
H2liquid 0.99
Water 3.2733
liquidArgon 3.7298
Aluminium 6.301
Iron 10.426
Lead 8.9969
Uranium 11.567
liquidArgon 3.7293
Aluminium 6.3003
Iron 10.422
Lead 8.9769
Uranium 11.54
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
@@ -231,17 +233,17 @@ MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
============= The cut Energy ==============================
gamma e- mu- proton neutron
Cut in range 2.2 mm 6.05 mum 1 mm 1 mm 1 mm
gamma e-
Cut in range 2.2 mm 6.05 mum
Cut in energy
Air 990 eV 990 eV 48.4 keV 83.2 keV 990 eV
H2liquid 990 eV 990 eV 1.23 MeV 3.18 MeV 990 eV
Water 4.06 keV 3.27 keV 3.39 MeV 8.95 MeV 990 eV
liquidArgon 9.08 keV 3.98 keV 3.24 MeV 8.32 MeV 990 eV
Aluminium 9.99 keV 9.97 keV 5.02 MeV 13.1 MeV 990 eV
Iron 31.1 keV 43.3 keV 8.52 MeV 22 MeV 990 eV
Lead 124 keV 42.8 keV 8.52 MeV 20.9 MeV 990 eV
Uranium 143 keV 53.4 keV 10.5 MeV 26.1 MeV 990 eV
Air 990 eV 990 eV
H2liquid 990 eV 990 eV
Water 4.06 keV 3.27 keV
liquidArgon 9.08 keV 3.98 keV
Aluminium 9.99 keV 9.97 keV
Iron 31.1 keV 43.3 keV
Lead 124 keV 42.8 keV
Uranium 143 keV 53.4 keV
===================================================
#
/run/verbose 2
@@ -263,18 +265,18 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 100
User=68.58s Real=73.99s Sys=4.55s
User=70.06s Real=75.54s Sys=4.95s
nb tracks/event neutral: 24.41 charged: 637.29
nb steps/event neutral: 132.32 charged: 1260.26
nb tracks/event neutral: 28.42 charged: 650.00
nb steps/event neutral: 151.89 charged: 1278.63
nb of process calls per event:
eIoni eBrem phot compt conv annihil
1237.22 21.65 23.02 107.91 1.39 1.39
1251.55 25.69 27.03 123.47 1.39 1.39
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 1386467388, 892794333
Current couple of seeds = 1391858697, 202982242
----------------------------------------
G4 kernel has come to Quit state.
Deletion of G4 kernel class start.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1DetectorConstruction.hh,v 1.2 1999/12/15 14:48:52 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1DetectorMessenger.hh,v 1.2 1999/12/15 14:48:53 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1EventAction.hh,v 1.2 1999/12/15 14:48:55 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1EventActionMessenger.hh,v 1.2 1999/12/15 14:48:55 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PhysicsList.hh,v 1.2 1999/12/15 14:48:55 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PhysicsListMessenger.hh,v 1.2 1999/12/15 14:48:55 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PrimaryGeneratorAction.hh,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1RunAction.hh,v 1.3 2000/01/21 12:29:25 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1RunAction.hh,v 1.4 2000/12/07 11:43:04 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -25,11 +25,6 @@
class G4Run;
class Em1RunActionMessenger;
#ifndef G4NOHIST
class HepTupleManager;
class HepHistogram;
#endif
class Em1RunAction : public G4UserRunAction
{
public:
@@ -49,11 +44,7 @@ class Em1RunAction : public G4UserRunAction
public:
void SetRndmFreq(G4int val) {saveRndm = val;}
G4int GetRndmFreq() {return saveRndm;}
#ifndef G4NOHIST
HepHistogram* GetHisto(G4int id) {return histo[id];}
#endif
private:
void bookHisto();
void cleanHisto();
@@ -65,11 +56,6 @@ class Em1RunAction : public G4UserRunAction
Em1RunActionMessenger* runMessenger;
G4int saveRndm;
#ifndef G4NOHIST
HepTupleManager* hbookManager;
HepHistogram* histo[3];
#endif
};
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1RunActionMessenger.hh,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1SteppingAction.hh,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,18 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1SteppingVerbose.hh,v 1.3 2000/02/29 12:13:24 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1SteppingVerbose.hh,v 1.4 2000/12/06 13:21:49 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// Em1SteppingVerbose.hh
//
// Description:
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
// It shows how to extract informations during the tracking of a particle.
//
//---------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
class Em1SteppingVerbose;
@@ -25,16 +22,17 @@ class Em1SteppingVerbose;
#include "G4SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
class Em1SteppingVerbose : public G4SteppingVerbose {
public:
// Constructor/Destructor
Em1SteppingVerbose();
~Em1SteppingVerbose();
//
void StepInfo();
void TrackingStarted();
//
};
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1TrackingAction.hh,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1VisManager.hh,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -7,7 +7,7 @@
// and all its terms.
//
// $Id: ProcessesCount.hh,v 1.3 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// -----------------------------------------------------------------
@@ -5,6 +5,7 @@
# and initializes the graphic.
#
/control/verbose 2
/run/verbose 2
#
####/run/initialize
#
@@ -18,27 +19,18 @@
# Create empty scene ("world" is default)
/vis/scene/create
#
# Add volume to scene
/vis/scene/add/volume
#
# Create a scene handler for a specific graphics system
# Edit the next line(s) to choose another graphic system
#
#/vis/sceneHandler/create DAWNFILE
/vis/sceneHandler/create OGLIX
#
# Create a viewer
/vis/viewer/create
#/vis/open DAWNFILE
/vis/open OGLIX
#
# Draw scene
/vis/scene/notifyHandlers
/vis/camera/zoom 1.4
/vis/drawVolume
#
# for drawing the tracks
# if too many tracks cause core dump => storeTrajectory 0
/tracking/storeTrajectory 1
/event/drawTracks all
#
# Flush visualization
/vis/viewer/update
#
/run/verbose 2
@@ -1,4 +1,4 @@
# $Id: run04.mac,v 1.1 1999/10/11 13:07:27 maire Exp $
# $Id: run04.mac,v 1.2 2000/12/06 13:21:49 maire Exp $
#
# Macro file for "TestEm1.cc"
# (can be run in batch, without graphic)
@@ -11,9 +11,9 @@
#
/process/eLoss/StepFunction 0.183 170 micrometer
/calor/cutG 95 cm
/calor/cutE 6.05 micrometer
#/calor/cutE 6.05 micrometer
/calor/cutE 100. micrometer
/run/initialize
/run/particle/dumpCutValues
#
/process/inactivate phot
/process/inactivate compt
@@ -6,8 +6,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1DetectorConstruction.cc,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1DetectorConstruction.cc,v 1.4 2000/12/13 11:11:59 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -109,6 +109,10 @@ density = 2.700*g/cm3;
a = 26.98*g/mole;
G4Material* Al = new G4Material(name="Aluminium" , z=13., a, density);
density = 2.330*g/cm3;
a = 28.09*g/mole;
G4Material* Si = new G4Material(name="Silicon" , z=14., a, density);
density = 7.870*g/cm3;
a = 55.85*g/mole;
G4Material* Fe = new G4Material(name="Iron" , z=26., a, density);
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1DetectorMessenger.cc,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1EventAction.cc,v 1.2 1999/12/15 14:48:56 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1EventActionMessenger.cc,v 1.2 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PhysicsList.cc,v 1.3 2000/03/05 03:31:39 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PhysicsListMessenger.cc,v 1.2 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1PrimaryGeneratorAction.cc,v 1.2 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1RunAction.cc,v 1.4 2000/01/21 12:29:26 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1RunAction.cc,v 1.6 2000/12/07 11:43:04 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -24,51 +24,30 @@
#include "Randomize.hh"
#ifndef G4NOHIST
#include "CLHEP/Hist/HBookFile.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em1RunAction::Em1RunAction()
{runMessenger = new Em1RunActionMessenger(this);
saveRndm = 1;
#ifndef G4NOHIST
hbookManager = NULL;
#endif
}
: ProcCounter(0), saveRndm (1),
runMessenger(new Em1RunActionMessenger(this))
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em1RunAction::~Em1RunAction()
{cleanHisto();
{
cleanHisto();
delete runMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em1RunAction::bookHisto()
{
#ifndef G4NOHIST
hbookManager = new HBookFile("testem1.histo", 68);
// booking histograms
histo[0] = hbookManager->histogram("track length (mm) of a charged particle",100,0.,50*cm);
histo[1] = hbookManager->histogram("Nb of steps per track (charged particle)",100,0.,100.);
histo[2] = hbookManager->histogram("step length (mm) charged particle",100,0.,10*mm);
#endif
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em1RunAction::cleanHisto()
{
#ifndef G4NOHIST
delete [] histo;
delete hbookManager;
#endif
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -142,7 +121,8 @@ void Em1RunAction::EndOfRunAction(const G4Run* aRun)
G4cout.setf(oldform,G4std::ios::floatfield);
G4cout.precision(oldprec);
}
ProcCounter->clearAndDestroy();
delete ProcCounter;
//draw the events
@@ -154,11 +134,6 @@ void Em1RunAction::EndOfRunAction(const G4Run* aRun)
{ HepRandom::showEngineStatus();
HepRandom::saveEngineStatus("endOfRun.rndm");
}
#ifndef G4NOHIST
// writing histogram file
hbookManager->write();
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1RunActionMessenger.cc,v 1.2 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1SteppingAction.cc,v 1.3 2000/01/21 12:29:26 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1SteppingAction.cc,v 1.4 2000/12/07 11:43:04 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -19,10 +19,6 @@
#include "G4SteppingManager.hh"
#include "G4VProcess.hh"
#ifndef G4NOHIST
#include "CLHEP/Hist/HBookFile.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em1SteppingAction::Em1SteppingAction(Em1RunAction* RuAct, Em1EventAction* EvAct)
@@ -45,11 +41,7 @@ void Em1SteppingAction::UserSteppingAction(const G4Step* aStep)
if (process) runAction->CountProcesses(process->GetProcessName());
G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
G4double steplen = aStep->GetStepLength();
#ifndef G4NOHIST
if (charge != 0.) runAction->GetHisto(2)->accumulate(steplen);
#endif
G4double steplen = aStep->GetStepLength();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -5,39 +5,30 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1SteppingVerbose.cc,v 1.3 2000/02/29 12:13:24 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1SteppingVerbose.cc,v 1.4 2000/12/06 13:21:50 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// Em1SteppingVerbose.cc
//
// Description:
// Implementation of the Em1SteppingVerbose class
//
//---------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#include "Em1SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Em1SteppingVerbose::Em1SteppingVerbose()
////////////////////////////////////////////////
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//////////////////////////////////////////////////
Em1SteppingVerbose::~Em1SteppingVerbose()
//////////////////////////////////////////////////
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
/////////////////////////////////////////
void Em1SteppingVerbose::StepInfo()
/////////////////////////////////////////
{
CopyState();
@@ -124,11 +115,11 @@ void Em1SteppingVerbose::StepInfo()
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
////////////////////////////////////////////////
void Em1SteppingVerbose::TrackingStarted()
////////////////////////////////////////////////
{
CopyState();
@@ -163,4 +154,6 @@ G4int prec = G4cout.precision(3);
G4cout << G4std::setw(10) << "initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -6,8 +6,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em1TrackingAction.cc,v 1.3 2000/01/21 12:29:26 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em1TrackingAction.cc,v 1.4 2000/12/07 11:43:04 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -18,10 +18,6 @@
#include "Em1RunAction.hh"
#include "G4Track.hh"
#ifndef G4NOHIST
#include "CLHEP/Hist/HBookFile.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -42,10 +38,6 @@ void Em1TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (aTrack->GetDefinition()->GetPDGCharge() == 0.)
{runAction->CountTraks0(1); runAction->CountSteps0(nbSteps);}
else {runAction->CountTraks1(1); runAction->CountSteps1(nbSteps);
#ifndef G4NOHIST
runAction->GetHisto(0)->accumulate(Trleng);
runAction->GetHisto(1)->accumulate((float)nbSteps);
#endif
}
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em1VisManager.cc,v 1.2 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// John Allison 24th January 1998.
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2000/05/17 10:55:39 maire Exp $
# $Id: GNUmakefile,v 1.4 2000/12/07 12:14:06 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -16,11 +16,4 @@ all: lib bin
include $(G4INSTALL)/config/architecture.gmk
ifdef G4NOHIST
CPPFLAGS += -DG4NOHIST
else
LDFLAGS += -L$(CERN)/pro/lib
LOADLIBS += -lpacklib $(FCLIBS)
endif
include $(G4INSTALL)/config/binmake.gmk
@@ -1,4 +1,4 @@
$Id: History,v 1.4 2000/06/24 08:01:20 stesting Exp $
$Id: History,v 1.7 2000/12/07 12:14:06 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,21 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07-12-00 mma (testem2-V02-00-03 & testem-noHist)
remove hbook histograms: GNUmakefile,runAction
06-12-00 mma (testem2-V02-00-02 & testem-withHist)
update of init.mac for new vis commands.
G4UItcsh in the main()
25th November 2000 Steve O'Neale (tagset210)
- Update test outputs for min.delta energy cut and cut tabulation
- Update test outputs Lateral profile changes comparable with rms (10 per cent)
- in first layers, Radial profile stable (values to 1 percent).
June 28, 2000 John Allison (testem2-V02-00-00)
- Updated TestEm2.out for geant4-02-00.
June 24, 2000 John Allison (testem2-V01-01-02)
- Updated TestEm2.out for stand-V01-01-05 and utils-V01-01-03.
@@ -5,17 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: TestEm2.cc,v 1.3 1999/12/15 14:48:57 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: TestEm2.cc,v 1.4 2000/12/06 14:12:15 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// Comments
//
//
// --------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"
#ifdef G4VIS_USE
@@ -31,6 +30,8 @@
#include "Em2SteppingAction.hh"
#include "Em2SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
int main(int argc,char** argv) {
//choose the Random engine
@@ -71,7 +72,12 @@ int main(int argc,char** argv) {
if (argc==1) // Define UI terminal for interactive mode.
{
G4UIsession * session = new G4UIterminal;
G4UIsession * session = 0;
#ifdef G4UI_USE_TCSH
session = new G4UIterminal(new G4UItcsh);
#else
session = new G4UIterminal();
#endif
UI->ApplyCommand("/control/execute init.mac");
session->SessionStart();
delete session;
@@ -92,3 +98,5 @@ int main(int argc,char** argv) {
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -1,6 +1,6 @@
**********************************************
Geant4 version $Name: geant4-02-00 $
(10-Mar-2000)
Geant4 version $Name: geant4-03-00 $
(30-Jun-2000)
Copyright : Geant4 Collaboration
**********************************************
@@ -69,16 +69,17 @@ eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to
material min.delta energy(keV)
Air 0.99
Water 81.518
lAr 78.381
Al 125.07
Fe 224.12
BGO 187.02
PbWO4 200.98
Tungsten 337
Lead 229.66
Water 81.507
lAr 78.362
Al 125.06
Fe 224.07
BGO 186.87
PbWO4 200.84
Tungsten 337.27
Lead 229.55
eBrem: Total cross sections from a parametrisation. Good description from 10 KeV to 100 GeV.
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.
@@ -97,14 +98,14 @@ msc: Tables of transport mean free paths.
material min.delta energy(keV)
Air 0.99
Water 81.518
lAr 78.381
Al 125.07
Fe 224.12
BGO 187.02
PbWO4 200.98
Tungsten 337
Lead 229.66
Water 81.507
lAr 78.362
Al 125.06
Fe 224.07
BGO 186.87
PbWO4 200.84
Tungsten 337.27
Lead 229.55
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
@@ -129,20 +130,20 @@ MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
============= The cut Energy ==============================
gamma e- mu- proton neutron
Cut in range 1 mm 1 mm 1 mm 1 mm 1 mm
gamma e-
Cut in range 1 mm 1 mm
Cut in energy
Air 990 eV 990 eV 48.4 keV 83.2 keV 990 eV
Water 2.9 keV 347 keV 3.39 MeV 8.95 MeV 990 eV
lAr 6.18 keV 343 keV 3.24 MeV 8.32 MeV 990 eV
Al 6.89 keV 597 keV 5.02 MeV 13.1 MeV 990 eV
Fe 20.8 keV 1.28 MeV 8.52 MeV 22 MeV 990 eV
BGO 77.7 keV 1.03 MeV 7.17 MeV 18.1 MeV 990 eV
PbWO4 84.8 keV 1.13 MeV 7.63 MeV 19.2 MeV 990 eV
Tungsten 105 keV 2.31 MeV 11.7 MeV 29.5 MeV 990 eV
Lead 101 keV 1.38 MeV 8.52 MeV 20.9 MeV 990 eV
Air 990 eV 990 eV
Water 2.9 keV 347 keV
lAr 6.18 keV 343 keV
Al 6.89 keV 597 keV
Fe 20.8 keV 1.28 MeV
BGO 77.7 keV 1.03 MeV
PbWO4 84.8 keV 1.13 MeV
Tungsten 105 keV 2.31 MeV
Lead 101 keV 1.38 MeV
===================================================
# $Id: TestEm2.out,v 1.5 2000/06/24 08:01:20 stesting Exp $
# $Id: TestEm2.out,v 1.9 2000/11/24 10:50:41 stesting Exp $
#
# Macro file for "TestEm2.cc"
# (can be run in batch, without graphic)
@@ -189,16 +190,17 @@ eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to
material min.delta energy(keV)
Air 3.2397
Water 215.05
lAr 209.6
Al 349.54
Fe 697.76
BGO 570.46
PbWO4 624.12
Tungsten 1195.6
Lead 745.94
Water 215.03
lAr 209.58
Al 349.52
Fe 697.65
BGO 571.17
PbWO4 625.41
Tungsten 1205.1
Lead 750.46
eBrem: Total cross sections from a parametrisation. Good description from 10 KeV to 100 GeV.
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.
@@ -217,14 +219,14 @@ msc: Tables of transport mean free paths.
material min.delta energy(keV)
Air 3.2397
Water 215.05
lAr 209.6
Al 349.54
Fe 697.76
BGO 570.46
PbWO4 624.12
Tungsten 1195.6
Lead 745.94
Water 215.03
lAr 209.58
Al 349.52
Fe 697.65
BGO 571.17
PbWO4 625.41
Tungsten 1205.1
Lead 750.46
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
@@ -249,18 +251,18 @@ MuPairProd: theoretical cross sections
Good description up to 1000 PeV.
PhysicsTables from 1 keV to 1000 PeV in 150 bins.
============= The cut Energy ==============================
gamma e- mu- proton neutron
Cut in range 5 mm 5 mm 5 mm 5 mm 5 mm
gamma e-
Cut in range 5 mm 5 mm
Cut in energy
Air 990 eV 3.24 keV 156 keV 326 keV 990 eV
Water 5.78 keV 1.16 MeV 8.21 MeV 22 MeV 990 eV
lAr 13.6 keV 1.16 MeV 8.01 MeV 20.9 MeV 990 eV
Al 14.6 keV 2.31 MeV 12.5 MeV 32.6 MeV 990 eV
Fe 46.4 keV 6.11 MeV 21.5 MeV 54.7 MeV 990 eV
BGO 126 keV 4.72 MeV 18.1 MeV 45.7 MeV 990 eV
PbWO4 137 keV 5.34 MeV 19.4 MeV 48.3 MeV 990 eV
Tungsten 241 keV 13 MeV 30.7 MeV 75.3 MeV 990 eV
Lead 204 keV 6.83 MeV 22 MeV 54 MeV 990 eV
Air 990 eV 3.24 keV
Water 5.78 keV 1.16 MeV
lAr 13.6 keV 1.16 MeV
Al 14.6 keV 2.31 MeV
Fe 46.4 keV 6.11 MeV
BGO 126 keV 4.72 MeV
PbWO4 137 keV 5.34 MeV
Tungsten 241 keV 13 MeV
Lead 204 keV 6.83 MeV
===================================================
#
/run/verbose 2
@@ -291,20 +293,20 @@ Start Run processing.
Run terminated.
Run Summary
Number of events processed : 100
User=135.06s Real=147.92s Sys=11.58s
User=140.09s Real=152.81s Sys=11.26s
LATERAL PROFILE CUMULATIVE LATERAL PROFILE
bin Mean rms bin Mean rms
0.00-> 1.11 radl: 12.83% 4.80% 0-> 1.11 radl: 12.83% 4.80%
1.11-> 2.22 radl: 22.99% 10.59% 0-> 2.22 radl: 35.82% 13.46%
2.22-> 3.33 radl: 23.35% 11.11% 0-> 3.33 radl: 59.17% 18.23%
3.33-> 4.44 radl: 14.66% 7.64% 0-> 4.44 radl: 73.83% 17.47%
4.44-> 5.55 radl: 10.04% 7.93% 0-> 5.55 radl: 83.88% 14.03%
5.55-> 6.66 radl: 5.77% 5.99% 0-> 6.66 radl: 89.65% 11.25%
6.66-> 7.77 radl: 2.68% 3.89% 0-> 7.77 radl: 92.33% 9.04%
7.77-> 8.88 radl: 1.65% 3.99% 0-> 8.88 radl: 93.97% 5.64%
8.88-> 9.99 radl: 1.02% 3.35% 0-> 9.99 radl: 94.99% 3.52%
0.00-> 1.11 radl: 14.27% 5.32% 0-> 1.11 radl: 14.27% 5.32%
1.11-> 2.22 radl: 25.49% 10.73% 0-> 2.22 radl: 39.76% 12.31%
2.22-> 3.33 radl: 24.35% 9.19% 0-> 3.33 radl: 64.11% 14.46%
3.33-> 4.44 radl: 14.08% 8.04% 0-> 4.44 radl: 78.19% 12.42%
4.44-> 5.55 radl: 7.56% 5.98% 0-> 5.55 radl: 85.75% 9.56%
5.55-> 6.66 radl: 4.56% 4.61% 0-> 6.66 radl: 90.31% 6.95%
6.66-> 7.77 radl: 2.53% 3.85% 0-> 7.77 radl: 92.84% 4.92%
7.77-> 8.88 radl: 1.36% 2.46% 0-> 8.88 radl: 94.20% 3.96%
8.88-> 9.99 radl: 0.81% 2.04% 0-> 9.99 radl: 95.00% 3.23%
@@ -312,21 +314,21 @@ Run Summary
bin Mean rms bin Mean rms
0.00-> 0.11 radl: 66.01% 9.70% 0-> 0.11 radl: 66.01% 9.70%
0.11-> 0.22 radl: 16.95% 6.97% 0-> 0.22 radl: 82.95% 7.09%
0.22-> 0.33 radl: 5.91% 4.08% 0-> 0.33 radl: 88.86% 5.43%
0.33-> 0.44 radl: 2.97% 2.51% 0-> 0.44 radl: 91.83% 4.45%
0.44-> 0.56 radl: 1.85% 1.52% 0-> 0.56 radl: 93.68% 3.99%
0.56-> 0.67 radl: 1.31% 1.50% 0-> 0.67 radl: 94.99% 3.52%
0.00-> 0.11 radl: 66.35% 10.09% 0-> 0.11 radl: 66.35% 10.09%
0.11-> 0.22 radl: 16.35% 6.18% 0-> 0.22 radl: 82.70% 7.45%
0.22-> 0.33 radl: 5.98% 3.96% 0-> 0.33 radl: 88.68% 5.74%
0.33-> 0.44 radl: 3.19% 3.15% 0-> 0.44 radl: 91.87% 4.09%
0.44-> 0.56 radl: 1.94% 2.23% 0-> 0.56 radl: 93.81% 3.33%
0.56-> 0.67 radl: 1.19% 1.25% 0-> 0.67 radl: 95.00% 3.23%
SUMMARY
energy deposit : 94.99 % E0 +- 3.52 % E0
charged traklen: 13.64 radl +- 0.52 radl
neutral traklen: 192.15 radl +- 20.63 radl
energy deposit : 95.00 % E0 +- 3.23 % E0
charged traklen: 13.59 radl +- 0.48 radl
neutral traklen: 200.27 radl +- 20.88 radl
--------- Ranecu engine status ---------
Initial seed (index) = 0
Current couple of seeds = 2001046935, 58619762
Current couple of seeds = 617458126, 1124214817
----------------------------------------
@@ -85,7 +85,7 @@
PAXIS = 0.
SAXIS = 0.2*Z1
CALL GDRAWC ('ECAL',IX,0.,10.,10.,SCALE,SCALE)
CALL GDAXIS (PAXIS,PAXIS,PAXIS,SAXIS)
CCC CALL GDAXIS (PAXIS,PAXIS,PAXIS,SAXIS)
CALL GDSCAL ( 10., 0.3)
CALL GDCLOS
END DO
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2DetectorConstruction.hh,v 1.2 1999/12/15 14:48:59 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2DetectorMessenger.hh,v 1.2 1999/12/15 14:48:59 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2EventAction.hh,v 1.2 1999/12/15 14:48:59 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2EventActionMessenger.hh,v 1.2 1999/12/15 14:48:59 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2PhysicsList.hh,v 1.3 2000/04/17 11:25:52 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2PhysicsListMessenger.hh,v 1.1 2000/04/17 11:25:52 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2PrimaryGeneratorAction.hh,v 1.2 1999/12/15 14:48:59 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em2RunAction.hh,v 1.4 2000/01/21 10:56:14 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em2RunAction.hh,v 1.5 2000/12/07 12:14:06 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -35,11 +35,6 @@ class Em2RunActionMessenger;
class G4Run;
#ifndef G4NOHIST
class HepTupleManager;
class HepHistogram;
#endif
class Em2RunAction : public G4UserRunAction
{
public:
@@ -96,16 +91,7 @@ class Em2RunAction : public G4UserRunAction
G4double sum2NeutrTrLength;
Em2RunActionMessenger* runMessenger;
G4int saveRndm;
#ifndef G4NOHIST
HepTupleManager* hbookManager;
HepHistogram *histo1, *histo2, *histo3;
HepHistogram *histo4, *histo5, *histo6;
HepHistogram *histo7, *histo8, *histo9;
HepHistogram *hist10, *hist11, *hist12;
#endif
G4int saveRndm;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2RunActionMessenger.hh,v 1.3 2000/01/21 10:56:15 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2SteppingAction.hh,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,18 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em2SteppingVerbose.hh,v 1.3 2000/02/29 12:16:59 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em2SteppingVerbose.hh,v 1.4 2000/12/06 14:12:16 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
// It shows how to extract informations during the tracking of a particle.
//
// Em2SteppingVerbose.hh
//
// Description:
// This class manages the vervose outputs in G4SteppingManager.
//
//---------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
class Em2SteppingVerbose;
@@ -25,16 +22,17 @@ class Em2SteppingVerbose;
#include "G4SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
class Em2SteppingVerbose : public G4SteppingVerbose {
public:
// Constructor/Destructor
Em2SteppingVerbose();
~Em2SteppingVerbose();
//
void StepInfo();
void TrackingStarted();
//
};
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2TrackingAction.hh,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2VisManager.hh,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,34 +5,26 @@
# and initializes the graphic.
#
/control/verbose 2
/run/verbose 2
#
# Create empty scene ("world" is default)
/vis/scene/create
#
# Add volume to scene
/vis/scene/add/volume
/vis/scene/create
#
# Create a scene handler for a specific graphics system
# Edit the next line(s) to choose another graphic system
#
#/vis/sceneHandler/create DAWNFILE
/vis/sceneHandler/create OGLIX
#
# Create a viewer
/vis/viewer/create
#/vis/open DAWNFILE
/vis/open OGLIX
#
# Draw scene
#
/vis/camera/zoom 1.1
/vis/camera/viewpoint 90 180
/vis/draw/axes 0 0 0 20
/vis/camera/zoom 1.
/vis/scene/notifyHandlers
/vis/drawVolume
#
# for drawing the tracks
# if too many tracks cause core dump => storeTrajectory 0
/tracking/storeTrajectory 1
/event/drawTracks charged
#
# Flush visualization
/vis/viewer/update
#
/run/verbose 2
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2DetectorConstruction.cc,v 1.4 2000/05/09 13:56:33 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2DetectorMessenger.cc,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2EventAction.cc,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2EventActionMessenger.cc,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em2PhysicsList.cc,v 1.4 2000/04/17 11:26:49 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em2PhysicsList.cc,v 1.5 2000/12/06 14:12:16 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -165,8 +165,8 @@ void Em2PhysicsList::ConstructEM()
//electron
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
pmanager->AddProcess(new G4eIonisation, -1, 2,2);
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
} else if (particleName == "e+") {
//positron
pmanager->AddProcess(new G4MultipleScattering, -1, 1,1);
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2PhysicsListMessenger.cc,v 1.1 2000/04/17 11:26:49 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2PrimaryGeneratorAction.cc,v 1.2 1999/12/15 14:49:00 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em2RunAction.cc,v 1.5 2000/05/18 15:30:28 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em2RunAction.cc,v 1.6 2000/12/07 12:14:07 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -29,10 +29,6 @@
#include "Randomize.hh"
#ifndef G4NOHIST
#include "CLHEP/Hist/HBookFile.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em2RunAction::Em2RunAction(Em2DetectorConstruction* det,
@@ -58,12 +54,7 @@ Em2RunAction::Em2RunAction(Em2DetectorConstruction* det,
sumE2RadialCumul = *new MyVector(nRbin);
runMessenger = new Em2RunActionMessenger(this);
saveRndm = 1;
#ifndef G4NOHIST
hbookManager = NULL;
#endif
saveRndm = 1;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -77,66 +68,12 @@ Em2RunAction::~Em2RunAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em2RunAction::bookHisto()
{
#ifndef G4NOHIST
hbookManager = new HBookFile("TestEm2.histo", 68);
assert (hbookManager != 0);
G4double Ekin = Em2Kin->GetParticleGun()->GetParticleEnergy();
G4double dLradl = Em2Det->GetdLradl();
G4double dRradl = Em2Det->GetdRradl();
histo1 = hbookManager->histogram("total energy deposit (percent of E inc)",
100,0.,100.);
histo2 = hbookManager->histogram("total charged tracklength (radl)",
100,0.,100.*Ekin/GeV);
histo3 = hbookManager->histogram("total neutral tracklength (radl)",
100,0.,1000.*Ekin/GeV);
histo4 = hbookManager->histogram("longit energy profile (% of E inc)",
nLbin,0.,nLbin*dLradl);
G4double Zmin=0.5*dLradl, Zmax=Zmin+nLbin*dLradl;
histo5 = hbookManager->histogram("cumul longit energy dep (% of E inc)",
nLbin,Zmin,Zmax);
histo6 = hbookManager->histogram("rms on cumul longit Edep (% of E inc)",
nLbin,Zmin,Zmax);
histo7 = hbookManager->histogram("nb of gamma per plane",
nLbin,Zmin,Zmax);
histo8 = hbookManager->histogram("nb of positron per plane",
nLbin,Zmin,Zmax);
histo9 = hbookManager->histogram("nb of electron per plane",
nLbin,Zmin,Zmax);
hist10 = hbookManager->histogram("radial energy profile (% of E inc)",
nRbin,0.,nRbin*dRradl);
G4double Rmin=0.5*dRradl, Rmax=Rmin+nRbin*dRradl;
hist11 = hbookManager->histogram("cumul radial energy dep (% of E inc)",
nRbin,Rmin,Rmax);
hist12 = hbookManager->histogram("rms on cumul radial Edep (% of E inc)",
nRbin,Rmin,Rmax);
#endif
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em2RunAction::cleanHisto()
{
#ifndef G4NOHIST
delete histo1; delete histo2; delete histo3;
delete histo4; delete histo5; delete histo6;
delete histo7; delete histo8; delete histo9;
delete hist10; delete hist11; delete hist12;
delete hbookManager;
#endif
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -226,19 +163,7 @@ void Em2RunAction::fillPerEvent()
sumChargTrLength += ChargTrLength;
sum2ChargTrLength += ChargTrLength*ChargTrLength;
sumNeutrTrLength += NeutrTrLength;
sum2NeutrTrLength += NeutrTrLength*NeutrTrLength;
#ifndef G4NOHIST
//fill histograms
//
G4double Ekin=Em2Kin->GetParticleGun()->GetParticleEnergy();
G4double mass=Em2Kin->GetParticleGun()->GetParticleDefinition()->GetPDGMass();
G4double radl=Em2Det->GetMaterial()->GetRadlen();
histo1->accumulate(100.*dLCumul/(Ekin+mass));
histo2->accumulate(ChargTrLength/radl);
histo3->accumulate(NeutrTrLength/radl);
#endif
sum2NeutrTrLength += NeutrTrLength*NeutrTrLength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -278,18 +203,6 @@ void Em2RunAction::EndOfRunAction(const G4Run* aRun)
gammaFlux (i) /= NbOfEvents;
electronFlux(i) /= NbOfEvents;
positronFlux(i) /= NbOfEvents;
#ifndef G4NOHIST
bin = i*dLradl;
histo4->accumulate(bin,MeanELongit(i)/dLradl);
bin = (i+1)*dLradl;
histo5->accumulate(bin,MeanELongitCumul(i));
histo6->accumulate(bin, rmsELongitCumul(i));
histo7->accumulate(bin, gammaFlux(i));
histo8->accumulate(bin, positronFlux(i));
histo9->accumulate(bin, electronFlux(i));
#endif
}
//radial
@@ -308,14 +221,7 @@ void Em2RunAction::EndOfRunAction(const G4Run* aRun)
MeanERadialCumul(i) = norme*sumERadialCumul(i);
rmsERadialCumul(i) = norme*sqrt(abs(NbOfEvents*sumE2RadialCumul(i)
- sumERadialCumul(i)*sumERadialCumul(i)));
#ifndef G4NOHIST
bin = i*dRradl;
hist10->accumulate(bin,MeanERadial(i)/dRradl);
bin = (i+1)*dRradl;
hist11->accumulate(bin,MeanERadialCumul(i));
hist12->accumulate(bin, rmsERadialCumul(i));
#endif
}
//track length
@@ -394,12 +300,7 @@ void Em2RunAction::EndOfRunAction(const G4Run* aRun)
if (saveRndm == 1)
{ HepRandom::showEngineStatus();
HepRandom::saveEngineStatus("endOfRun.rndm");
}
#ifndef G4NOHIST
// Write histogram file
hbookManager->write();
#endif
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2RunActionMessenger.cc,v 1.3 2000/01/21 10:56:16 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2SteppingAction.cc,v 1.2 1999/12/15 14:49:01 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -5,39 +5,30 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: Em2SteppingVerbose.cc,v 1.3 2000/02/29 12:17:15 maire Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: Em2SteppingVerbose.cc,v 1.4 2000/12/06 14:12:16 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//---------------------------------------------------------------
//
// Em2SteppingVerbose.cc
//
// Description:
// Implementation of the Em2SteppingVerbose class
//
//---------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#include "Em2SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
////////////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
Em2SteppingVerbose::Em2SteppingVerbose()
////////////////////////////////////////////////
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
//////////////////////////////////////////////////
Em2SteppingVerbose::~Em2SteppingVerbose()
//////////////////////////////////////////////////
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
/////////////////////////////////////////
void Em2SteppingVerbose::StepInfo()
/////////////////////////////////////////
{
CopyState();
@@ -124,11 +115,11 @@ void Em2SteppingVerbose::StepInfo()
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
////////////////////////////////////////////////
void Em2SteppingVerbose::TrackingStarted()
////////////////////////////////////////////////
{
CopyState();
@@ -163,4 +154,6 @@ G4int prec = G4cout.precision(3);
G4cout << G4std::setw(10) << "initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -7,7 +7,7 @@
// and all its terms.
//
// $Id: Em2TrackingAction.cc,v 1.2 1999/12/15 14:49:01 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Em2VisManager.cc,v 1.2 1999/12/15 14:49:01 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// John Allison 24th January 1998.
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2000/05/17 10:56:08 maire Exp $
# $Id: GNUmakefile,v 1.4 2000/12/07 12:38:24 maire Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
@@ -16,11 +16,4 @@ all: lib bin
include $(G4INSTALL)/config/architecture.gmk
ifdef G4NOHIST
CPPFLAGS += -DG4NOHIST
else
LDFLAGS += -L$(CERN)/pro/lib
LOADLIBS += -lpacklib $(FCLIBS)
endif
include $(G4INSTALL)/config/binmake.gmk
@@ -1,4 +1,4 @@
$Id: History,v 1.1 2000/06/17 12:49:00 stesting Exp $
$Id: History,v 1.4 2000/12/07 12:38:24 maire Exp $
-------------------------------------------------------------------
=========================================================
@@ -14,6 +14,20 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07-12-00 mma (testem3-V02-00-03 & testem-noHist)
remove hbook histograms: GNUmakefile,runAction,eventAction
06-12-00 mma (testem3-V02-00-02 & testem-withHist)
update of init.mac for new vis commands.
G4UItcsh in the main()
25th November 2000 Steve O'Neale (tagset210)
- Update test outputs for min.delta energy cut and table printout
- Update test outputs em tags 1 percent change in deposited energy
June 24, 2000 John Allison (testem3-V01-01-01)
- Updated TestEm3.out for stand-V01-01-05 and utils-V01-01-03.
June 17, 2000 John Allison (testem3-V01-00-00)
- Updated TestEm3.out for geant4-01-01-ref-06.

Some files were not shown because too many files have changed in this diff Show More