Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JRate.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to plot event rate of astrophysical source.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 
21 source $JPP_DIR/setenv.sh $JPP_DIR
22 
23 
26 set_variable INPUT_FILE $JPP_DATA/trigger_efficiency+background.root
28 set_variable NUMBER_OF_BLOCKS 2
29 
30 
31 if ( do_usage $* ); then
32  usage "$script [input file [output file]]"
33 fi
34 
35 case $# in
36  2) OUTPUT_FILE=$2;&
37  1) INPUT_FILE=$1;;
38 esac
39 
40 
41 if (( 1 )); then
42 
43  print_variable INPUT_FILE OUTPUT_FILE
44  check_input_file $INPUT_FILE
45 
46  $JPP_DIR/examples/JAstronomy/JRate \
47  -f $INPUT_FILE \
48  -o $OUTPUT_FILE \
49  -N $NUMBER_OF_BLOCKS \
50  -d $DEBUG --!
51 
52 fi
53 
54 
55 if (( 1 )); then
56 
57  JPlot1D \
58  -f ${OUTPUT_FILE}:ct \
59  -\> "cos(#theta)" \
60  -\^ "dP/d#Omega" \
61  -L TR
62 
63 fi
64 
65 
66 JPlot1D \
67  -f ${OUTPUT_FILE}:h0 \
68  -f ${OUTPUT_FILE}:h1 \
69  -y "0.01 4" \
70  -XXY \
71  -\> "E [GeV]" \
72  -\^ "Rate [events/year]" \
73  -L TR \
74  -o rate.gif
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
then for HISTOGRAM in h0 h1
Definition: JMatrixNZ.sh:69
&set_variable INPUT_FILE
Definition: JLegolas.sh:30
then JPizza f
Definition: JPizza.sh:46
then echo
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JPath.sh:52
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62