Difference between revisions of "Simulations and Backgrounds"

From Ciswikidb
Jump to navigation Jump to search
 
(144 intermediate revisions by one other user not shown)
Line 6: Line 6:
  
  
= '''GEANT4 Geometry''' =
 
* Using github.com to manage the simulation software: ''/group/bubble/''
 
  
* The current geometry for the Bubble Chamber is in gdml and is shown below:
+
= '''GEANT4 Simulation''' =
 +
 
 +
* Bubble Chamber STEP file (change .txt to .stp): [[media:BubbleChamber.txt]]
 +
* Beamline STEP file (change .txt to .stp): [[media:Beamline_STEPFile.txt]]
 +
* GEANT4 Photon-Inelastic Model: CHIPS Gamma Nuclear has this (wrong) cross section for our reaction:
 +
 
 +
[[file:G4_CrossSection.gif||500px|]]
 +
 
 +
 
 +
 
 +
 
 +
== '''gemc - Now (Fall 2015)''' ==
 +
 
 +
* We will use GEant4 Monte Carlo ''GEMC'': [https://gemc.jlab.org/gemc/Home.html]
 +
 
 +
 
 +
* To try:
 +
# $ '''ssh ifarm'''
 +
# $ '''mkdir /group/bubble/<user>'''
 +
# $ '''cd /group/bubble/<user>'''
 +
# $ '''setenv JLAB_ROOT /site/12gev_phys''' (for more details, see [https://data.jlab.org/drupal/])
 +
# $ '''setenv JLAB_VERSION 1.3'''
 +
# $ '''source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.csh'''
 +
# $ '''gemc'''
 +
 
 +
 
 +
* gemc help [[media:gemc-help-all.txt]]:
 +
# '''gemc -help-all'''
 +
 
 +
 
 +
* Simple Geometry and Material Tutorial: [https://www.jlab.org/12gev_phys/packages/tutorials/geometry1.pdf]
 +
 
 +
 
 +
* From above paper, use '''Livermore''' Electromagnetic Physics List (for Hadronic Physics: ''FTFP_BERT'')
 +
        <option name="PHYSICS" value="FTFP_BERT + LIV"/>
 +
 
 +
 
 +
* Drawings used to generate gemc Bubble Chamber Model:
 +
# Beamline Drawings:
 +
## Copper Radiator: [[media:JL0015733_CU_RADIATOR_WINDOW_ASSY.pdf]]
 +
## Copper Collimator: [[media:JL0015777_CU_COLLIMATOR.pdf]]
 +
## Photon Dump: [[media:JL0009386_ALUMINUM_PHOTON_BEAM_DUMP.pdf]]
 +
# Bubble Chamber Drawings:
 +
## High Pressure Vessel: [[media:NPD-20-001-R1.pdf]]
 +
## Pressure Vessel Blank Flange: [[media:NPD-20-002.pdf]]
 +
## Gamma Beam Window: [[media:NPD-20-011.pdf]]
 +
## Blank Flange MOD - Gamma Port: [[media:NPD-20-014.pdf]]
 +
## Glass Cell - Metal Adapter: [[media:NPD-21-106.pdf]]
 +
## Bubble Chamber Dimensions: [[media:Bubble_Chamber_Reference_Dimensions.pdf]]
 +
 
 +
 
 +
* How to start with '''git''' (DONE ONCE when you start working on this project):
 +
# Done once at the beginning on web:
 +
## Create an account (user-name and password) at https://github.com/
 +
## Fork gemc/detectors
 +
# Done once at the beginning in your work directory:
 +
## $ '''ssh ifarm'''
 +
## $ '''git clone https://github.com/your_git_user_name/detectors.git''' (create your disk copy)
 +
## $ '''git config --global user.name "Your Name"'''
 +
## $ '''git config --global user.email your_git_email@example.com'''
 +
# Done once at the beginning to add the master to your disk:
 +
## $ '''cd detectors/injector/'''
 +
## $ '''git remote add upstream https://github.com/gemc/detectors'''
 +
## $ '''git remote -v'''
 +
## $ '''git fetch upstream'''
 +
## $ '''git checkout master'''
 +
 
 +
 
 +
* To update your fork at github.com:
 +
# $ '''git add ''newfile'' ''' (if any)
 +
# $ '''git commit -a -m"comment"'''
 +
# $ '''git push'''
 +
 
 +
 
 +
* To ask the project manager to incorporate your changes into the “master":
 +
# First, update your fork at github.com – see above
 +
# Create pull request: done from github website, navigate to your fork – create pull request by pushing green button
 +
 
 +
 
 +
* To update your disk copy from master - see detailed instructions at http://gemc.github.io/ :
 +
# $ '''git fetch upstream'''
 +
# $ '''git checkout master'''
 +
# $ '''git merge upstream/master''' (sync your files at disk with the master: https://github.com/gemc/detectors.git)
 +
 
 +
 
 +
* How to run '''gemc''':
 +
# $ '''cd detectors/injector'''
 +
# $ '''setenv JLAB_ROOT /site/12gev_phys'''
 +
# $ '''setenv JLAB_VERSION 1.3'''
 +
# $ '''source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.csh'''
 +
# $ '''./geometry.pl config.dat'''
 +
# $ '''gemc bubble.gcard -USE_GUI=2'''
 +
 
 +
 
 +
* To check overlaps:
 +
# $ '''gemc bubble.gcard -USE_GUI=0 -CHECK_OVERLAPS=10'''
 +
 
 +
 
 +
* To draw axes: /vis/scene/add/axes 0 0 0 0.5 m (Draws axes at (x0, y0, z0) of given length and colour – x, y and z will be red, green and blue)
 +
 
 +
 
 +
* To print physics summary: '''gemc bubble.gcard -PHYS_VERBOSITY=10'''
 +
 
 +
 
 +
* To run gemc in batch mode:
 +
# $ '''gemc bubble.gcard -USE_GUI=0 -N=1000000 -PRINT_EVENT=100000'''
 +
 
 +
 
 +
* To set Tracking Energy Cut (in MeV):
 +
# $ '''gemc bubble.gcard -USE_GUI=0 -N=1000000 -PRINT_EVENT=100000 -ENERGY_CUT=4.0'''
 +
 
 +
 
 +
* To run large statistics run (using LUMI events):
 +
        <option name="LUMI_EVENT"    value="10000, 250*ns, 2*ns" />
 +
        <option name="LUMI_P"        value="e-, 8.5*MeV, 0.*deg, 0.*deg" />
 +
        <option name="LUMI_V"        value="(0.,0.,-5.)cm" />
 +
        <option name="LUMI_SPREAD_V"  value="(0., 0.)cm" />
 +
 
 +
# $ '''gemc bubble.gcard -USE_GUI=0 -N=10001 -PRINT_EVENT=100'''
  
[[file:BCjul7.jpeg||500px|]]
 
  
 +
* To reduce size of out.ev (and out.root), use:
 +
# $ '''bank.pl config.dat'''
 +
# $ '''hit.pl config.dat'''
 +
This creates ''bubble'' tree with leafs: detId, kinE, pid, hitn.
 +
To get gamma flux:
 +
root> bubble->Draw("kinE","detId==1&&pid==22",""); // To record gammas coming out of radiator (radiatorFlux)
 +
root> bubble->Draw("kinE","detId==2&&pid==22",""); // To record gammas entering glass cell (n20Cell)
 +
For 1B electrons (T<sub>e</sub>=8 MeV): out.ev=16GB, out.root=7.5GB, ''gemc'' interactive time = 250 hours
  
[[file:BC1jul7.jpeg||500px|]]
 
  
 +
* To convert to root:
 +
# $ '''$BANKS/bin/evio2root -INPUTF=out.ev -B=bubble'''
 +
Note: need ''bubble__bank.txt'' in same directory.
  
  
* '''To-do List:'''
+
* The current geometry for the Bubble Chamber is in gemc and is shown below:
# Geometry is in gdml format, need to get correct Radiator, Collimator, Beamline, PhotonDump geometry.
 
# Add sweep magnet and electrondump geometry in gdml format.
 
# Complete: Include the Bubble Chamber geometry using the Bubble Chamber STEP file (change .txt to .stp): [[media:BubbleChamber.txt]].
 
## Geometry has been created and is on github, BubbleMother.gdml and all daughter files
 
# The beamline STEP file will be ready very soon. When? Last file recieved was BubbleChamber again 6_24_2014.
 
# GEANT4 uses models that calculate wrong photo–nuclear cross sections (see below). GEANT4 does not allow for user’s cross sections. What to do?
 
## Use GEANT4 to produce the photon spectra impinging on the superheated liquid.
 
## Fold the above photon spectra with our cross sections in stand-alone codes.
 
## Could we not create a correct physicslist.cc in geant4 instead?
 
* GEANT4 Photon-Inelastic Model: CHIPS Gamma Nuclear has this cross section for our reaction:  
 
  
[[file:G4_CrossSection.gif||500px|]]
 
  
* The simulation below is outdated and doesnt work with gdml. See github for correct version.
+
[[file:bubble_gemc.png||500px|]]
* Quick start for the simulation: [[media:G4_BubbleEx_README.txt]]. There is also a README file that comes with the example.
 
* Bubble Chamber GEANT4 Example (change .txt to .tar): [[media:BubbleEx96.txt]]
 
  
= '''Compiling/Running Simulation (BubbleEx)''' =
 
  
* '''Using the ifarm or jlabl4 nodes'''
+
=== '''gemc and Batch Farm''' ===
* Login remotely to the JLab gateway: $ ssh login.jlab.org
 
* Connect to either ifarm or Jlabl4:
 
# $ ssh ifarm
 
# $ ssh jlabl4
 
  
* Load Geant4 and ROOT Environments by running the following commands: (needed every login)
+
- Group: bubble
# $ setenv JLAB_VERSION 1.0 (or 1.1)
+
- Group Disk: /group/bubble (20GB)  
# $ setenv JLAB_ROOT /site/12gev_phys
+
- Work Disk: /work/accel/bubble (500GB)
# $ source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.csh
 
* Should see a short list of programs such as ROOT and Geant4 listed:
 
  
> Common Environment Version: <1.0>  (Tue, 25 Feb 2014)
 
> Running as <user> on jlabl4
 
> OS Release:    Linux_RHEL6-x86_64-gcc4.4.7
 
> JLAB_ROOT set to:    /site/12gev_phys
 
> JLAB_SOFTWARE set to: /site/12gev_phys/1.0/Linux_RHEL6-x86_64-gcc4.4.7
 
> CLHEP  version: 2.1.3.1
 
> XERCES  version: 3.1.1
 
> QTDIR  version: 4.8.5
 
> Geant4  version: 4.9.6.p02
 
> ROOT    version: 5.34.13
 
> GEMC    version: 1.8
 
> JANA    version: 0.7.1p3
 
> Build  version: 1.0
 
> EVIO    version: 4.0
 
  
 +
* Bubble experiment is set up for farm use with 500GB work storage; please use project '''bubble''' for your jobs (Group account: accelerator).
  
* '''''Compiling the simulation'''''
 
* Simulation is available at https://github.com/JeffersonLab/BubbleEx
 
* Create directory for simulation:
 
* On JLab nodes can use /group/bubble/ directory:
 
# $ mkdir /group/bubble/<user>
 
# $ cd /group/bubble/<user>
 
# $ git clone https://github.com/JeffersonLab/BubbleEx.git
 
# $ cd BubbleEx
 
# $ git pull (to update files from github)
 
# $ mkdir build
 
# $ cd build
 
# $ use cmake (only if using JLab nodes)
 
# $ cmake ..
 
# $ make
 
# $ cd ..
 
  
* '''''Running the simulation'''''
+
* How to run gemc on batch farm:
* In the install directory
+
# $ '''cd /work/accel/bubble'''
# $ build/BubbleEx  (remember to run the source command before running)
+
# $ '''mkdir <user>'''
* Terminal will list what has been loaded and then display output command box
+
# $ '''cd <user>'''
* In session run:
+
# $ '''git clone https://github.com/maureeungaro/analysis.git'''
# $ /vis/open OGL
+
# $ '''cd analysis/farm/gemc
# $ /run/beamOn 100
+
# Modify file ''Master'':
  
* Initial run of the simulation is shown:
+
# Parameters set by user
 +
# ----------------------
 +
set NEVENTS    = 5001                                  # number of events / job@ 10,000 luminosity
 +
set NMAXJOBS  = 20                                    # number of jobs to be launched per gcard
 +
set GCARDSD    = /work/accel/bubble/<user>/cards      # collection of gcards. One job / gcard will be launched
 +
set OUTPUTD    = /work/accel/bubble/<user>/output      # output directory
 +
set DEBUG      = no                                    # "yes" will print out the jsub file instead of submitting it
 +
set EXPSD      = /work/accel/bubble/<user>/injector    # directory containing the detector definition - just remember in the gcard you have to have full path.
 +
set INPUTFILES = none                                  # directory containing the input files. Can be "none" for internal generator
 +
# Farm specific parameters
 +
set MEMORY  = "2000 MB"        # node memory to be used
 +
set OS      = centos65          # job OS
 +
set PROJECT  = bubble            # job project name
 +
set MAIL    = <user>@jlab.org  # author email
 +
set TRACK    = simulation       # job track
 +
set JSUBC    = /site/bin/jsub    # command to submit the job
 +
# End of user parameter
 +
# ---------------------
  
[[File:BubbleEx_Output.jpg||500px|]]
 
  
 +
In gcard file:
 +
    <detector name="bubble" factory="TEXT" variation="original"/>
 +
becomes
 +
    <detector name=“/work/accel/bubble/<user>/injector/bubble" factory="TEXT" variation="original"/>
  
  
 +
* Then run “Master”
 +
# $ '''./Master'''
  
  
= '''Relevant Cross Sections''' =
+
* To kill all submitted jobs:
* Photo-Nuclear Cross Sections:
+
# $ '''./killAll'''
[[file:CrossSections.gif|right|600px|]]
 
# <sup>16</sup>O(γ,α)<sup>12</sup>C [[media:cs16Oga.txt]] (Eg (MeV), Cross Section (b))
 
# <sup>17</sup>O(γ,α)<sup>13</sup>C [[media:cs17Oga.txt]]
 
# <sup>18</sup>O(γ,α)<sup>14</sup>C [[media:cs18Oga.txt]]
 
# <sup>14</sup>N(γ,p)<sup>13</sup>C [[media:cs14Ngp.txt]]
 
  
  
 +
* ''inquireSimulation'' Usage:
  
 +
set GCARDSD = /work/accel/bubble/<user>/cards    # collection of gcards. One job / gcard will be launched
 +
set INPUTD  = /work/accel/bubble/<user>/output    # location of evio files (inside each gcard title)
 +
set OUTPUTD = $INPUTD/root                        # output directory
 +
set EXACT  = 5001                                # number of expected events
 +
set MINP    = 5001                                # minimum number of events required for the sim to be processed
  
 +
Available options:
 +
reset:  will reset the event count number to 1 (write to .dat file)
 +
verbose: will display the event information (no ROOTIFICATION)
 +
root:    will rootify, w/o removing simulation dir
 +
rootr:  will rootify and remove simulation dir
 +
clear:  will remove unfinished directories
  
 +
# $ '''cd analysis/farm/gemc
 +
# Modify file ''inquireSimulation'' - see above
 +
# Copy file ''bubble__bank.txt'' to this directory
 +
# $ '''./inquireSimulation reset''' - only once per simulation
 +
# $ '''./inquireSimulation verbose'''
 +
# $ '''./inquireSimulation root'''
  
  
 +
* To add root files:
 +
# $ '''hadd destination.root directory/*.root'''
  
  
  
  
 +
-----
 +
-----
  
  
  
  
* Neutron Elastic Cross Sections:
+
== '''First Attempt - Spring 2014''' ==
# <sup>16</sup>O(n,n) [[media:cs16Onn.txt]] (En (MeV), Cross Section (b))
 
# <sup>14</sup>N(n,n) [[media:cs14Nnn.txt]]
 
[[file:cs16Onn.gif|left|500px|]]
 
[[file:cs14Nnn.gif|right|500px|]]
 
  
 +
* Quick start for the simulation: [[media:G4_BubbleEx_README.txt]]. There is also a README file that comes with the example.
 +
* Bubble Chamber GEANT4 Example (change .txt to .tar): [[media:BubbleEx96.txt]]
  
  
  
  
 +
== '''Second Attempt - Summer 2014''' ==
  
 +
* Use github.com to manage the simulation software
  
 +
* The current geometry for the Bubble Chamber is in gdml and is shown below:
  
 +
[[file:BCjul7.jpeg||500px|]]
  
  
 +
[[file:BC1jul7.jpeg||500px|]]
  
  
 +
=== '''Using ifarm'''===
 +
* Login remotely to the JLab gateway: $ '''ssh login.jlab.org'''
 +
* Connect to either ifarm or Jlabl4:
 +
# $ '''ssh ifarm'''
 +
# $ '''ssh jlabl4'''
  
 +
* Load Geant4 and ROOT Environments by running the following commands: (needed every login) (see [https://data.jlab.org/drupal/] for more details)
 +
# $ '''source /site/12gev_phys/production.csh 1.1'''
  
 +
* Should see a short list of programs such as ROOT and Geant4 listed:
  
 +
> Common Environment Version: <1.1>  (Mon, 20 Oct 2014)
 +
> Running as suleiman on ifarm1401
 +
> OS Release:    Linux_CentOS6.5-x86_64-gcc4.4.7
 +
> JLAB_ROOT set to:    /site/12gev_phys
 +
> JLAB_SOFTWARE set to: /site/12gev_phys/1.1/Linux_CentOS6.5-x86_64-gcc4.4.7
 +
> CLHEP  version: 2.1.3.1
 +
> XERCES  version: 3.1.1
 +
> QTDIR  version: system
 +
> Geant4  version: 4.9.6.p03
 +
> ROOT    version: 5.34.13
 +
> GEMC    version: 2.1
 +
> JANA    version: 0.7.2
 +
> Build  version: 1.1
 +
> EVIO    version: 4.0
 +
> Banks  version: 1.0
  
  
 +
=== '''''Compiling Simulation'''''===
 +
* Simulation is available at https://github.com/JeffersonLab/BubbleEx
 +
* Create directory for simulation (on JLab nodes can use /group/bubble/ directory):
 +
# $ '''mkdir /group/bubble/<user>'''
 +
# $ '''cd /group/bubble/<user>'''
 +
# $ '''git clone https://github.com/JeffersonLab/BubbleEx.git'''
 +
# $ '''cd BubbleEx'''
 +
# $ '''git pull''' (to update files from github)
 +
# $ '''mkdir build'''
 +
# $ '''cd build'''
 +
# $ '''use cmake''' (only if using JLab nodes)
 +
# $ '''cmake ..'''
 +
# $ '''make'''
 +
# $ '''cd ..'''
  
  
 +
=== '''''Running Simulation'''''===
 +
* In the install directory
 +
# $ '''build/BubbleEx'''  (remember to run the source command before running)
 +
* Terminal will list what has been loaded and then display output command box
 +
* In session run:
 +
# $ /vis/open OGL
 +
# $ /run/beamOn 100
  
 +
* Initial run of the simulation is shown:
  
 +
[[File:BubbleEx_Output.jpg||500px|]]
  
  
  
  
 +
=== '''To-do List'''===
  
 +
# Geometry is in gdml format, need to get correct Radiator, Collimator, Beamline, PhotonDump geometry.
 +
# Add sweep magnet and electrondump geometry in gdml format.
 +
# Complete: Include the Bubble Chamber geometry using the Bubble Chamber STEP file (change .txt to .stp): [[media:BubbleChamber.txt]].
 +
## Geometry has been created and is on github, BubbleMother.gdml and all daughter files
 +
# The beamline STEP file will be ready very soon.
 +
# GEANT4 uses models that calculate wrong photo–nuclear cross sections (see above). GEANT4 does not allow for user’s cross sections. What to do?
 +
## Use GEANT4 to produce the photon spectra impinging on the superheated liquid.
 +
## Fold the above photon spectra with our cross sections in stand-alone codes.
 +
## Could we not create a correct physicslist.cc in geant4 instead?
  
 +
= '''Relevant Theoretical Cross Sections''' =
 +
* Photo-Nuclear Cross Sections:
 +
[[file:CrossSections.gif|center|800px|]]
 +
# <sup>16</sup>O(γ,α)<sup>12</sup>C [[media:cs16Oga.txt]] (Eg (MeV), Cross Section (b))
 +
# <sup>17</sup>O(γ,α)<sup>13</sup>C [[media:cs17Oga.txt]]
 +
# <sup>18</sup>O(γ,α)<sup>14</sup>C [[media:cs18Oga.txt]]
 +
# <sup>14</sup>N(γ,p)<sup>13</sup>C [[media:cs14Ngp.txt]]
  
  
 +
* Neutron Elastic Cross Sections:
 +
# <sup>16</sup>O(n,n) [[media:cs16Onn.txt]] (En (MeV), Cross Section (b))
 +
# <sup>14</sup>N(n,n) [[media:cs14Nnn.txt]]
 +
[[file:cs16Onn.gif|center|700px|]]
 +
[[file:cs14Nnn.gif|center|700px|]]
  
  
 
* Fluorine Cross Section:  
 
* Fluorine Cross Section:  
 
# <sup>19</sup>F(γ,α)<sup>15</sup>N [[media:cs19Fga.txt]] (Eg (MeV), Cross Section (b))
 
# <sup>19</sup>F(γ,α)<sup>15</sup>N [[media:cs19Fga.txt]] (Eg (MeV), Cross Section (b))
 +
[[file:cs19Fga.gif|center|800px|]]

Latest revision as of 09:23, 27 February 2017

GEANT4 vs. Experimental Data

  • Benchmarking of monte carlo simulation of bremsstrahlung from thick targets at radiotherapy energies

B. A. Faddegon, M. Asai, J. Perl, C. Ross, J. Sempau, J. Tinslay, and F. Salvat. Med. Phys. 35 (2008) 4308 [1] media:MedPhys.35.4308.pdf



GEANT4 Simulation

G4 CrossSection.gif



gemc - Now (Fall 2015)

  • We will use GEant4 Monte Carlo GEMC: [2]


  • To try:
  1. $ ssh ifarm
  2. $ mkdir /group/bubble/<user>
  3. $ cd /group/bubble/<user>
  4. $ setenv JLAB_ROOT /site/12gev_phys (for more details, see [3])
  5. $ setenv JLAB_VERSION 1.3
  6. $ source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.csh
  7. $ gemc


  1. gemc -help-all


  • Simple Geometry and Material Tutorial: [4]


  • From above paper, use Livermore Electromagnetic Physics List (for Hadronic Physics: FTFP_BERT)
       <option name="PHYSICS" value="FTFP_BERT + LIV"/>


  • Drawings used to generate gemc Bubble Chamber Model:
  1. Beamline Drawings:
    1. Copper Radiator: media:JL0015733_CU_RADIATOR_WINDOW_ASSY.pdf
    2. Copper Collimator: media:JL0015777_CU_COLLIMATOR.pdf
    3. Photon Dump: media:JL0009386_ALUMINUM_PHOTON_BEAM_DUMP.pdf
  2. Bubble Chamber Drawings:
    1. High Pressure Vessel: media:NPD-20-001-R1.pdf
    2. Pressure Vessel Blank Flange: media:NPD-20-002.pdf
    3. Gamma Beam Window: media:NPD-20-011.pdf
    4. Blank Flange MOD - Gamma Port: media:NPD-20-014.pdf
    5. Glass Cell - Metal Adapter: media:NPD-21-106.pdf
    6. Bubble Chamber Dimensions: media:Bubble_Chamber_Reference_Dimensions.pdf


  • How to start with git (DONE ONCE when you start working on this project):
  1. Done once at the beginning on web:
    1. Create an account (user-name and password) at https://github.com/
    2. Fork gemc/detectors
  2. Done once at the beginning in your work directory:
    1. $ ssh ifarm
    2. $ git clone https://github.com/your_git_user_name/detectors.git (create your disk copy)
    3. $ git config --global user.name "Your Name"
    4. $ git config --global user.email your_git_email@example.com
  3. Done once at the beginning to add the master to your disk:
    1. $ cd detectors/injector/
    2. $ git remote add upstream https://github.com/gemc/detectors
    3. $ git remote -v
    4. $ git fetch upstream
    5. $ git checkout master


  • To update your fork at github.com:
  1. $ git add newfile (if any)
  2. $ git commit -a -m"comment"
  3. $ git push


  • To ask the project manager to incorporate your changes into the “master":
  1. First, update your fork at github.com – see above
  2. Create pull request: done from github website, navigate to your fork – create pull request by pushing green button


  1. $ git fetch upstream
  2. $ git checkout master
  3. $ git merge upstream/master (sync your files at disk with the master: https://github.com/gemc/detectors.git)


  • How to run gemc:
  1. $ cd detectors/injector
  2. $ setenv JLAB_ROOT /site/12gev_phys
  3. $ setenv JLAB_VERSION 1.3
  4. $ source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.csh
  5. $ ./geometry.pl config.dat
  6. $ gemc bubble.gcard -USE_GUI=2


  • To check overlaps:
  1. $ gemc bubble.gcard -USE_GUI=0 -CHECK_OVERLAPS=10


  • To draw axes: /vis/scene/add/axes 0 0 0 0.5 m (Draws axes at (x0, y0, z0) of given length and colour – x, y and z will be red, green and blue)


  • To print physics summary: gemc bubble.gcard -PHYS_VERBOSITY=10


  • To run gemc in batch mode:
  1. $ gemc bubble.gcard -USE_GUI=0 -N=1000000 -PRINT_EVENT=100000


  • To set Tracking Energy Cut (in MeV):
  1. $ gemc bubble.gcard -USE_GUI=0 -N=1000000 -PRINT_EVENT=100000 -ENERGY_CUT=4.0


  • To run large statistics run (using LUMI events):
       <option name="LUMI_EVENT"     value="10000, 250*ns, 2*ns" />
       <option name="LUMI_P"         value="e-, 8.5*MeV, 0.*deg, 0.*deg" />
       <option name="LUMI_V"         value="(0.,0.,-5.)cm" />
       <option name="LUMI_SPREAD_V"  value="(0., 0.)cm" />
  1. $ gemc bubble.gcard -USE_GUI=0 -N=10001 -PRINT_EVENT=100


  • To reduce size of out.ev (and out.root), use:
  1. $ bank.pl config.dat
  2. $ hit.pl config.dat
This creates bubble tree with leafs: detId, kinE, pid, hitn.
To get gamma flux: 
root> bubble->Draw("kinE","detId==1&&pid==22",""); // To record gammas coming out of radiator (radiatorFlux)
root> bubble->Draw("kinE","detId==2&&pid==22",""); // To record gammas entering glass cell (n20Cell)
For 1B electrons (Te=8 MeV): out.ev=16GB, out.root=7.5GB, gemc interactive time = 250 hours


  • To convert to root:
  1. $ $BANKS/bin/evio2root -INPUTF=out.ev -B=bubble
Note: need bubble__bank.txt in same directory.


  • The current geometry for the Bubble Chamber is in gemc and is shown below:


Bubble gemc.png


gemc and Batch Farm

- Group: bubble
- Group Disk: /group/bubble (20GB) 
- Work Disk: /work/accel/bubble (500GB) 


  • Bubble experiment is set up for farm use with 500GB work storage; please use project bubble for your jobs (Group account: accelerator).


  • How to run gemc on batch farm:
  1. $ cd /work/accel/bubble
  2. $ mkdir <user>
  3. $ cd <user>
  4. $ git clone https://github.com/maureeungaro/analysis.git
  5. $ cd analysis/farm/gemc
  6. Modify file Master:
# Parameters set by user
# ----------------------
set NEVENTS    = 5001                                  # number of events / job@ 10,000 luminosity
set NMAXJOBS   = 20                                    # number of jobs to be launched per gcard
set GCARDSD    = /work/accel/bubble/<user>/cards       # collection of gcards. One job / gcard will be launched
set OUTPUTD    = /work/accel/bubble/<user>/output      # output directory
set DEBUG      = no                                    # "yes" will print out the jsub file instead of submitting it
set EXPSD      = /work/accel/bubble/<user>/injector    # directory containing the detector definition - just remember in the gcard you have to have full path. 
set INPUTFILES = none                                  # directory containing the input files. Can be "none" for internal generator
# Farm specific parameters
set MEMORY   = "2000 MB"         # node memory to be used
set OS       = centos65          # job OS
set PROJECT  = bubble            # job project name
set MAIL     = <user>@jlab.org   # author email
set TRACK    = simulation        # job track
set JSUBC    = /site/bin/jsub    # command to submit the job 
# End of user parameter
# ---------------------


In gcard file:
   <detector name="bubble" factory="TEXT" variation="original"/>
becomes
   <detector name=“/work/accel/bubble/<user>/injector/bubble" factory="TEXT" variation="original"/>


  • Then run “Master”
  1. $ ./Master


  • To kill all submitted jobs:
  1. $ ./killAll


  • inquireSimulation Usage:
set GCARDSD = /work/accel/bubble/<user>/cards     # collection of gcards. One job / gcard will be launched
set INPUTD  = /work/accel/bubble/<user>/output    # location of evio files (inside each gcard title)
set OUTPUTD = $INPUTD/root                        # output directory
set EXACT   = 5001                                # number of expected events
set MINP    = 5001                                # minimum number of events required for the sim to be processed
Available options:
reset:   will reset the event count number to 1 (write to .dat file)
verbose: will display the event information (no ROOTIFICATION)
root:    will rootify, w/o removing simulation dir
rootr:   will rootify and remove simulation dir
clear:   will remove unfinished directories
  1. $ cd analysis/farm/gemc
  2. Modify file inquireSimulation - see above
  3. Copy file bubble__bank.txt to this directory
  4. $ ./inquireSimulation reset - only once per simulation
  5. $ ./inquireSimulation verbose
  6. $ ./inquireSimulation root


  • To add root files:
  1. $ hadd destination.root directory/*.root







First Attempt - Spring 2014



Second Attempt - Summer 2014

  • Use github.com to manage the simulation software
  • The current geometry for the Bubble Chamber is in gdml and is shown below:

BCjul7.jpeg


BC1jul7.jpeg


Using ifarm

  • Login remotely to the JLab gateway: $ ssh login.jlab.org
  • Connect to either ifarm or Jlabl4:
  1. $ ssh ifarm
  2. $ ssh jlabl4
  • Load Geant4 and ROOT Environments by running the following commands: (needed every login) (see [5] for more details)
  1. $ source /site/12gev_phys/production.csh 1.1
  • Should see a short list of programs such as ROOT and Geant4 listed:
> Common Environment Version: <1.1>  (Mon, 20 Oct 2014)
> Running as suleiman on ifarm1401
> OS Release:    Linux_CentOS6.5-x86_64-gcc4.4.7
> JLAB_ROOT set to:     /site/12gev_phys
> JLAB_SOFTWARE set to: /site/12gev_phys/1.1/Linux_CentOS6.5-x86_64-gcc4.4.7
> CLHEP   version: 2.1.3.1
> XERCES  version: 3.1.1
> QTDIR   version: system
> Geant4  version: 4.9.6.p03
> ROOT    version: 5.34.13
> GEMC    version: 2.1
> JANA    version: 0.7.2
> Build   version: 1.1
> EVIO    version: 4.0
> Banks   version: 1.0


Compiling Simulation

  1. $ mkdir /group/bubble/<user>
  2. $ cd /group/bubble/<user>
  3. $ git clone https://github.com/JeffersonLab/BubbleEx.git
  4. $ cd BubbleEx
  5. $ git pull (to update files from github)
  6. $ mkdir build
  7. $ cd build
  8. $ use cmake (only if using JLab nodes)
  9. $ cmake ..
  10. $ make
  11. $ cd ..


Running Simulation

  • In the install directory
  1. $ build/BubbleEx (remember to run the source command before running)
  • Terminal will list what has been loaded and then display output command box
  • In session run:
  1. $ /vis/open OGL
  2. $ /run/beamOn 100
  • Initial run of the simulation is shown:

BubbleEx Output.jpg



To-do List

  1. Geometry is in gdml format, need to get correct Radiator, Collimator, Beamline, PhotonDump geometry.
  2. Add sweep magnet and electrondump geometry in gdml format.
  3. Complete: Include the Bubble Chamber geometry using the Bubble Chamber STEP file (change .txt to .stp): media:BubbleChamber.txt.
    1. Geometry has been created and is on github, BubbleMother.gdml and all daughter files
  4. The beamline STEP file will be ready very soon.
  5. GEANT4 uses models that calculate wrong photo–nuclear cross sections (see above). GEANT4 does not allow for user’s cross sections. What to do?
    1. Use GEANT4 to produce the photon spectra impinging on the superheated liquid.
    2. Fold the above photon spectra with our cross sections in stand-alone codes.
    3. Could we not create a correct physicslist.cc in geant4 instead?

Relevant Theoretical Cross Sections

  • Photo-Nuclear Cross Sections:
CrossSections.gif
  1. 16O(γ,α)12C media:cs16Oga.txt (Eg (MeV), Cross Section (b))
  2. 17O(γ,α)13C media:cs17Oga.txt
  3. 18O(γ,α)14C media:cs18Oga.txt
  4. 14N(γ,p)13C media:cs14Ngp.txt


  • Neutron Elastic Cross Sections:
  1. 16O(n,n) media:cs16Onn.txt (En (MeV), Cross Section (b))
  2. 14N(n,n) media:cs14Nnn.txt
Cs16Onn.gif
Cs14Nnn.gif


  • Fluorine Cross Section:
  1. 19F(γ,α)15N media:cs19Fga.txt (Eg (MeV), Cross Section (b))
Cs19Fga.gif