Difference between revisions of "Running GSIM CLAS simulation"
From Hall A Wiki
Line 27: | Line 27: | ||
build_EG_cs | build_EG_cs | ||
− | (the result | + | (the result: an executable event generator e.g. '''EventGenerator_exe/EG_C.exe''') |
Line 37: | Line 37: | ||
./EG_C.exe > test.dat | ./EG_C.exe > test.dat | ||
− | (the result | + | (the result: a data file '''EventGenerator_exe/test.dat''') |
Line 54: | Line 54: | ||
./leptoroot.pl < test.dat > data.dat | ./leptoroot.pl < test.dat > data.dat | ||
− | (the result | + | (the result: a different (just numbers) data file '''LeptoRoot/data.dat''') |
* An executable is then used to write the data into a ROOT TTree | * An executable is then used to write the data into a ROOT TTree | ||
Line 60: | Line 60: | ||
./leptoroot | ./leptoroot | ||
− | (the result | + | (the result: a ROOT file '''LeptoRoot/data.root''' that will enable you to observe the generated distributions) |
+ | |||
Line 66: | Line 67: | ||
=== Converting generated data files to GEANT-3 format input === | === Converting generated data files to GEANT-3 format input === | ||
+ | * port the generated-events data file (in this example '''test.dat''') to the converters utility and convert it to txt format. | ||
+ | For example, a file from the 2H target would be converted by | ||
+ | |||
+ | cp $GSIM/Documents/EventGenerator_exe/test.dat $GSIM/converters | ||
+ | ./convert_deut < test.dat > convert_output.dat | ||
+ | |||
+ | (the result: a txt file '''/converters/convert_output.dat''' ) | ||
+ | |||
+ | * port and convert the txt file to a G3 part format corresponding to the MCTK bank (works better than particle bank in G3) | ||
+ | |||
+ | mv convert_output.dat ../Lepto64 | ||
+ | cd ../Lepto64 | ||
+ | ./txt2part -m -omctk.evt < convert_output.dat | ||
+ | |||
+ | (the result: a part file '''/Lepto64/mctk.evt''' suitable for GSIM) | ||
Revision as of 18:48, 2 March 2015
Contents
- 1 GSIM Inventory
- 2 Running GSIM
- 2.1 Setting an Event Generator and create events file
- 2.2 Converting generated data files to GEANT-3 format input
- 2.3 Running generated events through a CLASS GEANT-3 simulation
- 2.4 running GSIM with the generated events
- 2.5 Preprocessing to add smearing of the data
- 2.6 Look at the output files
- 2.7 Converting the GSIM output file to root
- 2.8 Observing the output ROOT TTree
GSIM Inventory
- GSIM directory is to be located on the farm, at a large enough work disk. An example of the simulation inventory can be found at
/work/halla/e07006/disk1/Erez/GSIM (will be used for the remainder of the documentation as $GSIM)
Running GSIM
Setting an Event Generator and create events file
- PYTHIA is used as the base-line event generator (EG) for GSIM
- The existing EG is a fortran script located under $GSIM/Documents/ directory.
Setting Event Generator
- The EG should be modified for the specific solid target. An example for 12C can be found at
$GSIM/Documents/EventGenerator/src/qp1C.f
- To build the event generator use the build compilation command, e.g.
cd $GSIM/Documents/ build_EG_cs
(the result: an executable event generator e.g. EventGenerator_exe/EG_C.exe)
Generate the Events
- Generate the events by executing the EG, e.g.
./EG_C.exe > test.dat
(the result: a data file EventGenerator_exe/test.dat)
Look at the generated distributions
- A utility for observing the generated data exist in the main EG directory $GSIM/Documents/EventGenerator/LeptoRoot
- Port the data file into the utility directory
cp $GSIM/Documents/EventGenerator_exe/test.dat $GSIM/Documents/LeptoRoot/
- A perl script is used to write it in the right format
./leptoroot.pl < test.dat > data.dat
(the result: a different (just numbers) data file LeptoRoot/data.dat)
- An executable is then used to write the data into a ROOT TTree
./leptoroot
(the result: a ROOT file LeptoRoot/data.root that will enable you to observe the generated distributions)
Converting generated data files to GEANT-3 format input
- port the generated-events data file (in this example test.dat) to the converters utility and convert it to txt format.
For example, a file from the 2H target would be converted by
cp $GSIM/Documents/EventGenerator_exe/test.dat $GSIM/converters ./convert_deut < test.dat > convert_output.dat
(the result: a txt file /converters/convert_output.dat )
- port and convert the txt file to a G3 part format corresponding to the MCTK bank (works better than particle bank in G3)
mv convert_output.dat ../Lepto64 cd ../Lepto64 ./txt2part -m -omctk.evt < convert_output.dat
(the result: a part file /Lepto64/mctk.evt suitable for GSIM)