Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b1491d4
Channel text not italic, legends on ratio plot on same line. Comment…
EmyrClement Oct 30, 2015
089cc77
Change labels in plots.
EmyrClement Oct 30, 2015
b7830d2
Try to change x axis range of angle bl control plot.
EmyrClement Oct 30, 2015
f7f6c26
Add more space between x axis and label of control plots. Don't use …
EmyrClement Oct 30, 2015
4bb3f4d
Other similar changes for result plots.
EmyrClement Oct 30, 2015
c73340b
Tweak some control plots.
EmyrClement Oct 30, 2015
177db27
Make lines more black and white friendly.
EmyrClement Nov 3, 2015
5aa7423
Back porting some plot changes.
EmyrClement Dec 18, 2015
b109678
Add extra powheg samples. Modify plotting style.
EmyrClement Dec 18, 2015
0bacbbc
Add additional powheg samples to unfolding files. Add some debugging …
EmyrClement Dec 18, 2015
4e11e7b
Add powheg files to config.
EmyrClement Dec 18, 2015
2b2d6c4
Update latex for variables and samples.
EmyrClement Dec 18, 2015
f3c1ac2
Comment out some stuff for debugging.
EmyrClement Dec 18, 2015
0019c85
Update path in plots2tdr.
EmyrClement Dec 18, 2015
94e2d7c
Small changes
EmyrClement Dec 18, 2015
7ab39c4
Fixing bug in axes labels in control plots.
jjacob Dec 18, 2015
ab9d749
changing x-axis label from angle(b,l) to \alpha.
jjacob Dec 18, 2015
d124b79
Reinstating some previously erroneously commented out lines.
jjacob Dec 27, 2015
38113c5
Fixing errors in filepaths and updating to use new BLT files for powh…
jjacob Dec 27, 2015
2f113eb
Changing default centre of mass energy to 8TeV in src/unfolding_tests…
jjacob Dec 27, 2015
28e6407
Changing unfolding error flag from Hreco to error_treatment, and chan…
jjacob Dec 27, 2015
2b601c3
Changing fontsize from 40 to 42 in unfolding pull plots so that they …
jjacob Dec 27, 2015
16d8762
Fixes to config/__init.py and tools/hist_utilities.py so unfolding pu…
jjacob Dec 27, 2015
c8b2b47
Updating condor/run.sh and README.md to use environment_conda.sh and …
jjacob Dec 27, 2015
6eeba2f
Updating README with instructions to include background subtraction, …
jjacob Jan 6, 2016
6a0f3e0
Adjusting legend and channel info location for lepton eta templates, …
jjacob Jan 6, 2016
05aeda1
Updating unfolding pull jobs README.
jjacob Jan 6, 2016
8dc26ab
Fixes for typical systematics table.
jjacob Jan 12, 2016
1b6f5bb
Setting normalise variable to false unless passed as an argument.
jjacob Jan 12, 2016
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
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ cd DailyPythonScripts
# get submodules:
git submodule init && git submodule update

# setup run:
./setup.sh
# setup environment (using virtualenv for python):
./setup_with_conda.sh

# setup environment (using virtualenv for python):
source environment.sh
source environment_conda.sh

# make sure matplotlib is up to date (should return 1.3.1 or above):
python -c 'import matplotlib; print matplotlib.__version__'
Expand Down Expand Up @@ -101,13 +101,23 @@ number of jobs: enter the number of merging jobs for the centre of mass energy i
- ```cd``` up to the folder containing DailyPythonScripts and ```tar --exclude='external/vpython' --exclude='any other large/unnecessary folders in DailyPythonScripts' -cf dps.tar DailyPythonScripts``` (tar file should be approximately 100MB in size)
- Merge the required BAT output files (e.g. SingleTop, QCD etc.) using ```condor_submit DailyPythonScripts/experimental/mergeBATOutputFilesOnDICE/submitMerge.description```

### Prepare config files for background subtraction
```python src/cross_section_measurement/create_measurement.py -c 8```
```python src/cross_section_measurement/create_measurement.py -c 7```
This puts config files in config/measurements/background_subtraction/ for use by the x_0Nb_all_vars scripts.

### Run final measurement scripts in bin/:
```
x_01_all_vars
x_01b_all_vars
x_02_all_vars
x_02b_all_vars
x_03_all_vars
x_03b_all_vars
x_04_all_vars
x_04b_all_vars
x_05_all_vars
x_05b_all_vars
x_98_all_vars
x_99_QCD_cross_checks
x_make_binning_plots
Expand Down
4 changes: 2 additions & 2 deletions bin/create_unfolding_pulls_on_DICE
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def main():
)
pull_jobs.append(pull_job)

# Since we are analysing 300 x 300 = 90000 samples and one 10x10 sample
# takes around 7 seconds it will take 1.75h in a single job.
# Since, in testing, one 10x10 sample took around 7 seconds
# and here we are analysing 300 x 300 = 90000 samples, it will take 1.75h in a single job.
# For very fast (~1 min) processing we want at least 100 jobs.
n_jobs_to_run = 100 # this is per pull_job
n_jobs_to_split = 100
Expand Down
16 changes: 8 additions & 8 deletions bin/plots2tdr
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ plot_map_common = {}
plot_map_paper = {
# <src relative to DPS plots folder> : <dst relative to TDR plots folder>,
# results 8 TeV
'7TeV/MET/central/normalised_xsection_combined_*.pdf': '7TeV/MET/',
'7TeV/HT/central/normalised_xsection_combined_*.pdf': '7TeV/HT/',
'7TeV/ST/central/normalised_xsection_combined_*.pdf': '7TeV/ST/',
'7TeV/WPT/central/normalised_xsection_combined_*.pdf': '7TeV/WPT/',
'fit/7TeV/MET/central/normalised_xsection_combined_*.pdf': '7TeV/MET/',
'fit/7TeV/HT/central/normalised_xsection_combined_*.pdf': '7TeV/HT/',
'fit/7TeV/ST/central/normalised_xsection_combined_*.pdf': '7TeV/ST/',
'fit/7TeV/WPT/central/normalised_xsection_combined_*.pdf': '7TeV/WPT/',
# results 8 TeV
'8TeV/MET/central/normalised_xsection_combined_*.pdf': '8TeV/MET/',
'8TeV/HT/central/normalised_xsection_combined_*.pdf': '8TeV/HT/',
'8TeV/ST/central/normalised_xsection_combined_*.pdf': '8TeV/ST/',
'8TeV/WPT/central/normalised_xsection_combined_*.pdf': '8TeV/WPT/',
'fit/8TeV/MET/central/normalised_xsection_combined_*.pdf': '8TeV/MET/',
'fit/8TeV/HT/central/normalised_xsection_combined_*.pdf': '8TeV/HT/',
'fit/8TeV/ST/central/normalised_xsection_combined_*.pdf': '8TeV/ST/',
'fit/8TeV/WPT/central/normalised_xsection_combined_*.pdf': '8TeV/WPT/',
# control plots 8 TeV
'control_plots/after_fit/8TeV/*_HT_2orMoreBtags_with_ratio.pdf': 'control/',
'control_plots/after_fit/8TeV/*_patType1CorrectedPFMet_2orMoreBtags_with_ratio.pdf': 'control/',
Expand Down
3 changes: 3 additions & 0 deletions bin/x_01_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
echo "This will take a while ... grab a coffee/tea/water/cocktail"
mkdir -p logs
fit_var="absolute_eta,M3,angle_bl"
# fit_var="absolute_eta"
# fit_var="M3"
#fit_var="angle_bl"
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
N_JOBS=6

Expand Down
3 changes: 3 additions & 0 deletions bin/x_02_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
echo "This will take a while ... grab a coffee/tea/water"
mkdir -p logs
fit_var="absolute_eta,M3,angle_bl"
# fit_var="absolute_eta"
# fit_var="M3"
# fit_var="angle_bl"
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
N_JOBS=6

Expand Down
3 changes: 3 additions & 0 deletions bin/x_03_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
echo "This will take a while ... grab a coffee/tea/water"
mkdir -p logs
fit_var="absolute_eta,M3,angle_bl"
# fit_var="absolute_eta"
# fit_var="M3"
# fit_var="angle_bl"
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
N_JOBS=6

Expand Down
17 changes: 11 additions & 6 deletions bin/x_04_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@ echo "This will take a while ... grab a coffee/tea/water"
mkdir -p logs
mkdir -p plots
fit_var="absolute_eta,M3,angle_bl"
# fit_var="absolute_eta"
# fit_var="M3"
# fit_var="angle_bl"
nice_fit_var=`echo $fit_var | sed 's/,/_/g'`
N_JOBS=5
N_JOBS=6

echo "Using the fit variable(s): $fit_var"

i=0
for var in MET HT ST MT WPT; do
for var in MET MT; do
echo "Plotting diff. x-section for distribution: $var"
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 7 -p data/$nice_fit_var -o plots/fit &> logs/04_${var}_plot_7TeV_${nice_fit_var}.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
let i+=1
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 7 -p data/$nice_fit_var -o plots/results/fit/ &> logs/04_${var}_plot_7TeV_${nice_fit_var}.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 7 -p data/$nice_fit_var -o plots/results/fit/ -s &> logs/04_${var}_plot_7TeV_${nice_fit_var}_with_bkgd_sub.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
let i+=2
if (( $i % N_JOBS == 0 ))
then
echo "Waiting on the above to finish."
wait;
fi

nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 8 -p data/$nice_fit_var -o plots/fit &> logs/04_${var}_plot_8TeV_${nice_fit_var}.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
let i+=1
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 8 -p data/$nice_fit_var -o plots/results/fit/ &> logs/04_${var}_plot_8TeV_${nice_fit_var}.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 8 -p data/$nice_fit_var -o plots/results/fit/ -s &> logs/04_${var}_plot_8TeV_${nice_fit_var}_with_bkgd_sub.log & # -a -s <--add -a option for additional plots, -s option to include the final results from background subtraction as well as from fitting
let i+=2
if (( $i % N_JOBS == 0 ))
then
echo "Waiting on the above to finish."
Expand Down
4 changes: 2 additions & 2 deletions bin/x_04b_all_vars
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ i=0
echo "Visible phase space"
for var in MET HT ST WPT MT; do
echo "Plotting diff. x-section for distribution: $var"
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 7 -p data/normalisation/background_subtraction/ -o plots/background_subtraction &> logs/04b_${var}_plot_7TeV.log & # -a <--add this option for additional plots
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 7 -p data/normalisation/background_subtraction/ -o plots/results/background_subtraction &> logs/04b_${var}_plot_7TeV.log & # -a <--add this option for additional plots
let i+=1
if (( $i % N_JOBS == 0 ))
then
echo "Waiting on the above to finish."
wait;
fi

nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 8 -p data/normalisation/background_subtraction/ -o plots/background_subtraction &> logs/04b_${var}_plot_8TeV.log & # -a <--add this option for additional plots
nohup time python src/cross_section_measurement/04_make_plots_matplotlib.py -v $var -c 8 -p data/normalisation/background_subtraction/ -o plots/results/background_subtraction &> logs/04b_${var}_plot_8TeV.log & # -a <--add this option for additional plots
let i+=1
if (( $i % N_JOBS == 0 ))
then
Expand Down
4 changes: 2 additions & 2 deletions condor/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
cmssw_version=CMSSW_7_4_7
git_branch=master
git_branch=run1
echo "Setting up ${cmssw_version} ..."
echo "... sourcing CMS default environment from CVMFS"
source /cvmfs/cms.cern.ch/cmsset_default.sh
Expand All @@ -22,7 +22,7 @@ time git submodule init && git submodule update
echo "... extracting ${_CONDOR_JOB_IWD}/dps.tar on top"
tar -xf ${_CONDOR_JOB_IWD}/dps.tar --overwrite
echo "... running setup routine"
>&2 "... running setup routine"
>&2 echo "... running setup routine"
time source setup_with_conda.sh
echo "... enforcing conda python environment"
# this is safe, as the dangerous part is only executed on soolin
Expand Down
6 changes: 3 additions & 3 deletions config/CMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
}

y_axis_title_small = {
'fontsize':40,
'fontsize':42,
'position' : (0, 1.),
'verticalalignment': 'bottom',
'horizontalalignment': 'right'
}

axis_label_major = {
'which':'major',
'labelsize':41,
'labelsize':42,
'length':20,
'width': 1,
'pad': 12
}
axis_label_minor = {
'which':'minor',
'labelsize':41,
'labelsize':42,
'length':10,
'width': 1,
'pad': 12
Expand Down
2 changes: 1 addition & 1 deletion config/RooUnfold_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SVD_k_value = 5
SVD_tau_value = -1
SVD_n_toy = 1000
Hreco = 2
error_treatment = 3
Bayes_n_repeat = 4

unfolded_markerStyle = 20
Expand Down
47 changes: 34 additions & 13 deletions config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ class XSectionConfig():
'unfolding_matching_up', 'unfolding_matching_up_raw',
'unfolding_mass_down', 'unfolding_mass_up',
'unfolding_mcatnlo', 'unfolding_mcatnlo_raw',
'unfolding_powheg_pythia', 'unfolding_powheg_pythia_raw',
'unfolding_powheg_herwig', 'unfolding_powheg_herwig_raw',
'unfolding_powheg_v2_pythia', 'unfolding_powheg_v2_pythia_raw',
'unfolding_powheg_v1_herwig', 'unfolding_powheg_v1_herwig_raw',
'unfolding_powheg_v2_herwig', 'unfolding_powheg_v2_herwig_raw',
'unfolding_scale_down', 'unfolding_scale_down_raw',
'unfolding_scale_up', 'unfolding_scale_up_raw',
'unfolding_ptreweight', 'unfolding_ptreweight_raw',
Expand Down Expand Up @@ -217,8 +218,10 @@ def __fill_defaults__( self ):
}

self.unfolding_madgraph_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV.root' % self.centre_of_mass_energy
self.unfolding_powheg_pythia_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powheg.root' % self.centre_of_mass_energy
self.unfolding_powheg_herwig_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powhegherwig.root' % self.centre_of_mass_energy
self.unfolding_powheg_v1_pythia_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powhegV1pythia.root' % self.centre_of_mass_energy
self.unfolding_powheg_v2_pythia_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powhegV2pythia.root' % self.centre_of_mass_energy
self.unfolding_powheg_v1_herwig_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powhegV1herwig.root' % self.centre_of_mass_energy
self.unfolding_powheg_v2_herwig_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_powhegV2herwig.root' % self.centre_of_mass_energy
self.unfolding_mcatnlo_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_mcatnlo.root' % self.centre_of_mass_energy
self.unfolding_ptreweight_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_withTopPtReweighting.root' % self.centre_of_mass_energy

Expand All @@ -228,8 +231,10 @@ def __fill_defaults__( self ):
self.unfolding_matching_up_raw = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_matchingup.root' % self.centre_of_mass_energy

self.unfolding_madgraph = self.unfolding_madgraph_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_pythia = self.unfolding_powheg_pythia_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_herwig = self.unfolding_powheg_herwig_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_v1_pythia = self.unfolding_powheg_v1_pythia_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_v2_pythia = self.unfolding_powheg_v2_pythia_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_v1_herwig = self.unfolding_powheg_v1_herwig_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_powheg_v2_herwig = self.unfolding_powheg_v2_herwig_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_mcatnlo = self.unfolding_mcatnlo_raw.replace( '.root', '_asymmetric.root' )
self.unfolding_ptreweight = path_to_unfolding_histograms + 'unfolding_TTJets_%dTeV_asymmetric_withTopPtReweighting.root' % self.centre_of_mass_energy

Expand Down Expand Up @@ -358,6 +363,12 @@ def __fill_defaults_7TeV__( self ):
'WPT' : 0
}

self.tau_values_electron = {
}

self.tau_values_muon = {
}

self.categories_and_prefixes['PU_down'] = '_PU_64600mb'
self.categories_and_prefixes['PU_up'] = '_PU_71400mb'

Expand Down Expand Up @@ -409,6 +420,12 @@ def __fill_defaults_8TeV__( self ):
'WPT' : 0
}

self.tau_values_electron = {
}

self.tau_values_muon = {
}

self.categories_and_prefixes['PU_down'] = '_PU_65835mb'
self.categories_and_prefixes['PU_up'] = '_PU_72765mb'

Expand All @@ -419,11 +436,15 @@ def __fill_defaults_8TeV__( self ):
'JES_down': path_to_files + 'JES_down/SingleElectron' + middle + self.categories_and_prefixes['JES_down'] + '.root'
}

fit_var_inputs = ['absolute_eta', 'M3', 'M_bl', 'angle_bl',
'absolute_eta_angle_bl',
'absolute_eta_M3',
'absolute_eta_M_bl',
'absolute_eta_M_bl_angle_bl',
fit_var_inputs = [
'absolute_eta', 'M3',
# 'M_bl',
'angle_bl',
# 'absolute_eta_angle_bl',
# 'absolute_eta_M3',
# 'absolute_eta_M_bl',
# 'absolute_eta_M_bl_angle_bl',
'absolute_eta_M3_angle_bl',
'absolute_eta_M_bl_M3',
'absolute_eta_M_bl_M3_angle_bl' ]
# 'absolute_eta_M_bl_M3',
# 'absolute_eta_M_bl_M3_angle_bl'
]
Loading