Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JFootprint.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 if [ -z $JPP_DIR ]; then
5  echo "Variable JPP_DIR undefined."
6  exit
7 fi
8 
9 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10 
11 set_variable: DEBUG ACOUSTICS_DEBUG 2
12 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13 
14 if do_usage $*; then
15  usage "$script <detector file> <tripod file> <Tx> <Ty>"\
16  "\nAuxiliary script to tilt footprint of system including detector and tripods."
17 fi
18 
19 if (( $# != 4 )); then
20  fatal "Wrong number of arguments."
21 fi
22 
24 set_variable TRIPOD $argv[2]
25 set_variable TX $argv[3]
26 set_variable TY $argv[4]
27 
28 if [[ ! -f $DETECTOR ]]; then
29  fatal "No detector file $DETECTOR."
30 fi
31 
32 if [[ ! -f $TRIPOD ]]; then
33  fatal "No tripod file $TRIPOD."
34 fi
35 
36 source JAcoustics.sh --
37 
38 CHECK_EXIT_CODE
39 
40 typeset -A TRIPODS
41 
42 get_tripods $TRIPOD TRIPODS
43 
44 let X_CENTER=0.0
45 let Y_CENTER=0.0
46 let Z_CENTER=0.0
47 
48 for key in "${(@k)TRIPODS}"; do
49 
50  echo $TRIPODS[${key}] | read X Y Z
51 
52  let X_CENTER="$X_CENTER + $X"
53  let Y_CENTER="$Y_CENTER + $Y"
54 done
55 
56 let X_CENTER="$X_CENTER / ${#TRIPODS}"
57 let Y_CENTER="$Y_CENTER / ${#TRIPODS}"
58 
59 
60 # Modify tripod positions
61 
62 for key in "${(@k)TRIPODS}"; do
63 
64  echo $TRIPODS[${key}] | read X Y Z
65 
66  let DZ="${TX} * (${X} - ${X_CENTER}) + ${TY} * (${Y} - ${Y_CENTER})"
67 
68  JEditTripod -f $TRIPOD -T "$key add 0.0 0.0 $DZ"
69 
70 done
71 
72 
73 # Modify module positions
74 
75 eval `JPrintDetector -a $DETECTOR -O HEADER`
76 
77 typeset -a OPTION
78 
79 JPrintDetector -a $DETECTOR -O modules | while read KEY MODULE STRING FLOOR X Y Z T0; do
80 
81  let DZ="$TX * ($X + $UTM_EAST - $X_CENTER) + $TY * ($Y + $UTM_NORTH - $Y_CENTER)"
82 
83  OPTION+=("$MODULE add 0.0 0.0 $DZ;")
84 
85 done
86 
87 JEditDetector \
88  -a $DETECTOR \
89  -M "$OPTION[*]" \
90  -o $DETECTOR \
91  -d $DEBUG
92 
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison fi case set_variable RANGE $argv[3]
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
then JMuonPostfit f
then usage $script< detector file >< inputfile > nUtility script to create PDF and CDF of transition time distribution fi case set_variable WORKDIR
Definition: JLegolas.sh:31
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
then echo
do echo $TRIPODS[${key}] read X Y Z let DZ
Definition: JFootprint.sh:66
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then break fi done getCenter read X Y Z let X
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then JCalibrateToT a
Definition: JTuneHV.sh:116
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
then fatal No tripod file $TRIPOD fi source JAcoustics sh CHECK_EXIT_CODE typeset A TRIPODS get_tripods $TRIPOD TRIPODS let X_CENTER
Definition: JFootprint.sh:44
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
set_variable DETECTOR
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP/tmp/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
script
Definition: JAcoustics.sh:2
then fatal Invalid tripod $TRIPOD
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null