Virtual MC, Geant4
I. Hrivnacova, IPN, Orsay
ALICE Offline Meeting, CERN, 4 March 2003
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
2
Outline
Virtual MC – Example E03– TMCVerbose– Performance tests– New VMC users
RootToG4 Geant4
– Release 5.0
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
3
Virtual MC
Examples E01, E02
Geant4 novice example N01, N02 rewritten with usage of the Virtual Monte Carlo
E01 – Builds simple geometry, tracks geantino and prints
info at each step
E02 – Builds parameterised geometry with magnetic field,
tracks proton, registers hits in a tracker and saves hits and kinematics in a Root file
– Default cuts in each MC (different) –> different results
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
4
Virtual MCNew E03
E03:– Builds geometry with divided volumes, with magnetic
field– Primary particles: e- with (optionally) randomised
position and fixed direction– Calorimeter hits – total energy deposit and track
length in the absorber and gap layers– Storing hits, particles stack
• Using E02 Root manager class– Verbosity (usage of TMCVerbose)
Same cuts -> Comparable results– G4: cut in range 1mm + /run/particle/applyCuts– G3: cuts in kin. energy set to correspond to G4 cut
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
5
Virtual MC
New E03
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
6
Virtual MCNew E03
Some setting in the G4 example N03 could not be ported to VMC:– Material from elements and/or other materials
(mixture of mixtures)– Gas in non STP conditions– Update geometry
New example of particles stack class– Simpler, only reference from daughter to mother– Better performance
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
7
Virtual MC
TMCVerbose
Inspired by verbose in Geant4– /tracking/verbose command enables a user to run
Geant4 with printing a detailed information from each step
Very useful for debugging, understanding what is going on
TMCVerbose – new class in root/mc For each TVirtualMCApplication function a
corresponding function is defined in TMCVerbose Defined levels of output: 0 – 3
– If level = 0 – no printing
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
8
Virtual MC
TMCVerbose Usage
Including MC Verbose in MC application is not automatic
User can add calls to MC verbose in some/all MC application functions; Eg.
void Ex03MCApplication::Stepping() {
// User actions at each step
fVerbose.Stepping();
fCalorimeter->ProcessHits();
}
Suggestion: to be included in AliRun in AliRoot
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
9
Virtual MC TMCVerbose Output
**************************************************************************************************** Particle = gamma Track ID = 13 Parent ID = 4****************************************************************************************************Step# X(cm) Y(cm) Z(cm) KinE(MeV) dE(MeV) Step(cm) TrackL(cm) Volume Process # 0 -6.634 -0.228 -0.067 0.6481 0.0000 0.000 0.000 ABSO No active process# 1 -6.500 -0.280 -0.134 0.6481 0.0000 0.159 0.159 ABSO Transportation# 2 -6.500 -0.280 -0.134 0.6481 0.0000 0.000 0.159 GAPX Transportation# 3 -6.000 -0.475 -0.385 0.6481 0.0000 0.592 0.751 GAPX Transportation# 4 -6.000 -0.475 -0.385 0.6481 0.0000 0.000 0.751 ABSO Transportation# 5 -5.758 -0.569 -0.506 0.0000 0.0880 0.287 1.038 ABSO Photoelectric effect
**************************************************************************************************** Particle = e- Track ID = 14 Parent ID = 13****************************************************************************************************Step# X(cm) Y(cm) Z(cm) KinE(MeV) dE(MeV) Step(cm) TrackL(cm) Volume Process # 0 -5.758 -0.569 -0.506 0.5601 0.0000 0.000 0.000 ABSO No active process# 1 -5.755 -0.570 -0.503 0.0551 0.1598 0.010 0.010 ABSO Bremstrahlung# 2 -5.755 -0.570 -0.503 -0.0000 0.0551 0.001 0.011 ABSO Energy loss
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
10
Virtual MC
Performance test
E03 – enables to compare performance of G3, G4 VMC and
G4 (native) on a simple geometry & physics problem Test:
– 50 events– 1000 primary e-, 50 MeV– 10 layers: 1cm Lead + 0.5 cm Liquid Argon– Default material (world): vacuum– EM physics
• G3: LOSS=1, DRAY=1, HADR=0• G4: TG4 EM Physics Constructor
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
11
Virtual MC
Performance test
Geant4 VMC configurations:– TG4SteppingAction, TG4TrackingAction on/off
• These classes insure performing special steps of zero length for new track and on boundary
– Magnetic field on/off– Saving secondaries to MC stack on/off
• If comparing with native G4 simulation be aware that G4 does not make secondaries persistent
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
12
Performance test G4 VMC Configurations
C1
fastest
No TG4SteppingAction, TG4TrackingAction
Not saving secondaries in MC stack
No magnetic field/ Mag. Field 0.2 tesla
C2 With TG4SteppingAction, TG4TrackingAction
Not saving secondaries in MC stack
No magnetic field/ -
C3 With TG4SteppingAction, TG4TrackingAction
Not saving secondaries in MC stack
Magnetic field 0 tesla / Uniform mag. Field 0.2 tesla
C4
slowest
With TG4SteppingAction, TG4TrackingAction
With saving secondaries in MC stack
Magnetic field 0 tesla / Uniform mag. Field 0.2 tesla
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
13
Virtual MC Performance test results
No mag. field Field 0.2 tesla
MC Time [s] Time [s]
G3 VMC 117 (0.60) 117 (0.60)
G4 native 193 (1.00) 1182 (6.13) vac
227 (1.18) air
G4 VMC c1 214 (1.11) 245 (1.27)
G4 VMC c2 240 (1.25) -
G4 VMC c3 292 (1.51) 272 (1.41)
G4 VMC c4 350 (1.81) 349 (1.81)
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
14
Virtual MC Performance test results
G3/G4:– 0.60– Cuts in G4
• Production treshold • Not tracking cut – particles are tracked till
stopping
G4 VMC / G4 native:– 1.25 in standard VMC application– 1.11 if no need to perform specials steps at
boundary, new track
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
15
Virtual MC Performance test results
No field/ Mag. Field:– G3: 1.0– G4 native: 6.13 !!
• If vacuum changed to air: 1.18 – G4 VMC: 1.27
• In low density materials G4 VMC defines automatically limited step
• In G4 user can customize accuracy parameters of magnetic field – not yet passed to Geant4 VMC
Saving secondaries in MC Stack (c4/c3):– 1.29
• Now optional – can be switched off if not needed
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
16
Virtual MC New users
OPERA – Neutrino oscillations, international collaboration
CBM – Nucleus-nucleus collision program at the future
accelerator facility, GSI, Darmstadt– Considering of building simulation based on VMC
Proposal by CBM– Meetings of VMC users with VMC developers per ~ 3
months
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
17
Virtual MC
New users (requirements)
Need/Would like to have– User defined particles, ions
• Gspart in TGeant3 has to be revised• Ions as primary particles
– Customisable G4 VMC physics list• Available already now, but requires to add
infrastructure and documentation– More documentation
• eg. on mapping G4 physics processes to TMCProcess
– G4 visualisation (Open Inventor driver)– Root geometry modeller -> VMC
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
18
Virtual MC New users (contribution)
Have done– Geant4 VMC HTML source code documentation
• Available at: http://www-linux.gsi.de/~gsisim/geant4_vmc
• By D. Bertini, GSI, using Doxygen– To be linked/included at VMC Web
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
19
RootToG4 Convertor
Convertor from Root TGeo geometry to Geant4 geometry
Independent from Geant4 VMC– Usable also for native Geant4 application
Will be used by Geant4 VMC – To support the new way of defining geometry with
direct usage of TGeo in a user VMC application In development, already operational
– Geometries from examples gexam1, gexam3, gexam4 have been successfully converted
Not yet available from VMC site
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
20
RootToG4 Convertor
Present Status
Supported– Shapes, Volumes, Positions, Materials, Divisions
• TArb8 not supported by Geant4• Divisions temporarily implemented as multiple
G4PVPlacement (to be revised when G4Divison is available)
To be done– Medias (using G3toG4), Boolean shapes
Not to be supported– Overlapping volumes (not supported by Geant4)
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
21
RootToG4 Convertor
g2root roottog4 g4toxmlGeant3 -> Root TGeo -> Geant4 -> GraXML
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
22
Geant4 5.0
Release 5.0 – 13 Dec 2003– Patch01 – 25 Feb 2003– Geant4-05-00-beta-02
From Release notes:– First release of the cascade part of the HETC re-write– First release of the binary-cascade (kinetic) model– First implementation of HepMC interfaces– Implementation of abstract layer for persistency;
removed ODBMS specific implementations and setup• Example for use of Root: examples/extended/persistency/PersEx01
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
23
Geant4 5.0
From Release notes (cont):– Compilation of g3tog4 optional (G4USE_G3TOG4)
• Has to be set by Geant4 VMC users– New G4Exception scheme based on severity level– G4RunManager: introduced ResetNavigator() method
(could be useful for Flugg ?) – …
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
24
Geant4 5.0
J.P.Wellish, GSI, Feb 2003
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
25
J.P.Wellish, GSI, Feb 2003
I. Hrivnacova ALICE Offline Meeting, CERN, 4 March 2003
26
J.P.Wellish, GSI, Feb 2003