Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
thresholdCalibration.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author acreusot
5 #
6 version=1.0
7 script=${0##*/}
8 
9 # ------------------------------------------------------------------------------------------
10 #
11 # Utility script to test threshold calibration.
12 #
13 # ------------------------------------------------------------------------------------------
14 # all data related to the threshold calibration have to be set in the same directory
15 
16 
17 if [ -z $JPP_DIR ]; then
18  echo "Variable JPP_DIR undefined."
19  exit
20 fi
21 
22 source $JPP_DIR/setenv.sh $JPP_DIR
23 
25 
26 if do_usage $*; then
27  usage "$script <working directory> <detector file> <threshold data directory>"
28 fi
29 
30 case $# in
31  3) set_variable THDIR $3;
34  *) fatal "wrong number of arguments!";;
35 esac
36 
37 # Retrieve cookie
38 JCookie.sh
39 
40 for FILEPATH in $(ls ${WORKDIR}/${THDIR}/); do
41  CURFILE=("${WORKDIR}/${THDIR}/${FILEPATH}")
42  TMP1=${FILEPATH#*_}
43  TMP2=${TMP1#*_}
44  RUNNB=${TMP2%.root}
45  if (( 1 )); then
46  JCalibrateToT \
47  -d $DEBUG \
48  -f ${CURFILE} \
49  -a ${WORKDIR}/${DETX} \
50  -C JDAQTimesliceL0 \
51  -o ${WORKDIR}/${FILEPATH%.root}_calibrateToT.root
52  fi
53 
54  if (( 1 )); then
55  JIntegrateToT \
56  -d $DEBUG \
57  -f ${WORKDIR}/${FILEPATH%.root}_calibrateToT.root \
58  -o ${WORKDIR}/${DETX%.detx}_integrateToT.txt \
59  -a ${WORKDIR}/${DETX} \
60  -r ${RUNNB}
61  fi
62 
63 done
64 
65 if (( 1 )); then
66  JTuneTH \
67  -d $DEBUG \
68  -a ${WORKDIR}/${DETX} \
69  -f ${WORKDIR}/${DETX%.detx}_integrateToT.txt \
70  -o ${WORKDIR}/${DETX%.detx}_thresholdTuning.json \
71  -t 0.5 \
72  -T "TH-TUNING-SEA-v1"
73 fi
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
data_type r[M+1]
Definition: JPolint.hh:758
then echo
static const double C
Physics constants.
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
set_variable DETX
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 JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG if do_usage *then usage $script< working directory >< detectorfile >< thresholddatadirectory > fi case set_variable THDIR
then JCalibrateToT a
Definition: JTuneHV.sh:116
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
do CURFILE
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
version
Definition: JCalibratePMT.sh:7