33
G4MC, A Geant4 Simulation Program for Hall A and C Jixie Zhang Hall A & C Data Analysis Workshop June 2017

G4MC, A Geant4 Simulation Program for Hall A and C

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: G4MC, A Geant4 Simulation Program for Hall A and C

G4MC, A Geant4 Simulation Program for Hall A and C

Jixie Zhang

Hall A & C Data Analysis Workshop

June 2017

Page 2: G4MC, A Geant4 Simulation Program for Hall A and C

Introduction • G4MC is a Geant4 program developed to simulate the physics for HRS,

especially for the G2P and GEP experiments. It was designed to support all other HRS experiments from the very beginning (Cf. Jixie’s talk at 2012 and 2013 analysis workshop) .

• G4MC is an upgrade version of G4MC. BigBite, HAND, SBS, HMS, NPS,LAC, RTPC detector and pure photon source equipment are added. All geometry are based on configuration files.

• Fields: g2p chicane fields, target field, septum fields, BigBite field. HRS QQDQ fields are not included. HMS QQQD fields not include neither.

• For HRS, the transportation package came from the SNAKE and MUDIFI.

• For HMS, no transportation package yet. Will not be difficult to add.

• Will not be difficult to support SHMS.

Jixie Zhang Analysis Workshop, June 2017 2

Page 3: G4MC, A Geant4 Simulation Program for Hall A and C

The UVA Polarized Target

The UVA polarized target was used in G2P|GEP.

Both Hall-C coil and Hall-B coil available, with field maps.

This target will also be used for several future experiment, for instance, polarized WACS, TCS, b1, b2 experiments and some future SoLID experiments.

Jixie Zhang Analysis Workshop, June 2017 3

Page 4: G4MC, A Geant4 Simulation Program for Hall A and C

G2P|GEP Geometries

G2P|GEP Geometries include the following: chicane magnet, target platform, scattering chamber, target coil, target nose and the target itself, local dump, sieve slits, septum magnet, plastic shielding blocks, 3rd arm.

Jixie Zhang Analysis Workshop, June 2017 4

Page 5: G4MC, A Geant4 Simulation Program for Hall A and C

BigBite and HAND Geometries

OLD BigBite and HAND geometries, good for E08-005, with magnetic field.

Jixie Zhang Analysis Workshop, June 2017 5

Page 6: G4MC, A Geant4 Simulation Program for Hall A and C

RTPC Geometries

6 GeV BoNuS (E03-012) RTPC, 12 GeV BoNuS (E12-06-113) RTPC, TDIS (E12-15-006) RTPC are all available.

Can change the following in the configuration files:

detector length, target pressure, target temprature, target straw thickness, drift region start radius and end radias, Mylar foil thickness, gem foil thickness and location ...

With CLAS6-DVCS field or UVA solenoid field or CLAS12 solenoid field.

Jixie Zhang Analysis Workshop, June 2017 6

40 cm length version

Page 7: G4MC, A Geant4 Simulation Program for Hall A and C

TDIS (E12-15-006): RTPC + SBS

RTPC using UVA solenoid

Jixie Zhang Analysis Workshop, June 2017 7

RTPC using DVCS solenoid

SuperBigBite magnet block added, not cut for the beam pipe yet. Field included. Neither the copper coil nor the detector geometries were built.

Page 8: G4MC, A Geant4 Simulation Program for Hall A and C

WACS(E12-14-006): UVA Target + HMS + NPS

Jixie Zhang Analysis Workshop, June 2017 8

HMS QQQD magnet block added, but no field map yet. No detectors

(a picture for WACS program)

A plane for NPS

Collimator

Page 9: G4MC, A Geant4 Simulation Program for Hall A and C

WACS: UVA Target + SBS + LAC|NPS

Jixie Zhang Analysis Workshop, June 2017 9

SBS magnet block added, magnetic field also ready. No detectors

(for WACS program) A plane for NPS

Page 10: G4MC, A Geant4 Simulation Program for Hall A and C

How to Add New Geometries Different experiments usually vary from geometries on the target platform.

Each target or detector is hard coded, associated with a configuration file to turn each individual component on or off.

Jixie Zhang Analysis Workshop, June 2017 10

CREX target + G2P septum

G4MC can support any new experiment by adding a new geometry class.

All sensitive detectors share a standard hit processing but vary in Sensitive Detector ID. All hits will be recorded automatically.

Detector.ini

G2P Detector_G2P.ini

CREX Detector_CREX.ini

XXX, Future Exp Detector_XXX.ini

RTPC Detector_RTPC.ini

SBS Detector_SBS.ini

HMS Detector_HMS.ini

LERD Detector_LERD.ini

Page 11: G4MC, A Geant4 Simulation Program for Hall A and C

HRS Transportation • HRS transportation function usually come from SNAKE and MUDIFI.

• Always fitting from target plane to focal plane.

• There will be 8 -10 end planes along the trajectory to make sure that the particle do not hit the magnet blocks.

• Currently the following SNAKE models are ready to use: – Standard HRS, 12.5 degrees, NO septum

– Two models of 6 degrees HRS with septum for E97-110. One is for larger X0 and the other is for normal X0

– Several models of 5.65 degrees HRS with septum and 3 cm circular raster for G2P|GEP, varying in the active septum coils in the right septum: 48-48-16 No Shims, 48-48-16, 40-32-16 and 40-00-16

– Can add your SANKE models too …

• Usually need to make correction in focal plane in order to match real data

• Alternate method: use optics calibration result, generate data from focal plane to target, then run MUDIFI to fit a forward transportation function. this will guarantee to match the real data!

Jixie Zhang Analysis Workshop, June 2017 11

Page 12: G4MC, A Geant4 Simulation Program for Hall A and C

What make G4MC different from others?

Jixie Zhang Analysis Workshop, June 2017 12

Page 13: G4MC, A Geant4 Simulation Program for Hall A and C

Advance Features of G4MC

• Flexible command line, (customize HRSUsage.ini)

• Flexible physics models

• Powerful field interpreter

• Powerful event generator: BdL, Elas, QuasiElas, RootNtuple, RootHisto, Compton, Two-body ...

• Flexible Virtual Detector configured by input file. One can study the acceptance of a future detector without modifying the source code

• Fast option

• XS models: elastic inelastic (QFS, EPC, Peter Bosted and wiser).

• Various SNAKE models, can easily add new ones

• HRS event can be reconstructed by both SNAKE backward and REAL optics matrix

Jixie Zhang Analysis Workshop, June 2017 13

Page 14: G4MC, A Geant4 Simulation Program for Hall A and C

Flexible Command Line

• G4MC can take more than 30 options in the command line, each option will have compulsory arguments and|or optional arguments. Each argument has a default value. The usage looks like:

G4MC -option1 <argu1(0)> [argu2(0)] ... [argu9(0)] \

-option2 <argu1(0)> [argu2(0)] ... –optionN

G4MC -help : Get whole help menu

G4MC -option1 help : Get help menu only for option1

• For an option, the key, the argument name, the data type and the default values and the explaination message are all defined in ‘HRSUsage.ini’.

• One can customize‘HRSUsage.ini’ with his own preferred values to make the command line short!

Jixie Zhang Analysis Workshop, June 2017 14

Page 15: G4MC, A Geant4 Simulation Program for Hall A and C

Geant4 Physics Modules • The following models are available (default is QGSP_BERT):

FTFP_BERT, FTFP_BERT_EMV, FTFP_BERT_EMX, FTF_BIC, LHEP, LHEP_EMV, QBBC, QGS_BIC, QGSC_BERT, QGSP, QGSP_BERT, QGSP_BERT_EMV, QGSP_BIC_EMY,

QGSP_BERT_EMX, QGSP_BERT_HP, QGSP_BIC, QGSP_BIC_HP

For detials of these model, please refer to

http://geant4.cern.ch/support/proc_mod_catalog/physics_lists/referencePL.shtml

• Jixie’s personal Models:

QGSP_BERT, QGSP_BERT_HP,QGSP_BIC, QGSP_BIC_HP, HRSHadronPhysics

User-Step-Limit will be invoked for e-, pr, alpha, D2 and He3 only in model HRSHadronPhysics, allowing various step length in the target nose, scattering chamber, in FZ magnets and the rest of the hall.

• Switch physics models in command line:

G4MC –physicsmodel <PhysicsModel(QGSP_BERT)> [UseJixieModel(0)] [TargetStepLimit(5)] \

[ScatChamberStepLimit(10)] [BStepLimit(500)] [FZBStepLimit(100)]

Jixie Zhang Analysis Workshop, June 2017 15

Include Neutrons, _HP means high precision, covers neutrons below 20 MeV

Page 16: G4MC, A Geant4 Simulation Program for Hall A and C

Cross Section Models • Elastics Cross Section Models are available

Have dedicated elastics cross section model for H, 3He, 4He, N, C (K. Stansfield’s and C. Larry’s model) and Ta, will use K. Stansfield’s fit for any other elements. See Phys. Rev. C, 3(1971)1448 for details.

• Inelastic Models: – Peter Bosted, with or without radiation correction

– QFS, with or without radiation correction

– EPC

– Wiser

• Real Compton Scattering: – Gerale Miller

• Deuteron Wave Function: – PARIS Model

Command line: G4MC -CalculateXS [CalculateXS(1)]

Jixie Zhang Analysis Workshop, June 2017 16

Page 17: G4MC, A Geant4 Simulation Program for Hall A and C

Fast Option of G4MC

• Geant4 full simulation usually runs very slow. But it can run faster if you understand how it executes your order.....

• Some possible actions which can make it run faster: – Use an efficient event generator

– Disable or minimize verbose (screen printing) using my building command

– Kill all secondaries if possible

– Shrink the size of the hall (configure Detector.ini)

– Place absorber (track got killed whenever it hit this object) in anywhere you wish to stop particles

– Turn off detector resonponse if possible, and do not not store all trajectories into the ntuple

– Cancel some event actions if possible, for example -CalculateXS 0

• The detail usage for option '-FAST' or '-fast' is: G4MC -fast [NoSecondary(1)] [NoDetectorResponse(0)] [StoreSecondary(2)] [StoreTrajectory(0)]

-CalculateXS [CalculateXS(1)]

Jixie Zhang Analysis Workshop, June 2017 17

Page 18: G4MC, A Geant4 Simulation Program for Hall A and C

Event Generators|Engines

• Candidates are: Uniform, HRSElasEl, HRSElasNucleus, HRSQuasiElasEl, HRSQuasiElasNucleon, BonusProton, FastProton, RootHisto, RootNtuple, Compton and BdL. – RootNtuple: Read the given ntuple file, which is the output of G4MC, use the vertex and momentum

– RootHisto: Read the given root file, which is also the output of G4MC, based on the histogram

distribution to throw position and momentum.

Specify event engine in command line using ‘-engine’ and ‘-mcin#’:

G4MC -engine <PrimaryEngine1(Uniform)> [PrimaryEngine2(Uniform)]...[PrimaryEngine8(Uniform)] \

-mcin1 <InRootFileName1(InRootFile0.root)> <InRootTreeName1(track0)> [TrigNum1(0)] \[SkipNum1(0)] \

... \

-mcin8 <InRootFileName8(InRootFile7.root)> <InRootTreeName8(track0)> [TrigNum8(0)] [SkipNum8(0)]

Example:

G4MC -engine HRSElasEl HRSElasNucleus

G4MC -engine RootNtuple -micn1 infile.root track0 1000 10

G4MC -engine RootNtuple RootNtuple -micn1 infile.root track0 -micn2 infile.root track1

Jixie Zhang Analysis Workshop, June 2017 18

Page 19: G4MC, A Geant4 Simulation Program for Hall A and C

Visulization Plugin(1)

Jixie Zhang Analysis Workshop, June 2017 19

Original for GEMC (Credit to Maurizio Ungaro) I modified it as a plugin of Geant4 Program, you can use it in your project too It allows you to manupulate the camera view or detector view Some features are dedicated for CLAS12, will be clean out in future Only support Qt4.

Page 20: G4MC, A Geant4 Simulation Program for Hall A and C

Visulization Plugin (2)

Jixie Zhang Analysis Workshop, June 2017 20

Sensortive Detector

Invisable

Expand the list of daughters

This widget allows to change the shape, position, rotation and visulization of a logical volumn Very cool for debugging ...

Page 21: G4MC, A Geant4 Simulation Program for Hall A and C

Visulization Plugin (3)

Jixie Zhang Analysis Workshop, June 2017 21

Page 22: G4MC, A Geant4 Simulation Program for Hall A and C

Output • Verbose (screen output): verbose can be turned on or off using internal

command, which can also be written into a macro files.

• Output files: 2 types of output are available: ascii file, root ntuple. Can be turn on|off in ‘Detector.ini’.

For the ascii and verbose output, one can choose the following: A. Keep everything

B. keep steps only in the given physical volumes: /stepping/add2PrintList

C. keep only one track in each event: /tracking/thisTrackOnly

D. keep only tracks of the given particle: /tracking/particleOnly

• What is in the ntuple? 1. Some 1-D or 2-D distribution histogram of the thrown vertex and momentum. Can be use as monitor histogram

and as the input for event generator ‘RootHisto’

2. Tree “config”: record important configuration parameters. Only one event is filled.

3. Tree “track#”, where # is 0,1,2...7: contains the vertex plane, target plane, sieve plane, focal plane variables and also the following variable at each step along the particle trajectory: X,Y,Z,L,TL,Ekin,dE,Dsty,Radlen,Bx,By,Bz

4. Tree “D”: contains trojectories of all particles and also the detector hit vaiables like: ParicleId,TarckId,ParentTrackId,SD_Id,T(time),X,Y,Z,Edep,Edep_daughter,P,theta,Phi,Pout

See details in file HRS_nt_structure.txt

Jixie Zhang Analysis Workshop, June 2017 22

Page 23: G4MC, A Geant4 Simulation Program for Hall A and C

Documentation • Source code is available in SVN:

https://jlabsvn.jlab.org/svnroot/halla/groups/g2p/G4MC/

Also in github: https://github.com/jixie/g4mc

• Instruction for Geant4 installation, environment setup and update history are available.

• Usage manual will be printed by typing these commands:

G4MC -h, G4MC --h, G4MC -help, G4MC --help

Usage: G4MC [option1 argument_list] [...] [optionN argument_list]

To get the detail usage of an option, just type 'help' after it. For example: G4MC -physicsmodel help

• Description for internal commands (html format) are already: https://jlabsvn.jlab.org/svnroot/halla/groups/g2p/HRSMC/Menu/

• Output root ntuple structure description is ready here: https://jlabsvn.jlab.org/svnroot/halla/groups/g2p/G4MC/HRS_nt_structure.txt

• A lot of macro files and root scripts are available: https://jlabsvn.jlab.org/svnroot/halla/groups/g2p/G4MC/macros

Jixie Zhang Analysis Workshop, June 2017 23

Page 24: G4MC, A Geant4 Simulation Program for Hall A and C

Resolution of G4MC Using SNAKE Model 484816+shim, No Target Field

Jixie Zhang Analysis Workshop, June 2017 24

Raster=2.4cm, BPM resolution: 1 mm in vertical, No target field

Page 25: G4MC, A Geant4 Simulation Program for Hall A and C

Resolution of G4MC Using SNAKE Model 484816+shim, Stop at Target Plane,5T

Jixie Zhang Analysis Workshop, June 2017 25

Raster=2.4cm, BPM resolution: 1 mm in vertical, 5.0 T target field Reconstructed to the target center

Page 26: G4MC, A Geant4 Simulation Program for Hall A and C

Conclusion

• G4MC is an extension of HRSMC. It was originally designed for G2P and GEP experiments, but be expanded to many experiments now.

• SBS, BB, HMS, HAND and RTPC LAC, and NPS are ready to use. It can be easily modified to support other experiments by adding new geometry class.

• G4MC does not include detector digitization.

• It is a perfect program to prepare experiment.

• For your HRS, or HMS, or SHMS experiment, your dedicated transportation package should be expected.

• Disadvantages: – Too many configuration files, hard for c++ beginner to handle.

– Scarify speed in order to able to run various detectors.

– Lost support of transportation package.

• Do not support Geant4 10.X version yet. Will work on it soon.

Jixie Zhang Analysis Workshop, June 2017 26

Page 27: G4MC, A Geant4 Simulation Program for Hall A and C

Back up

Jixie Zhang Analysis Workshop, June 2017 27

Page 28: G4MC, A Geant4 Simulation Program for Hall A and C

Input Files

• Compulsory input files:

Detector.ini: specify hall size, pivot, scattering chamber , target location, HRS angle. Also

specify which experiment geometry will be turned on.

Detector_G2P.ini: Specify how to build G2P geometries

Detector_CREX.ini: Specify how to build CREX geometries

Detector_XXX.ini: can be add for any future experiment

HRSUsage.ini: interpret the command line arguments and provide the usage menu. All

default values for the command line arguments are written in‘HRSUsage.ini’. One can customize them in this file to avoid typing long command.

BField_Helm.ini, BField_Septum.ini BField_*.ini: specify the rotation, position

and current ratio...etc.

Field maps: g2p_hallbfield.dat g2p_septumfield_484816.dat ...

• Macro files: contains a series of Geant4 commands that one want the program to execute. A lot of files can be found in directory named ‘macros’

Jixie Zhang Analysis Workshop, June 2017 28

Page 29: G4MC, A Geant4 Simulation Program for Hall A and C

Vertex Position Generator

• Uniform, support circular, rectangular and elipse shape of rasters. /mydet/rasterMode mode, where mode could be 1=circular, 2=rectangular and

3=elipse

/mydet/gunRHigh Rout unit, (will be the vertical half width if using rectangular raster)

/mydet/gunRLow Rin unit, (will be the horizontal half width if using rectangular raster)

• Straight beam line with a tilted angle: go through a given point with given slopes:

/mydet/fixedPointBL3V x0 y0 z0 unit

/mydet/slopeBL3V dxdz dydz z

• Fixed location /mydet/position3V x y z

Jixie Zhang Analysis Workshop, June 2017 29

Page 30: G4MC, A Geant4 Simulation Program for Hall A and C

Momentum Generator Engine(1)

• Uniform: – In HCS: Specify the lower and upper limits of Ptot, Theta, and Phi, it will throw

them in flat distribution in Hall Coordinate System

– In TCS: Specify the lower and upper limits of Ptot, in-plane-angle(Theta) and out-plane-anlge(Phi), it will throw them in flat distribution in the Transport Coordinate System

• Gaussian: – Specify the mean value of Ptot,Theta and Phi, also given their standard deviations

(sigmas), it will thrown them in gaussian distribution in HCS

• BdL: – When target field is on, integrate the BdL from the vertex to 1 meter away from

the target. Then throw Ptot, based on the BdL to determine the lower and upper limits of the in-plane-angle(Theta) and out-plane-anlge(Phi). Finally throw these 2 angles in TCS.

Jixie Zhang Analysis Workshop, June 2017 30

Page 31: G4MC, A Geant4 Simulation Program for Hall A and C

Momentum Generator Engine(2)

• HRSElasEl(e-N or e-P): – Throw the Theta and Phi angle Uniformly, then base on the beam energy and the

target mass to calculate the elatic scattering momentum for the scattered electron

• HRSElasNucleus (e-N): – Throw the Theta and Phi angle Uniformly, then base on the beam energy and the

target mass to calculate the elatic scattering momentum for the scattered electron

– If shooting both e (1st track)and N (2nd track), it will throw the Theta_el and Phi_el angles Uniformly for the electron, then determine the Ptot_el and Ptot_N, Theta_N, Phi_N

• HRSQuasiElasEl and HRSQuasiElasNucleus: – Similar to the elastic generator, but the target mass is proton mass (hard coded)

Jixie Zhang Analysis Workshop, June 2017 31

Page 32: G4MC, A Geant4 Simulation Program for Hall A and C

Momentum Generator Engine(3)

• Compton: – Generated incident photon energy according to Bremsstrahlung cross section,

then throw theta and phi angle, based on theta to calculate outgoing energy

– Can couple other primary to this photon such that one can simulate gamma-proton Real Compton Scattering event under fixed electron beam energy, where the photon come from a radiator

(using P_pr = P_incidentPhoton – P_outgoingPhoton )

• Two-Body: – Couple one primary to another primary, using P_this = beam – P_coupleto to

calculate its momentum vector

• Deutron Wave Function: – Generate recoil proton following deuteron wave function, good for BoNuS and

pion structure function program

Jixie Zhang Analysis Workshop, June 2017 32

Page 33: G4MC, A Geant4 Simulation Program for Hall A and C

Transform Vaiables between Coordinate Systems: TCS and HCS

• TCS = Transport Coordinate System

• HCS = Hall Coordinate System

Jixie Zhang Analysis Workshop, June 2017 33 Curtsey to Chao Gu