Jpp  18.6.0-rc.1
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 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 -@ "type = JDAQSummaryslice" -k number_of_entries` > 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
*fatal Wrong number of arguments esac source JAcousticsToolkit sh mkdir p $WORKDIR post calibration pushd $WORKDIR post calibration post calibration_D0ARCA021 sh $DIR popd set_variable DETECTOR $WORKDIR post calibration detector datx set_variable TRIPOD $WORKDIR post calibration tripod txt set_variable DETECTOR_INITIAL detector_initial datx expand_array RUNS mkdir p $HOMEDIR cd $HOMEDIR JDetectorDB D $DETECTOR_ID r $RUNS[1] V WW o $DETECTOR_INITIAL JEditDetector a $DETECTOR r o detector_tmp datx!eval JPrintDetector a $DETECTOR_INITIAL O SUMMARY
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 fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
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 usage eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID JCanberra sh $DETECTOR $INPUT_FILES[*] $WORKDIR canberra[%\] root source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR for STRING in $STRINGS[*]
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O SUMMARY JPrintDAQHeader f $INPUT_FILE read A DAQ_HEADER set_variable DETECTOR_ID
Definition: JSquid.sh:28
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
exit
Definition: JPizza.sh:36
then
Definition: datalogs.sh:34
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then fatal Missing detector file $DETECTOR fi eval JPrintDetector a $DETECTOR O IDENTIFIER RUNS
static const double C
Physics constants.
then fatal Invalid string $STRING
then JCalibrateToT a
Definition: JTuneHV.sh:107
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then rm i $OUTPUT_FILE fi let RUN
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[*]
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
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 JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
&set_variable OUTPUT_FILE
set_variable INPUT_FILE
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonStart.sh:47
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
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
do sput $STRING $FLOOR sget MODULE INPUT_FILES
then fatal Abort fi fi done for RUN in $RUNS[*]
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 echo
Definition: JQAQC.sh:92
*fatal Wrong option $OPTION
then getFile sh $JPP_ARCHIVE $DETECTOR_ID $RUNS[1] $KEY $VERSION $WORKDIR
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
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62