-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsetup.sh
executable file
·146 lines (116 loc) · 4.89 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#! /bin/sh
# $Id: setup.sh 1 01/12/2013 jalmond $
###################################################################################
# @Project: LQAnalyzer/SKTree - ROOT-based analysis framework for Korea CMS group #
# #
# @author John Almond <jalmond@cern.ch> - SNU #
# #
# Script that has to be sourced before compiling/running SFrame. #
# #
##################################################################################
# Greet the user
echo "Setting up environment for compiling/running CATAnalzer with SKTree"
export SKFLATVERSION="v9-4-9v2"
source bin/setup_timezone.sh
if [ $LQANALYZER_DIR ]; then
echo LQANALYZER_DIR is already defined, use a clean shell
return 1
fi
### setup any user aliases
source bin/setup_user.sh
##### setup root enviroment
export sktreemaker_version="False"
if [[ $1 == "sktreemaker" ]];
then
export sktreemaker_version="True"
fi
source bin/setup_root.sh $sktreemaker_version
# speficy the LQANALYZER_DIR base directory, i.e., the directory in which this file lives
export LQANALYZER_DIR=${PWD}
#### admin setup for analyzer
source bin/setup_admin.sh
python ${LQANALYZER_DIR}/scripts/CheckEmailIsSetup.py
cat_email="NULL"
while read line
do
prefix="email = "
if [[ $line == $prefix* ]];
then
line=${line:${#prefix}}
cat_email=$line
fi
done < ${LQANALYZER_DIR}/bin/catconfig
if [[ $cat_email == "NULL" ]];
then
echo "Email not setup. run setup.sh again"
export LQANALYZER_DIR=""
return 1
fi
### print git tag info
source bin/check_tag.sh
##### setup CMSSW version of analyzer
export yeartag="80X/"
### setup alias for using analyzer
if [[ $sktreemaker_version == "False" ]];
then
alias make_80x_fullclean="make distclean -f ${LQANALYZER_DIR}/bin/Make/Makefile80X"
alias make_80x_clean="make clean -f ${LQANALYZER_DIR}/bin/Make/Makefile80X"
alias make_80x="make -f ${LQANALYZER_DIR}/bin/Make/Makefile80X"
alias make_94x_fullclean="make distclean -f ${LQANALYZER_DIR}/bin/Make/Makefile94X"
alias make_94x_clean="make clean -f ${LQANALYZER_DIR}/bin/Make/Makefile94X"
alias make_94x="make -f ${LQANALYZER_DIR}/bin/Make/Makefile94X"
else
alias make_80x_fullclean="make distclean -f ${LQANALYZER_DIR}/bin/Make/Makefile80X_root5"
alias make_80x_clean="make clean -f ${LQANALYZER_DIR}/bin/Make/Makefile80X_root5"
alias make_80x="make -f ${LQANALYZER_DIR}/bin/Make/Makefile80X_root5"
alias make_94x_fullclean="make distclean -f ${LQANALYZER_DIR}/bin/Make/Makefile94X_root5"
alias make_94x_clean="make clean -f ${LQANALYZER_DIR}/bin/Make/Makefile94X_root5"
alias make_94x="make -f ${LQANALYZER_DIR}/bin/Make/Makefile94X_root5"
fi
alias cathistcounter="source scripts/Counter.sh "
alias catcutflowcounter="source scripts/CutFlow.sh "
alias sktree_80X="bash submitSKTree80X.sh"
alias sktree_94X="bash submitSKTree94X.sh"
alias sktreemaker_80X="bash submitSKTree80X.sh -M True "
alias sktreemaker_90X="bash submitSKTree94X.sh -M True "
alias sktree_val="bash submitSKTree.sh -V True "
alias sktree_bkg="nohup bash submitSKTree.sh -b True "
alias new_git_tag="bash "$LQANALYZER_DIR"/scripts/setup/git_newtag.sh"
alias git_commit_lq="bash scripts/setup/git_commit.sh"
alias sktree_bkg_log="python python/PrintBkgJob.py"
#### make all env variables used in alayzer
source bin/setup_analysis_aliases.sh
#### setup lib dir for new user/tag
source bin/setup_lib.sh
### Load cleaup functions
source ${LQANALYZER_BIN_PATH}/cleanup.sh
### setup workspace
python ${LQANALYZER_DIR}/python/SetUpWorkSpace.py
### make backup for important files
python ${LQANALYZER_DIR}/python/BackUpDirectory.py
### setup email list
python ${LQANALYZER_DIR}/python/SetupEmailList.py
if [ -z ${ROOTSYS} ] ; then
echo "Warning: ROOT environment doesn't seem to be configured!"
echo "Add these lines to your ~/.bashrc file to remove this warning in future."
echo ""
echo "source /usr/local/bin/thisroot.sh"
echo ""
export ROOTSYS=/usr/local
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib/root:
if [ -z ${ROOTSYS} ] ; then
echo "Error: ROOT environment cannot be configured!"
else echo "Setup root enviroment for user."
fi
fi
export LD_TMP_LIBRARY_PATH=${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${LQANALYZER_LIB_PATH}:${LD_LIBRARY_PATH}
export PATH=${LQANALYZER_BIN_PATH}:${PATH}
export PYTHONPATH=${LQANALYZER_DIR}/python:${PYTHONPATH}
export PAR_PATH=./:${LQANALYZER_LIB_PATH}
python ${LQANALYZER_DIR}/python/local_check.py
if [ ! -d ${LQANALYZER_LOG_PATH} ]; then
echo Directory ${LQANALYZER_LOG_PATH} does not exist ... creating it
mkdir ${LQANALYZER_LOG_PATH}
fi
echo "Running analysis from" $HOSTNAME " in directory: " $PWD