Difference between revisions of "SoLID Software Detector Simulation"

From Hall A Wiki
Jump to: navigation, search
(full simulation)
(Link to new wiki)
 
(28 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
This page has been moved to [https://solid.jlab.org/wiki/index.php/Software_Detector_Simulation https://solid.jlab.org/wiki/index.php/Software_Detector_Simulation] in the new [https://solid.jlab.org/wiki SoLID Wiki].  Please do not edit this page.
 +
 
= Introduction =
 
= Introduction =
  
Line 9: Line 11:
 
The "set_solid" script is used to setup env
 
The "set_solid" script is used to setup env
  
= compile and run =
+
= general note (Please read this!) =
  
<pre>
+
''' [https://hallaweb.jlab.org/wiki/index.php/Detector_simulation_general_note general note] for geometry, materiel, mirror, hit processing, calling gemc as library with added functionally etc'''
'''a temp fix for GEMC 2.2'''
+
I have updated gemc 2.2 with some temporary fix here
+
(use some fine tuned field parameters, support linear interpolation for field map,fix a bug to run on farm)
+
https://jlabsvn.jlab.org/svnroot/solid/tmp/2.2/
+
If you are using JLAB_VERSION=1.2 , do the following to use the fix
+
***************************
+
source your setup script
+
cd $GEMC/../
+
mv 2.2 2.2_old
+
svn co https://jlabsvn.jlab.org/svnroot/solid/tmp/2.2
+
cd 2.2/source
+
scons OPT=1 LIBRARY=shared
+
***************************
+
The temp fix will merge into the main GEMC release soon, stay tuned.
+
</pre>
+
  
Once you complete the setup procedure, you can now compile "solid_gemc"
+
= Setup plot =
  
source your set_solid if you haven't done so
+
They are stored here
cd $SoLID_GEMC/source/$GEMC_VERSION
+
scons OPT=1
+
(you need to recompile every time GEMC gets updated)
+
+
after compiling, do the following to run it
+
  
cd $SoLID_GEMC/script
+
http://hallaweb.jlab.org/12GeV/SoLID/download/sim/setup/
solid_gemc solid_PVDIS_LD2.gcard or solid_gemc solid_PVDIS_simple.gcard
+
solid_gemc solid_SIDIS_He3.gcard or solid_gemc solid_SIDIS_He3_simple.gcard or solid_gemc solid_SIDIS_He3_full.gcard
+
solid_gemc solid_SIDIS_NH3.gcard or  solid_gemc solid_SIDIS_NH3_simple.gcard
+
(you should go to a clean terminal and source your set_solid again if somehow solid_gemc binary is not found in default PATH)
+
  
= general note =
+
sort by "Last modified" to see latest
  
solid_gemc only adds hit process routine to generic gemc, so general GEMC things still apply
+
= compile and run =
  
'''Please read this [https://eic.jlab.org/wiki/index.php/Detector_simulation_general_note general note] for geometry, materiel, mirror, hit processing etc '''
+
Once you complete the setup procedure, you can now compile "solid_gemc"
  
= field map =
+
source your set_solid if you haven't done so
 +
cd $SoLID_GEMC/source/$GEMC_VERSION
 +
scons OPT=1
 +
(then go to a clean terminal and source your set_solid so that "solid_gemc" can found in default PATH)
 +
solid_gemc    (a empty graphic window with simulation setup should show up and confirm it's working, then you can move on full or subsystem simulation)
  
https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/field/
+
= full simulation =
  
solenoid_CLEOv8.dat (the field map for solenoid CLEOv8 design)
+
All subsystems have their own "production" version directories "ec,hgc,lgc,gem,mrpc,spd,magnet,baffle,target,beamline,absorber" at
  solenoid_CLEOv8_Bz.dat (Bz field only, Br is 0)
+
"https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/geometry/"
  Bz1.4T.dat (uniform Bz field , close to the peak value of CLASv8)
+
 
  solenoid_ptarget.dat (polarized proton 5T target field)
+
Run full SoLID simulation in graphic mode with all subsystems together by
 +
  source your set_solid
 +
  cd $SoLID_GEMC/script
 +
  solid_gemc solid_PVDIS_LD2_full.gcard
 +
solid_gemc solid_SIDIS_He3_full.gcard
 +
  solid_gemc solid_SIDIS_NH3_full.gcard
 +
solid_gemc solid_JPsi_LH2_full.gcard
  
 
= subsystem simulation =
 
= subsystem simulation =
Line 65: Line 53:
  
 
They are considered "devel" version and located in their individual directories and person responsible as below  
 
They are considered "devel" version and located in their individual directories and person responsible as below  
 
+
         
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/ec/ec_solid_gemc                (Rakitha,Vince?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/ec/ec_segmented_solid_gemc and https://jlabsvn.jlab.org/svnroot/solid/subsystem/ec/analysis/readme   
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/hgc/hgc_solid_gemc               (Zhiwen)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/hgc/hgc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/hgc/analysis/readme   
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/lgc/lgc_solid_gemc               (Michael)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/lgc/lgc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/lgc/analysis/readme                             
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/gem_solid_gemc              (Rich?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/gem_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/analysis/readme                
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/mrpc/mrpc_solid_gemc             (Zhihong?, Xinzhan?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/mrpc/mrpc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/mrpc/analysis/readme               
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/spd/spd_solid_gemc               (XinZhan)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/spd/spd_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/spd/analysis/readme   
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/magnet/magnet_solid_gemc        (Zhiwen?)
+
https://jlabsvn.jlab.org/svnroot/solid/subsystem/target/target_solid_gemc                         
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/baffle/baffle_solid_gemc        (Rich?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/magnet/magnet_solid_gemc         
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/target/target_solid_gemc        (Zhiwen?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/baffle/baffle_solid_gemc         
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/beamline/beamline_solid_gemc    (Zhiwen?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/target/target_solid_gemc         
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/absorber/absorber_solid_gemc    (Lorenzo?)
+
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/beamline/beamline_solid_gemc     
 +
  https://jlabsvn.jlab.org/svnroot/solid/subsystem/absorber/absorber_solid_gemc     
  
 
These directories should be kept clean so it only has files necessary for simulation, and ready to copy into the "production" area to be used with other subsystems
 
These directories should be kept clean so it only has files necessary for simulation, and ready to copy into the "production" area to be used with other subsystems
Line 83: Line 72:
  
 
Please refer to "hgc_solid_gemc" and "hgc" as an example
 
Please refer to "hgc_solid_gemc" and "hgc" as an example
 
= full simulation =
 
 
All subsystems have their own "production" version directories "ec,hgc,lgc,gem,mrpc,spd,magnet,baffle,target,beamline,absorber" at
 
"https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/geometry/"
 
 
Run full SoLID simulation with all subsystems together by
 
source your set_solid
 
cd $SoLID_GEMC/script
 
solid_gemc $SoLID_GEMC/script/solid_SIDIS_He3_full.gcard
 
solid_gemc $SoLID_GEMC/script/solid_PVDIS_LD2_full.gcard
 
solid_gemc $SoLID_GEMC/script/solid_JPsi_LH2_full.gcard
 
solid_gemc $SoLID_GEMC/script/solid_DDVCS_LH2_full.gcard
 
  
 
Once you think your subsystem devel version is ready, before making it a production version, be sure to test it with full simulation, meaning it has no conflict with any other production subsystem.  
 
Once you think your subsystem devel version is ready, before making it a production version, be sure to test it with full simulation, meaning it has no conflict with any other production subsystem.  
  
Modify "$SoLID_GEMC/geometry/solid_SIDIS_He3_full" or "$SoLID_GEMC/geometry/solid_PVDIS_LD2_full" (generating geometry,hit,bank) and "$SoLID_GEMC/script/solid_SIDIS_He3_full.gcard" or "$SoLID_GEMC/script/solid_PVDIS_LD2_full.gcard" to mix your devel version system and other production subsystems to test
+
copy, paste and modify "$SoLID_GEMC/script/solid_*_full.gcard" to mix your devel version system and other production subsystems to test
  
 
After verify no conflict, you may release it as production version by copying ONLY necessary files like all perl script and txt files without any change into its production directory.
 
After verify no conflict, you may release it as production version by copying ONLY necessary files like all perl script and txt files without any change into its production directory.
  
= analysis result =
+
= analyzing result =
 +
 
 +
== example ==
  
 
The root tree output can be analysis by some very simple scripts here
 
The root tree output can be analysis by some very simple scripts here
 
https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/analysis/
 
https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/analysis/
  
= study =
+
== header tree and generated tree ==
  
[[Solid_acceptance]]
+
header tree and generated tree are direct passing through from input, either particle gun or lund file produced by a generator, referring to [https://eic.jlab.org/wiki/index.php/Detector_simulation_general_note#input]
  
The study section (https://jlabsvn.jlab.org/svnroot/solid/study/) has many coding using software tools to do various study
+
For generator used for SoLID, "eicRate" and "halld" both use header defined here https://hallaweb.jlab.org/wiki/index.php/Solid_eventgenerator#Output_file
 +
 
 +
== flux tree ==
 +
 
 +
detector ID for flux hit processing
 +
 
 +
We use built-in flux hit processing for virtual planes near to real detectors to record particles entering or leaving real detectors
 +
 
 +
Each virtual plane has a unique id to identify it  and it appears in the "id" branch of "flux" tree
 +
 
 +
Its ID is defined by 7 digits integer like "abcdefg"
 +
a: detector
 +
    GEM 1, CC 2, EC 3, MRPC 4, SPD 5, muon 6
 +
b: sub-detector
 +
    GEM 1 - 6 layer, LGCC 1, HGCC 2, FAEC 1, LAEC 2, MRPC 1, FASPD 1, LASPD 2, muon forward 1, muon endcap donut 2,muon barrel 3
 +
c: subsub-detector
 +
    GEM 1, CC 1 front, MRPC 1 front,SPD 1 front,EC 1 front 4 rear
 +
d,e,f,g: not used for now
 +
for example, 3110000 is for forward angle EC front plane
 +
see code example here https://jlabsvn.jlab.org/svnroot/solid/study/background/background.C
 +
 
 +
= field map =
 +
 
 +
https://github.com/JeffersonLab/solid_gemc/blob/master/field/readme
  
 
= old way to run simulation, mainly for background study =
 
= old way to run simulation, mainly for background study =
Line 140: Line 141:
 
  ./solid_material.pl config_solid_SIDIS_NH3_simple.dat
 
  ./solid_material.pl config_solid_SIDIS_NH3_simple.dat
 
  ./solid_material.pl config_solid_SIDIS_NH3.dat
 
  ./solid_material.pl config_solid_SIDIS_NH3.dat
 
== hit processing ==
 
 
refer to general note
 
 
see examples under https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/source and https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/gem_solid_gemc/
 
 
detector ID for flux bank
 
 
Its ID is defined by 7 digits integer like "abcdefg"
 
a: detector type
 
    GEM 1, CC 2, EC 3, MRPC 4, SPD 5, muon 6
 
b: detector assembly
 
    GEM 1 - 6 layer, LGCC 1, HGCC 2, FAEC 1, LAEC 2, MRPC 1, FASPD 1, LASPD 2, muon forward 1, muon endcap donut 2,muon barrel 3
 
c: sub detector
 
    GEM not used, CC 0 PMT 1 front, MRPC 0 inside 1 front, EC 1 front 2 middle 3 inner 4 rear
 
d,e,f,g: not used for now
 
for example, 3110000 is for forward angle EC front plane
 
see code example here https://jlabsvn.jlab.org/svnroot/solid/study/background/background.C
 

Latest revision as of 15:38, 7 December 2020

This page has been moved to https://solid.jlab.org/wiki/index.php/Software_Detector_Simulation in the new SoLID Wiki. Please do not edit this page.

Introduction

SoLID detector simulation program "solid_gemc" is based on "GEMC 2.x" with additional hit process routine and outputs for all detector systems in SoLID.

It's located SoLID repository https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2 with source codes and detector configuration, field, scripts etc.

You need both the jlab framework and SoLID repository before you can compile and run solid_gemc, refer to the quick start section

The "set_solid" script is used to setup env

general note (Please read this!)

general note for geometry, materiel, mirror, hit processing, calling gemc as library with added functionally etc

Setup plot

They are stored here

http://hallaweb.jlab.org/12GeV/SoLID/download/sim/setup/

sort by "Last modified" to see latest

compile and run

Once you complete the setup procedure, you can now compile "solid_gemc"

source your set_solid if you haven't done so
cd $SoLID_GEMC/source/$GEMC_VERSION
scons OPT=1
(then go to a clean terminal and source your set_solid so that "solid_gemc" can found in default PATH)
solid_gemc    (a empty graphic window with simulation setup should show up and confirm it's working, then you can move on full or subsystem simulation)

full simulation

All subsystems have their own "production" version directories "ec,hgc,lgc,gem,mrpc,spd,magnet,baffle,target,beamline,absorber" at "https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/geometry/"

Run full SoLID simulation in graphic mode with all subsystems together by

source your set_solid
cd $SoLID_GEMC/script
solid_gemc solid_PVDIS_LD2_full.gcard
solid_gemc solid_SIDIS_He3_full.gcard
solid_gemc solid_SIDIS_NH3_full.gcard
solid_gemc solid_JPsi_LH2_full.gcard

subsystem simulation

"solid_gemc" can be used for individual sub-detector systems and the whole detector simulation.

Each of sub-detector systems can do simulation independently and ready to merge it back into the whole system simulation.

They are considered "devel" version and located in their individual directories and person responsible as below

https://jlabsvn.jlab.org/svnroot/solid/subsystem/ec/ec_segmented_solid_gemc and https://jlabsvn.jlab.org/svnroot/solid/subsystem/ec/analysis/readme    
https://jlabsvn.jlab.org/svnroot/solid/subsystem/hgc/hgc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/hgc/analysis/readme    
https://jlabsvn.jlab.org/svnroot/solid/subsystem/lgc/lgc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/lgc/analysis/readme                              
https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/gem_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/gem/analysis/readme               
https://jlabsvn.jlab.org/svnroot/solid/subsystem/mrpc/mrpc_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/mrpc/analysis/readme                 
https://jlabsvn.jlab.org/svnroot/solid/subsystem/spd/spd_solid_gemc and  https://jlabsvn.jlab.org/svnroot/solid/subsystem/spd/analysis/readme     
https://jlabsvn.jlab.org/svnroot/solid/subsystem/target/target_solid_gemc                          
https://jlabsvn.jlab.org/svnroot/solid/subsystem/magnet/magnet_solid_gemc         
https://jlabsvn.jlab.org/svnroot/solid/subsystem/baffle/baffle_solid_gemc         
https://jlabsvn.jlab.org/svnroot/solid/subsystem/target/target_solid_gemc         
https://jlabsvn.jlab.org/svnroot/solid/subsystem/beamline/beamline_solid_gemc     
https://jlabsvn.jlab.org/svnroot/solid/subsystem/absorber/absorber_solid_gemc     

These directories should be kept clean so it only has files necessary for simulation, and ready to copy into the "production" area to be used with other subsystems

For all other files, please put them into other directories under the same subsystems.

Please refer to "hgc_solid_gemc" and "hgc" as an example

Once you think your subsystem devel version is ready, before making it a production version, be sure to test it with full simulation, meaning it has no conflict with any other production subsystem.

copy, paste and modify "$SoLID_GEMC/script/solid_*_full.gcard" to mix your devel version system and other production subsystems to test

After verify no conflict, you may release it as production version by copying ONLY necessary files like all perl script and txt files without any change into its production directory.

analyzing result

example

The root tree output can be analysis by some very simple scripts here https://jlabsvn.jlab.org/svnroot/solid/solid_gemc2/analysis/

header tree and generated tree

header tree and generated tree are direct passing through from input, either particle gun or lund file produced by a generator, referring to [1]

For generator used for SoLID, "eicRate" and "halld" both use header defined here https://hallaweb.jlab.org/wiki/index.php/Solid_eventgenerator#Output_file

flux tree

detector ID for flux hit processing

We use built-in flux hit processing for virtual planes near to real detectors to record particles entering or leaving real detectors

Each virtual plane has a unique id to identify it and it appears in the "id" branch of "flux" tree

Its ID is defined by 7 digits integer like "abcdefg"
a: detector
   GEM 1, CC 2, EC 3, MRPC 4, SPD 5, muon 6
b: sub-detector
   GEM 1 - 6 layer, LGCC 1, HGCC 2, FAEC 1, LAEC 2, MRPC 1, FASPD 1, LASPD 2, muon forward 1, muon endcap donut 2,muon barrel 3
c: subsub-detector
   GEM 1, CC 1 front, MRPC 1 front,SPD 1 front,EC 1 front 4 rear
d,e,f,g: not used for now
for example, 3110000 is for forward angle EC front plane
see code example here https://jlabsvn.jlab.org/svnroot/solid/study/background/background.C

field map

https://github.com/JeffersonLab/solid_gemc/blob/master/field/readme

old way to run simulation, mainly for background study

geometry

refer to file " $SoLID_GEMC/geometry/changelog" for details

source your set_solid
cd $SoLID_GEMC/geometry
edit perl files to modify geometry, then run command below to generate new geometry txt files
./solid_PVDIS_simple.pl config_solid_PVDIS_simple.dat
./solid_PVDIS_LD2.pl config_solid_PVDIS_LD2.dat
./solid_SIDIS_He3_simple.pl config_solid_SIDIS_He3_simple.dat
./solid_SIDIS_He3.pl config_solid_SIDIS_He3.dat
./solid_SIDIS_NH3_simple.pl config_solid_SIDIS_NH3_simple.dat
./solid_SIDIS_NH3.pl config_solid_SIDIS_NH3.dat

materials

source your set_solid
cd $SoLID_GEMC/geometry
edit the perl file "solid_material.pl" to modify geometry, then run command below to generate new material txt files
./solid_material.pl config_solid_PVDIS_simple.dat
./solid_material.pl config_solid_PVDIS_LD2.dat
./solid_material.pl config_solid_SIDIS_He3_simple.dat
./solid_material.pl config_solid_SIDIS_He3.dat
./solid_material.pl config_solid_SIDIS_NH3_simple.dat
./solid_material.pl config_solid_SIDIS_NH3.dat