Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JTransitTime.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 transition time spread from JDETECTOR::JPMTAnalogueSignaProcessor.
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 DIR $JPP_DIR/examples/JDetector
28 set_variable NUMBER_OF_ENTRIES 10000000
29 
30 
31 if ( do_usage $* ); then
32  usage "$script [output file]"
33 fi
34 
35 case $# in
37 esac
38 
39 typeset -A TTS
40 
41 for OPTION in 1 38 41; do
42 
43  $DIR/JTransitTime \
44  -o ${OUTPUT_FILE/\%/[${OPTION}]} \
45  -n 0 \
46  -O $OPTION \
47  -n $NUMBER_OF_ENTRIES \
48  -d $DEBUG
49 
50  JFit \
51  -f ${OUTPUT_FILE/\%/[${OPTION}]}:pmt \
52  -F "[0]*exp(-0.5*(x-[1])*(x-[1])/([2]*[2]))" \
53  -@ "p0 = 0.8*GetMaximum" \
54  -@ "p1 = 0.0" \
55  -@ "p2 = 2.0" \
56  -o $WORKDIR/fit.root >& /dev/null
57 
58  set_array P2 `JPrintFit -f $WORKDIR/fit.root:pmt -@p2`
59 
60  TTS[${OPTION}]=$P2[1]
61 
62  JPlot1D \
63  -f ${OUTPUT_FILE/\%/[${OPTION}]}:tts \
64  -f ${OUTPUT_FILE/\%/[${OPTION}]}:pmt \
65  -y "1e-5 1.0" -Y \
66  -\> "time [ns]" \
67  -\^ "probability" \
68  -L TR \
69  -T ""
70 done
71 
72 JPlot1D \
73  -f ${OUTPUT_FILE/\%/[0]}:tts \
74  -f ${OUTPUT_FILE/\%/[38]}:tts \
75  -f ${OUTPUT_FILE/\%/[41]}:tts \
76  -y "1e-5 1.0" -Y \
77  -\> "time [ns]" \
78  -\^ "probability" \
79  -L TR \
80  -T ""
81 
82 for key value in ${(@kv)TTS}; do
83  printf "option %3d sigma %6.3f [ns]\n" $key $value
84 done
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
do echo Generating $dir eval DIR
Definition: JPlotNPE1D.sh:52
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
then echo
do set_variable OUTPUT_DIRECTORY $WORKDIR T
&set_variable OUTPUT_FILE
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
then awk F
* usage
p2
Definition: module-Z:fit.sh:48
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
alias put_queue eval echo n
Definition: qlib.csh:19
then display $WORKDIR
Definition: plot-Domino.sh:127
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
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 typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
version
Definition: JCalibratePMT.sh:7
*fatal Wrong option $OPTION
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62