Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ env:
- ROOT=5-34-18
- ROOT=6-00-00
global:
- CLANG_VERSION=3.4
- CLANG_VERSION=3.7
- GCC_VERSION=4.9
- BOOST_VERSION=1.55

before_install: source ci/before_install.sh
install: source ci/install.sh
script: bash ci/test.sh
cache: apt
41 changes: 41 additions & 0 deletions ci/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# This script is meant to be called by the "before_install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behaviour of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

#set -e

# Check if we are running Python 2 or 3. This is needed for the apt-get package names
if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then
export PYTHON_SUFFIX="3";
fi

sudo add-apt-repository --yes ppa:kalakris/cmake
# add repositories for gcc ${GCC_VERSION} and clang $CLANG_VERSION (set in .travis.yml)
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo add-apt-repository --yes 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main'
sudo add-apt-repository --yes 'deb http://ppa.launchpad.net/boost-latest/ppa/ubuntu precise main'
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# Needed because sometimes travis' repositories get out of date
sudo apt-get update -q
# Install the dependencies we need
time sudo apt-get -q install cmake clang-${CLANG_VERSION} libclang-${CLANG_VERSION}-dev gcc-${GCC_VERSION} g++-${GCC_VERSION} boost${BOOST_VERSION} libboost${BOOST_VERSION}-dev libboost-test${BOOST_VERSION}-dev \
python${PYTHON_SUFFIX}-numpy python${PYTHON_SUFFIX}-sphinx python${PYTHON_SUFFIX}-nose python${PYTHON_SUFFIX}-pip cython${PYTHON_SUFFIX}
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then
time sudo apt-get install -qq python-matplotlib python-tables;
fi

pip install nose --upgrade
nosetests -V

# setup newer compilers ( we need gcc >= 4.7 for c++11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 50;
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 50;
sudo update-alternatives --set gcc /usr/bin/gcc-${GCC_VERSION};
sudo update-alternatives --set g++ /usr/bin/g++-${GCC_VERSION};

sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 50;
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 50;
sudo update-alternatives --set clang /usr/bin/clang-${CLANG_VERSION};
sudo update-alternatives --set clang++ /usr/bin/clang++-${CLANG_VERSION};
59 changes: 9 additions & 50 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

#set -e

# Check if we are running Python 2 or 3. This is needed for the apt-get package names
if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then
export PYTHON_SUFFIX="3";
fi

# add repositories for gcc 4.8 and clang $CLANG_VERSION (set in .travis.yml)
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo add-apt-repository --yes 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main'
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# Needed because sometimes travis' repositories get out of date
time sudo apt-get update -qq

# Install the dependencies we need
time sudo apt-get -qq install clang-${CLANG_VERSION} libclang-${CLANG_VERSION}-dev gcc-4.8 g++-4.8
time sudo apt-get install -qq python${PYTHON_SUFFIX}-numpy python${PYTHON_SUFFIX}-sphinx python${PYTHON_SUFFIX}-nose python${PYTHON_SUFFIX}-pip cython${PYTHON_SUFFIX}
# matplotlib and PyTables are not available for Python 3 as packages from the main repo yet.
if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then
time sudo apt-get install -qq python-matplotlib python-tables;
fi
set -e

# Install a ROOT binary that we custom-built in a 64-bit Ubuntu VM
# for the correct python / ROOT version
Expand All @@ -38,38 +18,16 @@ source root/bin/thisroot.sh
root -l -q
python -c "import ROOT; ROOT.TBrowser()"

# setup newer compilers for ROOT 6
if [[ $ROOT == '6-00-00' ]]; then
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50;
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50;
sudo update-alternatives --set gcc /usr/bin/gcc-4.8; sudo update-alternatives --set g++ /usr/bin/g++-4.8;
fi

# setup vpython with all packages
# being standalone.sh
#DailyPythonTools location
export base=`pwd`

# setup vpython with all packages
# package list from FinalStateAnalysis
# (https://github.com/uwcms/FinalStateAnalysis/blob/master/recipe/install_python.sh)
echo "Installing yolk"
time sudo pip install -U yolk
echo "Installing ipython"
time sudo pip install -U ipython
echo "Installing termcolor"
time sudo pip install -U termcolor
echo "Installing uncertainties <-- awesome error propagation"
time sudo pip install -U uncertainties
echo "Install progressbar"
time sudo pip install -U progressbar
echo "Installing argparse"
time sudo pip install -U argparse
echo "Installing pudb <-- interactive debugging"
time sudo pip install -U pudb
echo "Installing dateutil"
time sudo pip install python-dateutil
echo "Installing PrettyTable"
time sudo pip install PrettyTable
time pip install -U uncertainties
echo "Installing tabulate (latex table printing, etc)"
pip install tabulate

echo "Installing rootpy"
time pip install --user -e $base/external/rootpy
Expand All @@ -82,7 +40,8 @@ if [ ! -d "$base/external/lib" ]; then
mkdir $base/external/lib
echo "Building RooUnfold"
cd $base/external/RooUnfold/
make -j4
cmake CMakeLists.txt
make
#remove tmp folder
rm -fr $base/external/RooUnfold/tmp
mv $base/external/RooUnfold/libRooUnfold.so $base/external/lib/.
Expand All @@ -92,7 +51,7 @@ if [ ! -d "$base/external/lib" ]; then

echo "Building TopAnalysis"
cd $base/external/TopAnalysis/
make -j4
make
# remove tmp folder
rm -fr $base/external/TopAnalysis/tmp
mv $base/external/TopAnalysis/libTopSVDUnfold.so $base/external/lib/.
Expand All @@ -102,6 +61,6 @@ fi

cd $base
export PATH=$PATH:$base/bin
# end standalone.sh

# add base path from setup_standalone to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$base
24 changes: 24 additions & 0 deletions config/unfolding/HT_7TeV_electron_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/7TeV/HT/fit_results/central/fit_results_electron_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/7TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 7,
"channel": "electron",
"variable": "HT"
}
24 changes: 24 additions & 0 deletions config/unfolding/HT_7TeV_muon_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/7TeV/HT/fit_results/central/fit_results_muon_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/7TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 7,
"channel": "muon",
"variable": "HT"
}
24 changes: 24 additions & 0 deletions config/unfolding/HT_8TeV_electron_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_electron_channel/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/8TeV/HT/fit_results/central/fit_results_electron_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/8TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 8,
"channel": "electron",
"variable": "HT"
}
24 changes: 24 additions & 0 deletions config/unfolding/HT_8TeV_muon_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_HT_analyser_muon_channel/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/8TeV/HT/fit_results/central/fit_results_muon_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/8TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 8,
"channel": "muon",
"variable": "HT"
}
26 changes: 26 additions & 0 deletions config/unfolding/MET_7TeV_electron_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/7TeV/MET/fit_results/central/fit_results_electron_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/7TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 7,
"channel": "electron",
"variable": "MET",
"n_toy": 1000,
"n_tau_scan_points": 100
}
26 changes: 26 additions & 0 deletions config/unfolding/MET_7TeV_muon_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/7TeV/MET/fit_results/central/fit_results_muon_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/7TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 7,
"channel": "muon",
"variable": "MET",
"n_toy": 1000,
"n_tau_scan_points": 100
}
26 changes: 26 additions & 0 deletions config/unfolding/MET_8TeV_electron_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_electron_channel_patType1CorrectedPFMet/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/8TeV/MET/fit_results/central/fit_results_electron_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/8TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 8,
"channel": "electron",
"variable": "MET",
"n_toy": 1000,
"n_tau_scan_points": 100
}
26 changes: 26 additions & 0 deletions config/unfolding/MET_8TeV_muon_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/8TeV/unfolding/unfolding_TTJets_8TeV_asymmetric.root",
"histogram": "unfolding_MET_analyser_muon_channel_patType1CorrectedPFMet/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/8TeV/MET/fit_results/central/fit_results_muon_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/8TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 8,
"channel": "muon",
"variable": "MET",
"n_toy": 1000,
"n_tau_scan_points": 100
}
26 changes: 26 additions & 0 deletions config/unfolding/MT_7TeV_electron_channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"config_for" : "src/unfolding_tests/get_best_regularisation.py",
"truth" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MT_analyser_electron_channel_patType1CorrectedPFMet/truth"
},
"gen_vs_reco" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MT_analyser_electron_channel_patType1CorrectedPFMet/response_without_fakes"
},
"measured" : {
"file": "/hdfs/TopQuarkGroup/results/histogramfiles/AN-14-071_6th_draft/7TeV/unfolding/unfolding_TTJets_7TeV_asymmetric.root",
"histogram": "unfolding_MT_analyser_electron_channel_patType1CorrectedPFMet/measured"
},
"data" : {
"file": "data/absolute_eta_M3_angle_bl/7TeV/MT/fit_results/central/fit_results_electron_patType1CorrectedPFMet.txt",
"histogram": "TTJet"
},
"output_folder": "plots/7TeV/unfolding_tests",
"output_format": ["png", "pdf"],
"centre-of-mass energy" : 7,
"channel": "electron",
"variable": "MT",
"n_toy": 1000,
"n_tau_scan_points": 100
}
Loading