Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMonitorHV.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 DATABASE_DEBUG 1
12 set_variable: WORKDIR DATABASE_WORKDIR ./
13 set_variable: FORMAT GRAPHICS_FORMAT gif
14 set_variable+ BATCH GRAPHICS_BATCH -B
15 set_variable DIR $JPP_DIR/examples/JDB/
16 set_variable YMIN -1400 # V
17 set_variable YMAX -700 # V
18 set_variable POSITION ".*"
19 #set_variable POSITION 22
20 
21 if do_usage $*; then
22  usage "$script (input file)+"\
23  "Auxiliary script to monitor HV for a set of data taking files."
24 fi
25 
26 if (( $# < 1 )); then
27  fatal "Wrong number of arguments."
28 fi
29 
30 set_array INPUT_FILES $argv[1,-1]
31 
32 JCookie.sh
33 
34 typeset -Z 4 STRING
35 typeset -Z 2 FLOOR
36 if [[ "$POSITION" != ".*" ]]; then
37  typeset -Z 2 POSITION
38 fi
39 
40 RUNS=()
41 
42 for INPUT_FILE in $INPUT_FILES[*]; do
43 
44  echo "Processing $INPUT_FILE"
45 
46  JPrintDAQHeader -f $INPUT_FILE | read DETECTOR_ID RUN FRAME_INDEX UTC
47  getUTC -f $INPUT_FILE | read -A UTC
48 
49  RUNS+=($RUN)
50 
51  set_variable DETECTOR $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}.detx
52 
53  if ( ! reuse_file $DETECTOR ); then
54  JDetectorDB -D $DETECTOR_ID -r $RUN -o $DETECTOR
55  fi
56 
57  eval `JPrintDetector -a $DETECTOR -O SUMMARY`
58 
59  let X="0.5*($UTC[1] + $UTC[2])"
60 
61  JText \
62  -p "$X $(($YMAX - 0.05*($YMAX - $YMIN))) $RUN" \
63  -@ "align = 22" \
64  -@ "size = 20" \
65  -o /tmp/text_${RUN}.root
66 
67  for (( i = 1; $i <= 2; ++i )); do
68  JLine \
69  -p "$UTC[${i}] $YMIN $UTC[${i}] $YMAX" \
70  -@ "width = 2" \
71  -o /tmp/utc${i}_${RUN}.root
72  done
73 done
74 
75 
76 if ( ! reuse_file $WORKDIR/hv_${RUNS[1]}-${RUNS[-1]}.root ); then
77 
78  $DIR/JCheckHV \
79  -D $DETECTOR_ID \
80  -R "$RUNS[*]" \
81  -o $WORKDIR/hv_${RUNS[1]}-${RUNS[-1]}.root >& hv.log
82 fi
83 
84 getUTC -f "$INPUT_FILES[*]" | read -A UTC
85 
86 for STRING in $STRINGS; do
87 
88  echo -n "Creating graphics for string $STRING.."
89 
90  for (( FLOOR = 1; $FLOOR <= $LAST_FLOOR; FLOOR += 1 )); do
91 
92  JPlot1D \
93  -w 1200x600 \
94  -f "$WORKDIR/hv_${RUNS[1]}-${RUNS[-1]}.root:G\[${STRING}.${FLOOR}.${POSITION}].hv" \
95  -f/tmp/utc1_${^RUNS}".root:.*" \
96  -f/tmp/utc2_${^RUNS}".root:.*" \
97  -f/tmp/text_${^RUNS}".root:.*" \
98  -x "$(($UTC[1] - 500)) $(($UTC[2] + 500))" \
99  -y "$YMIN $YMAX" \
100  -S 0.5 \
101  -T "${STRING}.${FLOOR}.${POSITION}" \
102  -N "X 505" \
103  -t utc \
104  -o /tmp/hv_${STRING}_${FLOOR}.$FORMAT $BATCH
105  done
106 
107  montage \
108  -tile 6x3 \
109  -geometry +0+0 \
110  /tmp/hv_${STRING}_*.$FORMAT \ $WORKDIR/hv_${RUNS[1]}-${RUNS[-1]}_${STRING}.$FORMAT >& /dev/null
111 
112  echo " -> $WORKDIR/hv_${RUNS[1]}-${RUNS[-1]}_${STRING}.$FORMAT"
113 
114 done
115 
116 
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]
data_type w[N+1][M+1]
Definition: JPolint.hh:741
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable WORKDIR if do_usage *then usage for INPUT_FILE in $INPUT_FILES[*]
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
set_variable INPUT_FILE
do JCanberra a $DETECTOR f $INPUT_FILE o $WORKDIR canberra[${EMITTER}\] root T $WORKDIR tripod txt V $WORKDIR sound_velocity txt M $WORKDIR mechanics txt E $EMITTER d $DEBUG!done kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR set_variable FIRST_FLOOR for STRING in $STRINGS[*]
Definition: JCanberra.sh:63
Auxiliary data structure for line.
Definition: JText.cc:16
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
exit
Definition: JPizza.sh:36
do echo Generating $dir eval DIR
Definition: JPlotNPE1D.sh:54
data_type r[M+1]
Definition: JPolint.hh:742
fatal Invalid number of arguments esac let YMIN
Definition: testToT.sh:39
then echo
const int n
Definition: JPolint.hh:660
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null if do_usage *then usage $script< detector identifier > fi case set_variable DETECTOR_ID
Definition: JTDC.sh:11
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 rm i $OUTPUT_FILE fi let RUN
then break fi done getCenter read X Y Z let X
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
set_array INPUT_FILES
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
Auxiliary data structure for line.
Definition: JLine.cc:16
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
Definition: JMatrixNZ.sh:58
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 $DIR JCheckHV D $DETECTOR_ID R $RUN o $WORKDIR hv_
Definition: JCheckHV.sh:41
then display $WORKDIR
Definition: plot-Domino.sh:128
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
do set_variable INPUT_FILE $WORKDIR KM3NeT_
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
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
set_array RUNS
Definition: JDataQuality.sh:23
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
do alias $i