Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JMuonCompass.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7source $JPP_DIR/setenv.sh $JPP_DIR
8
9set_variable: DEBUG RECONSTRUCTION_DEBUG 2
10set_variable: WORKDIR RECONSTRUCTION_WORKDIR ./
11set_variable: PDF RECONSTRUCTION_PDF $JPP_DATA/J%p.dat
12set_variable: A_RAD RECONSTRUCTION_A_RAD 1.0
13
14if do_usage $*; then
15 usage "$script <detector file> <input file>"\
16 "\nExample script to test compass calibration."\
17 "\nThe input file corresponds to an input file for the detector simulation (e.g. JSirene)."
18fi
19
20if (( $# != 2 )); then
21 fatal "Wrong number of arguments."
22fi
23
24set_variable DETECTOR $argv[1]
25set_variable INPUT_FILE $argv[2]
26
27mkdir -p $WORKDIR
28pushd $WORKDIR
29
30eval `JPrintDetector -a $DETECTOR -O SUMMARY`
31
32if [[ ! -f detector_A.datx ]]; then
33
34 JConvertDetectorFormat \
35 -a $DETECTOR \
36 -o detector_A.datx
37
38 if (( 0 )); then
39 for STRING in $STRINGS[*]; do
40
41 JEditDetector \
42 -a detector_A.datx \
43 -s "$STRING randrot $A_RAD" \
44 -o detector_A.datx -q
45 done
46 fi
47 if (( 1 )); then
48 for MODULE in $MODULES[*]; do
49
50 getLocation -a detector_A.datx -M $MODULE -d 0 | read STRING FLOOR
51
52 if (( $FLOOR != 0 )); then
53
54 JEditDetector \
55 -a detector_A.datx \
56 -M "$MODULE randrot $A_RAD" \
57 -o detector_A.datx -q
58 fi
59 done
60 fi
61
62 JConvertDetectorFormat \
63 -a detector_A.datx \
64 -o detector_B.datx
65fi
66
67if [[ ! -f sirene.root ]]; then
68 JSirene.sh $DETECTOR $INPUT_FILE sirene.root
69fi
70if [[ ! -f trigger_efficieny.root ]]; then
71 JTriggerEfficiency.sh $DETECTOR detector_A.datx sirene.root trigger_efficieny.root $JPP_DATA/trigger_parameters_arca.txt $JPP_DATA/PMT_parameters.txt
72fi
73if [[ ! -f jmuon.root ]]; then
74 JARCAMuonReconstruction.sh detector_A.datx trigger_efficieny.root %.root $JPP_DATA/PMT_parameters.txt
75fi
76
77JConvertDetectorFormat \
78 -a detector_B.datx \
79 -o detector_A.datx
80
81typeset -A PARAMETERS
82
83PARAMETERS=(
84 TTS_ns 2
85 E_GeV 1.0e3
86 TMin_ns -50.0
87 TMax_ns +450.0
88 R_Hz 6.0e3
89 roadWidth_m 175.0
90 numberOfPrefits 1)
91
92timer_start
93
94eval JMuonCompass \
95 -a detector_A.datx \
96 -f jmuon.root \
97 -o compass.root \
98 -P $PDF \
99 -@ `make_equation PARAMETERS` \
100 -d $DEBUG
101
102timer_stop
103timer_print
104
105$JPP_DIR/examples/JReconstruction/JMuonCompass \
106 -f compass.root \
107 -o hobbit.root \
108 -a detector_A.datx \
109 -A \
110 -d $DEBUG
111
112popd
113