27
GEANT4 simulation GEANT4 simulation efforts at NIU/NICADD efforts at NIU/NICADD Robert C. McIntosh Robert C. McIntosh [email protected] [email protected] Mike Arov Mike Arov [email protected] [email protected]

GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh [email protected] Mike Arov [email protected]

Embed Size (px)

Citation preview

Page 1: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

GEANT4 simulationGEANT4 simulationefforts at NIU/NICADDefforts at NIU/NICADD

Robert C. McIntosh Robert C. McIntosh [email protected]@nicadd.niu.edu

Mike ArovMike Arov

[email protected]@nicadd.niu.edu

Page 2: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

What is Geant4?What is Geant4?

From the Geant4 website (From the Geant4 website (http://geant4.web.cern.ch/geant4/http://geant4.web.cern.ch/geant4/):):– ““Geant4 is a (programming) toolkit for the Geant4 is a (programming) toolkit for the

simulation of the passage of particles through simulation of the passage of particles through matter”matter”

– ANDAND– ““Geant4 provides a complete set of tools for Geant4 provides a complete set of tools for

all the domains of detector simulation: all the domains of detector simulation: Geometry, Tracking, Detector Response, Run, Geometry, Tracking, Detector Response, Run, Event, and Track Management, Visualisation Event, and Track Management, Visualisation and User Interface”and User Interface”

Page 3: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

LCDRootLCDRoot

Authored by T. Abe and M. Iwasaki Authored by T. Abe and M. Iwasaki (University of Colorado)(University of Colorado)

What is LCDRoot?What is LCDRoot?– Group of tools for LCD studies, that Group of tools for LCD studies, that

covers two areas:covers two areas: Simulation engine using Geant4 Simulation engine using Geant4 and and ROOT ROOT

systemsystem Analysis is based based on the ROOT systemAnalysis is based based on the ROOT system Output as ROOT ntuplesOutput as ROOT ntuples

Page 4: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Lcdg4 – Our programLcdg4 – Our program

Is a port of the simulation engine (G4FullSim) in Is a port of the simulation engine (G4FullSim) in LCDRootLCDRoot– The LCDRoot G4FullSim classes decoupled from The LCDRoot G4FullSim classes decoupled from

ROOTROOT– Decoupling achieved by making appropriate Decoupling achieved by making appropriate

substitutions using C++ STL and CLHEP libraries substitutions using C++ STL and CLHEP libraries instead of ROOT internal classesinstead of ROOT internal classes

– This port is work in progress…This port is work in progress… The result:The result:

– A standalone geant4 simulation programA standalone geant4 simulation program– XML description of detector geometryXML description of detector geometry– SIO output functionalitySIO output functionality

Page 5: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Why decouple from ROOTWhy decouple from ROOT

Decoupling allows us to have a Decoupling allows us to have a “standalone” simulation program“standalone” simulation program

Standalone simulation program, not Standalone simulation program, not bound to a particular analysis bound to a particular analysis environmentenvironment

I/O compatible with the SLAC/HEP.LCD I/O compatible with the SLAC/HEP.LCD library and JASlibrary and JAS

Preservation of the ROOT compatibility. Preservation of the ROOT compatibility. Ntuple output is still an optionNtuple output is still an option

Page 6: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Structure of packageStructure of package

All lcdg4 user action classes are nearly All lcdg4 user action classes are nearly identical to their G4FullSim identical to their G4FullSim counterparts (appropriate counterparts (appropriate modifications made…)modifications made…)

EventAction class has been modified to EventAction class has been modified to output in SIO formatoutput in SIO format

The rough graph class structure of the The rough graph class structure of the package is shown on the next slidepackage is shown on the next slide

Page 7: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

O rg an iza tio n o f L CD G 4 p a cka geC la sse s m arke d in g ree n a re n e w o r rew ritten

HADCallorimeterEM Callorimeter

TrackerVXD etc.

XYZtoID classInitialization

Required for futureSpecialization of the detector

XML2G4DetConstExtracts the info

about the dimmentions ofthe detector

SIO record constructor

Primary Detector Construction

STDHEP inputUnder construction

PrimaryGeneratorActionMain Physics content

XYZtoID convertionProdices the HitID

HAD HitsEM HitsMU Hits

etc.

SIO record fillThe final output stream

EventAction TrackerActionStepingAction

(MCpart Mannager)

LCDG4The Main Driver

XML parserReads in the detector description

Page 8: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Some of the advantages of the Serial Input Output format

Is the preferred data format for Java Analysis Studio, the main analysis framework for NICADDAllows read access to huge files in sequential/selective manner, using records and blocks without overburdening the memoryAllows 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

Page 9: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Writing SIO outputWriting SIO output

O rg an iza tio n o f S IO R e co rd

H A D C a llo rim e terS IO _ H A D

E x ten d s S IO _ B lo ck a ndC o n ne c ts to E ve nt R eco rd

E M C a llo rim e terS IO _ E M

E x ten d s S IO _ B lo ck a ndC o n ne c ts to E ve nt R eco rd

O the r co m p o ne n tsT yp e t it le h e re

E x ten d s S IO _ B lo ck a ndC o n ne c ts to E ve nt R eco rd

E ven t A c tionp ro ce se s h its

fo rm in g in th e p roce ssT h e E ve nt R eco rd

Page 10: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

XYZ to ID conversionXYZ to ID conversion

The output of GEANT4 provides the Cartesian The output of GEANT4 provides the Cartesian coordinates of the hits, without regard for the coordinates of the hits, without regard for the actual geometry: actual geometry:

a)a) number, shape and spacing of the cells number, shape and spacing of the cells

b)b) projective or non-projective towers projective or non-projective towers Specific detector geometry is handled by a Specific detector geometry is handled by a

separate class, initialized at the construction separate class, initialized at the construction of the detector and invoked on each eventof the detector and invoked on each event

Important for the hexagonal geometry of the Important for the hexagonal geometry of the cellcell

Page 11: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

(0,0)

(0,2)

(1,1)

(1,-1)(-1,-1)

(-1,1)

(j,k)

Z(k)

φ(j)

(0,-2)

Layer (i)

Cell (j, k)

The Cell “neighborhood”

NIU Prototype

Page 12: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Using the geometry described above Using the geometry described above one can determined which Cell the one can determined which Cell the coordinates of the hit correspond to coordinates of the hit correspond to and associate the ID of the Cell with and associate the ID of the Cell with the hitthe hit

The ID formed contains 3 fields : The ID formed contains 3 fields :

a)a) R_ID (the radial componentR_ID (the radial component

b)b) Phi_ID (the azimuthal angle Phi_ID (the azimuthal angle component)component)

c) c) Theta_ID (or Z_ID) (the transverse Theta_ID (or Z_ID) (the transverse angle angle

component)component)

Page 13: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Test ResultsTest Results

The Sampling Fractions for the EM The Sampling Fractions for the EM and Hadronic Callorimetersand Hadronic Callorimeters

EMfr = 0.05935EMfr = 0.05935

HADfr = 0.07421HADfr = 0.07421

The old values are 0.02187 The old values are 0.02187

and 0.06338 correspondinglyand 0.06338 correspondingly

entries : 751.00 min : 0 max : 31.210 mean : 17.976

3.6934

Page 14: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Total (EM+HAD) energy for the 10 GeV pions

Using LCDG4 with NICADD proposed detector

Energy, GeV

0 2 4 6 8 10 12 14 160

20

40

60

80

100

120

140 entries : 1001.0 min : 0 max : 16.318 mean : 9.9900 rms : 1.8152

Page 15: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Phi vs Theta for layer 1

66 68 70 72 74 76 78 80 82 84 86 88 90 920

2

4

6

8

10

12

14

16 entries : 76.000 x mean : 76.973 x rms : 4.8503 x min : 66.000 x max : 92.000 y mean : 5.0263 y rms : 3.6848 y min : 0 y max : 16.000

Page 16: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Energy, GeV

1 2 3 4 5 6 7 8 9 10 11 12 13 14 1505

101520253035404550

The total energy deposition for 20 GeV charged pions in HAD

Page 17: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

number of hits in 1000s

Energy, GeV

0 5 10 15 20 25 30 35

2468

1012141618

Energy in HAD vs. # of hits (Response plot)

Page 18: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Shower Profile for the10 GeV charged pions

Page 19: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

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

Page 20: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

The total energy in HAD. Also over 1000 events

Page 21: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

The Projective VersionThe Projective Version

The TowerID class had been The TowerID class had been implemented - automatically fills in implemented - automatically fills in the ID field in SIO output to be the ID field in SIO output to be read in JAS without complications read in JAS without complications (Thanks to Noman Graf) (Thanks to Noman Graf)

Standard projective geometry + Standard projective geometry + rectangular cells of the SD design rectangular cells of the SD design is assumed by the digitizeris assumed by the digitizer

Page 22: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

SIO File ContentsSIO File Contents

EventHeader - being read every EventHeader - being read every time user scroldtime user scrold

EMCal HitListEMCal HitList HADCal HitListHADCal HitList MU and Tracker infoMU and Tracker info MCPrint (the Monte Carlo Particle MCPrint (the Monte Carlo Particle

Table)Table)

Page 23: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

Usage of the packageUsage of the package

Http://nicadd.niu.edu/simulations/Http://nicadd.niu.edu/simulations/software/software/

Source + binary (Linux) are availableSource + binary (Linux) are available lcdg4-bin,tar.gz and materials.tar.gzlcdg4-bin,tar.gz and materials.tar.gz the proper command line format is the proper command line format is

lcdg4 b input_file.xml output_file.sio lcdg4 b input_file.xml output_file.sio Detector_ID MacroFile HepEvt_FileDetector_ID MacroFile HepEvt_File

Page 24: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

ExamplesExamples

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,5000

200

400

600

800

1,000

1,200 N_Hits_G4_50GeV e+ entries : 1000.0 min : 49.000 max : 7796.0 mean : 305.28 rms : 414.85

N_Hits_Gismo_50GeV_e+ entries : 1000.0 min : 0 max : 108.00 mean : 9.2260 rms : 7.4414

Page 25: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

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,5000

50

100

150

200

250

300

350

400

Page 26: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

The ProblemsThe Problems

Monte Carlo Particle output is wrong !Monte Carlo Particle output is wrong ! The discrepancy between GEANT4 and The discrepancy between GEANT4 and

Gismo is still there - about 7 times more Gismo is still there - about 7 times more hits for the same event in G4hits for the same event in G4

The multitude of versions we currently The multitude of versions we currently have has to be brought togetherhave has to be brought together

Geometry is “hard - coded”Geometry is “hard - coded”

Page 27: GEANT4 simulation efforts at NIU/NICADD Robert C. McIntosh rmcintos@nicadd.niu.edu Mike Arov arov@nicadd.niu.edu

ConclusionsConclusions

We now have two version of the package: We now have two version of the package: for projective and non-projective designsfor projective and non-projective designs

The non-projective package had little The non-projective package had little modification and is currently geared for modification and is currently geared for NICADD’s calorimeter designNICADD’s calorimeter design

The projective geometry package interacts The projective geometry package interacts seamlessly with JAS (save for the annoying seamlessly with JAS (save for the annoying MC bug)MC bug)

More creative work and bug fixing is in More creative work and bug fixing is in orderorder