Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
if [[ ! -n "${JUGGLER_DETECTOR}" ]] ; then
export JUGGLER_DETECTOR="topside"
fi
if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
export JUGGLER_N_EVENTS=100
fi
if [[ ! -n "${JUGGLER_INSTALL_PREFIX}" ]] ; then
export JUGGLER_INSTALL_PREFIX="/usr/local"
fi
export JUGGLER_FILE_NAME_TAG="dis"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
### Build the detector constructors.
git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git
pushd ${JUGGLER_DETECTOR}
ln -s ../accelerator/eic
popd
mkdir ${JUGGLER_DETECTOR}/build
pushd ${JUGGLER_DETECTOR}/build
cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install
popd
# generate the input events
# temporary standin until hepmc output from pythia is generated.
root -b -q "dis/scripts/gen_central_electrons.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
fi
#
pushd ${JUGGLER_DETECTOR}
## run geant4 simulations
npsim --runType batch \
--part.minimalKineticEnergy 1000*GeV \
-v WARNING \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${JUGGLER_DETECTOR}.xml \
--inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \
--outputFile ${JUGGLER_SIM_FILE}
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
fi
# Need to figure out how to pass file name to juggler from the commandline
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
gaudirun.py ../options/tracker_reconstruction.py
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler"
exit 1
fi
ls -l
popd
pwd
mkdir -p results/dis
root -b -q "dis/scripts/rec_dis_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script"
exit 1
fi
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/dis/.