Jpp - 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 usage for INPUT_FILE in $INPUT_FILES[*]
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
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 JPizza f
Definition: JPizza.sh:46
then echo
static const double FITTOT_GAINSPREAD_MAX
Default maximal gain spread.
Definition: JFitToT.hh:47
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:45
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:38
script
Definition: JAcoustics.sh:2
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62