Jpp  16.0.3
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> <first run> <last run>] <QA/QC file>"\
18  "\nExample script to produce data quality plots."\
19  "\nWhen a detector identifier and runs are specified, data are downloaded from the database"\
20  "\nand subsequently stored in the QA/QC file beforehand."
21 fi
22 
23 case $# in
24  0) fatal "Wrong number of arguments.";;
26  set_array RUNS $argv[2,-2];&
28 esac
29 
31 set_variable QUALITY_ROOT ${QUALITY_TXT%%.*}.root
32 
33 if (( ${#RUNS} > 0 )); then
34 
35  if ( ! reuse_file $QUALITY_TXT ); then
36 
37  JCookie.sh
38 
39  JDataQuality \
40  -D "$DETECTOR_ID" \
41  -R "$RUNS[*]" \
42  -o $QUALITY_TXT \
43  -d $DEBUG --!
44  fi
45 fi
46 
47 JDataQuality \
48  -f $QUALITY_TXT \
49  -Q "livetime_s; 1200 60000" \
50  -Q "(UTCMax_s - UTCMin_s) - livetime_s; -100 +100" \
51  -Q "JDAQEvent / livetime_s; 0.05 50.0" \
52  -Q "HRV; 0.00 0.2" \
53  -Q "DAQ; 0.95 1.05" \
54  -Q "WR; 0.95 1.05" \
55  -Q "FIFO; 0.00 0.01" \
56  -Q "MEAN_Rate_Hz; 4500 15000" \
57  -Q "RMS_Rate_Hz; 200 5000" \
58  -Q "Acoustics / livetime_s; 0.0 100.0" \
59  -Q "AHRS / livetime_s; 0.0 100.0" \
60  -V "(JDAQEvent - JTriggerReprocessor) * 1.0 / (JDAQEvent + 1.0e-10); -5.0e-3 +5.0e-3" \
61  -V "out_sync; 0 0" \
62  -o $QUALITY_ROOT \
63  -d $DEBUG --!
64 
65 JPlot1D \
66  -f ${QUALITY_ROOT}:h0 \
67  -\> "quality" \
68  -\^ "number of runs" \
69  -T "" \
70  -o $WORKDIR/${FILEPREFIX}_quality.${FORMAT} $BATCH
71 
72 JPlot1D \
73  -f ${QUALITY_ROOT}:h1 \
74  -\^ "number of runs" \
75  -T "" \
76  -o $WORKDIR/${FILEPREFIX}_selection.${FORMAT} $BATCH
77 
78 JPlot1D \
79  -w 1200x600 \
80  -f ${QUALITY_ROOT}:VETO \
81  -\> "run number" \
82  -O P \
83  -T "VETO" \
84  -L BL \
85  -o $WORKDIR/${FILEPREFIX}_veto.${FORMAT} $BATCH
86 
87 typeset -A BUFFER
88 
89 BUFFER=(
90  \^livetime_s\$ livetime
91  UTC UTC-livetime
92  \^JDAQEvent\.\*livetime_s event-rate
93  \^\(JDAQEvent\.\*JTriggerReprocessor\) event-count
94  HRV HRV
95  \^DAQ\$ DAQ
96  WR WR
97  FIFO FIFO
98  MEAN_Rate_Hz PMT-rate-mean
99  RMS_Rate_Hz PMT-rate-rms
100  \^out_sync\$ out_sync
101  Acoustics acoustics
102  AHRS AHRS)
103 
104 for KEY VALUE in ${(@kv)BUFFER}; do
105 
106  JPlot1D \
107  -w 1200x600 \
108  -f ${QUALITY_ROOT}:${KEY} \
109  -\> "run number" \
110  -O P \
111  -T "?" \
112  -o $WORKDIR/${FILEPREFIX}_${VALUE}.${FORMAT} $BATCH
113 done
data_type w[N+1][M+1]
Definition: JPolint.hh:757
Q(UTCMax_s-UTCMin_s)-livetime_s
set_array RUNS
V out_sync
Definition: JDataQuality.sh:61
*set_variable DETECTOR_ID $argv[1] set_array RUNS $argv[2,-2]
Definition: JDataQuality.sh:24
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
Q MEAN_Rate_Hz
Definition: JDataQuality.sh:56
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
then for HISTOGRAM in h0 h1
Definition: JMatrixNZ.sh:71
&set_variable QUALITY_TXT
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
esac set_variable FILEPREFIX
Definition: JDataQuality.sh:30
then JCookie sh JDataQuality D $DETECTOR_ID R $RUNS[*] o $QUALITY_TXT d $DEBUG!fi fi JDataQuality f $QUALITY_TXT Q livetime_s
Definition: JDataQuality.sh:49
then echo
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
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
Q DAQ
Definition: JDataQuality.sh:53
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 usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
Q RMS_Rate_Hz
Definition: JDataQuality.sh:57
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
Q FIFO
Definition: JDataQuality.sh:55
std::vector< int > count
Definition: JAlgorithm.hh:180
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
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR $JPP_DATA set_variable MAKE_PDF set_variable MERGE_PDF set_variable MAKE_CDF set_variable CLEAN set_variable BACKGROUND set_variable WGET set_variable RMAX_M set_variable absorptionLengthFactor set_variable scatteringLengthFactor BUFFER
Definition: JMakePDF.sh:36
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
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
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
Q HRV
Definition: JDataQuality.sh:52
static const JPBS_t AHRS(3, 4, 3, 4)
PBS of compass
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
Q WR
Definition: JDataQuality.sh:54