Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
# $Id: GNUmakefile,v 2.1 1998/07/02 15:27:15 gunter Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := exampleN05
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
+140
View File
@@ -0,0 +1,140 @@
$Id: History,v 2.6 1998/12/11 19:13:41 verderi Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example N05 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 *
----------------------------------------------------------
11 December 1998 M. Verderi
- fix made in ExN05CalorimeterSD to allow several instanciations of this class.
The problem was a static variable (HCID) used in EndOfEventAction which made
confusion to get the hits collection. HCID is now put as private (non static!)
member of the class.
- the example.in/.out are updated accordingly
9 December 1998 M. Verderi
- Added ExN05PionShowerModel: a model producing hits
for pi+/pi-
- Modify ExN05EMShowerModel to produce a "less unrealistic"
shower shape: now the longitudinal profile is according to
the Gamma distribution. Transverse profile is two cylinder:
the 1 moliere radius receive 90% of the energy, the 3.5 one
receives the rest.
- Added RandomGamma: shoot at random according to the Gamma
distribution. Adapted from RNGAMA function of KERNLIB.
(thanks to D. Bernard who gave me the source).
- ExN05DetectorConstruction. Many changes:
- EM calo size reduced, crytals also;
- addition of an hadronic calorimeter
- addition of a ghost volume
The G4VFastSimulationModel are instanciated(?) here, and
no more in exampleN05.cc
- exampleN05.in modified to shoot pions in order to test
the ghost geometry.
- ExN05PhysicsList modified to add the parameterisation
process as a Post&Along process, because of the ghost.
16th August 1998 H.Kurashige
- Added ExN05MinRangeCuts, ExN05MinEkineCuts, ExN05MaxTimeCuts
and their base class of ExN05SpecialCuts for using UserLimits.
- Modified ExN05PhysicsList to register above processes.
- Modified ExN05DetectorConstruction to attach Userlimits to crystal.
- Added ExN05DetectorMessenger to switch on/off UserLimits.
- Modified exampleN05.in
9th August 1998 John Allison
- Changed G4UIterminal to G4UIGAG.
16th July 1998 John Allison
- Changed /vis~/Draw... to /vis~/draw.
June 26th 98 Marc Verderi:
Remove previous files, and add new ones with the
good (hopefully) naming conventions this time.
Improvements done in ExN05EMShowerModel by using
a private navigator, rather than the one for tracking.
include:
ExN05CalorimeterHit.hh
ExN05CalorimeterHitsCollection.hh
ExN05CalorimeterSD.hh
ExN05DetectorConstruction.hh
ExN05EMShowerModel.hh
ExN05EnergySpot.hh
ExN05EventAction.hh
ExN05EventActionMessenger.hh
ExN05PhysicsList.hh
ExN05PiModel.hh
ExN05PrimaryGeneratorAction.hh
ExN05RunAction.hh
ExN05SteppingAction.hh
ExN05SteppingActionMessenger.hh
src:
ExN05CalorimeterHit.cc
ExN05CalorimeterHitsCollection.cc
ExN05CalorimeterSD.cc
ExN05DetectorConstruction.cc
ExN05EMShowerModel.cc
ExN05EnergySpot.cc
ExN05EventAction.cc
ExN05EventActionMessenger.cc
ExN05PhysicsList.cc
ExN05PiModel.cc
ExN05PrimaryGeneratorAction.cc
ExN05RunAction.cc
ExN05SteppingAction.cc
ExN05SteppingActionMessenger.cc
May 07, 98 M. Verderi
- First commit (many improvements needed):
- main() coded in exampleN05.cc
- include:
MyCalorimeterHit.hh
MyCalorimeterHitsCollection.hh
MyCalorimeterSD.hh
MyDetectorBox.hh
MyEMCShower.hh
MyEnergySpot.hh
MyEventAction.hh
MyEventActionMessenger.hh
MyPhysicsList.hh
MyPiModel.hh
MyPrimaryGeneratorAction.hh
MyRunAction.hh
MySteppingAction.hh
MySteppingActionMessenger.hh
- src:
MyCalorimeterHit.cc
MyCalorimeterHitsCollection.cc
MyCalorimeterSD.cc
MyDetectorBox.cc
MyEMCShower.cc
MyEnergySpot.cc
MyEventAction.cc
MyEventActionMessenger.cc
MyPhysicsList.cc
MyPiModel.cc
MyPrimaryGeneratorAction.cc
MyRunAction.cc
MySteppingAction.cc
MySteppingActionMessenger.cc
April 09, 98 G. Cosmo
- Created.
+20
View File
@@ -0,0 +1,20 @@
#
/gun/particle e-
/gun/energy 1 GeV
/gun/position 0 0 0
#
/tracking/verbose 1
#
/gun/direction 0 .6 1.
/run/beamOn 5
#
/gun/direction 0 .3 1.
/run/beamOn 5
#
/gun/direction 0 -.3 1.
/run/beamOn 5
#
/gun/direction 0 -.6 1.
/run/beamOn 5
#
exit
+72
View File
@@ -0,0 +1,72 @@
$Id: README,v 2.1 1998/12/10 04:12:53 verderi Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
ExampleN05
----------
ExampleN05 provides examples of the use of parameterisation facilities.
Geometry, sensitive detector, hits, processes are defined respectively in:
ExN05DetectorConstruction
ExN05CalorimeterSD
ExN05CalorimeterHit
ExN05PhysicsList
The particularities are:
o The parameterisation models:
o ExN05EMShowerModel which provides a crude
parameterisation for e+/e-/gamma. This model
is bound to the EM calorimeter.
o ExN05PionShowerModel: an even more crude
parameterisation for pi+/pi-. This model
is bound to a ghost volume.
Those two models produces "hits": ie the energy
of the incident particle is distributed into
the volume of the envelope throught energy spots
(class ExN05EnergySpot), those energy spots being
recorded in the sensitive detector at this point
if any.
They are rather similar from a technical point of vue.
They both make use of a private G4Navigator to set
their energy spots into the sensitive volumes.
However, we don't take car of putting every spot into
a sensitive (which is recommended in a "serious"
parameterisation !).
Those two models trigger their parameterisation
on the first step the particle does in the envelope,
but it would be perfectly possible to wait that the
particle is far enough from the boundary of the envelope
for example.
o ExN0PiModel: just there to show how a parameterisation
can create secondaries, but not used.
o ExN05PhysicsList: AddParameterisation(). A method which
sets the G4FastSimulationManagerProcess in the process
manager of all the particles. This process provides
the INTERFACE between the tracking and the parameterisation
models.
o ExN05DetectorConstruction: in the .cc file, the parameterisation
models are built and bound to envelopes:
o ExN05EMShowerModel is bound to the electromagnetic
calorimeter
o ExN05PionShowerModel is bound to a ghost volume
which encompasses the electromagnetic and
hadronic calorimters
+141
View File
@@ -0,0 +1,141 @@
// This code implementation is the intellectual property of
// the RD44 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: exampleN05.cc,v 2.7 1998/12/10 04:14:01 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 - exampleN05
//
// For information related to this code contact:
// CERN, IT Division, ASD Group
// --------------------------------------------------------------
// Comments
//
// * Example of a main program making use of parameterisation
// ie "Fast Simulation".
//-------------------------------------------------------------------
//---------------------------
// Parameterisation manager:
//---------------------------
#include "G4GlobalFastSimulationManager.hh"
//--------------------
// Detector:
//--------------------
#include "ExN05DetectorConstruction.hh"
//------------------------------
// Run, Generator etc.. actions:
//------------------------------
#include "ExN05RunAction.hh"
#include "ExN05PrimaryGeneratorAction.hh"
#include "ExN05EventAction.hh"
#include "ExN05SteppingAction.hh"
//----------------------------------
// ExN05PhysicsList makes use of the
// G4ParameterisationManagerProcess
//----------------------------------
#include "ExN05PhysicsList.hh"
#ifdef GNU_GCC
#include "ExN05CalorimeterHit.hh"
template class RWTValVector<ExN05CalorimeterHit>;
template class G4Allocator<ExN05CalorimeterHit>;
#endif
#include "G4UIterminal.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#ifdef G4VIS_USE
#include "MyVisManager.cc"
#endif
#include "G4ios.hh"
int main(int argc, char** argv) {
//-------------------------------
// Initialization of Run manager
//-------------------------------
G4cout << "RunManager construction starting...." << endl;
G4RunManager * runManager = new G4RunManager;
// Detector geometry
ExN05DetectorConstruction* Detector = new ExN05DetectorConstruction();
runManager->SetUserInitialization(Detector);
// PhysicsList: (including G4FastSimulationManagerProcess)
runManager->SetUserInitialization(new ExN05PhysicsList);
// UserAction classes.
runManager->SetUserAction(new ExN05RunAction);
runManager->SetUserAction(new ExN05PrimaryGeneratorAction);
runManager->SetUserAction(new ExN05EventAction);
runManager->SetUserAction(new ExN05SteppingAction);
// Inizialize Run manager
runManager->Initialize();
// Close the "fast simulation": will
// trigger the ghost geomtries construction:
G4GlobalFastSimulationManager::GetGlobalFastSimulationManager()->
CloseFastSimulation();
//----------------
// Visualization:
//----------------
#ifdef G4VIS_USE
G4cout << "Instantiating MyVisManager......." << endl;
G4VisManager* visManager = new MyVisManager;
visManager -> Initialize ();
#endif
//Setup commandes:
G4UImanager * UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/Step/Verbose 0");
UI->ApplyCommand("/tracking/Verbose 1");
UI->ApplyCommand("/gun/particle e-");
UI->ApplyCommand("/gun/energy 100 MeV");
UI->ApplyCommand("/gun/direction 0 0 1");
UI->ApplyCommand("/gun/position 0 0 0");
UI->ApplyCommand("/gun/direction 0 .3 1.");
if(argc==1)
{
//--------------------------
// Define (G)UI
//--------------------------
// G4UIterminal is a (dumb) terminal.
G4UIsession* session = new G4UIterminal;
session->SessionStart();
delete session;
}
else
{
G4UImanager* UImanager = G4UImanager::GetUIpointer();
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
}
delete runManager;
#ifdef G4VIS_USE
delete visManager;
#endif
return EXIT_SUCCESS;
}
View File
+67
View File
@@ -0,0 +1,67 @@
# exampleN05.in
#
/gun/particle e-
/gun/energy 1 GeV
/gun/position 0 0 0
#
#/tracking/verbose 1
#
/gun/direction 0 .6 1.
/run/beamOn 5
#
/gun/direction 0 .3 1.
/run/beamOn 5
#
/gun/direction 0 -.3 1.
/run/beamOn 5
#
/gun/direction 0 -.6 1.
/run/beamOn 5
#
/gun/particle pi-
/gun/energy 1 GeV
/gun/position 0 0 0
#
#
#
/gun/direction 0 .6 1.
/run/beamOn 5
#
/gun/direction 0 .3 1.
/run/beamOn 5
#
/gun/direction 0 -.3 1.
/run/beamOn 5
#
/gun/direction 0 -.6 1.
/run/beamOn 5
#
#
# switch off Fast Simulation
#
/gun/particle e-
#
/process/inactivate G4FastSimulationManagerProcess
#
# switch off UserLimits
/exN05/detector/switchUserLimits off
#
/gun/direction 0 .6 1.
/run/beamOn 5
#
# switch on UserLimits
/exN05/detector/switchUserLimits on
#
/gun/direction 0 .6 1.
/run/beamOn 5
#
exit
+361
View File
@@ -0,0 +1,361 @@
RunManager construction starting....
ExN05DetectorConstruction....
ExN05PhysicsList::SetCuts:CutLength : 1 (mm)
conv: Total cross sections from a parametrisation(L.Urban). Good description from 1.5 MeV to 100 GeV for all Z.
e+e- energies according Bethe-Heitler
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
compt: Total cross sections from a parametrisation(L.Urban). Good description from 10 KeV to (100/Z) GeV.
Scattered gamma energy according Klein-Nishina.
PhysicsTables from 10 keV to 100 GeV in 100 bins.
phot: Total cross sections from a parametrisation(L.Urban). Good description from 10 KeV to 50 MeV for all Z
PhysicsTables from 10 keV to 50 MeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
eIoni: delta cross sections from Moller+Bhabha. Good description from 1 KeV to 100 GeV.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
eBrem: Total cross sections from a parametrisation(L.Urban). Good description from 1 KeV to 100 GeV.
log scale extrapolation above 100 GeV
Gamma energy sampled from a parametrised formula.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
annihil: Total cross section from Heilter formula (annihilation into 2 photons).
gamma energies sampled according Heitler
PhysicsTables from 10 keV to 10 TeV in 100 bins.
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
MuIoni: knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 1000 PeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
MuBrems: cross sections from R. Kokoulin
Good description up to 1000 TeV.
PhysicsTables from 1 GeV to 1000 PeV in 100 bins.
MuPairProd: cross sections from R. Kokoulin
Good description up to 1000 TeV.
PhysicsTables from 1 GeV to 1000 PeV in 50 bins.
Closing FastSimulation
Idle> # exampleN05.in
Idle> #
Idle> Idle> Idle> Idle> #
Idle> #/tracking/verbose 1
Idle> #
Idle> Idle> ### Run 0 start.
>>> Event 0
11 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999942 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 1
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999939 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 2
9 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999914 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 3
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.98995 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.989944 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 1 start.
>>> Event 0
11 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999949 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 1
12 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999942 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 2
8 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999939 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 3
8 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999933 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999919 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 2 start.
>>> Event 0
9 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.99995 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 1
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999923 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 2
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999944 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 3
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999946 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
9 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999952 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 3 start.
>>> Event 0
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.989951 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 1
12 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999941 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 2
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999934 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 3
9 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999926 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
10 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999887 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
number of event = 5
Idle> #
Idle> Idle> Idle> Idle> #
Idle> #
Idle> #
Idle> Idle> ### Run 4 start.
>>> Event 0
6 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.139991 (GeV)
10 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.559966 (GeV)
>>> Event 1
9 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.219987 (GeV)
15 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 1.13994 (GeV)
>>> Event 2
14 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.479968 (GeV)
15 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 1.39992 (GeV)
>>> Event 3
14 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.579963 (GeV)
17 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 1.91989 (GeV)
>>> Event 4
17 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.819949 (GeV)
17 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 2.35986 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 5 start.
>>> Event 0
20 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.879946 (GeV)
28 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 3.17982 (GeV)
>>> Event 1
23 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.939941 (GeV)
29 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 3.99975 (GeV)
>>> Event 2
23 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.979939 (GeV)
31 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 4.8797 (GeV)
>>> Event 3
23 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.979939 (GeV)
33 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 5.77966 (GeV)
>>> Event 4
23 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.979939 (GeV)
36 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 6.69962 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 6 start.
>>> Event 0
25 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.01994 (GeV)
46 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 7.61957 (GeV)
>>> Event 1
25 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.01994 (GeV)
53 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 8.47953 (GeV)
>>> Event 2
26 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.03994 (GeV)
53 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 9.37949 (GeV)
>>> Event 3
27 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.05993 (GeV)
54 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 10.2594 (GeV)
>>> Event 4
28 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.07993 (GeV)
56 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 11.1794 (GeV)
number of event = 5
Idle> #
Idle> Idle> ### Run 7 start.
>>> Event 0
35 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.25992 (GeV)
65 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 11.7194 (GeV)
>>> Event 1
40 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.39991 (GeV)
68 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 12.2593 (GeV)
>>> Event 2
44 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.5599 (GeV)
70 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 12.7193 (GeV)
>>> Event 3
49 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.71989 (GeV)
72 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 13.2592 (GeV)
>>> Event 4
51 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 1.91988 (GeV)
73 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 13.8192 (GeV)
number of event = 5
Idle> #
Idle> #
Idle> # switch off Fast Simulation
Idle> #
Idle> Idle> #
Idle> Idle> #
Idle> # switch off UserLimits
Idle> Idle> #
Idle> Idle> ### Run 8 start.
>>> Event 0
35 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.993405 (GeV)
2 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.00516441 (GeV)
>>> Event 1
35 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.995341 (GeV)
1 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.00035878 (GeV)
>>> Event 2
34 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.994058 (GeV)
2 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.00263402 (GeV)
>>> Event 3
34 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.995217 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
38 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.994244 (GeV)
3 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.00232988 (GeV)
number of event = 5
Idle> #
Idle> # switch on UserLimits
Idle> Idle> #
Idle> Idle> ### Run 9 start.
>>> Event 0
16 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999924 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 1
14 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.992427 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 2
21 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.999946 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 3
28 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.998739 (GeV)
0 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0 (GeV)
>>> Event 4
25 hits are stored in EM ExN05CalorimeterHitsCollection.
Total energy deposition in EM calorimeter crytals : 0.996411 (GeV)
3 hits are stored in HAD ExN05CalorimeterHitsCollection.
Total energy deposition in HAD calorimeter towers : 0.00221826 (GeV)
number of event = 5
Idle> #
Idle>
@@ -0,0 +1,85 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05CalorimeterHit.hh,v 2.2 1998/07/12 02:42:10 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05CalorimeterHit_h
#define ExN05CalorimeterHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
class ExN05CalorimeterHit : public G4VHit
{
public:
ExN05CalorimeterHit();
ExN05CalorimeterHit(G4LogicalVolume* logVol);
~ExN05CalorimeterHit();
ExN05CalorimeterHit(const ExN05CalorimeterHit &right);
const ExN05CalorimeterHit& operator=(const ExN05CalorimeterHit &right);
int operator==(const ExN05CalorimeterHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
private:
G4double edep;
G4ThreeVector pos;
G4RotationMatrix rot;
const G4LogicalVolume* pLogV;
public:
inline void SetEdep(G4double de)
{ edep = de; };
inline void AddEdep(G4double de)
{ edep += de; };
inline G4double GetEdep()
{ return edep; };
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; };
inline G4ThreeVector GetPos()
{ return pos; };
inline void SetRot(G4RotationMatrix rmat)
{ rot = rmat; };
inline G4RotationMatrix GetRot()
{ return rot; };
inline const G4LogicalVolume * GetLogV()
{ return pLogV; };
};
typedef G4THitsCollection<ExN05CalorimeterHit> ExN05CalorimeterHitsCollection;
extern G4Allocator<ExN05CalorimeterHit> ExN05CalorimeterHitAllocator;
inline void* ExN05CalorimeterHit::operator new(size_t)
{
void *aHit;
aHit = (void *) ExN05CalorimeterHitAllocator.MallocSingle();
return aHit;
}
inline void ExN05CalorimeterHit::operator delete(void *aHit)
{
ExN05CalorimeterHitAllocator.FreeSingle((ExN05CalorimeterHit*) aHit);
}
#endif
@@ -0,0 +1,46 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05CalorimeterSD.hh,v 2.4 1998/12/11 19:14:02 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05CalorimeterSD_h
#define ExN05CalorimeterSD_h 1
#include "ExN05CalorimeterHit.hh"
#include "G4VSensitiveDetector.hh"
#include "G4Step.hh"
class ExN05CalorimeterSD : public G4VSensitiveDetector
{
public:
ExN05CalorimeterSD(G4String name, G4int nCells, G4String colName);
~ExN05CalorimeterSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
ExN05CalorimeterHitsCollection *CalCollection;
int* CellID;
int numberOfCells;
int HCID;
};
#endif
@@ -0,0 +1,59 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05DetectorConstruction.hh,v 2.3 1998/12/10 04:11:02 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05DetectorConstruction_h
#define ExN05DetectorConstruction_h 1
#include "G4LogicalVolume.hh"
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4UserLimits;
class ExN05DetectorMessenger;
class ExN05DetectorConstruction : public G4VUserDetectorConstruction
{
public:
ExN05DetectorConstruction();
~ExN05DetectorConstruction();
public:
G4VPhysicalVolume* Construct();
// methods for UserLimits in crystal
void UseUserLimits(G4bool value);
G4bool IsUseUserLimits() { return fUseUserLimits; }
G4double GetMaxTimeInCrystal() const { return theMaxTimeCutsInCrystal; }
G4double GetMinEkineInCrystal() const { return theMinEkineCutsInCrystal; }
G4double GetMinRangeInCrystal() const { return theMinRangeCutsInCrystal; }
void SetMaxTimeInCrystal(G4double value);
void SetMinEkineInCrystal(G4double value);
void SetMinRangeInCrystal(G4double value);
private:
G4LogicalVolume* theCrystalLog;
G4LogicalVolume* theTowerLog;
G4bool fUseUserLimits;
G4UserLimits* theUserLimitsForCrystal;
G4double theMaxTimeCutsInCrystal;
G4double theMinEkineCutsInCrystal;
G4double theMinRangeCutsInCrystal;
// messeneger
ExN05DetectorMessenger* theMessenger;
};
#endif
@@ -0,0 +1,44 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05DetectorMessenger.hh,v 2.1 1998/08/14 08:21:17 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef ExN05DetectorMessenger_h
#define ExN05DetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class ExN05DetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
class ExN05DetectorMessenger: public G4UImessenger
{
public:
ExN05DetectorMessenger(ExN05DetectorConstruction * myDet);
~ExN05DetectorMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
ExN05DetectorConstruction* myDetector;
G4UIdirectory* mydetDir;
G4UIcmdWithAString* SwitchCmd;
G4UIcmdWithADoubleAndUnit* TmaxCmd;
G4UIcmdWithADoubleAndUnit* EminCmd;
G4UIcmdWithADoubleAndUnit* RminCmd;
};
#endif
@@ -0,0 +1,64 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EMShowerModel.hh,v 2.1 1998/12/10 04:07:36 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//----------------------------------------------
// Parameterisation of e+/e-/gamma producing hits
// The hits are the same as defined in the detailed
// simulation.
//----------------------------------------------
#ifndef ExN05EMShowerModel_h
#define ExN05EMShowerModel_h 1
#include "ExN05EnergySpot.hh"
#include "G4VFastSimulationModel.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include <rw/tvordvec.h>
class ExN05EMShowerModel : public G4VFastSimulationModel
{
public:
//-------------------------
// Constructor, destructor
//-------------------------
ExN05EMShowerModel (G4String, G4LogicalVolume*);
ExN05EMShowerModel (G4String);
~ExN05EMShowerModel ();
//------------------------------
// Virtual methods of the base
// class to be coded by the user
//------------------------------
// -- IsApplicable
G4bool IsApplicable(const G4ParticleDefinition&);
// -- ModelTrigger
G4bool ModelTrigger(const G4FastTrack &);
// -- User method DoIt
void DoIt(const G4FastTrack&, G4FastStep&);
private:
void AssignSpotAndCallHit(const ExN05EnergySpot &eSpot);
void FillFakeStep(const ExN05EnergySpot &eSpot);
void Explode(const G4FastTrack&);
void BuildDetectorResponse();
G4Step *fFakeStep;
G4StepPoint *fFakePreStepPoint, *fFakePostStepPoint;
G4VTouchable*fpTouchable;
G4Navigator *fpNavigator;
G4bool fNaviSetup;
RWTValOrderedVector<ExN05EnergySpot> feSpotList;
};
#endif
@@ -0,0 +1,48 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EnergySpot.hh,v 2.2 1998/12/10 04:11:07 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05EnergySpot_h
#define ExN05EnergySpot_h
#include "G4ThreeVector.hh"
class G4Colour;
class ExN05EnergySpot
{
public:
ExN05EnergySpot();
ExN05EnergySpot(const G4ThreeVector& point, G4double E);
~ExN05EnergySpot();
inline void SetEnergy(const G4double& E) {Energy = E;}
inline G4double GetEnergy() const {return Energy;}
inline void SetPosition(const G4ThreeVector& point) {Point = point;}
inline G4ThreeVector GetPosition() const {return Point;}
// Required by Rogue Wave explicitely,
// when using RWTValOrderedVector<ExN05EnergySpot>
int operator==(const ExN05EnergySpot& eSpot) const
{
return (Energy==eSpot.Energy && Point==eSpot.Point) ? 1 : 0;
};
// Draw:
void Draw(G4Colour* color = NULL);
// Print:
void Print();
private:
G4double Energy;
G4ThreeVector Point;
};
#endif
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EventAction.hh,v 2.2 1998/12/10 04:11:11 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05EventAction_h
#define ExN05EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class G4Event;
class ExN05EventAction : public G4UserEventAction
{
public:
ExN05EventAction();
~ExN05EventAction();
public:
void BeginOfEventAction();
void EndOfEventAction();
private:
G4int calorimeterCollID;
G4int hadCalorimeterCollID;
G4bool drawFlag;
public:
inline void SetDrawFlag(G4bool val)
{ drawFlag = val; };
};
#endif
@@ -0,0 +1,34 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EventActionMessenger.hh,v 2.1 1998/07/12 02:42:14 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05EventActionMessenger_h
#define ExN05EventActionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithABool;
class ExN05EventAction;
class ExN05EventActionMessenger: public G4UImessenger
{
public:
ExN05EventActionMessenger(ExN05EventAction* EA);
void SetNewValue(G4UIcommand* command, G4String newValues);
private:
ExN05EventAction* EventAction;
G4UIdirectory* eventDirectory;
G4UIcmdWithABool* drawEventCmd;
};
#endif
@@ -0,0 +1,54 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MaxTimeCuts.hh,v 2.2 1998/08/16 14:09:50 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
// 14 Aug. 1998 H.Kurashige
// ------------------------------------------------------------
#ifndef ExN05MaxTimeCuts_h
#define ExN05MaxTimeCuts_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "ExN05SpecialCuts.hh"
class ExN05MaxTimeCuts : public ExN05SpecialCuts
{
public:
ExN05MaxTimeCuts(const G4String& processName ="ExN05MaxTimeCuts" );
~ExN05MaxTimeCuts();
// PostStep GPIL
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
private:
// hide assignment operator as private
ExN05MaxTimeCuts(ExN05MaxTimeCuts&);
ExN05MaxTimeCuts& operator=(const ExN05MaxTimeCuts& right);
};
#endif
@@ -0,0 +1,54 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MinEkineCuts.hh,v 2.2 1998/08/16 14:09:51 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
// 14 Aug. 1998 H.Kurashige
// ------------------------------------------------------------
#ifndef ExN05MinEkineCuts_h
#define ExN05MinEkineCuts_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "ExN05SpecialCuts.hh"
class ExN05MinEkineCuts : public ExN05SpecialCuts
{
public:
ExN05MinEkineCuts(const G4String& processName ="ExN05MinEkineCuts" );
~ExN05MinEkineCuts();
// PostStep GPIL
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
private:
// hide assignment operator as private
ExN05MinEkineCuts(ExN05MinEkineCuts&);
ExN05MinEkineCuts& operator=(const ExN05MinEkineCuts& right);
};
#endif
@@ -0,0 +1,54 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MinRangeCuts.hh,v 2.2 1998/08/16 14:09:51 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
// 14 Aug. 1998 H.Kurashige
// ------------------------------------------------------------
#ifndef ExN05MinRangeCuts_h
#define ExN05MinRangeCuts_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "ExN05SpecialCuts.hh"
class ExN05MinRangeCuts : public ExN05SpecialCuts
{
public:
ExN05MinRangeCuts(const G4String& processName ="ExN05MinRangeCuts" );
~ExN05MinRangeCuts();
// PostStep GPIL
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
private:
// hide assignment operator as private
ExN05MinRangeCuts(ExN05MinRangeCuts&);
ExN05MinRangeCuts& operator=(const ExN05MinRangeCuts& right);
};
#endif
@@ -0,0 +1,53 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PhysicsList.hh,v 2.2 1998/08/14 08:21:17 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef ExN05PhysicsList_h
#define ExN05PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
class ExN05PhysicsList: public G4VUserPhysicsList
{
public:
ExN05PhysicsList();
virtual ~ExN05PhysicsList();
protected:
// Construct particle and physics
virtual void ConstructParticle();
virtual void ConstructProcess();
//
virtual void SetCuts(G4double aCut);
protected:
// these methods Construct particles
virtual void ConstructBosons();
virtual void ConstructLeptons();
virtual void ConstructMesons();
virtual void ConstructBarions();
virtual void ConstructIons();
protected:
// these methods Construct physics processes and register them
void AddParameterisation();
virtual void ConstructGeneral();
virtual void ConstructEM();
virtual void ConstructHad();
virtual void ConstructLeptHad();
virtual void AddTransportation();
};
#endif
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PiModel.hh,v 2.0 1998/07/02 14:09:18 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//----------------------------------------
// Simple example of a "parameterisation".
//----------------------------------------
#ifndef ExN05PiModel_h
#define ExN05PiModel_h 1
#include "G4VFastSimulationModel.hh"
class ExN05PiModel : public G4VFastSimulationModel
{
public:
//-------------------------
// Constructor, destructor
//-------------------------
ExN05PiModel (G4LogicalVolume *anEnvelope);
~ExN05PiModel ();
//------------------------------
// Virtual methods of the base
// class to be coded by the user
//------------------------------
// -- IsApplicable
G4bool IsApplicable(const G4ParticleDefinition&);
// -- ModelTrigger
G4bool ModelTrigger(const G4FastTrack &);
// -- User method DoIt
void DoIt(const G4FastTrack&, G4FastStep&);
};
#endif
@@ -0,0 +1,62 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PionShowerModel.hh,v 2.1 1998/12/10 04:05:49 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//----------------------------------------------
// Parameterisation for pi+/pi- producing hits.
//----------------------------------------------
#ifndef ExN05PionShowerModel_h
#define ExN05PionShowerModel_h 1
#include "ExN05EnergySpot.hh"
#include "G4VFastSimulationModel.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include <rw/tvordvec.h>
class ExN05PionShowerModel : public G4VFastSimulationModel
{
public:
//-------------------------
// Constructor, destructor
//-------------------------
ExN05PionShowerModel (G4String, G4LogicalVolume*);
ExN05PionShowerModel (G4String);
~ExN05PionShowerModel ();
//------------------------------
// Virtual methods of the base
// class to be coded by the user
//------------------------------
// -- IsApplicable
G4bool IsApplicable(const G4ParticleDefinition&);
// -- ModelTrigger
G4bool ModelTrigger(const G4FastTrack &);
// -- User method DoIt
void DoIt(const G4FastTrack&, G4FastStep&);
private:
void AssignSpotAndCallHit(const ExN05EnergySpot &eSpot);
void FillFakeStep(const ExN05EnergySpot &eSpot);
void Explode(const G4FastTrack&);
void BuildDetectorResponse();
G4Step *fFakeStep;
G4StepPoint *fFakePreStepPoint, *fFakePostStepPoint;
G4VTouchable*fpTouchable;
G4Navigator *fpNavigator;
G4bool fNaviSetup;
RWTValOrderedVector<ExN05EnergySpot> feSpotList;
};
#endif
@@ -0,0 +1,36 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PrimaryGeneratorAction.hh,v 2.1 1998/07/12 02:42:16 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05PrimaryGeneratorAction_h
#define ExN05PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
class G4ParticleGun;
class G4Event;
class ExN05PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
ExN05PrimaryGeneratorAction();
~ExN05PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
G4ParticleGun* GetParticleGun();
private:
G4ParticleGun* particleGun;
};
#endif
@@ -0,0 +1,37 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05RunAction.hh,v 2.1 1998/07/12 02:42:16 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05RunAction_h
#define ExN05RunAction_h 1
#include "G4UserRunAction.hh"
#include "G4Timer.hh"
#include "globals.hh"
class G4Run;
class ExN05RunAction : public G4UserRunAction
{
public:
ExN05RunAction();
~ExN05RunAction();
public:
void BeginOfRunAction(G4Run* aRun);
void EndOfRunAction(G4Run* aRun);
private:
G4Timer* timer;
G4int runIDcounter;
};
#endif
@@ -0,0 +1,84 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SpecialCuts.hh,v 2.3 1998/08/16 14:09:52 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
// 15 April 1998 M.Maire
// ------------------------------------------------------------
#ifndef ExN05SpecialCuts_h
#define ExN05SpecialCuts_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VProcess.hh"
class ExN05SpecialCuts : public G4VProcess
{
public:
ExN05SpecialCuts(const G4String& processName ="ExN05SpecialCut" );
~ExN05SpecialCuts(){};
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
// no operation in AtRestGPIL
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
){ return -1.0; };
// no operation in AtRestDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
){return NULL;};
// no operation in AlongStepGPIL
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
// no operation in AlongStepDoIt
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return NULL;};
private:
// hide assignment operator as private
ExN05SpecialCuts& operator=(const ExN05SpecialCuts& right){return *this;};
};
#endif
@@ -0,0 +1,34 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SteppingAction.hh,v 2.1 1998/07/12 02:42:17 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05SteppingAction_h
#define ExN05SteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class ExN05SteppingAction : public G4UserSteppingAction
{
public:
ExN05SteppingAction();
~ExN05SteppingAction(){};
void UserSteppingAction();
private:
G4bool drawFlag;
public:
inline void SetDrawFlag(G4bool val)
{ drawFlag = val; };
};
#endif
@@ -0,0 +1,37 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SteppingActionMessenger.hh,v 2.1 1998/07/12 02:42:18 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef ExN05SteppingActionMessenger_h
#define ExN05SteppingActionMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
#include "G4UIcommand.hh"
class ExN05SteppingAction;
class G4UIdirectory;
class G4UIcmdWithABool;
class ExN05SteppingActionMessenger: public G4UImessenger
{
public:
ExN05SteppingActionMessenger(ExN05SteppingAction *SA);
void SetNewValue(G4UIcommand* command, G4String newValues);
private:
ExN05SteppingAction* SteppingAction;
G4UIdirectory* stepDirectory;
G4UIcmdWithABool* drawStepCmd;
G4UIcmdWithABool* verboseStepCmd;
};
#endif
@@ -0,0 +1,13 @@
// -----------------------------------
// Header file for RandomGamma:
// adaptation of RNGAMA function from
// KERNLIB
// -----------------------------------
#ifndef RandomGamma_h
#define RanfomGamma_h 1
extern double RandomGamma(double);
#endif
@@ -0,0 +1,75 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05CalorimeterHit.cc,v 2.2 1998/07/13 16:34:05 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05CalorimeterHit.hh"
#include "G4VVisManager.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4LogicalVolume.hh"
#include "G4ios.hh"
G4Allocator<ExN05CalorimeterHit> ExN05CalorimeterHitAllocator;
ExN05CalorimeterHit::ExN05CalorimeterHit()
{pLogV=NULL;}
ExN05CalorimeterHit::ExN05CalorimeterHit(G4LogicalVolume* logVol)
:pLogV(logVol)
{;}
ExN05CalorimeterHit::~ExN05CalorimeterHit()
{;}
ExN05CalorimeterHit::ExN05CalorimeterHit(const ExN05CalorimeterHit &right)
{
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
}
const ExN05CalorimeterHit& ExN05CalorimeterHit::operator=(const ExN05CalorimeterHit &right)
{
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
return *this;
}
int ExN05CalorimeterHit::operator==(const ExN05CalorimeterHit &right) const
{
return 0;
}
void ExN05CalorimeterHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Transform3D trans(rot,pos);
G4VisAttributes attribs;
const G4VisAttributes* pVA = pLogV->GetVisAttributes();
if(pVA) attribs = *pVA;
G4Colour colour(1.,0.,0.);
attribs.SetColour(colour);
attribs.SetForceWireframe(false);
attribs.SetForceSolid(true);
pVVisManager->Draw(*pLogV,attribs,trans);
}
}
void ExN05CalorimeterHit::Print()
{
}
@@ -0,0 +1,98 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05CalorimeterSD.cc,v 2.6 1998/12/11 19:14:06 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05CalorimeterSD.hh"
#include "ExN05CalorimeterHit.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Track.hh"
#include "G4ParticleDefinition.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
ExN05CalorimeterSD::ExN05CalorimeterSD(G4String name, G4int nCells, G4String colName)
:G4VSensitiveDetector(name),numberOfCells(nCells),HCID(-1)
{
G4String HCname;
collectionName.insert(HCname=colName);
CellID = new int[numberOfCells];
}
ExN05CalorimeterSD::~ExN05CalorimeterSD()
{
delete [] CellID;
}
void ExN05CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
{
CalCollection = new ExN05CalorimeterHitsCollection
(SensitiveDetectorName,collectionName[0]);
for(int j=0;j<numberOfCells;j++)
{
CellID[j] = -1;
}
}
G4bool ExN05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
if(edep<=0.) return false;
const G4VPhysicalVolume* physVol
= aStep->GetPreStepPoint()->GetPhysicalVolume();
int copyID = physVol->GetCopyNo();
if(CellID[copyID]==-1)
{
ExN05CalorimeterHit* calHit = new ExN05CalorimeterHit(physVol->GetLogicalVolume());
G4RotationMatrix rotM;
if(physVol->GetObjectRotation()) rotM = *(physVol->GetObjectRotation());
calHit->SetEdep( edep );
calHit->SetPos( physVol->GetTranslation() );
calHit->SetRot( rotM );
int icell = CalCollection->insert( calHit );
CellID[copyID] = icell - 1;
if(verboseLevel>0)
{ G4cout << " New Calorimeter Hit on CellID " << copyID << endl; }
}
else
{
(*CalCollection)[CellID[copyID]]->AddEdep( edep );
if(verboseLevel>0)
{ G4cout << " Energy added to CellID " << copyID << endl; }
}
return true;
}
void ExN05CalorimeterSD::EndOfEvent(G4HCofThisEvent*HCE)
{
if(HCID<0)
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
HCE->AddHitsCollection( HCID, CalCollection );
}
void ExN05CalorimeterSD::clear()
{
}
void ExN05CalorimeterSD::DrawAll()
{
}
void ExN05CalorimeterSD::PrintAll()
{
}
@@ -0,0 +1,357 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05DetectorConstruction.cc,v 2.8 1998/12/14 16:58:12 sadilov Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05DetectorConstruction.hh"
#include "ExN05CalorimeterSD.hh"
#include "ExN05DetectorMessenger.hh"
#include "ExN05EMShowerModel.hh"
#include "ExN05PionShowerModel.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4SDManager.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4UserLimits.hh"
#include "G4FastSimulationManager.hh"
ExN05DetectorConstruction::ExN05DetectorConstruction()
{
theUserLimitsForCrystal = NULL;
fUseUserLimits = false;
theMaxTimeCutsInCrystal = 1000.0 * ns;
theMinEkineCutsInCrystal = 1.0 * MeV;
theMinRangeCutsInCrystal = 1.0 * mm;
theMessenger = new ExN05DetectorMessenger(this);
}
ExN05DetectorConstruction::~ExN05DetectorConstruction()
{
if (theUserLimitsForCrystal != NULL) delete theUserLimitsForCrystal;
delete theMessenger;
}
G4VPhysicalVolume* ExN05DetectorConstruction::Construct()
{
G4cout << "\nExN05DetectorConstruction....\n" << endl;
//--------- Material definition ---------
G4double a, iz, z, density;
G4String name, symbol;
G4int nel;
a = 14.01*g/mole;
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
a = 16.00*g/mole;
G4Element* elO = new G4Element(name="Oxigen", symbol="O", iz=8., a);
a = 126.9*g/mole;
G4Element* elI = new G4Element(name="Iodine", symbol="I", iz=53., a);
a = 132.9*g/mole;
G4Element* elCs= new G4Element(name="Cesium", symbol="Cs", iz=55., a);
density = 4.51*g/cm3;
G4Material* CsI = new G4Material(name="CsI", density, nel = 2);
CsI->AddElement(elI, .5);
CsI->AddElement(elCs,.5);
a = 4.0*g/mole;
density = 0.1786e-03*g/cm3;
G4Material* He = new G4Material(name="He", z=2., a, density);
a = 26.98*g/mole;
density = 2.7*g/cm3;
G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
a = 207.19*g/mole;
density = 11.35*g/cm3;
G4Material* Pb = new G4Material(name="Lead", z=82., a, density);
a = 55.85*g/mole;
density = 7.87*g/cm3;
G4Material* Fe = new G4Material(name="Fer", z=26., a, density);
density = 1.29e-03*g/cm3;
G4Material* Air = new G4Material(name="Air", density, nel=2);
Air->AddElement(elN, .7);
Air->AddElement(elO, .3);
//--------- G4VSolid, G4LogicalVolume, G4VPhysicalVolume ---------
//--------------
// World:
//--------------
G4Box *WorldBox= new G4Box("WorldBox",400*cm, 400*cm, 400*cm);
G4LogicalVolume *WorldLog=new G4LogicalVolume(WorldBox,Air,
"WorldLogical", 0, 0, 0);
G4PVPlacement *WorldPhys=new G4PVPlacement(0,G4ThreeVector(),
"WorldPhysical",
WorldLog,
0,false,0);
// Size of detectors:
G4double detectSize = 125*cm;
//-----------------------------
// "Drift Chamber":
// Not used in parameterisation.
//-----------------------------
// -- Logical volume:
G4Box *driftChamberBox
= new G4Box("DriftChamberSolid", detectSize, detectSize, 40*cm);
G4LogicalVolume *driftChamberLog = new G4LogicalVolume(driftChamberBox,He,
"DriftChamberLogical", 0, 0, 0);
// -- Placement:
G4PVPlacement *driftChamberPhys = new G4PVPlacement(0,G4ThreeVector(0., 0., 50*cm),
"DriftChamberPhysical",
driftChamberLog,
WorldPhys,false,0);
//--------------------------
// "Calorimeter": used in
// parameterisation below
//--------------------------
// -- Logical volume:
G4Box *calorimeterBox
= new G4Box("CalorimeterSolid", detectSize, detectSize, 20*cm);
G4LogicalVolume *calorimeterLog = new G4LogicalVolume(calorimeterBox,Air,
"CalorimeterLogical", 0, 0, 0);
// -- Placement:
G4PVPlacement *calorimeterPhys = new G4PVPlacement(0,G4ThreeVector(0., 0., 120*cm),
"CalorimeterPhysical",
calorimeterLog,
WorldPhys,false,0);
//--------------------------------------
// The calorimeter is filled with
// crystals:
//--------------------------------------
// -- Logical volume:
G4double CrystalX = 2.5*cm;
G4double CrystalY = CrystalX;
G4double CrystalZ = 20*cm;
G4Box *CrystalSolid = new G4Box("CrystalSolid", CrystalX, CrystalY, CrystalZ);
theCrystalLog = new G4LogicalVolume(CrystalSolid,CsI,
"CrystalLogical", 0, 0, 0);
// create UserLimits
if (theUserLimitsForCrystal != NULL) delete theUserLimitsForCrystal;
theUserLimitsForCrystal = new G4UserLimits( DBL_MAX, //step max
DBL_MAX, // track max
theMaxTimeCutsInCrystal,
theMinEkineCutsInCrystal,
theMinRangeCutsInCrystal );
// attach UserLimits
if (fUseUserLimits) {
theCrystalLog->SetUserLimits(theUserLimitsForCrystal);
}
G4String tName1("Crystal"); // Allow all target physicals to share
// same name (delayed copy)
// -- and placements inside the calorimeter:
G4PVPlacement *crystalPhys;
G4int copyNo=0;
G4double xTlate, yTlate;
G4int nX = 48;
G4int nY = 48;
for (G4int j = 0; j < nY; j++)
{
yTlate = -detectSize + 3*CrystalY + j*2*CrystalY;
for (G4int i = 0; i < nX; i++)
{
xTlate = -detectSize + 3*CrystalX + i*2*CrystalX;
crystalPhys
= new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
tName1,
theCrystalLog,
calorimeterPhys,false,copyNo++);
}
}
//--------------------------
// "Hadron Calorimeter": used
// in parameterisation with
// a ghost volume
//--------------------------
// -- Logical volume:
G4Box *hadCaloBox
= new G4Box("HadCaloSolid", detectSize, detectSize, 50*cm);
G4LogicalVolume *hadCaloLog = new G4LogicalVolume(hadCaloBox,Air,
"HadCaloLogical", 0, 0, 0);
// -- Placement:
G4PVPlacement *hadCaloPhys = new G4PVPlacement(0,G4ThreeVector(0., 0., 200*cm),
"HadCaloPhysical",
hadCaloLog,
WorldPhys,false,0);
//--------------------------------------
// The calorimeter is filled with
// towers:
//--------------------------------------
// -- Logical volume:
G4double TowerX = 5*cm;
G4double TowerY = TowerX;
G4double TowerZ = 45*cm;
G4Box *TowerSolid = new G4Box("TowerSolid", TowerX, TowerY, TowerZ);
theTowerLog = new G4LogicalVolume(TowerSolid,Fe,
"TowerLogical", 0, 0, 0);
G4String tName2("Tower");
// -- and placements inside the calorimeter:
G4PVPlacement *towerPhys;
copyNo=0;
G4int nXhad = 23;
G4int nYhad = 23;
for (G4int jj = 0; jj < nYhad; jj++)
{
yTlate = -detectSize + 3*TowerY + jj*2*TowerY;
for (G4int i = 0; i < nXhad; i++)
{
xTlate = -detectSize + 3*TowerX + i*2*TowerX;
towerPhys
= new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
tName2,
theTowerLog,
hadCaloPhys,false,copyNo++);
}
}
//------------------------------------------------------------
//
//
//--------------- Ghost Volumes ------------------------------------
// Ghost volumes will be placed in an automatic copy of the world volume.
// The placement of the ghost logical volume are specified by the
// G4FastSimulationManager object attached to it.
// Those placement are given compared to the world.
// -- Solid:
G4Box *ghostBox
= new G4Box("GhostBox", detectSize+5*cm, detectSize+5*cm, 80*cm);
// -- Logical volume:
G4LogicalVolume* ghostLogical
= new G4LogicalVolume(ghostBox,Air,
"GhostLogical",
0, 0, 0);
// G4FastSimulationManager doesn't exist yet: we set it
// (not needed if we set a G4VFastSimulationModel which
// takes care of creating one if needed)
new G4FastSimulationManager(ghostLogical);
ghostLogical->GetFastSimulationManager()->
AddGhostPlacement(0,G4ThreeVector(0., 0., 175*cm));
//--------- Sensitive detector -------------------------------------
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String calorimeterSDname = "ExN05/Calorimeter";
ExN05CalorimeterSD* CalorimeterSD = new ExN05CalorimeterSD( calorimeterSDname, nX*nY, "CalCollection" );
SDman->AddNewDetector( CalorimeterSD );
theCrystalLog->SetSensitiveDetector(CalorimeterSD);
G4String hadCalorimeterSDname = "ExN05/HadronCalorimeter";
ExN05CalorimeterSD* HadCalorimeterSD = new ExN05CalorimeterSD( hadCalorimeterSDname, nXhad*nYhad, "HadCollection" );
SDman->AddNewDetector( HadCalorimeterSD );
theTowerLog->SetSensitiveDetector(HadCalorimeterSD);
//------------------ Parameterisation ------------------------------
// builds a model and sets it to the envelope of the calorimeter:
ExN05EMShowerModel* emShowerModel =
new ExN05EMShowerModel("emShowerModel",calorimeterLog);
// and a model attached to the ghost:
ExN05PionShowerModel* ghostPionShowerModel =
new ExN05PionShowerModel("ghostPionShowerModel",ghostLogical);
//--------- Visualization attributes -------------------------------
WorldLog->SetVisAttributes(G4VisAttributes::Invisible);
G4VisAttributes * driftchamberTubeVisAtt
= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
driftchamberTubeVisAtt->SetForceWireframe(true);
driftChamberLog->SetVisAttributes(driftchamberTubeVisAtt);
G4VisAttributes * calorimeterBoxVisAtt
= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
calorimeterBoxVisAtt->SetForceWireframe(true);
calorimeterLog->SetVisAttributes(calorimeterBoxVisAtt);
G4VisAttributes * crystalVisAtt
= new G4VisAttributes(G4Colour(1.0,0.0,0.0));
crystalVisAtt->SetForceWireframe(true);
theCrystalLog->SetVisAttributes(crystalVisAtt);
G4VisAttributes * hadCaloBoxVisAtt
= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
hadCaloBoxVisAtt->SetForceWireframe(true);
hadCaloLog->SetVisAttributes(hadCaloBoxVisAtt);
G4VisAttributes * towerVisAtt
= new G4VisAttributes(G4Colour(0.5,0.0,1.0));
towerVisAtt->SetForceWireframe(true);
theTowerLog->SetVisAttributes(towerVisAtt);
G4VisAttributes * ghostVisAtt
= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
ghostVisAtt->SetForceWireframe(true);
ghostLogical->SetVisAttributes(ghostVisAtt);
//------------------------------------------------------------------
//-----------------------
// Returns the pointer to
// the physical world:
//-----------------------
return WorldPhys;
}
void ExN05DetectorConstruction::SetMaxTimeInCrystal(G4double value)
{
theMaxTimeCutsInCrystal = value;
if (theUserLimitsForCrystal != NULL) {
theUserLimitsForCrystal->SetUserMaxTime(value);
}
}
void ExN05DetectorConstruction::SetMinEkineInCrystal(G4double value)
{
theMinEkineCutsInCrystal = value;
if (theUserLimitsForCrystal != NULL) {
theUserLimitsForCrystal->SetUserMinEkine(value);
}
}
void ExN05DetectorConstruction::SetMinRangeInCrystal(G4double value)
{
theMinRangeCutsInCrystal = value;
if (theUserLimitsForCrystal != NULL) {
theUserLimitsForCrystal->SetUserMinRange(value);
}
}
void ExN05DetectorConstruction::UseUserLimits(G4bool isUse)
{
fUseUserLimits = isUse;
if ( fUseUserLimits && (theUserLimitsForCrystal!= NULL)) {
theCrystalLog->SetUserLimits(theUserLimitsForCrystal);
}
}
@@ -0,0 +1,114 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05DetectorMessenger.cc,v 2.1 1998/08/14 08:21:21 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#include "ExN05DetectorMessenger.hh"
#include "ExN05DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "globals.hh"
#include <iomanip.h>
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
ExN05DetectorMessenger::ExN05DetectorMessenger(ExN05DetectorConstruction * myDet) : myDetector(myDet)
{
mydetDir = new G4UIdirectory("/exN05/detector/");
mydetDir->SetGuidance("ExN05 detector control.");
SwitchCmd = new G4UIcmdWithAString("/exN05/detector/switchUserLimits",this);
SwitchCmd->SetGuidance("Switch On/Off UserLimits for crystals");
SwitchCmd->SetGuidance(" Choice : on / off ");
SwitchCmd->SetParameterName("choice",true);
SwitchCmd->SetDefaultValue("on");
SwitchCmd->SetCandidates("on ON off OFF");
SwitchCmd->AvailableForStates(PreInit,Idle);
TmaxCmd = new G4UIcmdWithADoubleAndUnit("/exN05/detector/maxTime",this);
TmaxCmd->SetGuidance("Set maximum time in crystal");
TmaxCmd->SetParameterName("Tmax",false,false);
TmaxCmd->SetDefaultUnit("ns");
TmaxCmd->SetUnitCategory("Time");
TmaxCmd->AvailableForStates(PreInit,Idle);
EminCmd = new G4UIcmdWithADoubleAndUnit("/exN05/detector/minEkine",this);
EminCmd->SetGuidance("Set minimum kinetic energy in crystal");
EminCmd->SetParameterName("Emin",false,false);
EminCmd->SetDefaultUnit("MeV");
EminCmd->SetUnitCategory("Energy");
EminCmd->AvailableForStates(PreInit,Idle);
RminCmd = new G4UIcmdWithADoubleAndUnit("/exN05/detector/minRange",this);
RminCmd->SetGuidance("Set minimum range in crystal");
RminCmd->SetParameterName("Rmin",false,false);
RminCmd->SetDefaultUnit("mm");
RminCmd->SetUnitCategory("Length");
RminCmd->AvailableForStates(PreInit,Idle);
}
ExN05DetectorMessenger::~ExN05DetectorMessenger()
{
delete SwitchCmd;
delete TmaxCmd;
delete RminCmd;
delete EminCmd;
}
void ExN05DetectorMessenger::SetNewValue(G4UIcommand * command,G4String newValues)
{
if( command == SwitchCmd ) {
if ( (newValues == "off") || (newValues == "OFF") ){
myDetector->UseUserLimits(false);
} else {
myDetector->UseUserLimits(true);
}
} else if( command == TmaxCmd ) {
myDetector->SetMaxTimeInCrystal(TmaxCmd->GetNewDoubleValue(newValues));
} else if( command == EminCmd ) {
myDetector->SetMinEkineInCrystal(EminCmd->GetNewDoubleValue(newValues));
} else if( command == RminCmd ) {
myDetector->SetMinRangeInCrystal(RminCmd->GetNewDoubleValue(newValues));
}
}
G4String ExN05DetectorMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String returnValue('\0');
char line[255];
ostrstream os(line,255);
if( command == SwitchCmd ) {
if ( myDetector->IsUseUserLimits() )returnValue = "on";
else returnValue = "off";
} else if( command == TmaxCmd ) {
os << myDetector->GetMaxTimeInCrystal()/ns << " ns" << '\0';
returnValue = G4String(line);
} else if( command == EminCmd ) {
os << myDetector->GetMinEkineInCrystal()/MeV << " MeV" << '\0';
returnValue = G4String(line);
} else if( command == RminCmd ) {
os << myDetector->GetMinRangeInCrystal()/mm << " mm" << '\0';
returnValue = G4String(line);
}
return returnValue;
}
@@ -0,0 +1,237 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EMShowerModel.cc,v 2.4 1998/12/10 04:07:39 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05EMShowerModel.hh"
#include "ExN05EnergySpot.hh"
#include "RandomGamma.hh"
#include "Randomize.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4Gamma.hh"
#include "G4TransportationManager.hh"
#include "G4VSensitiveDetector.hh"
#include "G4VTouchable.hh"
ExN05EMShowerModel::ExN05EMShowerModel(G4String modelName, G4LogicalVolume* envelope)
: G4VFastSimulationModel(modelName, envelope)
{
fFakeStep = new G4Step();
fFakePreStepPoint = fFakeStep->GetPreStepPoint();
fFakePostStepPoint = fFakeStep->GetPostStepPoint();
fpTouchable = new G4TouchableHistory();
fpNavigator = new G4Navigator();
fNaviSetup = false;
}
ExN05EMShowerModel::ExN05EMShowerModel(G4String modelName)
: G4VFastSimulationModel(modelName)
{
fFakeStep = new G4Step();
fFakePreStepPoint = fFakeStep->GetPreStepPoint();
fFakePostStepPoint = fFakeStep->GetPostStepPoint();
fpTouchable = new G4TouchableHistory();
fpNavigator = new G4Navigator();
fNaviSetup = false;
}
ExN05EMShowerModel::~ExN05EMShowerModel()
{
delete fFakeStep;
delete fpTouchable;
delete fpNavigator;
}
G4bool ExN05EMShowerModel::IsApplicable(const G4ParticleDefinition& particleType)
{
return
&particleType == G4Electron::ElectronDefinition() ||
&particleType == G4Positron::PositronDefinition() ||
&particleType == G4Gamma::GammaDefinition();
}
G4bool ExN05EMShowerModel::ModelTrigger(const G4FastTrack& fastTrack)
{
// Applies the parameterisation above 100 MeV:
return fastTrack.GetPrimaryTrack()->GetKineticEnergy() > 100*MeV;
}
void ExN05EMShowerModel::DoIt(const G4FastTrack& fastTrack,
G4FastStep& fastStep)
{
// Kill the parawmeterised particle:
fastStep.KillPrimaryTrack();
fastStep.SetPrimaryTrackPathLength(0.0);
fastStep.SetTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy());
// split into "energy spots" energy according to the shower shape:
Explode(fastTrack);
// and put those energy spots into the crystals:
BuildDetectorResponse();
}
void ExN05EMShowerModel::Explode(const G4FastTrack& fastTrack)
{
//-----------------------------------------------------
//
//-----------------------------------------------------
// Reduced quantities:
// -- critical energy in CsI:
G4double Ec = 800*MeV/(54. + 1.2); // 54 = mean Z of CsI
G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
G4double y = Energy/Ec;
// compute value of parameter "a" of longitudinal profile, b assumed = 0.5
G4double a, tmax, b(0.5), C;
if (fastTrack.GetPrimaryTrack()->GetDefinition() == G4Gamma::GammaDefinition()) C = 0.5;
else C = -0.5;
tmax = 1.0 * (log(y) + C);
a = 1.0 + b*tmax;
// t : reduced quantity = z/X0:
G4double t, bt;
G4Material* CsI = G4Material::GetMaterial("CsI");
G4double X0 = CsI->GetRadlen();
// Moliere radius:
G4double Es = 21*MeV;
G4double Rm = X0*Es/Ec;
// axis of the shower, in global reference frame:
G4ThreeVector xShower, yShower, zShower;
zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
xShower = zShower.orthogonal();
yShower = zShower.cross(xShower);
// starting point of the shower:
G4ThreeVector sShower = fastTrack.GetPrimaryTrack()->GetPosition();
// We shoot 100 spots of energy:
G4int nSpots = 100;
G4double deposit = Energy/double(nSpots);
ExN05EnergySpot eSpot;
eSpot.SetEnergy(deposit);
G4ThreeVector ePoint;
G4double z, r, phi;
feSpotList.clear();
for (int i = 0; i < nSpots; i++)
{
// Longitudinal profile:
// -- shoot z according to Gamma distribution:
bt = RandomGamma(a);
t = bt/b;
z = t*X0;
// transverse profile:
// we set 90% of energy in one Rm,
// the rest between 1 and 3.5 Rm:
G4double xr = G4UniformRand();
if (xr < 0.9) r = xr/0.9*Rm;
else r = ((xr - 0.9)/0.1*2.5 + 1.0)*Rm;
phi = G4UniformRand()*twopi;
// build the position:
ePoint = sShower +
z*zShower +
r*cos(phi)*xShower + r*sin(phi)*yShower;
// and the energy spot:
eSpot.SetPosition(ePoint);
// Records the eSpot:
feSpotList.insert(eSpot);
}
}
void ExN05EMShowerModel::BuildDetectorResponse()
{
// Does the assignation of the energy spots to the sensitive volumes:
for (int i = 0; i < feSpotList.entries(); i++)
{
// Draw the energy spot:
feSpotList[i].Draw();
// feSpotList[i].Print();
// "converts" the energy spot into the fake
// G4Step to pass to sensitive detector:
AssignSpotAndCallHit(feSpotList[i]);
}
}
void ExN05EMShowerModel::AssignSpotAndCallHit(const ExN05EnergySpot &eSpot)
{
//
// "converts" the energy spot into the fake
// G4Step to pass to sensitive detector:
//
FillFakeStep(eSpot);
//
// call sensitive part: taken/adapted from the stepping:
// Send G4Step information to Hit/Dig if the volume is sensitive
//
G4VPhysicalVolume* pCurrentVolume =
fFakeStep->GetPreStepPoint()->GetPhysicalVolume();
G4VSensitiveDetector* pSensitive;
if( pCurrentVolume != 0 )
{
pSensitive = pCurrentVolume->GetLogicalVolume()->
GetSensitiveDetector();
if( pSensitive != 0 )
{
pSensitive->Hit(fFakeStep);
}
}
}
void ExN05EMShowerModel::FillFakeStep(const ExN05EnergySpot &eSpot)
{
//-----------------------------------------------------------
// find in which volume the spot is.
//-----------------------------------------------------------
if (!fNaviSetup)
{
fpNavigator->
SetWorldVolume(G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume());
fpNavigator->
LocateGlobalPointAndUpdateTouchable(eSpot.GetPosition(),
fpTouchable,
false);
fNaviSetup = true;
}
else
{
fpNavigator->
LocateGlobalPointAndUpdateTouchable(eSpot.GetPosition(),
fpTouchable);
}
//--------------------------------------
// Fills attribute of the G4Step needed
// by our sensitive detector:
//-------------------------------------
// set touchable volume at PreStepPoint:
fFakePreStepPoint->SetTouchable(fpTouchable);
// set total energy deposit:
fFakeStep->SetTotalEnergyDeposit(eSpot.GetEnergy());
}
@@ -0,0 +1,74 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EnergySpot.cc,v 2.3 1998/12/10 04:11:29 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05EnergySpot.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4Polyline.hh"
#include "G4VVisManager.hh"
#include "G4Step.hh"
ExN05EnergySpot::ExN05EnergySpot()
{;}
ExN05EnergySpot::ExN05EnergySpot(const G4ThreeVector& point, G4double E)
{
Point = point;
Energy = E;
}
ExN05EnergySpot::~ExN05EnergySpot()
{;}
void ExN05EnergySpot::Draw(G4Colour *color)
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if (pVVisManager)
{
G4Polyline polyline;
G4Colour colour(1.,.5,.5);
if (color != 0) colour = *color;
G4VisAttributes attribs(colour);
polyline.SetVisAttributes(colour);
G4ThreeVector pp(Point);
// Draw a "home made" marker:
// Will be better by using a real Marker:
pp.setZ(pp.z()+1*cm);
polyline.append(pp);
pp.setZ(pp.z()-2*cm);
polyline.append(pp);
pp = Point;
polyline.append(pp);
pp.setX(pp.x()+1*cm);
polyline.append(pp);
pp.setX(pp.x()-2*cm);
polyline.append(pp);
pp = Point;
polyline.append(pp);
pp.setY(pp.y()+1*cm);
polyline.append(pp);
pp.setY(pp.y()-2*cm);
polyline.append(pp);
pVVisManager -> Draw(polyline);
}
}
void ExN05EnergySpot::Print()
{
G4cout << " ExN05EnergySpot {E = " << Energy << "; Position = " << Point << " }"<< endl;
}
+106
View File
@@ -0,0 +1,106 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EventAction.cc,v 2.7 1998/12/11 19:14:07 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05EventAction.hh"
#include "ExN05EventActionMessenger.hh"
#include "ExN05CalorimeterHit.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4SDManager.hh"
#include "G4UImanager.hh"
#include <rw/tvordvec.h>
#include "G4ios.hh"
ExN05EventAction::ExN05EventAction()
:drawFlag(false)
{
new ExN05EventActionMessenger(this);
}
ExN05EventAction::~ExN05EventAction()
{;}
void ExN05EventAction::BeginOfEventAction()
{
if(drawFlag)
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/draw/current");
}
}
}
void ExN05EventAction::EndOfEventAction()
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
G4String colNam;
calorimeterCollID = SDman->GetCollectionID(colNam="CalCollection");
hadCalorimeterCollID = SDman->GetCollectionID(colNam="HadCollection");
const G4Event* evt = fpEventManager->GetConstCurrentEvent();
G4cout << ">>> Event " << evt->GetEventID() << endl;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
ExN05CalorimeterHitsCollection* CaloHC = NULL;
ExN05CalorimeterHitsCollection* HadCaloHC = NULL;
if(HCE)
{
CaloHC = (ExN05CalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
HadCaloHC = (ExN05CalorimeterHitsCollection*)(HCE->GetHC(hadCalorimeterCollID));
}
if(CaloHC)
{
int n_hit = CaloHC->entries();
G4cout << " " << n_hit
<< " hits are stored in EM ExN05CalorimeterHitsCollection." << endl;
G4double totE = 0;
for(int i=0;i<n_hit;i++)
{ totE += (*CaloHC)[i]->GetEdep(); }
G4cout << " Total energy deposition in EM calorimeter crytals : "
<< totE / GeV << " (GeV)" << endl;
}
if(HadCaloHC)
{
int n_hit = HadCaloHC->entries();
G4cout << " " << n_hit
<< " hits are stored in HAD ExN05CalorimeterHitsCollection." << endl;
G4double totE = 0;
for(int i=0;i<n_hit;i++)
{ totE += (*HadCaloHC)[i]->GetEdep(); }
G4cout << " Total energy deposition in HAD calorimeter towers : "
<< totE / GeV << " (GeV)" << endl;
}
if(drawFlag)
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
if(CaloHC) CaloHC->DrawAllHits();
if(HadCaloHC) HadCaloHC->DrawAllHits();
G4UImanager::GetUIpointer()->ApplyCommand("/vis~/show/view");
}
}
}
@@ -0,0 +1,40 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05EventActionMessenger.cc,v 2.1 1998/07/12 02:42:25 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05EventActionMessenger.hh"
#include "ExN05EventAction.hh"
#include "globals.hh"
#include "G4UIcmdWithABool.hh"
ExN05EventActionMessenger::ExN05EventActionMessenger(ExN05EventAction* EA)
:EventAction(EA)
{
// uses "/event" directory already
// defined in G4EvManMessenger
drawEventCmd = new G4UIcmdWithABool("/event/Draw",this);
drawEventCmd->SetGuidance("Set drawFlag to Draw an event. (default = false)");
drawEventCmd->SetParameterName("Draw", false);
drawEventCmd->SetDefaultValue(false);
}
void ExN05EventActionMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
if( command->GetCommandName() == "Draw" )
{
G4int vl;
const char* t = newValues;
istrstream is((char*)t);
is >> vl;
EventAction->SetDrawFlag(vl!=0);
}
}
@@ -0,0 +1,75 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MaxTimeCuts.cc,v 2.3 1998/08/16 14:09:55 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// --------------------------------------------------------------
// 15 April 1998 M.Maire
// --------------------------------------------------------------
#include "ExN05MaxTimeCuts.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
#include "G4EnergyLossTables.hh"
ExN05MaxTimeCuts::ExN05MaxTimeCuts(const G4String& aName)
: ExN05SpecialCuts(aName)
{
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< endl;
}
SetProcessType(fUserDefined);
}
ExN05MaxTimeCuts::~ExN05MaxTimeCuts()
{}
ExN05MaxTimeCuts::ExN05MaxTimeCuts(ExN05MaxTimeCuts& right)
{}
G4double ExN05MaxTimeCuts::PostStepGetPhysicalInteractionLength(
const G4Track& aTrack,
G4double ,
G4ForceCondition* condition
)
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double proposedStep = DBL_MAX;
// get the pointer to UserLimits
G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
G4ParticleDefinition* aParticleDef = aTrack.GetDefinition();
if (pUserLimits) {
G4double temp = DBL_MAX;
//max time limit
G4double dTime= (pUserLimits->GetUserMaxTime(aTrack) - aTrack.GetGlobalTime());
if (dTime < 0. ) {
proposedStep = 0.;
} else {
G4double beta = (aParticle->GetTotalMomentum())/(aParticle->GetTotalEnergy());
temp = beta*c_light*dTime;
if (proposedStep > temp) proposedStep = temp;
}
}
return proposedStep;
}
@@ -0,0 +1,82 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MinEkineCuts.cc,v 2.3 1998/08/16 14:09:56 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// --------------------------------------------------------------
// 15 April 1998 M.Maire
// --------------------------------------------------------------
#include "ExN05MinEkineCuts.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
#include "G4EnergyLossTables.hh"
ExN05MinEkineCuts::ExN05MinEkineCuts(const G4String& aName)
: ExN05SpecialCuts(aName)
{
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< endl;
}
SetProcessType(fUserDefined);
}
ExN05MinEkineCuts::~ExN05MinEkineCuts()
{}
ExN05MinEkineCuts::ExN05MinEkineCuts(ExN05MinEkineCuts& right)
{}
G4double ExN05MinEkineCuts::PostStepGetPhysicalInteractionLength(
const G4Track& aTrack,
G4double ,
G4ForceCondition* condition
)
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double proposedStep = DBL_MAX;
// get the pointer to UserLimits
G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
G4ParticleDefinition* aParticleDef = aTrack.GetDefinition();
if (pUserLimits) {
//min kinetic energy
G4double temp = DBL_MAX;
G4double eKine = aParticle->GetKineticEnergy();
G4Material* aMaterial = aTrack.GetMaterial();
G4double eMin = pUserLimits->GetUserMinEkine(aTrack);
G4double rangeNow = DBL_MAX;
if (aParticleDef->GetPDGCharge() != 0.0) {
rangeNow = G4EnergyLossTables::GetRange(aParticleDef,eKine,aMaterial);
}
if (eKine < eMin ) {
proposedStep = 0.;
} else if (aParticleDef->GetPDGCharge() != 0.0) {
// charged particles only
G4double rangeMin = G4EnergyLossTables::GetRange(aParticleDef,eMin,aMaterial);
temp = rangeNow - rangeMin;
if (proposedStep > temp) proposedStep = temp;
}
}
return proposedStep;
}
@@ -0,0 +1,80 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05MinRangeCuts.cc,v 2.3 1998/08/16 14:09:56 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// --------------------------------------------------------------
// 15 April 1998 M.Maire
// --------------------------------------------------------------
#include "ExN05MinRangeCuts.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
#include "G4EnergyLossTables.hh"
ExN05MinRangeCuts::ExN05MinRangeCuts(const G4String& aName)
: ExN05SpecialCuts(aName)
{
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< endl;
}
SetProcessType(fUserDefined);
}
ExN05MinRangeCuts::~ExN05MinRangeCuts()
{}
ExN05MinRangeCuts::ExN05MinRangeCuts(ExN05MinRangeCuts& right)
{}
G4double ExN05MinRangeCuts::PostStepGetPhysicalInteractionLength(
const G4Track& aTrack,
G4double ,
G4ForceCondition* condition
)
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double proposedStep = DBL_MAX;
// get the pointer to UserLimits
G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
G4ParticleDefinition* aParticleDef = aTrack.GetDefinition();
if (pUserLimits) {
G4double temp = DBL_MAX;
//min remaining range
G4double eKine = aParticle->GetKineticEnergy();
G4Material* aMaterial = aTrack.GetMaterial();
G4double rangeNow = DBL_MAX;
if (aParticleDef->GetPDGCharge() != 0.0) {
rangeNow = G4EnergyLossTables::GetRange(aParticleDef,eKine,aMaterial);
}
temp = (rangeNow - pUserLimits->GetUserMinRange(aTrack));
if (temp < 0.) {
proposedStep = 0.;
} else {
if (proposedStep > temp) proposedStep = temp;
}
}
return proposedStep;
}
+302
View File
@@ -0,0 +1,302 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PhysicsList.cc,v 2.7 1998/12/10 04:11:43 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#include "ExN05PhysicsList.hh"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4ios.hh"
#include <iomanip.h>
#include "G4FastSimulationManagerProcess.hh"
ExN05PhysicsList::ExN05PhysicsList(): G4VUserPhysicsList()
{
SetVerboseLevel(1);
}
ExN05PhysicsList::~ExN05PhysicsList()
{
}
void ExN05PhysicsList::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();
ConstructBarions();
ConstructIons();
}
void ExN05PhysicsList::ConstructBosons()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
#include "G4LeptonConstructor.hh"
void ExN05PhysicsList::ConstructLeptons()
{
// Construct all leptons
G4LeptonConstructor pConstructor;
pConstructor.ConstructParticle();
}
#include "G4MesonConstructor.hh"
void ExN05PhysicsList::ConstructMesons()
{
// Construct all mesons
G4MesonConstructor pConstructor;
pConstructor.ConstructParticle();
}
#include "G4BarionConstructor.hh"
void ExN05PhysicsList::ConstructBarions()
{
// Construct all barions
G4BarionConstructor pConstructor;
pConstructor.ConstructParticle();
}
#include "G4IonConstructor.hh"
void ExN05PhysicsList::ConstructIons()
{
// Construct light ions
G4IonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void ExN05PhysicsList::ConstructProcess()
{
AddTransportation();
AddParameterisation();
ConstructEM();
ConstructLeptHad();
ConstructHad();
ConstructGeneral();
}
#include "ExN05MaxTimeCuts.hh"
#include "ExN05MinEkineCuts.hh"
#include "ExN05MinRangeCuts.hh"
void ExN05PhysicsList::AddTransportation()
{
G4VUserPhysicsList::AddTransportation();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
pmanager->AddDiscreteProcess(new ExN05MaxTimeCuts());
pmanager->AddDiscreteProcess(new ExN05MinEkineCuts());
pmanager->AddDiscreteProcess(new ExN05MinRangeCuts());
}
}
#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"
void ExN05PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
// gamma
// Construct processes for gamma
pmanager->AddDiscreteProcess(new G4GammaConversion());
pmanager->AddDiscreteProcess(new G4ComptonScattering());
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
} else if (particleName == "e-") {
//electron
// Construct processes for 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
// Construct processes for 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
// Construct processes for 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);
}
}
}
void ExN05PhysicsList::ConstructHad()
{;}
void ExN05PhysicsList::ConstructLeptHad()
{;}
#include "G4Decay.hh"
void ExN05PhysicsList::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);
}
}
}
void ExN05PhysicsList::AddParameterisation()
{
G4FastSimulationManagerProcess*
theFastSimulationManagerProcess =
new G4FastSimulationManagerProcess();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
// both postStep and alongStep action are required: because
// of the use of ghost volumes. If no ghost, the postStep
// is sufficient.
pmanager->AddProcess(theFastSimulationManagerProcess, -1, 1, 1);
}
}
void ExN05PhysicsList::SetCuts(G4double cut)
{
if (verboseLevel >0){
G4cout << "ExN05PhysicsList::SetCuts:";
G4cout << "CutLength : " << cut/mm << " (mm)" << endl;
}
// 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(cut, "gamma");
SetCutValue(cut, "e-");
SetCutValue(cut, "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(cut, "proton");
SetCutValue(cut, "anti_proton");
SetCutValueForOthers(cut);
if (verboseLevel>1) {
DumpCutValuesTable();
}
}
+133
View File
@@ -0,0 +1,133 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PiModel.cc,v 2.3 1998/09/07 15:12:32 mora Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05PiModel.hh"
#include "G4PionMinus.hh"
#include "G4PionPlus.hh"
#include "G4Gamma.hh"
ExN05PiModel::ExN05PiModel(G4Envelope *anEnvelope) :
G4VFastSimulationModel("ExN05PiModel",anEnvelope)
{;}
ExN05PiModel::~ExN05PiModel()
{;}
G4bool ExN05PiModel::IsApplicable(const G4ParticleDefinition& particleType)
{
return
&particleType == G4PionMinus::PionMinusDefinition() ||
&particleType == G4PionPlus::PionPlusDefinition();
}
G4bool ExN05PiModel::ModelTrigger(const G4FastTrack& fastTrack) {
//-------------------------------------------------------------
// UserTrigger() method: method which has to decide if
// the parameterisation has to be applied.
// Here ModelTrigger() asks the user (ie you) a 0/1 answer.
//
// Note that quantities like the local/global position/direction etc..
// are available at this level via the fastTrack parameter (allowing
// to check distance from boundaries, see below to allow the decision)
//--------------------------------------------------------------
G4cout << "\nExN05PiModel::ModelTrigger() called:" << endl;
G4cout << "--------------------------------" << endl;
G4cout << "(particle is a " << fastTrack.GetPrimaryTrack()->
GetDefinition()->GetParticleName() << " )\n" << endl;
// -- Examples of available informations:
// -- position:
G4cout << " Track position: " <<
fastTrack.GetPrimaryTrack()->GetPosition() << "(global coord.)" <<
fastTrack.GetPrimaryTrackLocalPosition() << "(in envelope coord.)"
<< endl;
// -- direction:
G4cout << " Track direction:" <<
fastTrack.GetPrimaryTrack()->GetMomentum().unit() <<
"(global coord.)" <<
fastTrack.GetPrimaryTrackLocalDirection() << "(in envelope coord.)" <<
endl;
return true;
}
void ExN05PiModel::DoIt(const G4FastTrack& fastTrack,
G4FastStep& fastStep)
//--------------------------------------------------
//
// User method to code the parameterisation properly
// said.
//
//--------------------------------------------------
{
//------------------------------------------------
// The primary track continues along its direction.
// One secondary (a photon) is added:
//------------------------------------------------
G4cout << " Pion `model' applied\n" << endl;
//------------------------------
// Primary:
// idem as in "DefaultModel":
//
//------------------------------
G4ThreeVector position;
G4double distance;
distance = fastTrack.GetEnvelopeSolid()->
DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
fastTrack.GetPrimaryTrackLocalDirection());
position = fastTrack.GetPrimaryTrackLocalPosition() +
distance*fastTrack.GetPrimaryTrackLocalDirection();
// -- set final position:
fastStep.SetPrimaryTrackFinalPosition(position);
//---------------------------
// Secondary:
// Adds one "secondary":
//
//---------------------------
// -- First, user has to say how many secondaries will be created:
fastStep.SetNumberOfSecondaryTracks(1);
//------------------------
// -- Build the secondary:
//------------------------
// -- direction:
G4ParticleMomentum direction(fastTrack.GetPrimaryTrackLocalDirection());
direction.setZ(direction.z()*0.5);
direction.setY(direction.y()+direction.z()*0.1);
direction = direction.unit(); // necessary ?
// -- dynamics (Note that many constructors exists for G4DynamicParticle
// -- see prototype/particle+matter/particles/management/include/G4DynamicParticle.hh)
G4DynamicParticle dynamique(G4Gamma::GammaDefinition(),
direction,
fastTrack.GetPrimaryTrack()->
GetKineticEnergy()/2.);
// -- position:
G4double Dist;
Dist = fastTrack.GetEnvelopeSolid()->
DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
direction);
G4ThreeVector posi;
posi = fastTrack.GetPrimaryTrackLocalPosition() + Dist*direction;
//------------------------------------
//-- Creation of the secondary Track:
//------------------------------------
fastStep.CreateSecondaryTrack(dynamique, posi,
fastTrack.GetPrimaryTrack()->GetGlobalTime());
}
@@ -0,0 +1,211 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PionShowerModel.cc,v 2.1 1998/12/10 04:05:54 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05PionShowerModel.hh"
#include "ExN05EnergySpot.hh"
#include "Randomize.hh"
#include "G4PionMinus.hh"
#include "G4PionPlus.hh"
#include "G4TransportationManager.hh"
#include "G4VSensitiveDetector.hh"
#include "G4VTouchable.hh"
#include "G4Colour.hh"
ExN05PionShowerModel::ExN05PionShowerModel(G4String modelName, G4LogicalVolume* envelope)
: G4VFastSimulationModel(modelName, envelope)
{
fFakeStep = new G4Step();
fFakePreStepPoint = fFakeStep->GetPreStepPoint();
fFakePostStepPoint = fFakeStep->GetPostStepPoint();
fpTouchable = new G4TouchableHistory();
fpNavigator = new G4Navigator();
fNaviSetup = false;
}
ExN05PionShowerModel::ExN05PionShowerModel(G4String modelName)
: G4VFastSimulationModel(modelName)
{
fFakeStep = new G4Step();
fFakePreStepPoint = fFakeStep->GetPreStepPoint();
fFakePostStepPoint = fFakeStep->GetPostStepPoint();
fpTouchable = new G4TouchableHistory();
fpNavigator = new G4Navigator();
fNaviSetup = false;
}
ExN05PionShowerModel::~ExN05PionShowerModel()
{
delete fFakeStep;
delete fpTouchable;
delete fpNavigator;
}
G4bool ExN05PionShowerModel::IsApplicable(const G4ParticleDefinition& particleType)
{
return
&particleType == G4PionMinus::PionMinusDefinition() ||
&particleType == G4PionPlus::PionPlusDefinition();
}
G4bool ExN05PionShowerModel::ModelTrigger(const G4FastTrack& fastTrack)
{
// Applies the parameterisation always: ie as soon as the pion enters the envelope
return true;
}
void ExN05PionShowerModel::DoIt(const G4FastTrack& fastTrack,
G4FastStep& fastStep)
{
// Kill the parawmeterised particle:
fastStep.KillPrimaryTrack();
fastStep.SetPrimaryTrackPathLength(0.0);
fastStep.SetTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy());
// split into "energy spots" energy according to the shower shape:
Explode(fastTrack);
// and put those energy spots into the crystals:
BuildDetectorResponse();
}
void ExN05PionShowerModel::Explode(const G4FastTrack& fastTrack)
{
//-----------------------------------------------------
// Non-physical shower generated: exp along z and
// transverse.
//-----------------------------------------------------
// center of the shower, we put at the middle of the ghost:
G4ThreeVector showerCenter;
G4double distOut;
distOut = fastTrack.GetEnvelopeSolid()->
DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
fastTrack.GetPrimaryTrackLocalDirection());
showerCenter = fastTrack.GetPrimaryTrackLocalPosition() +
(distOut/2.)*fastTrack.GetPrimaryTrackLocalDirection();
showerCenter = fastTrack.GetInverseAffineTransformation()->
TransformPoint(showerCenter);
// axis of the shower, in global reference frame:
G4ThreeVector xShower, yShower, zShower;
zShower = fastTrack.GetPrimaryTrack()->GetMomentumDirection();
xShower = zShower.orthogonal();
yShower = zShower.cross(xShower);
// shoot the energy spots:
G4double Energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
G4int nSpot = 50;
G4double deposit = Energy/double(nSpot);;
ExN05EnergySpot eSpot;
eSpot.SetEnergy(deposit);
G4ThreeVector ePoint;
G4double z, r, phi;
for (int i = 0; i < nSpot; i++)
{
z = RandGauss::shoot(0,20*cm);
r = RandGauss::shoot(0,10*cm);
phi = RandFlat::shoot()*twopi;
ePoint = showerCenter +
z*zShower +
r*cos(phi)*xShower + r*sin(phi)*yShower;
eSpot.SetPosition(ePoint);
feSpotList.insert(eSpot);
}
}
void ExN05PionShowerModel::BuildDetectorResponse()
{
// Does the assignation of the energy spots to the sensitive volumes:
for (int i = 0; i < feSpotList.entries(); i++)
{
// Draw the energy spot:
G4Colour red(1.,0.,0.);
feSpotList[i].Draw(&red);
// feSpotList[i].Print();
// "converts" the energy spot into the fake
// G4Step to pass to sensitive detector:
AssignSpotAndCallHit(feSpotList[i]);
}
}
void ExN05PionShowerModel::AssignSpotAndCallHit(const ExN05EnergySpot &eSpot)
{
//
// "converts" the energy spot into the fake
// G4Step to pass to sensitive detector:
//
FillFakeStep(eSpot);
//
// call sensitive part: taken/adapted from the stepping:
// Send G4Step information to Hit/Dig if the volume is sensitive
//
G4VPhysicalVolume* pCurrentVolume =
fFakeStep->GetPreStepPoint()->GetPhysicalVolume();
G4VSensitiveDetector* pSensitive;
if( pCurrentVolume != 0 )
{
pSensitive = pCurrentVolume->GetLogicalVolume()->
GetSensitiveDetector();
if( pSensitive != 0 )
{
pSensitive->Hit(fFakeStep);
}
}
}
void ExN05PionShowerModel::FillFakeStep(const ExN05EnergySpot &eSpot)
{
//-----------------------------------------------------------
// find in which volume the spot is.
//-----------------------------------------------------------
if (!fNaviSetup)
{
fpNavigator->
SetWorldVolume(G4TransportationManager::GetTransportationManager()->
GetNavigatorForTracking()->GetWorldVolume());
fpNavigator->
LocateGlobalPointAndUpdateTouchable(eSpot.GetPosition(),
fpTouchable,
false);
fNaviSetup = true;
}
else
{
fpNavigator->
LocateGlobalPointAndUpdateTouchable(eSpot.GetPosition(),
fpTouchable);
}
//--------------------------------------
// Fills attribute of the G4Step needed
// by our sensitive detector:
//-------------------------------------
// set touchable volume at PreStepPoint:
fFakePreStepPoint->SetTouchable(fpTouchable);
// set total energy deposit:
fFakeStep->SetTotalEnergyDeposit(eSpot.GetEnergy());
}
@@ -0,0 +1,50 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05PrimaryGeneratorAction.cc,v 2.1 1998/07/12 02:42:27 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "globals.hh"
ExN05PrimaryGeneratorAction::ExN05PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="geantino");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
particleGun->SetParticleEnergy(100.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,-300.*cm,0.*cm));
}
ExN05PrimaryGeneratorAction::~ExN05PrimaryGeneratorAction()
{
delete particleGun;
}
void ExN05PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
particleGun->GeneratePrimaryVertex(anEvent);
}
G4ParticleGun* ExN05PrimaryGeneratorAction::GetParticleGun()
{
return particleGun;
}
+43
View File
@@ -0,0 +1,43 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05RunAction.cc,v 2.2 1998/07/13 16:34:16 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05RunAction.hh"
#include "G4Run.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
ExN05RunAction::ExN05RunAction()
{
timer = new G4Timer;
runIDcounter = 0;
}
ExN05RunAction::~ExN05RunAction()
{
delete timer;
}
void ExN05RunAction::BeginOfRunAction(G4Run* aRun)
{
aRun->SetRunID(runIDcounter++);
G4cout << "### Run " << aRun->GetRunID() << " start." << endl;
// timer->Start();
}
void ExN05RunAction::EndOfRunAction(G4Run* aRun)
{
timer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent() << endl;
// << " " << *timer << endl;
}
@@ -0,0 +1,57 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SpecialCuts.cc,v 2.3 1998/08/16 14:09:57 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ------------------------------------------------------------
// 15 April 1998 M.Maire
// ------------------------------------------------------------
#include "ExN05SpecialCuts.hh"
#include "G4VParticleChange.hh"
#include "G4Track.hh"
#include "G4Step.hh"
ExN05SpecialCuts::ExN05SpecialCuts(const G4String& aName)
: G4VProcess(aName)
{
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< endl;
}
}
G4VParticleChange* ExN05SpecialCuts::PostStepDoIt(
const G4Track& aTrack,
const G4Step&
)
//
// Stop the current particle, if requested by G4UserLimits
//
{
aParticleChange.Initialize(aTrack);
aParticleChange.SetEnergyChange(0.) ;
aParticleChange.SetLocalEnergyDeposit (aTrack.GetKineticEnergy()) ;
aParticleChange.SetStatusChange(fStopButAlive);
return &aParticleChange;
}
G4double ExN05SpecialCuts::PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
)
{
return DBL_MAX;
}
@@ -0,0 +1,51 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SteppingAction.cc,v 2.0 1998/07/02 14:10:07 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05SteppingAction.hh"
#include "ExN05SteppingActionMessenger.hh"
#include "G4VVisManager.hh"
#include "G4Polyline.hh"
#include "G4Colour.hh"
#include "G4VisAttributes.hh"
#include "G4SteppingManager.hh"
ExN05SteppingAction::ExN05SteppingAction()
:drawFlag(false)
{
new ExN05SteppingActionMessenger(this);
}
void ExN05SteppingAction::UserSteppingAction()
{
if(drawFlag)
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if (pVVisManager) {
const G4SteppingManager* pSM = GetSteppingManager();
G4Polyline polyline;
G4double charge = pSM->GetTrack()->GetDefinition()->GetPDGCharge();
G4Colour colour;
if (charge < 0.) colour = G4Colour(1., 0., 0.);
else if (charge > 0.) colour = G4Colour(0., 0., 1.);
else colour = G4Colour(0., 1., 0.);
G4VisAttributes attribs(colour);
polyline.SetVisAttributes(attribs);
polyline.append(pSM->GetStep()->GetPreStepPoint()->GetPosition());
polyline.append(pSM->GetStep()->GetPostStepPoint()->GetPosition());
pVVisManager -> Draw(polyline);
}
}
}
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the RD44 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: ExN05SteppingActionMessenger.cc,v 2.2 1998/07/15 12:41:22 verderi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#include "ExN05SteppingActionMessenger.hh"
#include "ExN05SteppingAction.hh"
#include "globals.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
ExN05SteppingActionMessenger::ExN05SteppingActionMessenger(ExN05SteppingAction* SA)
:SteppingAction(SA)
{
stepDirectory = new G4UIdirectory("/step/");
stepDirectory->SetGuidance("Step draw control command.");
drawStepCmd = new G4UIcmdWithABool("/step/draw",this);
drawStepCmd->SetGuidance("Draw each step on the fly. (default = true)");
drawStepCmd->SetParameterName("draw", true);
drawStepCmd->SetDefaultValue(true);
}
void ExN05SteppingActionMessenger::SetNewValue(G4UIcommand* command, G4String newValues)
{
if( command->GetCommandName() == "draw" )
{
G4int vl;
const char* t = newValues;
istrstream is((char*)t);
is >> vl;
SteppingAction->SetDrawFlag(vl!=0);
}
}
+73
View File
@@ -0,0 +1,73 @@
// --------------------------------------------
// Adapted from RNGAMA function of the KERNLIB
// Shoot at random according to the gamma
// distribution.
// --------------------------------------------
#include "RandomGamma.hh"
#include <CLHEP/Random/Randomize.h>
double RandomGamma(double p)
{
double h;
double stor[15];
h = 0.;
if (p > 15)
{
while (h <= 0.)
{
double a;
a = RandExponential::shoot();
h = p*(1.-1./(9*p)+a/(3*sqrt(p)));
h = h*h*h;
}
}
else
{
int m = p;
double f = p - m;
if (m > 0)
{
double x = 1.;
RandFlat::shootArray(m, stor);
for (int i = 0; i < m; i++) x *= stor[i];
h = -log(x);
}
if (f >= 0.00001)
{
double x = RandFlat::shoot();
double x1 = -log(x);
if (f >= 0.9999) h += x1;
else
{
x = RandFlat::shoot();
double wlog;
while (1)
{
wlog = log(x)/f;
if (wlog > -100.)
{
double w1 = exp(wlog);
x = RandFlat::shoot();
wlog = log(x)/(1.-f);
if (wlog < -100.)
{
h += x1;
break;
}
else
{
double w = w1 + exp(wlog);
if (w <= 1.)
{
h += w1/w;
break;
}
}
}
}
}
}
}
return h;
}