Jpp  15.0.5
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
testToT.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Example script to test JFitToT results.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 
18 source $JPP_DIR/setenv.sh $JPP_DIR
19 
20 zmodload zsh/mathfunc
21 
22 set_variable: DEBUG FITTOT_DEBUG 3
23 set_variable: CHI2_MIN FITTOT_CHI2_MIN 0.0
24 set_variable: CHI2_MAX FITTOT_CHI2_MAX 3.0
25 set_variable: GAIN_MIN FITTOT_GAIN_MIN 0.0
26 set_variable: GAIN_MAX FITTOT_GAIN_MAX 2.0
27 set_variable: GAINSPREAD_MIN FITTOT_GAINSPREAD_MIN 0.0
28 set_variable: GAINSPREAD_MAX FITTOT_GAINSPREAD_MAX 1.0
29 
30 if do_usage $*; then
31  usage "$script (input file)+"
32 fi
33 
34 case $# in
35  *) INPUT_FILES=($*);;
36  0) fatal "Invalid number of arguments"
37 esac
38 
39 let YMIN=((pow(10,$CHI2_MIN)))
40 let YMAX=((pow(10,$CHI2_MAX)))
41 
42 for INPUT_FILE in $INPUT_FILES[*]; do
43 
45 
46  JTestRange1D \
47  -f ${INPUT_FILE}:\^chi2\$ \
48  -H "GetEntries 0.5 1.0e10" \
49  -x "$CHI2_MIN $CHI2_MAX" -X \
50  -y "0.0 0.0" \
51  -d $DEBUG --!
52 
53  CHECK_EXIT_CODE
54 
55  JTestRange1D \
56  -f ${INPUT_FILE}:\.\*.1chi2\$ \
57  -y "$YMIN $YMAX" \
58  -d $DEBUG
59 
60  CHECK_EXIT_CODE
61 
62  JTestRange1D \
63  -f ${INPUT_FILE}:\.\*.1gain\$ \
64  -y "$GAIN_MIN $GAIN_MAX" \
65  -d $DEBUG
66 
67  CHECK_EXIT_CODE
68 
69  JTestRange1D \
70  -f ${INPUT_FILE}:\.\*.1gainspread\$ \
71  -y "$GAINSPREAD_MIN $GAINSPREAD_MAX" \
72  -d $DEBUG
73 
74  CHECK_EXIT_CODE
75 
76 done
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 JMuonPostfit f
static const double FITTOT_GAIN_MAX
Default maximal gain.
Definition: JFitToT.hh:44
static const double FITTOT_GAIN_MIN
Default minimal gain.
Definition: JFitToT.hh:43
set_variable INPUT_FILE
static const double H
Planck constant [eV s].
exit
Definition: JPizza.sh:36
fatal Invalid number of arguments esac let YMIN
Definition: testToT.sh:39
then echo
static const double FITTOT_GAINSPREAD_MAX
Default maximal gain spread.
Definition: JFitToT.hh:47
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:20
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
then break fi done getCenter read X Y Z let X
int debug
debug level
Definition: JSirene.cc:63
* usage
set_array INPUT_FILES
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
static const double FITTOT_GAINSPREAD_MIN
Default minimal gain spread.
Definition: JFitToT.hh:46
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:41
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/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
script
Definition: JAcoustics.sh:2