forked from lbrianza/ECALELF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_git.sh
executable file
·272 lines (227 loc) · 10.9 KB
/
setup_git.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#!/bin/bash
checkVERSION(){
case $CMSSW_VERSION in
CMSSW_5_3_7_patch6)
echo "[ERROR] $CMSSW_VERSION now deprecated, please use the CMSSW_5_3_14_patch2"
exit 1
;;
CMSSW_5_3_14_patch2)
echo "[INFO] Installing for $CMSSW_VERSION (2012 8TeV)"
;;
CMSSW_7_0_*)
echo "[INFO] Installing for $CMSSW_VERSION (2012 8TeV)"
;;
CMSSW_7_2_0_pre7)
echo "[INFO] Installing for $CMSSW_VERSION (2012 8TeV)"
;;
*)
echo "[ERROR] Sorry, $CMSSW_VERSION not configured for ECALELF"
echo " Be sure that you don't want 4_2_8_patch7 or CMSSW_4_4_5_patch2 or 5_3_14_patch2 or CMSSW_7_0_*"
exit 1
;;
esac
}
case $# in
1)
echo "[STATUS] Creating $1 CMSSW release working area"
CMSSW_VERSION=$1
checkVERSION
scram project CMSSW ${CMSSW_VERSION} || exit 1
cd ${CMSSW_VERSION}/src
eval `scramv1 runtime -sh`
;;
*)
checkVERSION
;;
esac
export CMSSW_VERSION
# put in the right directory
cd $CMSSW_BASE/src
#########################################################################################
echo "[STATUS] Download of the skims"
# last WSkim version
git-cms-addpkg DataFormats/EgammaCandidates #>> setup.log || exit 1
#########################################################################################
echo "[STATUS] Patch GsfElectrons for ECALELF rereco"
sed -i 's|[/]*assert|////assert|' DataFormats/EgammaCandidates/src/GsfElectron.cc
#########################################################################################
echo "[STATUS] Download ECALELF directory"
myDir=Calibration
if [ ! -d "$myDir" ];then
case "$USER" in
shervin)
git clone [email protected]:ECALELFS/ECALELF.git $myDir >> setup.log || exit 1 # read-only mode
;;
hengne)
git clone [email protected]:hengne/ECALELF.git $myDir >> setup.log || exit 1 # read-only mode
cd $myDir/ALCARAW_RECO/
git clone https://github.com/hengne/Utilities.git bin
;;
lbrianza)
git clone [email protected]:lbrianza/ECALELF.git $myDir >> setup.log || exit 1 # read-only mode
cd $myDir/
case $CMSSW_VERSION in
CMSSW_7_2_0_pre7)
echo "[INFO] Checkout: download for 720_pre7"
git checkout devel_7_2_0_pre7
;;
esac
;;
*)
### if you are not Shervin download this to have some useful scripts
git clone https://github.com/ECALELFS/ECALELF.git $myDir >> setup.log || exit 1 # read-only mode
cd $myDir/ALCARAW_RECO/
git clone https://github.com/ECALELFS/Utilities.git bin
;;
esac
fi
cd $CMSSW_BASE/src
#Other package to download:
# - Last stable pattuple code:
case $CMSSW_VERSION in
CMSSW_5_*)
git clone https://github.com/cms-cvs-history/DPGAnalysis-Skims DPGAnalysis/Skims >> setup.log || exit 1
cd DPGAnalysis/Skims/
git checkout DPGAnalysis-Skims-V01-00-07 >> setup.log || exit 1
cd -
#addpkg PhysicsTools/PatAlgos V08-10-05 >> setup.log
###### - Electron regression 5_3_X
git clone https://github.com/cms-cvs-history/DataFormats-PatCandidates DataFormats/PatCandidates >> setup.log || exit 1
cd DataFormats/PatCandidates >> setup.log || exit 1
git checkout DataFormats-PatCandidates-V06-05-06-10 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/PhysicsTools-PatAlgos PhysicsTools/PatAlgos >> setup.log || exit 1
cd PhysicsTools/PatAlgos >> setup.log || exit 1
git checkout PhysicsTools-PatAlgos-V08-09-56 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/PhysicsTools-PatUtils PhysicsTools/PatUtils >> setup.log || exit 1
cd PhysicsTools/PatUtils >> setup.log || exit 1
git checkout PhysicsTools-PatUtils-V03-09-28 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/DataFormats-CaloRecHit DataFormats/CaloRecHit >> setup.log || exit 1
cd DataFormats/CaloRecHit >> setup.log || exit 1
git checkout DataFormats-CaloRecHit-V02-05-11 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/DataFormats-StdDictionaries DataFormats/StdDictionaries >> setup.log || exit 1
cd DataFormats/StdDictionaries >> setup.log || exit 1
git checkout DataFormats-StdDictionaries-V00-02-14 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/FWCore-GuiBrowsers FWCore/GuiBrowsers >> setup.log || exit 1
cd FWCore/GuiBrowsers >> setup.log || exit 1
git checkout FWCore-GuiBrowsers-V00-00-70 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/RecoMET-METProducers RecoMET/METProducers >> setup.log || exit 1
cd RecoMET/METProducers >> setup.log || exit 1
git checkout RecoMET-METProducers-V03-03-12-02 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-cvs-history/RecoEgamma-EgammaTools RecoEgamma/EgammaTools >> setup.log || exit 1
cd RecoEgamma/EgammaTools >> setup.log || exit 1
git checkout RecoEgamma-EgammaTools-V09-00-01 >> setup.log || exit 1
cd - >> setup.log || exit 1
git clone https://github.com/cms-analysis/EgammaAnalysis-ElectronTools EgammaAnalysis/ElectronTools >> setup.log || exit 1
cd EgammaAnalysis/ElectronTools >> setup.log || exit 1
git checkout EgammaAnalysis-ElectronTools-MD-21Apr2013-test-2 >> setup.log || exit 1
cd - >> setup.log || exit 1
patch -p0 < $myDir/ALCARAW_RECO/test/electronRegression.patch >> setup.log || exit 1
cd EgammaAnalysis/ElectronTools/data/ >> setup.log || exit 1
cat download.url | xargs wget >> setup.log || exit 1
cd - >> setup.log || exit 1
###### New Josh regression
mkdir HiggsAnalysis/
cd HiggsAnalysis/
git clone -b legacyCompatibility https://github.com/bendavid/GBRLikelihood.git
git clone -b hggpaperV6 https://github.com/bendavid/GBRLikelihoodEGTools.git
cd -
mv GBRLikelihoodEGTools/data/*.root $myDir/EleNewEnergiesProducer/data/
echo "[STATUS] applying patch for CMSSW_5_X"
sed 's|,eleIt->ecalEnergyError()\*(nearestSC.*);|);|' $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc_topatch > $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc
if [ ! -e "$CMSSW_BASE/src/RecoEcal/EgammaCoreTools" ];then
git-cms-addpkg RecoEcal/EgammaCoreTools >> setup.log || exit 1
fi
if [ "`grep -c getEcalEBRecHitCollection $CMSSW_BASE/src/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h`" == "0" ];then
patch -p0 < $myDir/ALCARAW_RECO/test/clusterLazyTools.patch >> setup.log || exit 1
fi
#patch -p0 < $myDir/ALCARAW_RECO/test/class_def.xml.patch >> setup.log || exit 1
cp /afs/cern.ch/user/b/bendavid/cmspublic/regweights52xV3/*.root $myDir/EleNewEnergiesProducer/data/ >> setup.log || exit 1
# for pdfSystematics
scram setup lhapdffull
eval `scramv1 runtime -sh`
git-cms-addpkg ElectroWeakAnalysis/Utilities
scram b -j16
;;
CMSSW_7_2_0_pre7)
git-cms-addpkg EgammaAnalysis/ElectronTools >> setup.log || exit 1
patch -p1 < $myDir/ALCARAW_RECO/test/electronRegression700.patch >> setup.log || exit 1
cd EgammaAnalysis/ElectronTools/data/ >> setup.log || exit 1
cat download.url | grep '.root' | xargs wget >> setup.log || exit 1
cd - >> setup.log || exit 1
###### New Josh regression
mkdir HiggsAnalysis/
cd HiggsAnalysis/
git clone -b legacyCompatibility https://github.com/bendavid/GBRLikelihood.git
git clone -b hggpaperV6 https://github.com/bendavid/GBRLikelihoodEGTools.git
cd -
mv GBRLikelihoodEGTools/data/*.root $myDir/EleNewEnergiesProducer/data/
sed -i 's|REGRESSION=3|REGRESSION=4|' Calibration/*/BuildFile.xml
echo "<Flags CppDefines=\"CMSSW_7_0_X\"/>" >> $myDir/EleSelectionProducers/BuildFile.xml
echo "[STATUS] applying patch for CMSSW_5_X and following"
sed 's|,eleIt->ecalEnergyError()\*(nearestSC.*);|);|' $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc_topatch > $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc
echo "[STATUS] applying patch for CMSSW_7_2_0_pre7"
patch -p1 < $myDir/ALCARAW_RECO/test/EGEnergyCorrectorSemiParm.h.patch >> setup.log || exit 1
patch -p1 < $myDir/ALCARAW_RECO/test/EGEnergyCorrectorTraditional.h.patch >> setup.log || exit 1
patch -p1 < $myDir/ALCARAW_RECO/test/EGEnergyAnalyzerSemiParm.cc.patch >> setup.log || exit 1
if [ ! -e "$CMSSW_BASE/src/RecoEcal/EgammaCoreTools" ];then
git-cms-addpkg RecoEcal/EgammaCoreTools >> setup.log || exit 1
fi
if [ "`grep -c getEcalEBRecHitCollection $CMSSW_BASE/src/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h`" == "0" ];then
patch -p0 < $myDir/ALCARAW_RECO/test/clusterLazyTools.patch >> setup.log || exit 1
fi
cp /afs/cern.ch/user/b/bendavid/cmspublic/regweights52xV3/*.root $myDir/EleNewEnergiesProducer/data/ >> setup.log || exit 1
;;
CMSSW_7_*)
git-cms-addpkg EgammaAnalysis/ElectronTools >> setup.log || exit 1
patch -p1 < $myDir/ALCARAW_RECO/test/electronRegression700.patch >> setup.log || exit 1
cd EgammaAnalysis/ElectronTools/data/ >> setup.log || exit 1
cat download.url | grep '.root' | xargs wget >> setup.log || exit 1
cd - >> setup.log || exit 1
###### New Josh regression
mkdir HiggsAnalysis/
cd HiggsAnalysis/
git clone -b legacyCompatibility https://github.com/bendavid/GBRLikelihood.git
git clone -b hggpaperV6 https://github.com/bendavid/GBRLikelihoodEGTools.git
cd -
mv GBRLikelihoodEGTools/data/*.root $myDir/EleNewEnergiesProducer/data/
sed -i 's|REGRESSION=3|REGRESSION=4|' Calibration/*/BuildFile.xml
echo "<Flags CppDefines=\"CMSSW_7_0_X\"/>" >> $myDir/EleSelectionProducers/BuildFile.xml
echo "[STATUS] applying patch for CMSSW_5_X and following"
sed 's|,eleIt->ecalEnergyError()\*(nearestSC.*);|);|' $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc_topatch > $myDir/ALCARAW_RECO/src/ElectronRecalibSuperClusterAssociatorSH.cc
if [ ! -e "$CMSSW_BASE/src/RecoEcal/EgammaCoreTools" ];then
git-cms-addpkg RecoEcal/EgammaCoreTools >> setup.log || exit 1
fi
if [ "`grep -c getEcalEBRecHitCollection $CMSSW_BASE/src/RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h`" == "0" ];then
patch -p0 < $myDir/ALCARAW_RECO/test/clusterLazyTools.patch >> setup.log || exit 1
fi
cp /afs/cern.ch/user/b/bendavid/cmspublic/regweights52xV3/*.root $myDir/EleNewEnergiesProducer/data/ >> setup.log || exit 1
esac
# compile
scram b -j16
# for file in `find -name '*.url'`;
# do
# if [ "`basename $file`" == "copy.url" ];then
# #echo $file;
# for cpFile in `cat $file`;
# do
# cp -u $cpFile `dirname $file`;
# done;
# fi;
# if [ "`basename $file`" == "download.url" ];then
# echo $file;
# for cpFile in `cat $file`;
# do
# cvs co -l -d `dirname $file` $cpFile
# done;
# fi;
# done
####--------> Each time you set your environment!
#PATH=$PATH:$CMSSW_BASE/$myDir/ALCARAW_RECO/bin
#Previous command MUST be executed every time you log in