Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:37:34

0001 #!/bin/bash
0002 
0003 # Generate a gps steer file in the current directory for the
0004 # specified particle, energy, and angles. Energy needs units,
0005 # but angles always in degrees.
0006 #
0007 # Example:
0008 # for particle in e- proton neutron \
0009 #                 pi+ pi- pi0 mu+ mu- \
0010 #                 kaon0L kaon0S kaon+ kaon- \
0011 #                 gamma J/psi ; do
0012 #   for energy in 100*MeV 150*MeV 200*MeV 300*MeV 500*MeV 750*MeV \
0013 #                   1*GeV 1.5*GeV 2*GeV 3*GeV 5*GeV 7.5*GeV \
0014 #                  10*GeV 15*GeV 20*GeV 30*GeV 50*GeV ; do
0015 #     ./generate.sh $particle $energy
0016 #   done
0017 # done
0018 #
0019 # Allowable particle names (Geant4):
0020 #      GenericIon, He3, alpha, anti_neutron
0021 #      anti_nu_e, anti_nu_mu, anti_nu_tau, anti_proton
0022 #      chargedgeantino, deuteron, e+, e-
0023 #      eta, eta_prime, gamma, geantino
0024 #      mu+, mu-, neutron, nu_e
0025 #      nu_mu, nu_tau, opticalphoton, pi+
0026 #      pi-, pi0, proton, tau+, tau-, triton,
0027 #      D+, D-, D0, anti_D0, Ds+, Ds-, J/psi
0028 #
0029 
0030 PARTICLE=${1:-e-}
0031 ENERGY=${2:-1\*GeV}
0032 MINTHETA=${3:-45}
0033 MAXTHETA=${4:-135}
0034 
0035 DIR=$(dirname $0)
0036 FILE=${PARTICLE//[\/_]/}_${ENERGY/\*/}_${MINTHETA}to${MAXTHETA}deg.steer
0037 sed "s|%MINTHETA%|${MINTHETA}|g;s|%MAXTHETA%|${MAXTHETA}|g;
0038      s|%PARTICLE%|${PARTICLE}|g;s|%ENERGY%|${ENERGY}|g" ${DIR}/template.in \
0039    > ${FILE}
0040 echo ${FILE}