From 497e852d8c26a830c3643278958ffdc3cb72eab7 Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 11:16:06 +0200 Subject: [PATCH 1/6] obsolete README See the main README in the main directory. Fixes #6 --- bash/README | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 bash/README diff --git a/bash/README b/bash/README deleted file mode 100644 index 568b544..0000000 --- a/bash/README +++ /dev/null @@ -1,17 +0,0 @@ -git clone git@github.com:gerbaudo/susynt-write.git -cd susynt-write -git checkout -b xaod origin/xaod - -================================================== -Follow these instructions to install from fresh: - -bash/setup_area.sh 2>&1 | tee install.log - -Then -cd prod - -//Do this each time you setup a new terminal. -source sourceme.sh - -cd SusyCommon/run -./test_and_log.sh From 14737064d0f2c302b1559026c70b849c7e4771bd Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 11:52:28 +0200 Subject: [PATCH 2/6] improve script Details: - more robust parsing opts, automatic https vs. ssh (as in susynt/susynt-read#5) - safer `git checkout` (only after successfull cd). --- README.md | 2 +- bash/setup_area.sh | 96 +++++++++++++++++++++++++++------------------- 2 files changed, 57 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index f2aa8a6..90dee04 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Follow these commands to set up an area to read SusyNtuples. git clone git@github.com:gerbaudo/susynt-write.git --branch xaod cd susynt-write source bash/setup_release.sh -./bash/setup_area.sh 2>&1 | tee install.log +./bash/setup_area.sh [--dev] 2>&1 | tee install.log rc find_packages rc compile 2>&1 | tee compile.log ``` diff --git a/bash/setup_area.sh b/bash/setup_area.sh index 1b80f52..7100855 100755 --- a/bash/setup_area.sh +++ b/bash/setup_area.sh @@ -64,53 +64,69 @@ function checkout_packages_external { } function checkout_packages_uci { - local dev_or_stable="$1" # whether we should checkout the dev branch or the latest production tags - cd ${PROD_DIR} - git clone git@github.com:gerbaudo/SusyNtuple.git SusyNtuple - cd SusyNtuple - if [ "${dev_or_stable}" = "--stable" ] + local dev_or_stable="$1" + local GIT="" + local tag_common="" + local tag_ntuple="" + if [[ "${dev_or_stable}" = "dev" ]] then - git checkout SusyNtuple-00-03-01 # tag n0213-02 - else - git checkout -b master origin/master - fi - cd - - git clone git@github.com:gerbaudo/SusyCommon.git SusyCommon - cd SusyCommon - if [ "${dev_or_stable}" = "--stable" ] + GIT="git@github.com:" # read+write + tag_common="mc15" + tag_ntuple="master" + elif [[ "${dev_or_stable}" = "stable" ]] then - git checkout SusyCommon-00-02-10 # tag n0213 + GIT="https://github.com/" # read-only + tag_common="SusyCommon-00-02-10" # tag n0213 + tag_ntuple="SusyNtuple-00-03-01" # tag n0213-02 else - git checkout -b mc15 origin/mc15 + echo "unknown dev_or_stable '${dev_or_stable}'" fi - cd - -} + cd ${PROD_DIR} + git clone ${GIT}susynt/SusyNtuple.git SusyNtuple + git clone ${GIT}susynt/SusyCommon.git SusyCommon + cd ${PROD_DIR}/SusyNtuple && git checkout ${tag_ntuple} + cd ${PROD_DIR}/SusyCommon && git checkout ${tag_common} + cd ${PROD_DIR} +} +#----------------------------------------------------------- function main { - if [ $# -ge 2 ]; then - print_usage - return - elif [ $# -eq 1 ] && [ "$1" == "--help" ]; then + # parse as in + # http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash + local dev_or_stable="stable" + local help="" + while [[ $# > 0 ]] + do + key="$1" + case $key in + --dev) + dev_or_stable="dev" + ;; + -h|--help) + help=true + ;; + *) + # unknown option + ;; + esac + shift # past argument or value + done + + + if [[ ${help} ]] + then print_usage - return - fi - echo "Starting -- `date`" - # todo: sanity/env checks (probably better off in python) - # if missing_kerberos - # then - # echo "cannot continue" - # return 1 - # else - # echo "checkout and compile" - # fi - prepare_directories - checkout_packages_external - checkout_packages_uci $* - echo "Done -- `date`" - echo "You can now go ahead and compile with:" - echo "rc find_packages" - echo "rc compile 2>&1 | tee compile.log" + else + echo "Starting -- `date`" + prepare_directories + checkout_packages_external + checkout_packages_uci ${dev_or_stable} + echo "Done -- `date`" + echo "You can now go ahead and compile with:" + echo "rc find_packages" + echo "rc compile 2>&1 | tee compile.log" + fi } - +#----------------------------------------------------------- main $* From eb16340fa7dfab05bb6ad0f025006e61a7cd2795 Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 11:56:38 +0200 Subject: [PATCH 3/6] follows susnyt/SusyCommon#78 --- bash/setup_area.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/setup_area.sh b/bash/setup_area.sh index 7100855..a7fa1ad 100755 --- a/bash/setup_area.sh +++ b/bash/setup_area.sh @@ -71,7 +71,7 @@ function checkout_packages_uci { if [[ "${dev_or_stable}" = "dev" ]] then GIT="git@github.com:" # read+write - tag_common="mc15" + tag_common="master" tag_ntuple="master" elif [[ "${dev_or_stable}" = "stable" ]] then From f4b03d740b2503a205e3b44dc8bddb23a1c36433 Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 11:58:17 +0200 Subject: [PATCH 4/6] update gitignore --- .gitignore | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index 3703ad4..1a20a02 100644 --- a/.gitignore +++ b/.gitignore @@ -20,38 +20,16 @@ *.out *.app -# files & dirs created during the installation +# directories and files created during the installation +AssociationUtils/ +Mt2/ +RootCoreBin/ +SUSYTools/ +SusyCommon/ +SusyNtuple/ +TauAnalysisTools/ +xAODMuon/ install.log -prod/ApplyJetCalibration/ -prod/ApplyJetResolutionSmearing/ -prod/CalibrationDataInterface/ -prod/DGTriggerReweight/ -prod/ElectronEfficiencyCorrection/ -prod/GoodRunsLists/ -prod/HistFitterTree/ -prod/JVFUncertaintyTool/ -prod/JetResolution/ -prod/JetSelectorTools/ -prod/JetUncertainties/ -prod/LeptonTruthTools/ -prod/MissingETUtility/ -prod/Mt2/ -prod/MultiLep/ -prod/MuonEfficiencyCorrections/ -prod/MuonMomentumCorrections/ -prod/ObjectSelectorCore/ -prod/PATCore/ -prod/PileupReweighting/ -prod/ReweightUtils/ -prod/RootCore/ -prod/SUSYTools/ -prod/SignificanceCalculator/ -prod/TauCorrUncert/ -prod/TauCorrections/ -prod/TileTripReader/ -prod/TopTag/ -prod/TrigMuonEfficiency/ -prod/TrigRootAnalysis/ -prod/TriggerMatch/ -prod/egammaAnalysisUtils/ -prod/egammaEvent/ +rcSetup.csh +rcSetup.sh +.RootCoreBin From 156d10500dbc1c516df17cfa41a6e1d7a6b2726d Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 12:02:22 +0200 Subject: [PATCH 5/6] drop Mt2 dependency moved to new implementation, see susynt/SusyNtuple#45 and susynt/SusyNtuple#82 --- bash/setup_area.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/bash/setup_area.sh b/bash/setup_area.sh index a7fa1ad..4f636f8 100755 --- a/bash/setup_area.sh +++ b/bash/setup_area.sh @@ -58,9 +58,6 @@ function checkout_packages_external { svn co ${SVNOFF}/PhysicsAnalysis/AnalysisCommon/IsolationSelection-00-01-00 IsolationSelection # check out this tag of TauAnalysisTools so things work svn co ${SVNOFF}/PhysicsAnalysis/TauID/TauAnalysisTools/tags/TauAnalysisTools-00-00-50 TauAnalysisTools - - # SusyNtuple dependencies - svn co ${SVNWEAK}/Mt2/tags/Mt2-00-00-01 Mt2 } function checkout_packages_uci { From 8a5ecafa52d3e4e8995d0cf7df4761669743e83e Mon Sep 17 00:00:00 2001 From: gerbaudo Date: Wed, 30 Sep 2015 12:18:54 +0200 Subject: [PATCH 6/6] fixes susynt/susynt-write#6 --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90dee04..e8623ec 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Prerequisites: Follow these commands to set up an area to read SusyNtuples. ``` -git clone git@github.com:gerbaudo/susynt-write.git --branch xaod +git clone https://github.com/susynt/susynt-write.git cd susynt-write source bash/setup_release.sh ./bash/setup_area.sh [--dev] 2>&1 | tee install.log @@ -37,8 +37,10 @@ cd susynt-write source bash/setup_release.sh ``` -Note1: the submission of the jobs must be performed from a +**Note1**: the submission of the jobs must be performed from a different directory from the one where the packages are compiled. -Note2: if you want to submit a production, you should use the -`--stable` option of `setup_area.sh`. \ No newline at end of file +**Note2**: By default you'll get the most recent stable tags of +SusyCommon and SusyNtuple. If you want to develop code, you should +replace `https://github.com/` with `git@github.com:` and run +`setup_area.sh` with the `--dev` option. \ No newline at end of file