ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/macros/drawSynchro.sh
Revision: 1.3
Committed: Mon Aug 27 10:26:40 2012 UTC (12 years, 8 months ago) by cwiok
Content type: application/x-sh
Branch: MAIN
CVS Tags: Artur_11_07_2013_B, Artur_11_07_2013_A, Artur_11_07_2013, Artur_28_06_2013, Mikolaj_cmssw533, HEAD
Changes since 1.2: +6 -4 lines
Error occurred while calculating annotation data.
Log Message:
Updated scripts for making the plots

File Contents

# Content
1 #!/bin/bash
2 . /etc/bashrc
3 #
4 # This shell script executes drawSynchro.C ROOT macro.
5 # Parses delays.txt file created by synchroMerger and plots:
6 # - distribution of BX average for LBs
7 # - distribution of BX rms for LBs
8 # - cumulative distribution of LBs vs window size around L1A
9 # that contains a given fraction of LB hits.
10 #
11 echo Start.
12 pdir=`pwd`
13
14 if [ $# -ne 3 ]; then
15 echo
16 echo "Usage: "`basename $0`" <RunRange_string> <DataSet_string> <OutFiles_prefix>"
17 echo
18 echo "where: <RunRange_string>, <DataSet_string> - are comments to be shown"
19 echo " in the plots."
20 echo
21 echo " <OutFile_prefix> - prefix for output file names."
22 echo
23 echo "The script will process 'delays_*.txt' files located in the current"
24 echo "directory and produce synchronization plots in three formats:"
25 echo ".root, .png and .eps. They will be stored in 'root', 'png' and 'eps'"
26 echo "subdirectories respectively. For example:"
27 echo " "`basename $0`" \"140000-150000\" \"Cosmics\" \"plot\""
28 echo "will produce .png files like this:"
29 echo " png/plot_Barrel+Endcap_*.png"
30 echo " png/plot_Barrel_*.png"
31 echo " png/plot_Endcap_*.png, etc, etc"
32 echo "and .root files like this:"
33 echo " root/plot_Barrel+Endcap.root"
34 echo " root/plot_Barrel.root"
35 echo " root/plot_Endcap.root, etc, etc."
36 echo
37 exit -1
38 fi
39 #
40 # convert to absolute paths
41 cd `dirname $0` ; scriptdir=`pwd` ; cd -
42 input1=`pwd`
43 prefix=`basename $3`
44 string="${scriptdir}/drawSynchro.C++(\"${input1}\", \"$1\", \"$2\", \"$prefix\")"
45 #
46 if ! [ -f "${scriptdir}/drawSynchro.C" ]; then
47 echo "Can't find ${scriptdir}/drawSynchro.C!"
48 exit -2
49 fi
50 if ! [ -f "${scriptdir}/Style.C" ]; then
51 echo "Can't find ${scriptdir}/Style.C!"
52 exit -2
53 fi
54 #
55 root.exe -l -q "${string}"
56 mkdir -p fig_synchro_root fig_synchro_eps fig_synchro_png fig_synchro_C fig_synchro_pdf
57 ls -lart
58 \mv `\ls -1 ${prefix}*.root` fig_synchro_root/.
59 \mv `\ls -1 ${prefix}*.eps` fig_synchro_eps/.
60 \mv `\ls -1 ${prefix}*.png` fig_synchro_png/.
61 \mv `\ls -1 ${prefix}*.C` fig_synchro_C/.
62 \mv `\ls -1 ${prefix}*.pdf` fig_synchro_pdf/.
63
64 cd ${pdir}
65 echo Done.