GEANT4 simulation effort at NIU

Download Report

Transcript GEANT4 simulation effort at NIU

GEANT4 simulation
efforts at NIU/NICADD
Robert C. McIntosh
[email protected]
Mike Arov
[email protected]
What is Geant4?

From the Geant4 website
(http://geant4.web.cern.ch/geant4/):
– “Geant4 is a (programming) toolkit for the
simulation of the passage of particles through
matter”
– AND
– “Geant4 provides a complete set of tools for all
the domains of detector simulation: Geometry,
Tracking, Detector Response, Run, Event, and
Track Management, Visualisation and User
Interface”
LCDRoot
Authored by T. Abe and M. Iwasaki
(University of Colorado)
 What is LCDRoot?

– Group of tools for LCD studies, that covers
two areas:



Simulation engine using Geant4 and ROOT
system
Analysis is based based on the ROOT system
Output as ROOT ntuples
Lcdg4 – Our program


Is a port of the simulation engine (G4FullSim) in LCDRoot
– The LCDRoot G4FullSim classes decoupled from ROOT
– Decoupling achieved by making appropriate substitutions
using C++ STL and CLHEP libraries instead of ROOT internal
classes
– This port is work in progress…
The result:
– A standalone geant4 simulation program
– XML description of detector geometry
– SIO output functionality
Why decouple from ROOT
Decoupling allows us to have a
“standalone” simulation program
 Standalone simulation program, not
bound to a particular analysis
environment
 I/O compatible with the SLAC/HEP.LCD
library and JAS
 Preservation of the ROOT compatibility.
Ntuple output is still an option

Structure of package
All lcdg4 user action classes are nearly
identical to their G4FullSim counterparts
(appropriate modifications made…)
 EventAction class has been modified to
output in SIO format
 The rough graph class structure of the
package is shown on the next slide

Organization of LCDG4 package
Classes marked in green are new or rewritten
LCDG4
The Main Driver
Primary Detector Construction
XML2G4DetConst
Extracts the info
about the dimmentions of
the detector
HADCallorimeter
EM Callorimeter
Tracker
VXD etc.
SIO record constructor
XYZtoID class
Initialization
Required for future
Specialization of the detector
XML parser
Reads in the detector description
PrimaryGeneratorAction
Main Physics content
STDHEP input
Under construction
EventAction
HAD Hits
EM Hits
MU Hits
etc.
XYZtoID convertion
Prodices the HitID
TrackerAction
StepingAction
(MCpart Mannager)
SIO record fill
The final output stream
Some of the advantages of the Serial Input Output format
Is the preferred data format for Java Analysis Studio, the
main analysis framework for NICADD
Allows read access to huge files in sequential/selective
manner, using records and blocks without overburdening
the memory
Allows writing onto several streams simultaneously
Has built-in support for file compression, which is
important, since uncompressed events can take well over
1 GB of space
Writing SIO output
Organization of SIO Record
Event Action
proceses hits
forming in the process
The Event Record
HADCallorimeter
SIO_HAD
Extends SIO_Block and
Connects to Event Record
EM Callorimeter
SIO_EM
Extends SIO_Block and
Connects to Event Record
Other components
Type title here
Extends SIO_Block and
Connects to Event Record
XYZ to ID conversion



The output of GEANT4 provides the Cartesian
coordinates of the hits, without regard for the
actual geometry:
a) number, shape and spacing of the cells
b) projective or non-projective towers
Specific detector geometry is handled by a
separate class, initialized at the construction of
the detector and invoked on each event
Important for the hexagonal geometry of the cell
Z(k)
NIU Prototype
(j,k)
Layer (i)
(0,2)
Cell (j, k)
(-1,1)
(1,1)
(0,0)
(-1,-1)
(1,-1)
(0,-2)
The Cell
“neighborhood”
φ(j)
Using the geometry described above
one can determined which Cell the
coordinates of the hit correspond to and
associate the ID of the Cell with the hit
 The ID formed contains 3 fields :
a) R_ID (the radial component
b) Phi_ID (the azimuthal angle
component)
c) Theta_ID (or Z_ID) (the transverse
angle
component)

Test Results

The Sampling Fractions for the EM and
Hadronic Callorimeters
EMfr = 0.05935
HADfr = 0.07421

The old values are 0.02187
and 0.06338 correspondingly
entries : 751.00
min :
0
max :
31.210
mean : 17.976
3.6934
Total (EM+HAD) energy for the 10 GeV pions
140
entries :1001.0
min :
0
max : 16.318
mean : 9.9900
rms : 1.8152
120
100
80
60
40
20
0
0
2
4
6
8
10
12
14
Energy, GeV
Using LCDG4 with NICADD proposed detector
16
Phi vs Theta for layer 1
16
entries76.000
:
x mean
76.973
:
x rms 4.8503
:
x min 66.000
:
x max92.000
:
y mean
5.0263
:
y rms 3.6848
:
y min : 0
y max16.000
:
14
12
10
8
6
4
2
0
66
68
70
72
74
76
78
80
82
84
86
88
90
92
50
45
40
35
30
25
20
15
10
5
0
The total energy deposition
for 20 GeV charged pions in
HAD
1
2
3
4
5
6
7
8
9
Energy, GeV
10 11 12 13 14 15
Energy in HAD vs. # of hits (Response plot)
Energy, GeV
18
16
14
12
10
8
6
4
2
0
5
10
15
20
25
number of hits in 1000s
30
35
Shower Profile for the10 GeV charged pions
The comparison plot of energy per hit
between Gismo and Root for 10 GeV pions,
run over 1000 events each
The units are GeV. Green is GEANT4
The total energy in HAD. Also over 1000 events
The Projective Version
The TowerID class had been
implemented - automatically fills in the
ID field in SIO output to be read in JAS
without complications (Thanks to
Noman Graf)
 Standard projective geometry +
rectangular cells of the SD design is
assumed by the digitizer

SIO File Contents
EventHeader - being read every time
user scrold
 EMCal HitList
 HADCal HitList
 MU and Tracker info
 MCPrint (the Monte Carlo Particle Table)

Usage of the package
Http://nicadd.niu.edu/simulations/software/
 Source + binary (Linux) are available
 lcdg4-bin,tar.gz and materials.tar.gz
 the proper command line format is
lcdg4 b input_file.xml output_file.sio
Detector_ID MacroFile HepEvt_File

Examples
1,200
N_Hits_G4_50GeV e+
entries :
1000.0
min :
49.000
max :
7796.0
mean :
305.28
rms :
414.85
1,000
800
600
N_Hits_Gismo_50GeV_e+
N_Hits_Gismo_50GeV_e+
entries :
1000.0
min :
0
max :
108.00
mean :
9.2260
rms :
7.4414
400
200
0
N_Hits_G4_50GeV e+
0
500
1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 5,000 5,500 6,000 6,500 7,000 7,500
400
N_Hits_Geant4_50GeV_pi+
350
N_Hits_Gismo_50GeV_pi+
300
250
200
150
100
50
0
500
1,000 1,500 2,000 2,500 3,000 3,500 4,000 4,500 5,000 5,500 6,000 6,500 7,000 7,500
The Problems
Monte Carlo Particle output is wrong !
 The discrepancy between GEANT4 and
Gismo is still there - about 7 times more
hits for the same event in G4
 The multitude of versions we currently
have has to be brought together
 Geometry is “hard - coded”

Conclusions




We now have two version of the package: for
projective and non-projective designs
The non-projective package had little
modification and is currently geared for
NICADD’s calorimeter design
The projective geometry package interacts
seamlessly with JAS (save for the annoying
MC bug)
More creative work and bug fixing is in order