Jpp  test_elongated_shower_pde
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JCheckK40.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 CALIBRATION_DEBUG 1
12 set_variable: WORKDIR CALIBRATION_WORKDIR `pwd`
13 set_variable: DAQ_TIMESLICE CALIBRATION_TIMESLICE JDAQTimesliceL1
14 set_variable+ DATABASE_OPTION CALIBRATION_USEPMTID -U
15 set_variable: FORMAT GRAPHICS_FORMAT gif
16 set_variable+ BATCH GRAPHICS_BATCH -B
17 
18 if do_usage $*; then
19  usage "$script <detector file> <input file> <input file> <input file>"\
20  "\nThe 1st and 3rd input file should correspond to a data taking run in which the HV settings are complete (e.g. \"vendor\" or \"tuned\")."\
21  "\nThe 2nd input file should correspond to a run with so-called hybrid HV settings."\
22  "\nIn this, half of the PMTs should have the same HV settings as either the 1st or 3rd input file."
23 fi
24 
25 if (( $# == 4 )); then
27  set_array INPUT_FILES $argv[2,-1]
28 else
29  fatal "Wrong number of arguments."
30 fi
31 
32 
33 RUNS=()
34 
35 for INPUT_FILE in $INPUT_FILES[*]; do
36 
37  JPrintDAQHeader -f $INPUT_FILE | read DETECTOR_ID RUN FRAME_INDEX UTC
38 
39  RUNS+=($RUN)
40 
41  # Background option
42 
43  if (( `JPrintTree -f $INPUT_FILE | awk '/JDAQSummaryslice/ { print $3 } '` > 0 )); then
44  set_variable OPTION rates
45  else
46  set_variable OPTION counts
47  fi
48 
49  set_variable OUTPUT_FILE $WORKDIR/monitor_${RUN}.root
50 
51  if [[ ! -f $OUTPUT_FILE ]]; then
52 
53  JCalibrateK40 \
54  -f $INPUT_FILE \
55  -C $DAQ_TIMESLICE \
56  -a $DETECTOR \
57  -o $OUTPUT_FILE \
58  -b $OPTION \
59  -d $DEBUG
60  fi
61 done
62 
63 #
64 # Monitor pair of data taking runs.
65 #
66 # \param 1 1st run
67 # \param 2 2nd run
68 #
69 function monitor()
70 {
71  $JPP_DIR/examples/JCalibrate/JCheckK40 \
72  -a $DETECTOR \
73  -f "$WORKDIR/monitor_${1}.root $WORKDIR/monitor_${2}.root" \
74  -o $WORKDIR/monitor\[${1}-${2}\].root \ $DATABASE_OPTION \
75  -d $DEBUG --!
76 }
77 
78 # Monitor
79 
80 monitor $RUNS[1] $RUNS[2]
81 monitor $RUNS[2] $RUNS[3]
82 
83 if (( 1 )); then
84 
85  eval `JPrintDetector -a $DETECTOR -O SUMMARY`
86 
87  kill_child_processes_at_exit
88 
89  attach getModule -a $DETECTOR
90 
91  typeset -Z 4 STRING
92  typeset -Z 2 FLOOR
93 
94  for STRING in $STRINGS[*]; do
95  for (( FLOOR = 1; $FLOOR <= 18; ++FLOOR )); do
96 
97  sput $STRING $FLOOR
98  sget MODULE
99 
100  JPlot1D \
101  -f $WORKDIR/monitor\[${RUNS[1]}-${RUNS[2]}\].root:${MODULE} \
102  -f $WORKDIR/monitor\[${RUNS[2]}-${RUNS[3]}\].root:${MODULE} \
103  -y "-10.0 +10.0" \
104  -\> "PMT" \
105  -\^ "#Deltat [ns]" \
106  -T "${STRING}.${FLOOR} ($MODULE)" \
107  -L TL \
108  -o ${MODULE}-${RUNS[1]}-${RUNS[2]}-${RUNS[3]}.${FORMAT} $BATCH
109  done
110  done
111 
112  detach
113 fi
114 
&set_variable DAQ_TIMESLICE
Definition: JLegolas.sh:32
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
Definition: JDataMonitor.sh:24
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[*]
set_array RUNS
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
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
then echo
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 H $WORKDIR hydrophone txt E $EMITTER $DISABLE d $DEBUG!done kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR for STRING in $STRINGS[*]
Definition: JCanberra.sh:64
static const double C
Physics constants.
then fatal Invalid string $STRING
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 fatal Detector file should be binary format fi eval JPrintDetector a $DETECTOR O IDENTIFIER typeset a INPUT_FILES for RANGE in $RUNS[*]
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 STRING_TXT awk
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then rm i $OUTPUT_FILE fi let RUN
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 ${TMPDIR:-/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
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
* usage
then JConvertDetectorFormat a $DETECTOR[1] o
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
set_variable INPUT_FILE
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:73
&set_variable OUTPUT_FILE
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 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
static void monitor()
Definition: DataQueue.cc:32
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:42
script
Definition: JAcoustics.sh:2
*fatal Wrong option $OPTION
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number