Difference between revisions of "HOWTO run a single-particle-gun simulation"

From GlueXWiki
Jump to: navigation, search
(Running a single particle Gun)
(Running a single particle Gun)
Line 8: Line 8:
 
# here a few more pointers
 
# here a few more pointers
 
#* Don't forget the appropriate setting for the environment variable JANA_CALIB_CONTEXT to have the desired variation like "mc" or the like
 
#* Don't forget the appropriate setting for the environment variable JANA_CALIB_CONTEXT to have the desired variation like "mc" or the like
#* If you want to know which decay modes are defined for a given particle in "geant4 -i" you can execute the following two commands in hdgeant4:<br> Idle> /particle/select eta <br>Idle> /particle/property/decay/dump<br> This will print out the all the decay modes with their branching ratios and what the decay modes are. For a full list of particles in geant execute the command: <br> /particle/list
+
#* If you want to know which decay modes are defined for a given particle in "geant4 -i" you can execute the following two commands in hdgeant4:<br> Idle> /particle/select eta <br>Idle> /particle/property/decay/dump<br> This will print out the all the decay modes with their branching ratios and what the decay modes are. For a full list of particles in geant execute the command: <br> Idle> /particle/list

Revision as of 07:11, 26 May 2020

Running a single particle Gun

In this example we are going to use hdgeant4 and we are simulating a single particle eta to be generated. The eta is chosen to also show how to force geant to let eta decay only into one final state rather than all possible ones. To achieve all this we require two files:

  1. "control.in", to define the kinematics and with the particle type. An example of this files looks as follows:
    TRIG 1000
    KINE 117 5.97 0.01 0. 0.0 0.05 360.
    SCAP 0. 0. 1.
    TGTWIDTH 0.5 .5
    HADR 1
    OUTFILE 'etaRAND.hddm'
    RNDM 2057859
    RUNG 30402
  2. "r.mac", this file contains the necessary commands to run hdgeant4 and also sets up the decay modes for the eta as follows, in this example decay mode 1 is given 100% (3pi0 decay) all other decay modes are zero and 1000 events are generated:
    /particle/select eta
    /particle/property/decay/select 0
    /particle/property/decay/br 0
    /particle/property/decay/select 1
    /particle/property/decay/br 1
    /particle/property/decay/select 2
    /particle/property/decay/br 0
    /particle/property/decay/select 3
    /particle/property/decay/br 0
    /run/beamOn 1000
  3. run this as follows:
    hdgeant4 r.mac
    and will create a file etaRAND.hddm as specified in the control.in file.
  4. the final step before analysis is smearing the simulated data which is done like this:
    mcsmear foo.dat
    where foo.dat is the simulated data from hdgeant4. The output will have the form foo_smeared.dat
  5. here a few more pointers
    • Don't forget the appropriate setting for the environment variable JANA_CALIB_CONTEXT to have the desired variation like "mc" or the like
    • If you want to know which decay modes are defined for a given particle in "geant4 -i" you can execute the following two commands in hdgeant4:
      Idle> /particle/select eta
      Idle> /particle/property/decay/dump
      This will print out the all the decay modes with their branching ratios and what the decay modes are. For a full list of particles in geant execute the command:
      Idle> /particle/list