Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDataQuality.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 QAQC_DEBUG 2
12 set_variable: WORKDIR QAQC_WORKDIR `pwd`
13 set_variable: FORMAT GRAPHICS_FORMAT gif
14 set_variable+ BATCH GRAPHICS_BATCH -B
15 
16 if do_usage $*; then
17  usage "$script [<detector identifier> <run range>] <QA/QC file>"\
18  "\nExample script to produce data quality plots."\
19  "\nWhen a detector identifier and run range are specified, data are downloaded from the database"\
20  "\nand subsequently stored in the given QA/QC file, unless this file already exists."
21 fi
22 
23 case $# in
24  0) fatal "Wrong number of arguments.";;
28 esac
29 
31 set_variable QUALITY_ROOT ${QUALITY_TXT%%.*}.root
32 
33 if (( $# == 3 )); then
34 
35  if ( ! reuse_file $QUALITY_TXT ); then
36 
37  JCookie.sh
38 
39  JDataQuality \
40  -D "$DETECTOR_ID" \
41  -R "${RANGE%%-*} ${RANGE##*-}" \
42  -o $QUALITY_TXT \
43  -d $DEBUG --!
44  else
45 
46  echo "Note that the specified detector identifer and runs are discarded."
47  fi
48 fi
49 
50 
51 JDataQuality \
52  -D "$DETECTOR_ID" \
53  -R "${RANGE%%-*} ${RANGE##*-}" \
54  -f $QUALITY_TXT \
55  -Q "livetime_s; 1200 60000" \
56  -Q "(UTCMax_s - UTCMin_s) - livetime_s; -100 +100" \
57  -Q "JDAQEvent / livetime_s; 0.05 50.0" \
58  -Q "HRV; 0.00 0.2" \
59  -Q "DAQ; 0.95 1.05" \
60  -Q "WR; 0.95 1.05" \
61  -Q "FIFO; 0.00 0.01" \
62  -Q "MEAN_Rate_Hz; 4500 15000" \
63  -Q "RMS_Rate_Hz; 200 5000" \
64  -Q "Acoustics / livetime_s; 0.0 100.0" \
65  -Q "AHRS / livetime_s; 0.0 100.0" \
66  -V "(JDAQEvent - JTriggerReprocessor) * 1.0 / (JDAQEvent + 1.0e-10); -5.0e-3 +5.0e-3" \
67  -V "out_sync; 0 0" \
68  -V "out_usync; 0 0" \
69  -o $QUALITY_ROOT \
70  -d $DEBUG --!
71 
72 CHECK_EXIT_CODE
73 
74 
75 JPlot1D \
76  -f ${QUALITY_ROOT}:h0 \
77  -\> "quality" \
78  -\^ "number of runs" \
79  -T "" \
80  -o $WORKDIR/${FILEPREFIX}_quality.${FORMAT} $BATCH
81 
82 JPlot1D \
83  -f ${QUALITY_ROOT}:h1 \
84  -\^ "number of runs" \
85  -T "" \
86  -o $WORKDIR/${FILEPREFIX}_selection.${FORMAT} $BATCH
87 
88 JPlot1D \
89  -w 1200x600 \
90  -f ${QUALITY_ROOT}:VETO \
91  -\> "run number" \
92  -O P \
93  -N "X 505" \
94  -T "VETO" \
95  -L BL \
96  -o $WORKDIR/${FILEPREFIX}_veto.${FORMAT} $BATCH
97 
98 typeset -A BUFFER
99 
100 BUFFER=(
101  \^livetime_s\$ livetime
102  UTC UTC-livetime
103  \^JDAQEvent\.\*livetime_s event-rate
104  \^\(JDAQEvent\.\*JTriggerReprocessor\) event-count
105  HRV HRV
106  \^DAQ\$ DAQ
107  WR WR
108  FIFO FIFO
109  MEAN_Rate_Hz PMT-rate-mean
110  RMS_Rate_Hz PMT-rate-rms
111  \^out_sync\$ out_sync
112  \^out_usync\$ out_usync
113  Acoustics acoustics
114  AHRS AHRS)
115 
116 for KEY VALUE in ${(@kv)BUFFER}; do
117 
118  JPlot1D \
119  -w 1200x600 \
120  -f ${QUALITY_ROOT}:${KEY} \
121  -\> "run number" \
122  -O P \
123  -N "X 505" \
124  -T "?" \
125  -o $WORKDIR/${FILEPREFIX}_${VALUE}.${FORMAT} $BATCH
126 done
data_type w[N+1][M+1]
Definition: JPolint.hh:778
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
Q(UTCMax_s-UTCMin_s)-livetime_s
V out_sync
Definition: JDataQuality.sh:67
esac done BUFFER
Definition: JMakePDF.sh:77
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
Q MEAN_Rate_Hz
Definition: JDataQuality.sh:62
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
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
&set_variable QUALITY_TXT
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
esac set_variable FILEPREFIX
Definition: JDataQuality.sh:30
Q JDAQEvent livetime_s
Definition: JDataQuality.sh:57
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Q DAQ
Definition: JDataQuality.sh:59
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
Q RMS_Rate_Hz
Definition: JDataQuality.sh:63
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
Q FIFO
Definition: JDataQuality.sh:61
then display $WORKDIR
Definition: plot-Domino.sh:128
then eval ls $DIR $ID $TYPE _
Definition: getArchive.sh:104
then echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
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 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:46
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
Q HRV
Definition: JDataQuality.sh:58
V out_usync
Definition: JDataQuality.sh:68
static const JPBS_t AHRS(3, 4, 3, 4)
PBS of compass
then fatal Invalid detector identifier $DETECTOR_ID fi set_variable RUNSETUPID typeset a RANGE RANGE[1]
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
Q WR
Definition: JDataQuality.sh:60