Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -0,0 +1,34 @@
# $Id: GNUmakefile,v 1.4 1999/12/01 15:29:08 morita Exp $
# --------------------------------------------------------------
# GNUmakefile for tests module. Gabriele Cosmo, 27/06/98.
# --------------------------------------------------------------
# You must have unique G4EXAMPLE_FDID assigned by your local
# manager of Objectivity/DB lock server.
#
name := PersistentEx02
G4ODBMS := true
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
.PHONY: all doall
all: cleandb headers
@(G4ODBMS_DEPEND=1; export G4ODBMS_DEPEND; $(MAKE) doall)
doall: lib bin
include $(G4INSTALL)/config/architecture.gmk
G4OODDLX_BOOT := $(G4EXAMPLE_BOOT)
include $(G4INSTALL)/config/binmake.gmk
CPPFLAGS += \
-Iinclude \
-I$(G4TMPDIR)
@@ -0,0 +1,38 @@
$Id: History,v 1.7 1999/12/05 22:28:52 morita Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
PersistentEx02 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 *
----------------------------------------------------------
5th December 1999 Y.Morita (PersistentEx02-V00-01-03)
- LD_LIBRARY_PATH change for Linux
- readDB: added access to G4PPrimaryParticle.
3rd December 1999 Y.Morita (PersistentEx02-V00-01-02)
- more bug fixes (TrackerSD)
1st December 1999 Y.Morita (PersistentEx02-V00-01-01)
- Fix GNUmakefile to pick up right dependency files.
- new PersistentEx01run script file for new config.
29th November 1999 Y.Morita
- Bug fix for persistent hits collection based on PersistentEx01.
(Requires persistency-V00-01-08)
10th November 1999 Y.Morita (PersistentEx02-V00-01-00)
- tagged for release 4.1
Oct 18, 1999 Y. Morita
- Example for persistent hits, started from exampleN02.
@@ -0,0 +1,82 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersistentEx02.cc,v 1.2.2.1 1999/12/07 20:47:20 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// --------------------------------------------------------------
// GEANT4 - PersistentEx02
//
// For information related to this code contact:
// CERN, IT Division, ASD Group
// --------------------------------------------------------------
// Comments
//
//
// --------------------------------------------------------------
#include "PersEx02DetectorConstruction.hh"
#include "PersEx02PhysicsList.hh"
#include "PersEx02RunAction.hh"
#include "PersEx02PrimaryGeneratorAction.hh"
#include "PersEx02EventAction.hh"
#include "PersEx02StackingAction.hh"
#include "G4ios.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4PersistencyManager.hh"
int main(int argc, char** argv)
{
// Persistency Manager
G4PersistencyManager * persistencyManager =
G4PersistencyManager::GetPersistencyManager();
// Run manager
G4RunManager * runManager = new G4RunManager;
// Detector geometry
runManager->SetUserInitialization(new PersEx02DetectorConstruction);
runManager->SetUserInitialization(new PersEx02PhysicsList);
// UserAction classes.
runManager->SetUserAction(new PersEx02RunAction);
runManager->SetUserAction(new PersEx02PrimaryGeneratorAction);
runManager->SetUserAction(new PersEx02EventAction);
runManager->SetUserAction(new PersEx02StackingAction);
// get the pointer to the User Interface manager
G4UImanager* UI = G4UImanager::GetUIpointer();
if(argc==1)
// Define (G)UI terminal for interactive mode
{
G4UIsession* session = new G4UIterminal;
UI->ApplyCommand("/control/execute prerunPEx02.mac");
session->SessionStart();
delete session;
}
else
// Batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
// job termination
delete runManager;
delete persistencyManager;
return 0;
}
@@ -0,0 +1,15 @@
#
# PersistentEx02.in
#
/control/verbose 2
/db/verbose 2
###/db/run NewRuns
###/db/event NewEvents
###/db/geometry NewGeometry
/run/initialize
#
# 100 events
#
/run/beamOn 100
#
exit
@@ -0,0 +1,805 @@
Opening federated database OO_FD_BOOT.
WARNING: g4example: Could not find naming root directory: Naming will be disabled.
#
# PersistentEx02.in
#
/db/verbose 2
###/db/run NewRuns
###/db/event NewEvents
###/db/geometry NewGeometry
/run/initialize
-- Tracker type sensitive detector
PersEx02PhysicsList::SetCuts:CutLength : 1 (mm)
conv: Total cross sections from a parametrisation. Good description from 1.5 MeV to 100 GeV for all Z.
e+e- energies according Bethe-Heitler
PhysicsTables from 1.022 MeV to 100 GeV in 100 bins.
compt: Total cross sections from a parametrisation. Good description from 10 KeV to (100/Z) GeV.
Scattered gamma energy according Klein-Nishina.
PhysicsTables from 10 keV to 100 GeV in 100 bins.
phot: Total cross sections from a parametrisation. Good description from 10 KeV to 50 MeV for all Z
Sandia crossSection below 50 KeV
PhysicsTables from 50 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. Good description from 1 KeV to 100 GeV.
log scale extrapolation above 100 GeV
Gamma energy sampled from a parametrised formula.
PhysicsTables from 1 keV to 100 TeV in 100 bins.
annihil: Total cross section from Heilter formula (annihilation into 2 photons).
gamma energies sampled according Heitler
PhysicsTables from 10 keV to 10 TeV in 100 bins.
msc: Tables of transport mean free paths.
New model of MSC , computes the lateral
displacement of the particle , too.
PhysicsTables from 100 eV to 100 TeV in 100 bins.
hIoni: Knock-on electron cross sections .
Good description above the mean excitation energy.
delta ray energy sampled from differential Xsection.
PhysicsTables from 1 keV to 100 TeV in 150 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.
MuBrems: theoretical cross section
Good description up to 1000 TeV.
PhysicsTables from 1 GeV to 1000 PeV in 100 bins.
MuPairProd: theoretical cross sections
Good description up to 1000 TeV.
PhysicsTables from 1 GeV to 1000 PeV in 50 bins.
#
# 100 events
#
/run/beamOn 100
Transaction started for /Geometry/GeomContainer/ with non-sustained mode.
-- Geometry stored in /Geometry/GeomContainer/
Transaction is committed on /Geometry/GeomContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
>>> Event 0
Event : 0
mySD/EvenCollection Number of hits 9
Edep of the first Hit 34.3698
mySD/OddCollection Number of hits 38
Edep of the first Hit 18.4405
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 0 stored in /Events/EventContainer/ (sustained)
>>> Event 1
Event : 1
mySD/EvenCollection Number of hits 21
Edep of the first Hit 99.9396
mySD/OddCollection Number of hits 20
Edep of the first Hit 25.443
-- G4PEvent 1 stored in /Events/EventContainer/ (sustained)
>>> Event 2
Event : 2
mySD/EvenCollection Number of hits 21
Edep of the first Hit 6.23362
mySD/OddCollection Number of hits 19
Edep of the first Hit 64.6385
-- G4PEvent 2 stored in /Events/EventContainer/ (sustained)
>>> Event 3
Event : 3
mySD/EvenCollection Number of hits 13
Edep of the first Hit 48.4612
mySD/OddCollection Number of hits 38
Edep of the first Hit 14.5902
-- G4PEvent 3 stored in /Events/EventContainer/ (sustained)
>>> Event 4
Event : 4
mySD/EvenCollection Number of hits 31
Edep of the first Hit 50.5145
mySD/OddCollection Number of hits 16
Edep of the first Hit 57.8215
-- G4PEvent 4 stored in /Events/EventContainer/ (sustained)
>>> Event 5
Event : 5
mySD/EvenCollection Number of hits 6
Edep of the first Hit 139.802
mySD/OddCollection Number of hits 34
Edep of the first Hit 109.904
-- G4PEvent 5 stored in /Events/EventContainer/ (sustained)
>>> Event 6
Event : 6
mySD/EvenCollection Number of hits 10
Edep of the first Hit 21.8663
mySD/OddCollection Number of hits 27
Edep of the first Hit 14.2566
-- G4PEvent 6 stored in /Events/EventContainer/ (sustained)
>>> Event 7
Event : 7
mySD/EvenCollection Number of hits 12
Edep of the first Hit 2.93176
mySD/OddCollection Number of hits 42
Edep of the first Hit 3.13845
-- G4PEvent 7 stored in /Events/EventContainer/ (sustained)
>>> Event 8
Event : 8
mySD/EvenCollection Number of hits 18
Edep of the first Hit 13.787
mySD/OddCollection Number of hits 34
Edep of the first Hit 13.6233
-- G4PEvent 8 stored in /Events/EventContainer/ (sustained)
>>> Event 9
Event : 9
mySD/EvenCollection Number of hits 7
Edep of the first Hit 42.2712
mySD/OddCollection Number of hits 40
Edep of the first Hit 21.0987
-- G4PEvent 9 stored in /Events/EventContainer/ (sustained)
>>> Event 10
Event : 10
mySD/EvenCollection Number of hits 24
Edep of the first Hit 14.0895
mySD/OddCollection Number of hits 24
Edep of the first Hit 7.74588
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 10 stored in /Events/EventContainer/ (sustained)
>>> Event 11
Event : 11
mySD/EvenCollection Number of hits 10
Edep of the first Hit 106.832
mySD/OddCollection Number of hits 35
Edep of the first Hit 30.1659
-- G4PEvent 11 stored in /Events/EventContainer/ (sustained)
>>> Event 12
Event : 12
mySD/EvenCollection Number of hits 8
Edep of the first Hit 7.46186
mySD/OddCollection Number of hits 36
Edep of the first Hit 16.788
-- G4PEvent 12 stored in /Events/EventContainer/ (sustained)
>>> Event 13
Event : 13
mySD/EvenCollection Number of hits 10
Edep of the first Hit 16.4669
mySD/OddCollection Number of hits 38
Edep of the first Hit 55.2629
-- G4PEvent 13 stored in /Events/EventContainer/ (sustained)
>>> Event 14
Event : 14
mySD/EvenCollection Number of hits 8
Edep of the first Hit 21.5352
mySD/OddCollection Number of hits 36
Edep of the first Hit 7.92271
-- G4PEvent 14 stored in /Events/EventContainer/ (sustained)
>>> Event 15
Event : 15
mySD/EvenCollection Number of hits 12
Edep of the first Hit 17.9607
mySD/OddCollection Number of hits 43
Edep of the first Hit 8.11967
-- G4PEvent 15 stored in /Events/EventContainer/ (sustained)
>>> Event 16
Event : 16
mySD/EvenCollection Number of hits 6
Edep of the first Hit 39.8096
mySD/OddCollection Number of hits 37
Edep of the first Hit 13.969
-- G4PEvent 16 stored in /Events/EventContainer/ (sustained)
>>> Event 17
Event : 17
mySD/EvenCollection Number of hits 11
Edep of the first Hit 29.4604
mySD/OddCollection Number of hits 40
Edep of the first Hit 5.21882
-- G4PEvent 17 stored in /Events/EventContainer/ (sustained)
>>> Event 18
Event : 18
mySD/EvenCollection Number of hits 9
Edep of the first Hit 23.4087
mySD/OddCollection Number of hits 37
Edep of the first Hit 2.57686
-- G4PEvent 18 stored in /Events/EventContainer/ (sustained)
>>> Event 19
Event : 19
mySD/EvenCollection Number of hits 28
Edep of the first Hit 68.7516
mySD/OddCollection Number of hits 14
Edep of the first Hit 36.0667
-- G4PEvent 19 stored in /Events/EventContainer/ (sustained)
>>> Event 20
Event : 20
mySD/EvenCollection Number of hits 9
Edep of the first Hit 41.2316
mySD/OddCollection Number of hits 36
Edep of the first Hit 32.5255
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 20 stored in /Events/EventContainer/ (sustained)
>>> Event 21
Event : 21
mySD/EvenCollection Number of hits 10
Edep of the first Hit 33.6799
mySD/OddCollection Number of hits 40
Edep of the first Hit 2.63774
-- G4PEvent 21 stored in /Events/EventContainer/ (sustained)
>>> Event 22
Event : 22
mySD/EvenCollection Number of hits 8
Edep of the first Hit 15.6979
mySD/OddCollection Number of hits 35
Edep of the first Hit 82.3056
-- G4PEvent 22 stored in /Events/EventContainer/ (sustained)
>>> Event 23
Event : 23
mySD/EvenCollection Number of hits 27
Edep of the first Hit 23.5513
mySD/OddCollection Number of hits 12
Edep of the first Hit 27.8059
-- G4PEvent 23 stored in /Events/EventContainer/ (sustained)
>>> Event 24
Event : 24
mySD/EvenCollection Number of hits 8
Edep of the first Hit 43.1612
mySD/OddCollection Number of hits 42
Edep of the first Hit 5.25522
-- G4PEvent 24 stored in /Events/EventContainer/ (sustained)
>>> Event 25
Event : 25
mySD/EvenCollection Number of hits 12
Edep of the first Hit 52.9242
mySD/OddCollection Number of hits 30
Edep of the first Hit 14.3396
-- G4PEvent 25 stored in /Events/EventContainer/ (sustained)
>>> Event 26
Event : 26
mySD/EvenCollection Number of hits 12
Edep of the first Hit 18.0676
mySD/OddCollection Number of hits 39
Edep of the first Hit 66.0532
-- G4PEvent 26 stored in /Events/EventContainer/ (sustained)
>>> Event 27
Event : 27
mySD/EvenCollection Number of hits 30
Edep of the first Hit 1.07471
mySD/OddCollection Number of hits 18
Edep of the first Hit 2.81278
-- G4PEvent 27 stored in /Events/EventContainer/ (sustained)
>>> Event 28
Event : 28
mySD/EvenCollection Number of hits 10
Edep of the first Hit 71.478
mySD/OddCollection Number of hits 40
Edep of the first Hit 38.2902
-- G4PEvent 28 stored in /Events/EventContainer/ (sustained)
>>> Event 29
Event : 29
mySD/EvenCollection Number of hits 8
Edep of the first Hit 18.7046
mySD/OddCollection Number of hits 39
Edep of the first Hit 24.2962
-- G4PEvent 29 stored in /Events/EventContainer/ (sustained)
>>> Event 30
Event : 30
mySD/EvenCollection Number of hits 5
Edep of the first Hit 17.7432
mySD/OddCollection Number of hits 38
Edep of the first Hit 8.45743
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 30 stored in /Events/EventContainer/ (sustained)
>>> Event 31
Event : 31
mySD/EvenCollection Number of hits 9
Edep of the first Hit 15.4573
mySD/OddCollection Number of hits 38
Edep of the first Hit 5.60297
-- G4PEvent 31 stored in /Events/EventContainer/ (sustained)
>>> Event 32
Event : 32
mySD/EvenCollection Number of hits 12
Edep of the first Hit 49.3456
mySD/OddCollection Number of hits 37
Edep of the first Hit 4.42142
-- G4PEvent 32 stored in /Events/EventContainer/ (sustained)
>>> Event 33
Event : 33
mySD/EvenCollection Number of hits 7
Edep of the first Hit 39.7136
mySD/OddCollection Number of hits 43
Edep of the first Hit 40.911
-- G4PEvent 33 stored in /Events/EventContainer/ (sustained)
>>> Event 34
Event : 34
mySD/EvenCollection Number of hits 7
Edep of the first Hit 71.5197
mySD/OddCollection Number of hits 38
Edep of the first Hit 49.5622
-- G4PEvent 34 stored in /Events/EventContainer/ (sustained)
>>> Event 35
Event : 35
mySD/EvenCollection Number of hits 11
Edep of the first Hit 38.1744
mySD/OddCollection Number of hits 43
Edep of the first Hit 3.09679
-- G4PEvent 35 stored in /Events/EventContainer/ (sustained)
>>> Event 36
Event : 36
mySD/EvenCollection Number of hits 7
Edep of the first Hit 52.4219
mySD/OddCollection Number of hits 38
Edep of the first Hit 18.9069
-- G4PEvent 36 stored in /Events/EventContainer/ (sustained)
>>> Event 37
Event : 37
mySD/EvenCollection Number of hits 9
Edep of the first Hit 15.05
mySD/OddCollection Number of hits 42
Edep of the first Hit 6.99795
-- G4PEvent 37 stored in /Events/EventContainer/ (sustained)
>>> Event 38
Event : 38
mySD/EvenCollection Number of hits 9
Edep of the first Hit 11.2992
mySD/OddCollection Number of hits 37
Edep of the first Hit 63.4584
-- G4PEvent 38 stored in /Events/EventContainer/ (sustained)
>>> Event 39
Event : 39
mySD/EvenCollection Number of hits 3
Edep of the first Hit 143.19
mySD/OddCollection Number of hits 42
Edep of the first Hit 20.4067
-- G4PEvent 39 stored in /Events/EventContainer/ (sustained)
>>> Event 40
Event : 40
mySD/EvenCollection Number of hits 5
Edep of the first Hit 49.8201
mySD/OddCollection Number of hits 39
Edep of the first Hit 35.403
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 40 stored in /Events/EventContainer/ (sustained)
>>> Event 41
Event : 41
mySD/EvenCollection Number of hits 6
Edep of the first Hit 56.283
mySD/OddCollection Number of hits 42
Edep of the first Hit 19.0004
-- G4PEvent 41 stored in /Events/EventContainer/ (sustained)
>>> Event 42
Event : 42
mySD/EvenCollection Number of hits 10
Edep of the first Hit 57.1055
mySD/OddCollection Number of hits 37
Edep of the first Hit 36.6327
-- G4PEvent 42 stored in /Events/EventContainer/ (sustained)
>>> Event 43
Event : 43
mySD/EvenCollection Number of hits 8
Edep of the first Hit 7.60171
mySD/OddCollection Number of hits 44
Edep of the first Hit 18.0399
-- G4PEvent 43 stored in /Events/EventContainer/ (sustained)
>>> Event 44
Event : 44
mySD/EvenCollection Number of hits 7
Edep of the first Hit 53.2389
mySD/OddCollection Number of hits 34
Edep of the first Hit 5.52172
-- G4PEvent 44 stored in /Events/EventContainer/ (sustained)
>>> Event 45
Event : 45
mySD/EvenCollection Number of hits 11
Edep of the first Hit 48.5526
mySD/OddCollection Number of hits 38
Edep of the first Hit 25.8542
-- G4PEvent 45 stored in /Events/EventContainer/ (sustained)
>>> Event 46
Event : 46
mySD/EvenCollection Number of hits 9
Edep of the first Hit 29.785
mySD/OddCollection Number of hits 39
Edep of the first Hit 1.97563
-- G4PEvent 46 stored in /Events/EventContainer/ (sustained)
>>> Event 47
Event : 47
mySD/EvenCollection Number of hits 8
Edep of the first Hit 49.2885
mySD/OddCollection Number of hits 37
Edep of the first Hit 14.1009
-- G4PEvent 47 stored in /Events/EventContainer/ (sustained)
>>> Event 48
Event : 48
mySD/EvenCollection Number of hits 7
Edep of the first Hit 17.334
mySD/OddCollection Number of hits 39
Edep of the first Hit 28.9757
-- G4PEvent 48 stored in /Events/EventContainer/ (sustained)
>>> Event 49
Event : 49
mySD/EvenCollection Number of hits 6
Edep of the first Hit 30.2462
mySD/OddCollection Number of hits 39
Edep of the first Hit 41.7358
-- G4PEvent 49 stored in /Events/EventContainer/ (sustained)
>>> Event 50
Event : 50
mySD/EvenCollection Number of hits 10
Edep of the first Hit 7.09492
mySD/OddCollection Number of hits 33
Edep of the first Hit 129.963
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 50 stored in /Events/EventContainer/ (sustained)
>>> Event 51
Event : 51
mySD/EvenCollection Number of hits 6
Edep of the first Hit 1.77473
mySD/OddCollection Number of hits 41
Edep of the first Hit 1.6009
-- G4PEvent 51 stored in /Events/EventContainer/ (sustained)
>>> Event 52
Event : 52
mySD/EvenCollection Number of hits 9
Edep of the first Hit 22.1206
mySD/OddCollection Number of hits 43
Edep of the first Hit 5.21217
-- G4PEvent 52 stored in /Events/EventContainer/ (sustained)
>>> Event 53
Event : 53
mySD/EvenCollection Number of hits 6
Edep of the first Hit 13.318
mySD/OddCollection Number of hits 38
Edep of the first Hit 71.7173
-- G4PEvent 53 stored in /Events/EventContainer/ (sustained)
>>> Event 54
Event : 54
mySD/EvenCollection Number of hits 28
Edep of the first Hit 10.4189
mySD/OddCollection Number of hits 21
Edep of the first Hit 34.7557
-- G4PEvent 54 stored in /Events/EventContainer/ (sustained)
>>> Event 55
Event : 55
mySD/EvenCollection Number of hits 10
Edep of the first Hit 14.7846
mySD/OddCollection Number of hits 40
Edep of the first Hit 17.1474
-- G4PEvent 55 stored in /Events/EventContainer/ (sustained)
>>> Event 56
Event : 56
mySD/EvenCollection Number of hits 8
Edep of the first Hit 26.8971
mySD/OddCollection Number of hits 39
Edep of the first Hit 31.0888
-- G4PEvent 56 stored in /Events/EventContainer/ (sustained)
>>> Event 57
Event : 57
mySD/EvenCollection Number of hits 5
Edep of the first Hit 44.9334
mySD/OddCollection Number of hits 35
Edep of the first Hit 66.4154
-- G4PEvent 57 stored in /Events/EventContainer/ (sustained)
>>> Event 58
Event : 58
mySD/EvenCollection Number of hits 12
Edep of the first Hit 2.20857
mySD/OddCollection Number of hits 33
Edep of the first Hit 1.23394
-- G4PEvent 58 stored in /Events/EventContainer/ (sustained)
>>> Event 59
Event : 59
mySD/EvenCollection Number of hits 22
Edep of the first Hit 15.214
mySD/OddCollection Number of hits 23
Edep of the first Hit 3.83712
-- G4PEvent 59 stored in /Events/EventContainer/ (sustained)
>>> Event 60
Event : 60
mySD/EvenCollection Number of hits 9
Edep of the first Hit 16.8675
mySD/OddCollection Number of hits 41
Edep of the first Hit 44.7627
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 60 stored in /Events/EventContainer/ (sustained)
>>> Event 61
Event : 61
mySD/EvenCollection Number of hits 6
Edep of the first Hit 3.47969
mySD/OddCollection Number of hits 43
Edep of the first Hit 30.56
-- G4PEvent 61 stored in /Events/EventContainer/ (sustained)
>>> Event 62
Event : 62
mySD/EvenCollection Number of hits 7
Edep of the first Hit 15.0186
mySD/OddCollection Number of hits 40
Edep of the first Hit 2.9719
-- G4PEvent 62 stored in /Events/EventContainer/ (sustained)
>>> Event 63
Event : 63
mySD/EvenCollection Number of hits 12
Edep of the first Hit 41.015
mySD/OddCollection Number of hits 42
Edep of the first Hit 5.60219
-- G4PEvent 63 stored in /Events/EventContainer/ (sustained)
>>> Event 64
Event : 64
mySD/EvenCollection Number of hits 8
Edep of the first Hit 19.799
mySD/OddCollection Number of hits 41
Edep of the first Hit 16.2043
-- G4PEvent 64 stored in /Events/EventContainer/ (sustained)
>>> Event 65
Event : 65
mySD/EvenCollection Number of hits 14
Edep of the first Hit 15.7985
mySD/OddCollection Number of hits 33
Edep of the first Hit 9.14023
-- G4PEvent 65 stored in /Events/EventContainer/ (sustained)
>>> Event 66
Event : 66
mySD/EvenCollection Number of hits 8
Edep of the first Hit 14.5406
mySD/OddCollection Number of hits 42
Edep of the first Hit 67.0776
-- G4PEvent 66 stored in /Events/EventContainer/ (sustained)
>>> Event 67
Event : 67
mySD/EvenCollection Number of hits 7
Edep of the first Hit 53.7664
mySD/OddCollection Number of hits 36
Edep of the first Hit 53.2186
-- G4PEvent 67 stored in /Events/EventContainer/ (sustained)
>>> Event 68
Event : 68
mySD/EvenCollection Number of hits 11
Edep of the first Hit 0.0268595
mySD/OddCollection Number of hits 40
Edep of the first Hit 13.2218
-- G4PEvent 68 stored in /Events/EventContainer/ (sustained)
>>> Event 69
Event : 69
mySD/EvenCollection Number of hits 4
Edep of the first Hit 28.0916
mySD/OddCollection Number of hits 39
Edep of the first Hit 8.14295
-- G4PEvent 69 stored in /Events/EventContainer/ (sustained)
>>> Event 70
Event : 70
mySD/EvenCollection Number of hits 9
Edep of the first Hit 46.4878
mySD/OddCollection Number of hits 44
Edep of the first Hit 0.310941
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 70 stored in /Events/EventContainer/ (sustained)
>>> Event 71
Event : 71
mySD/EvenCollection Number of hits 7
Edep of the first Hit 11.3829
mySD/OddCollection Number of hits 40
Edep of the first Hit 5.78213
-- G4PEvent 71 stored in /Events/EventContainer/ (sustained)
>>> Event 72
Event : 72
mySD/EvenCollection Number of hits 6
Edep of the first Hit 102.104
mySD/OddCollection Number of hits 41
Edep of the first Hit 31.2024
-- G4PEvent 72 stored in /Events/EventContainer/ (sustained)
>>> Event 73
Event : 73
mySD/EvenCollection Number of hits 7
Edep of the first Hit 25.7397
mySD/OddCollection Number of hits 38
Edep of the first Hit 13.4817
-- G4PEvent 73 stored in /Events/EventContainer/ (sustained)
>>> Event 74
Event : 74
mySD/EvenCollection Number of hits 7
Edep of the first Hit 4.22867
mySD/OddCollection Number of hits 40
Edep of the first Hit 7.92935
-- G4PEvent 74 stored in /Events/EventContainer/ (sustained)
>>> Event 75
Event : 75
mySD/EvenCollection Number of hits 7
Edep of the first Hit 53.4164
mySD/OddCollection Number of hits 41
Edep of the first Hit 61.7056
-- G4PEvent 75 stored in /Events/EventContainer/ (sustained)
>>> Event 76
Event : 76
mySD/EvenCollection Number of hits 10
Edep of the first Hit 9.39781
mySD/OddCollection Number of hits 38
Edep of the first Hit 24.0445
-- G4PEvent 76 stored in /Events/EventContainer/ (sustained)
>>> Event 77
Event : 77
mySD/EvenCollection Number of hits 9
Edep of the first Hit 6.83122
mySD/OddCollection Number of hits 38
Edep of the first Hit 44.4089
-- G4PEvent 77 stored in /Events/EventContainer/ (sustained)
>>> Event 78
Event : 78
mySD/EvenCollection Number of hits 8
Edep of the first Hit 1.36272
mySD/OddCollection Number of hits 45
Edep of the first Hit 1.69722
-- G4PEvent 78 stored in /Events/EventContainer/ (sustained)
>>> Event 79
Event : 79
mySD/EvenCollection Number of hits 29
Edep of the first Hit 56.4575
mySD/OddCollection Number of hits 13
Edep of the first Hit 2.42198
-- G4PEvent 79 stored in /Events/EventContainer/ (sustained)
>>> Event 80
Event : 80
mySD/EvenCollection Number of hits 32
Edep of the first Hit 6.56751
mySD/OddCollection Number of hits 16
Edep of the first Hit 64.8193
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 80 stored in /Events/EventContainer/ (sustained)
>>> Event 81
Event : 81
mySD/EvenCollection Number of hits 23
Edep of the first Hit 77.0987
mySD/OddCollection Number of hits 20
Edep of the first Hit 43.7444
-- G4PEvent 81 stored in /Events/EventContainer/ (sustained)
>>> Event 82
Event : 82
mySD/EvenCollection Number of hits 29
Edep of the first Hit 31.2056
mySD/OddCollection Number of hits 11
Edep of the first Hit 30.487
-- G4PEvent 82 stored in /Events/EventContainer/ (sustained)
>>> Event 83
Event : 83
mySD/EvenCollection Number of hits 18
Edep of the first Hit 8.34544
mySD/OddCollection Number of hits 18
Edep of the first Hit 18.5952
-- G4PEvent 83 stored in /Events/EventContainer/ (sustained)
>>> Event 84
Event : 84
mySD/EvenCollection Number of hits 15
Edep of the first Hit 1.30057
mySD/OddCollection Number of hits 40
Edep of the first Hit 11.4435
-- G4PEvent 84 stored in /Events/EventContainer/ (sustained)
>>> Event 85
Event : 85
mySD/EvenCollection Number of hits 7
Edep of the first Hit 38.8382
mySD/OddCollection Number of hits 42
Edep of the first Hit 14.691
-- G4PEvent 85 stored in /Events/EventContainer/ (sustained)
>>> Event 86
Event : 86
mySD/EvenCollection Number of hits 11
Edep of the first Hit 6.5076
mySD/OddCollection Number of hits 41
Edep of the first Hit 103.732
-- G4PEvent 86 stored in /Events/EventContainer/ (sustained)
>>> Event 87
Event : 87
mySD/EvenCollection Number of hits 8
Edep of the first Hit 4.17298
mySD/OddCollection Number of hits 41
Edep of the first Hit 70.4753
-- G4PEvent 87 stored in /Events/EventContainer/ (sustained)
>>> Event 88
Event : 88
mySD/EvenCollection Number of hits 31
Edep of the first Hit 17.119
mySD/OddCollection Number of hits 22
Edep of the first Hit 28.4859
-- G4PEvent 88 stored in /Events/EventContainer/ (sustained)
>>> Event 89
Event : 89
mySD/EvenCollection Number of hits 9
Edep of the first Hit 47.2302
mySD/OddCollection Number of hits 43
Edep of the first Hit 49.3412
-- G4PEvent 89 stored in /Events/EventContainer/ (sustained)
>>> Event 90
Event : 90
mySD/EvenCollection Number of hits 8
Edep of the first Hit 23.1413
mySD/OddCollection Number of hits 41
Edep of the first Hit 18.5923
Transaction is committed on /Events/EventContainer/
Transaction started for /Events/EventContainer/ with sustained mode.
-- G4PEvent 90 stored in /Events/EventContainer/ (sustained)
>>> Event 91
Event : 91
mySD/EvenCollection Number of hits 9
Edep of the first Hit 27.6976
mySD/OddCollection Number of hits 41
Edep of the first Hit 28.5904
-- G4PEvent 91 stored in /Events/EventContainer/ (sustained)
>>> Event 92
Event : 92
mySD/EvenCollection Number of hits 14
Edep of the first Hit 7.49035
mySD/OddCollection Number of hits 36
Edep of the first Hit 85.1197
-- G4PEvent 92 stored in /Events/EventContainer/ (sustained)
>>> Event 93
Event : 93
mySD/EvenCollection Number of hits 28
Edep of the first Hit 30.053
mySD/OddCollection Number of hits 25
Edep of the first Hit 26.7725
-- G4PEvent 93 stored in /Events/EventContainer/ (sustained)
>>> Event 94
Event : 94
mySD/EvenCollection Number of hits 6
Edep of the first Hit 15.6043
mySD/OddCollection Number of hits 43
Edep of the first Hit 61.7972
-- G4PEvent 94 stored in /Events/EventContainer/ (sustained)
>>> Event 95
Event : 95
mySD/EvenCollection Number of hits 25
Edep of the first Hit 20.5769
mySD/OddCollection Number of hits 21
Edep of the first Hit 11.6616
-- G4PEvent 95 stored in /Events/EventContainer/ (sustained)
>>> Event 96
Event : 96
mySD/EvenCollection Number of hits 6
Edep of the first Hit 1.25488
mySD/OddCollection Number of hits 36
Edep of the first Hit 75.4839
-- G4PEvent 96 stored in /Events/EventContainer/ (sustained)
>>> Event 97
Event : 97
mySD/EvenCollection Number of hits 8
Edep of the first Hit 1.63689
mySD/OddCollection Number of hits 31
Edep of the first Hit 80.3105
-- G4PEvent 97 stored in /Events/EventContainer/ (sustained)
>>> Event 98
Event : 98
mySD/EvenCollection Number of hits 10
Edep of the first Hit 36.8743
mySD/OddCollection Number of hits 37
Edep of the first Hit 29.8302
-- G4PEvent 98 stored in /Events/EventContainer/ (sustained)
>>> Event 99
Event : 99
mySD/EvenCollection Number of hits 11
Edep of the first Hit 8.25636
mySD/OddCollection Number of hits 31
Edep of the first Hit 24.0489
-- G4PEvent 99 stored in /Events/EventContainer/ (sustained)
Transaction is committed on /Events/EventContainer/
Transaction started for /Runs/RunContainer/ with non-sustained mode.
-- G4PRun 0 stored in /Runs/RunContainer/
Transaction is committed on /Runs/RunContainer/
#
exit
PersistencyManager is deleting.
@@ -0,0 +1,48 @@
#! /bin/csh -f
# check some configurations
if ( ! $?G4EXAMPLE_FDID ) then
echo "G4EXAMPLE_FDID is not defined. Stop."
exit 2
endif
# setup some variables
set name = PersistentEx02
set CWD = `pwd`
set G4ROOT = ${CWD}/../../../..
if ( $?G4WORKDIR ) then
set G4BIN = ${G4WORKDIR}/bin/${G4SYSTEM}
else
set G4BIN = ${G4ROOT}/bin/${G4SYSTEM}
endif
# check for LHC++ variables
source ${G4ROOT}/examples/extended/persistency/PersistentEx01/setup_lhcxx.csh
# install new runtime federated database
set G4EXAMPLE_FD = $G4WORKDIR/exampleFD/$G4SYSTEM/${name}
echo "Copying G4EXAMPLE_BOOT into runtime federated database..."
gmake newfd
setenv OO_FD_BOOT $G4EXAMPLE_FD
echo "OO_FD_BOOT is set to $OO_FD_BOOT"
echo ""
if ( $?BACKGROUND ) then
if ( -e ${name}.log.old ) rm -f ${name}.log.old
if ( -e ${name}.log ) mv -f ${name}.log ${name}.log.old
${G4BIN}/${name} ${name}.in >& ${name}.log &
echo "Job ${name} submitted..."
sleep 2
echo "tail -f ${name}.log"
tail -f ${name}.log
else
${G4BIN}/${name} ${name}.in
endif
@@ -0,0 +1,142 @@
$Id: README,v 1.6 1999/12/05 22:27:05 morita Exp $
------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Example PersistentEx02
----------------------
This example program demonstrates how users can use object database
with Geant4 Persistency Manager with HepODBMS and Objectivity/DB.
Ask your local system manager for the availability of these
products on your system. For more detail description of the
setup, see the README file of PersistentEx01.
============
Introduction
============
PersistentEx02 demonstrates how to store persistent hits, in
addition to other objects demonstrated in PersistentEx01.
To make persistent hits, schema definitions of PersEx02TrackerHit and
PersEx02TrackerHitsCollection must inherit from Geant4 persistent
hit classes G4PVHit and G4PVHitsCollection. Note that the data
members in persistent hits must be persistent-capable types.
-------------------------
In PersEx02TrackerHit.ddl
-------------------------
class PersEx02TrackerHit : public G4PVHit
{
public:
:
private:
G4Pdouble edep;
G4ThreeVector pos;
:
}
------------------------------------
In PersEx02TrackerHitsCollection.ddl
------------------------------------
typedef d_Varray< d_Ref<PersEx02TrackerHit> > PersEx02TrackerHitsVArray;
class PersEx02TrackerHitsCollection : public G4PVHitsCollection
{
public:
:
private:
PersEx02TrackerHitsVArray hitsCollection;
:
}
When persistent hits collections are made at runtime, each hit collection
should be registered to the collection of hits collections
(G4PHCofThisEvent) by the user SensitiveDetector (PersEx02TrackerSD).
Each event object stored in the database has an association to this
collection of the collections for the future reference.
====================
Sustained Transation
====================
There are two types of database transactions in the Geant4
persistency. By default, Geant4 persistent objects are
stored at the end of each event as an atmic database transaction.
In this example, user-defined persistent hits are created
during the event. To enable this, user should explicitly call
StartTransaction() and Commit() of G4PersistencyManager.
These calls are implemented in BeginOfRunAction() and
EndOfRunAction() of the RunAction class.
void PersEx02RunAction::BeginOfRunAction(const G4Run* aRun)
{
....
persM->StartTransaction(kEventDB, kUpdate, true);
....
}
void PersEx02RunAction::EndOfRunAction(const G4Run* )
{
....
persM->Commit(kEventDB, true);
....
}
To make a "check point", a pair of Commit()/StartTransaction()
is called at EndOfEventAction() in the EventAction class at
every 10 events.
void PersEx02EventAction::EndOfEventAction(const G4Event* evt)
{
....
if( persM && (evt->GetEventID() % 10 == 0))
{
persM->Commit(kEventDB, true);
persM->StartTransaction(kEventDB, kUpdate, true);
}
....
}
=========================
PersistentEx02 executable
=========================
PersistentEx02 executable can be made by simply typing "gmake" in this
directory. Use PersistentEx02run csh-script for a simple test.
example:
gmake # creates PersistentEx02 executable
PersistentEx02run # run PersistentEx02
PersistentEx02run will copy the G4EXAMPLE_BOOT file into runtime
federated database. Whenever PersistentEx02run is executed again,
it will delete the old federeated database and start from the
new copy of G4EXAMPLE_BOOT.
=================
Persistent output
=================
When PersistentEx02 is run correctly, following database files will be
created in your runtime federeated database directory.
Events.PersistentEx02.DB Geometry.PersistentEx02.DB
PersistentEx02 PersistentEx02.FDDB
Runs.PersistentEx02.DB System.PersistentEx02.DB
Hits are stored in "Events" database.
To browse the database contents, refer to the README file in
PersistentEx01. Persistent hits are stored in the Events
database.
======
readDB
======
A simple standalone application readDB, provided in this directory,
can also be used to access the event and hits objects.
See PersistentEx02/readDB/README for more detail.
--
@@ -0,0 +1,30 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02DetectorConstruction.hh,v 1.3 1999/11/29 18:15:28 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02DetectorConstruction_h
#define PersEx02DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class PersEx02DetectorConstruction : public G4VUserDetectorConstruction
{
public:
PersEx02DetectorConstruction();
~PersEx02DetectorConstruction();
public:
G4VPhysicalVolume* Construct();
};
#endif
@@ -0,0 +1,36 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02EventAction.hh,v 1.3 1999/11/29 18:23:31 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02EventAction_h
#define PersEx02EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class PersEx02EventAction : public G4UserEventAction
{
public:
PersEx02EventAction();
virtual ~PersEx02EventAction();
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
G4int colID1;
G4int colID2;
};
#endif
@@ -0,0 +1,52 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02PhysicsList.hh,v 1.3 1999/11/29 18:23:32 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02PhysicsList_h
#define PersEx02PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
class PersEx02PhysicsList: public G4VUserPhysicsList
{
public:
PersEx02PhysicsList();
virtual ~PersEx02PhysicsList();
protected:
// Construct particle and physics
virtual void ConstructParticle();
virtual void ConstructProcess();
//
virtual void SetCuts();
protected:
// these methods Construct particles
virtual void ConstructBosons();
virtual void ConstructLeptons();
virtual void ConstructMesons();
virtual void ConstructBaryons();
virtual void ConstructIons();
protected:
// these methods Construct physics processes and register them
virtual void ConstructGeneral();
virtual void ConstructEM();
virtual void ConstructHad();
virtual void ConstructLeptHad();
};
#endif
@@ -0,0 +1,35 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02PrimaryGeneratorAction.hh,v 1.3 1999/11/29 18:23:32 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02PrimaryGeneratorAction_h
#define PersEx02PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
class G4ParticleGun;
class G4Event;
class PersEx02PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PersEx02PrimaryGeneratorAction();
~PersEx02PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4ParticleGun* particleGun;
};
#endif
@@ -0,0 +1,34 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02RunAction.hh,v 1.3 1999/11/29 18:23:32 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02RunAction_h
#define PersEx02RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
class PersEx02RunAction : public G4UserRunAction
{
public:
PersEx02RunAction();
virtual ~PersEx02RunAction();
public:
virtual void BeginOfRunAction(const G4Run* aRun);
virtual void EndOfRunAction(const G4Run* aRun);
private:
};
#endif
@@ -0,0 +1,35 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02StackingAction.hh,v 1.2 1999/11/29 18:23:33 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02StackingAction_H
#define PersEx02StackingAction_H 1
#include "globals.hh"
#include "G4UserStackingAction.hh"
#include "G4ThreeVector.hh"
class G4Track;
class PersEx02StackingAction : public G4UserStackingAction
{
public:
PersEx02StackingAction();
virtual ~PersEx02StackingAction();
public:
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
};
#endif
@@ -0,0 +1,53 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerHit.ddl,v 1.4 1999/11/29 19:27:52 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02TrackerHit_h
#define PersEx02TrackerHit_h 1
#include "G4PVHit.hh"
#include "G4ThreeVector.hh"
#include "G4PersistentTypes.hh"
#include "HepODBMS/odbms/HepODBMS.h"
class PersEx02TrackerHit
: public G4PVHit
{
public:
PersEx02TrackerHit();
~PersEx02TrackerHit();
PersEx02TrackerHit(const PersEx02TrackerHit &right);
const PersEx02TrackerHit& operator=(const PersEx02TrackerHit &right);
int operator==(const PersEx02TrackerHit &right) const;
void Draw();
void Print();
private:
G4Pdouble edep;
G4ThreeVector pos;
public:
inline void SetEdep(G4double de)
{ edep = de; };
inline G4double GetEdep()
{ return edep; };
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; };
inline G4ThreeVector GetPos()
{ return pos; };
};
#endif
@@ -0,0 +1,64 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerHitsCollection.ddl,v 1.3 1999/11/29 18:23:33 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02TrackerHitsCollection_h
#define PersEx02TrackerHitsCollection_h 1
#include "HepODBMS/odbms/HepODBMS.h"
#include "HepODBMS/clustering/HepClusteringHint.h"
#include "G4PersistentTypes.hh"
#include "G4PVHit.hh"
#include "G4PVHitsCollection.hh"
#include "G4ThreeVector.hh"
#include "PersEx02TrackerHit.hh"
typedef d_Varray< d_Ref<PersEx02TrackerHit> > PersEx02TrackerHitsVArray;
class PersEx02TrackerHitsCollection
: public G4PVHitsCollection
{
public:
PersEx02TrackerHitsCollection(G4String dName, G4String aName);
~PersEx02TrackerHitsCollection();
void DrawAllHits();
void PrintAllHits();
public:
static HepClusteringHint clustering;
private:
PersEx02TrackerHitsVArray hitsCollection;
size_t elems;
public:
inline void Insert(d_Ref<PersEx02TrackerHit> pHit)
{
size_t curSize = hitsCollection.size();
if (elems >= curSize)
hitsCollection.resize(curSize + 1024);
hitsCollection[elems++] = pHit;
};
inline void ShrinkToFit()
{ hitsCollection.resize(elems); };
inline size_t size() const
{ return hitsCollection.size(); }
inline HepRef(PersEx02TrackerHit) element(const size_t i) const
{ return hitsCollection[i]; }
inline HepRef(PersEx02TrackerHit) operator[](const size_t i) const
{ return hitsCollection[i]; }
};
#endif
@@ -0,0 +1,44 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerSD.hh,v 1.3 1999/11/29 18:23:33 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef PersEx02TrackerSD_h
#define PersEx02TrackerSD_h 1
#include "G4VSensitiveDetector.hh"
#include "PersEx02TrackerHitsCollection.hh"
#include "G4Step.hh"
#include "HepODBMS/odbms/HepODBMS.h"
class G4PersistentHitMan;
class PersEx02TrackerSD : public G4VSensitiveDetector
{
public:
PersEx02TrackerSD(G4String name);
~PersEx02TrackerSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
G4PersistentHitMan* f_hitMan;
HepRef(PersEx02TrackerHitsCollection) EvenCollection;
HepRef(PersEx02TrackerHitsCollection) OddCollection;
HepContainerRef hitContainer;
};
#endif
@@ -0,0 +1,6 @@
#
# prerunPEx02.mac
#
/control/verbose 2
/db/verbose 2
/run/initialize
@@ -0,0 +1,63 @@
include $(HEP_ODBMS_DIR)/etc/HepODBMS.mk
# application name, source files on objects
APPL = readDB
SRCS = $(APPL).cpp
OBJS = $(OS)/$(APPL).$(OBJ_EXT)
LIBS = $(HEP_ODBMS_LIBS) $(OBJY_LIBS) $(OSPACE_LIBS)
G4INSTALL := ../../../../..
G4ODBMS := true
ifeq ($(OS),Solaris)
G4SYSTEM := SUN-CC
endif
ifeq ($(OS),HP-UX)
G4SYSTEM := HP-aCC
endif
CLHEPLIB := /afs/cern.ch/sw/geant4/dev/CLHEP/$(G4SYSTEM)/pro/lib/libCLHEP.a
include $(G4INSTALL)/config/architecture.gmk
.PHONY: cleanall
# CPPFLAGS is defined in Geant4 architecture.gmk
CPPFLAGS += \
-I$./ \
-I$../include \
-I$(G4TMP)/$(G4SYSTEM)/PersistentEx02 \
-I$(G4SCHEMA_INCLUDE) \
-I$(G4INSTALL)/source/global/management/include \
-I$(G4INSTALL)/source/persistency/global/include \
-I$(G4INSTALL)/source/persistency/management/include \
-I$(G4INSTALL)/source/persistency/events/include \
-I$(G4INSTALL)/source/persistency/digits+hits/hits/include \
-I$(G4INSTALL)/source/event/include \
-I$(G4INSTALL)/source/tracking/include \
-I$(G4INSTALL)/source/digits+hits/hits/include \
-I$(G4INSTALL)/source/digits+hits/digits/include
# C_FLAGS is the one used in the rules of HepODBMS.mk
C_FLAGS += $(CPPFLAGS)
# Add Geant4 Persistent Libraries
LIBS := -L$(G4TMP)/$(G4SYSTEM)/PersistentEx02 \
-lPersistentEx02 \
-L$(G4LIB)/$(G4SYSTEM) \
-lG4pmanagement -lG4pgeomn -lG4pgeomBoolean -lG4pcsg \
-lG4pgeomGlobal -lG4prun -lG4pevents -lG4phits -lG4pglobal \
-lG4event -lG4partman -lG4hits -lG4digits \
-lG4materials \
-lG4intercoms -lG4globman -lG4hepnumerics \
$(LIBS) \
$(CLHEPLIB)
# make APPL the default target
all : $(APPL)
$(APPL): GNUmakefile $(OBJS)
$(C++) $(C_FLAGS) $(CPPFLAGS) -o $(APPL) $(OBJS) $(LIBS)
cleanall : clean
@rm -f $(APPL)
@@ -0,0 +1,18 @@
$Id: README,v 1.2 1999/12/02 20:51:49 morita Exp $
-------------------------------------------------------------------
readDB
------
This short program demonstrates how to access events and their
associations which are stored in the database.
To create and populate the database, see the file PersistentEx02/README.
For the setup of readDB, see PersistentEx01/readDB/README.
The difference between PersistentEx01/readDB and this example
is the additional capability to look into the user derived
persistent hits.
--
@@ -0,0 +1,125 @@
#include "HepODBMS/clustering/HepDbApplication.h"
#include "G4PEvent.hh"
#include "G4PPrimaryVertex.hh"
#include "G4PPrimaryParticle.hh"
#include "G4PHCofThisEvent.hh"
#include "PersEx02TrackerHitsCollection.hh"
class dbAccessApp : public HepDbApplication {
// Application inherits session control from HepDbApplication
public:
// this application implements just one method: run the
dbAccessApp(const char *name) : HepDbApplication(name)
{};
int run()
{
// print an
message("about to initialise the db connection");
Init(); // initialise the db session
message("starting a read transaction");
startRead(); // start a read transaction
HepDatabaseRef myDb = db("Events");
// if the database ref is not valid:
// - print a message
// - exit the application with an error code
if (myDb == 0)
fatal("could not find Events DB");
// locates Events container in this database
HepContainerRef cont = container("EventContainer");
if (cont == 0 )
fatal("could not find Events Container");
// initialize iterator for G4PEvent in "Events" Container
ooItr(G4PEvent) pevent_iterator;
pevent_iterator.scan(cont);
// Loop for all G4PEvent in the "EventContainer"
while (pevent_iterator.next())
{
// access this G4PEvent
int evt_id = pevent_iterator->GetEventID();
int n_pvertex = pevent_iterator->GetNumberOfPrimaryVertex();
cout << endl << "Reading event #" << evt_id << ":" << endl;
cout << " No. of primary vertex: " << n_pvertex << endl;
// Loop for all primary vertex in this event
for ( int i = 0; i < n_pvertex; i++ )
{
HepRef(G4PPrimaryVertex) pvertex =
pevent_iterator->GetPrimaryVertex(i);
cout << " ObjectID of the primary vertex: "
<< pvertex.sprint() << endl;
cout << " No. of particle in the primary vertex: "
<< pvertex->GetNumberOfParticle() << endl;
for ( int j = 0; j < pvertex->GetNumberOfParticle() ; j++ )
{
HepRef(G4PPrimaryParticle) particle = pvertex->GetPrimary(j);
cout << " PDGcode: " << particle->GetPDGcode()
<< " Px = " << particle->GetPx()
<< " Py = " << particle->GetPy()
<< " Pz = " << particle->GetPz() << endl;
}
}
// HitCollections of this event
const HepRef(G4PHCofThisEvent) hcte = pevent_iterator->GetHCofThisEvent();
if( hcte != 0 )
{
cout << " ObjectID of the Hit Collections: " << hcte.sprint() << endl;
// Capacity of the Hit Collections VArray
// G4int numHC = hcte->GetCapacity();
// Actual number of Hit Collections in this event
G4int numHCact = hcte->GetNumberOfCollections();
cout << " No. of the Hit Collections: " << numHCact << endl;
for( G4int i = 0; i<numHCact; i++)
{
const HepRef(PersEx02TrackerHitsCollection) aHC =
(HepRef(PersEx02TrackerHitsCollection)) hcte->GetHC(i);
if( aHC != 0 )
{
cout << " Hit Collection[" << i << "]: Name: "
<< aHC->GetName();
cout << " Sensitive Detector: " << aHC->GetSDname() << endl;
HepRef(PersEx02TrackerHit) aHit = aHC->element(0);
if( aHit != 0 )
{
cout << " Number of hits: " << aHC->size() << endl
<< " Edep of the first hit: " << aHit->GetEdep() << endl;
}
}
}
}
else
{ cout << " No Hit Collections for this event." << endl; }
}
message("End of loop over events.");
// finish this read transaction and return
commit();
return 0;
}
};
int main(int argc, const char *argv[])
{
dbAccessApp myApp(argv[0]); // create an application object
return myApp.run(); // call it's run method
}
@@ -0,0 +1,2 @@
setenv OO_FD_BOOT $G4WORKDIR/exampleFD/$G4SYSTEM/PersistentEx02
source ../../PersistentEx01/setup_lhcxx.csh
@@ -0,0 +1,2 @@
OO_FD_BOOT=$G4WORKDIR/exampleFD/$G4SYSTEM/PersistentEx02; export OO_FD_BOOT
. ../../PersistentEx01/setup_lhcxx.sh
@@ -0,0 +1,128 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02DetectorConstruction.cc,v 1.3 1999/11/29 18:33:27 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02DetectorConstruction.hh"
#include "PersEx02TrackerSD.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"
PersEx02DetectorConstruction::PersEx02DetectorConstruction()
{;}
PersEx02DetectorConstruction::~PersEx02DetectorConstruction()
{;}
G4VPhysicalVolume* PersEx02DetectorConstruction::Construct()
{
G4cout << " -- Tracker type sensitive detector" << 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 = 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);
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 ---------
G4double offset=22.5*cm, xTlate, yTlate;
G4int i,j,copyNo;
G4Box *myWorldBox= new G4Box("WBox",10000*cm, 10000*cm, 10000*cm);
G4Box *myCalBox = new G4Box("CBox",1500*cm, 1500*cm, 1000*cm);
G4Tubs *myTargetTube
= new G4Tubs("TTube",0*cm, 22.5*cm, 1000*cm, 0.*deg, 360.*deg);
G4LogicalVolume *myWorldLog=new G4LogicalVolume(myWorldBox,Air,
"WLog", 0, 0, 0);
G4LogicalVolume *myCalLog=new G4LogicalVolume(myCalBox,Al,
"CLog", 0, 0, 0);
G4LogicalVolume *myTargetLog=new G4LogicalVolume(myTargetTube,Pb,
"TLog", 0, 0, 0);
G4PVPlacement *myWorldPhys=new G4PVPlacement(0,G4ThreeVector(),
"WPhys",
myWorldLog,
0,false,0);
G4PVPlacement *myCalPhys=new G4PVPlacement(0,G4ThreeVector(),
"CalPhys",
myCalLog,
myWorldPhys,false,0);
G4String tName1("TPhys1");
copyNo=1;
for (j=1;j<=25;j++)
{
yTlate = -1000.0*cm - 40.0*cm + j*80.0*cm;
for (i=1;i<=50;i++)
{
xTlate = -1000.0*cm - 20.0*cm + i*45.0*cm - offset;
G4PVPlacement *myTargetPhys
=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
tName1,myTargetLog,myCalPhys,false,copyNo++);
}
}
G4String tName2("TPhys2");
copyNo=1;
for (j=1;j<=26;j++)
{
yTlate = -1000.0*cm - 80.0*cm + j*80.0*cm;
for (i=1;i<=50;i++)
{
xTlate = -1000.0*cm - 20.0*cm + i*45.0*cm;
G4PVPlacement *myTargetPhys
=new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
tName2,myTargetLog,myCalPhys,false,copyNo++);
}
}
//--------- Sensitive detector -------------------------------------
// A concrete object named "mySD", which corresponds to
// the G4LogicalVolume object "myTargetLog"
G4String sdName = "sample/tracker/mySD";
PersEx02TrackerSD* mySD = new PersEx02TrackerSD( sdName );
myTargetLog->SetSensitiveDetector( mySD );
// "mySD" will be registrated
G4SDManager* SDman = G4SDManager::GetSDMpointer();
SDman->AddNewDetector( mySD );
//------------------------------------------------------------------
return myWorldPhys;
}
@@ -0,0 +1,85 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02EventAction.cc,v 1.3 1999/11/29 18:33:28 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02EventAction.hh"
#include "PersEx02TrackerHit.hh"
#include "PersEx02TrackerHitsCollection.hh"
#include "G4PersistencyManager.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4PHCofThisEvent.hh"
#include "G4PersistentHitMan.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
#include "HepODBMS/odbms/HepODBMS.h"
PersEx02EventAction::PersEx02EventAction()
{
colID1 = -1;
colID2 = -1;
}
PersEx02EventAction::~PersEx02EventAction()
{;}
void PersEx02EventAction::BeginOfEventAction(const G4Event* )
{
if(colID1<0||colID2<0)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
G4String colNam;
colID1 = SDman->GetCollectionID(colNam="EvenCollection");
colID2 = SDman->GetCollectionID(colNam="OddCollection");
}
}
void PersEx02EventAction::EndOfEventAction(const G4Event* evt)
{
G4cout << ">>> Event " << evt->GetEventID() << endl;
G4PHCofThisEvent* pHCE = G4PersistentHitMan::GetPersistentHitMan()
->GetCurrentPHCofThisEvent();
HepRef(PersEx02TrackerHitsCollection) pTHC1
= (HepRef(PersEx02TrackerHitsCollection))(pHCE->GetHC(colID1));
HepRef(PersEx02TrackerHitsCollection) pTHC2
= (HepRef(PersEx02TrackerHitsCollection))(pHCE->GetHC(colID2));
G4cout << "Event : " << evt->GetEventID() << endl
<< pTHC1->GetSDname() << "/" << pTHC1->GetName() << " "
<< "Number of hits " << pTHC1->size() << endl;
if( pTHC1->size() > 0 )
{
HepRef(PersEx02TrackerHit) aHit = pTHC1->element(0);
G4cout << " Edep of the first Hit " << aHit->GetEdep() << endl;
}
G4cout << pTHC2->GetSDname() << "/" << pTHC2->GetName() << " "
<< "Number of hits " << pTHC2->size() << endl;
if( pTHC2->size() > 0 )
{
HepRef(PersEx02TrackerHit) aHit = pTHC2->element(0);
assert(aHit!=NULL);
G4cout << " Edep of the first Hit " << aHit->GetEdep() << endl;
}
G4PersistencyManager* persM
= G4PersistencyManager::GetPersistencyManager();
if( persM && (evt->GetEventID() % 10 == 0))
{
// commit and resume the sustained event DB transaction for every 10 events
persM->Commit(kEventDB, true);
persM->StartTransaction(kEventDB, kUpdate, true);
}
}
@@ -0,0 +1,196 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02PhysicsList.cc,v 1.3 1999/11/29 18:33:28 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "globals.hh"
#include "PersEx02PhysicsList.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4BosonConstructor.hh"
#include "G4LeptonConstructor.hh"
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4IonConstructor.hh"
#include "G4Material.hh"
#include "G4MaterialTable.hh"
#include "G4ios.hh"
#include <iomanip.h>
PersEx02PhysicsList::PersEx02PhysicsList(): G4VUserPhysicsList()
{
SetVerboseLevel(1);
}
PersEx02PhysicsList::~PersEx02PhysicsList()
{
}
void PersEx02PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
void PersEx02PhysicsList::ConstructBosons()
{
// Construct all bosons
G4BosonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void PersEx02PhysicsList::ConstructLeptons()
{
// Construct all leptons
G4LeptonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void PersEx02PhysicsList::ConstructMesons()
{
// Construct all mesons
G4MesonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void PersEx02PhysicsList::ConstructBaryons()
{
// Construct all baryons
G4BaryonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void PersEx02PhysicsList::ConstructIons()
{
// Construct light ions
G4IonConstructor pConstructor;
pConstructor.ConstructParticle();
}
void PersEx02PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
ConstructLeptHad();
ConstructHad();
ConstructGeneral();
}
#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 PersEx02PhysicsList::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
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
// Construct processes for muon+
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
// all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
}
}
}
}
void PersEx02PhysicsList::ConstructHad()
{;}
void PersEx02PhysicsList::ConstructLeptHad()
{;}
#include "G4Decay.hh"
void PersEx02PhysicsList::ConstructGeneral()
{
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle)) {
pmanager->AddProcess(theDecayProcess, INT_MAX, -1, INT_MAX);
}
}
}
void PersEx02PhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "PersEx02PhysicsList::SetCuts:";
G4cout << "CutLength : " << defaultCutValue/mm << " (mm)" << endl;
}
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
}
@@ -0,0 +1,48 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02PrimaryGeneratorAction.cc,v 1.3 1999/11/29 18:33:28 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02PrimaryGeneratorAction.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "globals.hh"
PersEx02PrimaryGeneratorAction::PersEx02PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
// default particle
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="mu-");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,1.,0.));
particleGun->SetParticleEnergy(1.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
}
PersEx02PrimaryGeneratorAction::~PersEx02PrimaryGeneratorAction()
{
delete particleGun;
}
void PersEx02PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
particleGun->GeneratePrimaryVertex(anEvent);
}
@@ -0,0 +1,58 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02RunAction.cc,v 1.3 1999/11/29 18:33:28 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02RunAction.hh"
#include "G4Run.hh"
#include "G4PersistencyManager.hh"
#include "G4TransportationManager.hh"
#include "G4VPhysicalVolume.hh"
PersEx02RunAction::PersEx02RunAction()
{
}
PersEx02RunAction::~PersEx02RunAction()
{
}
void PersEx02RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4PersistencyManager* persM
= G4PersistencyManager::GetPersistencyManager();
if(aRun->GetRunID()==0)
{
if(persM)
{
G4VPhysicalVolume* theWorld
= G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking()->GetWorldVolume();
persM->Store(theWorld);
}
}
// start event DB transaction with sustained mode
persM->StartTransaction(kEventDB, kUpdate, true);
}
void PersEx02RunAction::EndOfRunAction(const G4Run* )
{
G4PersistencyManager* persM
= G4PersistencyManager::GetPersistencyManager();
if(persM)
{
// commit the sustained event DB transaction
persM->Commit(kEventDB, true);
}
}
@@ -0,0 +1,40 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02StackingAction.cc,v 1.2 1999/11/29 18:33:29 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02StackingAction.hh"
#include "G4Track.hh"
#include "G4TrackStatus.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4ios.hh"
PersEx02StackingAction::PersEx02StackingAction()
{;}
PersEx02StackingAction::~PersEx02StackingAction()
{;}
G4ClassificationOfNewTrack
PersEx02StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
G4ClassificationOfNewTrack classification = fKill;
if(aTrack->GetParentID()==0)
{ classification = fUrgent; }
return classification;
}
void PersEx02StackingAction::NewStage()
{;}
void PersEx02StackingAction::PrepareNewEvent()
{;}
@@ -0,0 +1,46 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerHit.cc,v 1.3 1999/11/29 18:33:29 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02TrackerHit.hh"
PersEx02TrackerHit::PersEx02TrackerHit()
{;}
PersEx02TrackerHit::~PersEx02TrackerHit()
{;}
PersEx02TrackerHit::PersEx02TrackerHit(const PersEx02TrackerHit &right)
{
edep = right.edep;
pos = right.pos;
}
const PersEx02TrackerHit& PersEx02TrackerHit::operator=(const PersEx02TrackerHit &right)
{
edep = right.edep;
pos = right.pos;
return *this;
}
int PersEx02TrackerHit::operator==(const PersEx02TrackerHit &right) const
{
return 0;
}
void PersEx02TrackerHit::Draw()
{
}
void PersEx02TrackerHit::Print()
{
}
@@ -0,0 +1,28 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerHitsCollection.cc,v 1.3 1999/11/29 18:33:29 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include "PersEx02TrackerHitsCollection.hh"
PersEx02TrackerHitsCollection::PersEx02TrackerHitsCollection
(G4String dName, G4String aName)
: G4PVHitsCollection(dName, aName), elems(0)
{;}
PersEx02TrackerHitsCollection::~PersEx02TrackerHitsCollection()
{;}
void PersEx02TrackerHitsCollection::DrawAllHits()
{;}
void PersEx02TrackerHitsCollection::PrintAllHits()
{;}
@@ -0,0 +1,99 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PersEx02TrackerSD.cc,v 1.4 1999/12/02 17:05:17 morita Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#include <assert.h>
#include "PersEx02TrackerSD.hh"
#include "PersEx02TrackerHit.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Track.hh"
#include "G4ParticleDefinition.hh"
#include "G4SDManager.hh"
#include "G4PersistentHitMan.hh"
#include "G4PHCofThisEvent.hh"
#include "G4ios.hh"
PersEx02TrackerSD::PersEx02TrackerSD(G4String name)
: G4VSensitiveDetector(name)
{
G4String HCname;
collectionName.insert(HCname="EvenCollection");
collectionName.insert(HCname="OddCollection");
f_hitMan = G4PersistentHitMan::GetPersistentHitMan();
hitContainer = f_hitMan->GetContainer();
assert(hitContainer != NULL);
}
PersEx02TrackerSD::~PersEx02TrackerSD(){;}
void PersEx02TrackerSD::Initialize(G4HCofThisEvent*HCE)
{
HepRef(G4PHCofThisEvent) aPHC = new( hitContainer ) G4PHCofThisEvent;
f_hitMan->SetCurrentPHCofThisEvent(aPHC);
EvenCollection = new( hitContainer )
PersEx02TrackerHitsCollection(SensitiveDetectorName,collectionName[0]);
OddCollection = new( hitContainer )
PersEx02TrackerHitsCollection(SensitiveDetectorName,collectionName[1]);
}
G4bool PersEx02TrackerSD::ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
if( edep == 0. ) return true;
const G4VPhysicalVolume* physVol
= aStep->GetPreStepPoint()->GetPhysicalVolume();
HepRef(PersEx02TrackerHit) newHit = new( hitContainer ) PersEx02TrackerHit();
newHit->SetEdep( edep );
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
if( physVol->GetName() == "TPhys1" )
{ EvenCollection->Insert( newHit ); }
else if( physVol->GetName() == "TPhys2" )
{ OddCollection->Insert( newHit ); }
return true;
}
void PersEx02TrackerSD::EndOfEvent(G4HCofThisEvent*HCE)
{
static G4int IDe = -1;
static G4int IDo = -1;
if(IDe<0)
{ IDe = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
if(IDo<0)
{ IDo = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[1]); }
// Shrink the array size to the actual hit entries
EvenCollection->ShrinkToFit();
OddCollection->ShrinkToFit();
// Register this HitCollection to Persistent HCofThisEvent
G4PHCofThisEvent* aPHC = f_hitMan->GetCurrentPHCofThisEvent();
aPHC->AddHitsCollection( IDe, EvenCollection );
aPHC->AddHitsCollection( IDo, OddCollection );
}
void PersEx02TrackerSD::clear()
{
}
void PersEx02TrackerSD::DrawAll()
{
}
void PersEx02TrackerSD::PrintAll()
{
}