BoostedChargeAsymmetry - twiki - ... in construction ...
This twiki claim to be an important reference/guide for the boosted charge asymmetry members and also, a common point to share information...
@@ Set up

PanDA Clients setup (pathena / prun / pbook):
UMichTwikiPage
###Here we have set up the cvmfs software and asked to set up the Panda Clients
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
echo "--- set up PandaClient:"
localSetupPandaClient --noAthenaCheck
### you should NOT try to setup both ROOT and an ATLAS release in the same session, as it can cause problems
#export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
#source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh

Grid environment + Panda tools setup:
echo "--- Panda set up:"
source /afs/cern.ch/atlas/offline/external/GRID/DA/panda-client/latest/etc/panda/panda_setup.sh
echo "--- grid_env:"
export PATHENA_GRID_SETUP_SH=/afs/cern.ch/project/gd/LCG-share/current/etc/profile.d/grid_env.sh
echo "--- voms:"
voms-proxy-init --voms atlas

Root setup:
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
localSetupROOT 5.34.14-x86_64-slc6-gcc4.7
localSetupPandaClient --noAthenaCheck
export CERN_USER=vsanchez
---or---
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
echo "--- set up ROOT:"
localSetupROOT 5.34.14-x86_64-slc6-gcc4.7

DQ2 setup:
source /afs/cern.ch/project/gd/LCG-share/current/etc/profile.d/grid_env.sh
source /afs/cern.ch/atlas/offline/external/GRID/ddm/DQ2Clients/setup.sh
###And create a valid voms-proxy as follows, do not use the grid-proxy-init command:
voms-proxy-init -voms atlas
---or---
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
export CERN_USER=vsanchez
echo "--- set up DQ2:"
export RUCIO_ACCOUNT=$CERN_USER
localSetupDQ2Client
###look here dq2-sources or export DQ2_LOCAL_SITE_ID=ROAMING
export DQ2_LOCAL_SITE_ID=IFIC-LCG2_LOCALGROUPDISK
voms-proxy-init -voms atlas

rucio setup:
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
echo
source /afs/cern.ch/atlas/offline/external/GRID/ddm/rucio/rucio_testing.sh
###The clients are available at cern and outside cern with cvmfs through asetup:
asetup 17.1.4,rucio
/lustre/ific.uv.es/grid/atlas/atlaslocalgroupdisk/rucio/user/vsanchez
/lustre/ific.uv.es/grid/atlas/atlaslocalgroupdisk/user/vsanchez

ganga setup:
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
echo "--- set up Ganga:"
localSetupGanga

Athena setup:
echo "--- set up ATLAS:"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
echo "--- set up Athena:"
ls /afs/cern.ch/atlas/software/releases/
asetup 18.1.2
...
Testing
AnalysisTop packages with
TopD3PDBoosted-14-00-22 to produce the boosted ntuples necessary for the
boosted lepton+jets analysis.
Twikis:
Communities e-group:
Working at: lxplus
Data & MC: mc12_8TeV - NTUP_COMMON p1562-p1575-p1606...
Recommended by ttbar resonances searches in one lepton channel & TopD3PDBoosted: AnalysisTop-1.5.0==TopRootCoreRelease-14-00-24 &
TopD3PDBoosted-14-00-22
1. First time setup of AnalysisTop
For sites with access to cvmfs, e.g. lxplus, Birmingham you can do:
mkdir AnalysisTop-1.5.0_ttbarResonances
cd AnalysisTop-1.5.0_ttbarResonances
setupATLAS
rcSetup Top,1.5.0
#rc version | grep TopD3PDBoosted
rc checkout_pkg atlasoff/PhysicsAnalysis/TopPhys/TopD3PDBoosted/tags/TopD3PDBoosted-14-00-22
#rc version | grep TopD3PDCorrection
rc checkout_pkg atlasoff/PhysicsAnalysis/TopPhys/TopD3PDCorrections/tags/TopD3PDCorrections-12-01-44
#rc version | grep JetUncertainties
rc checkout_pkg atlasoff/Reconstruction/Jet/JetUncertainties/tags/JetUncertainties-00-08-16
#rc version | grep ttResoSingleLepton
rc checkout_pkg atlasphys/Physics/Top/PhysAnalysis/ttResoSingleLepton/tags/ttResoSingleLepton-00-00-42
rc find_packages
rc compile
exit
Attention!
Check if all the new packages you've download has the same release than above:
rc version | grep TopD3PDBoosted
rc version | grep TopD3PDCorrection
rc version | grep JetUncertainties
rc version | grep ttResoSingleLepton
You might want to make a script called
setup.sh
in this directory that contains the next nugget. Note that it is subtly different from what is written above. For example,
rcSetup
only needs to know the release for the first time setup. After that, it can work it out. Also the script turns on panda, dq2, ami. Since they're useful.
#!/bin/bash
echo
echo
echo "========================= AnalysisTop-1.5.0_ttbarResonances ========================="
date +"setups %x %r"
echo
echo
echo "--- set up ATLAS:"
setupATLAS
echo
echo "--- set up Panda, DQ2 & PyAMI:"
export CERN_USER=vsanchez
export RUCIO_ACCOUNT=$CERN_USER
localSetupPandaClient --noAthenaCheck
localSetupDQ2Client --skipConfirm
localSetupPyAMI
###dq2-sources
#export DQ2_LOCAL_SITE_ID=IFIC-LCG2_LOCALGROUPDISK
echo
echo "--- getting a proxy:"
voms-proxy-init -voms atlas
echo
echo "--- set up AnalysisTop-1.5.0_ttbarResonances"
rcSetup #notice I dropped the parameters
echo
2. Setup run-time environment (needs to be done for each new shell)
This makes sure all the paths are set correctly and must be done every time.
cd AnalysisTop-1.5.0_ttbarResonances
source setup.sh
That's it, isn't that much better than the old way?
3. Make a run/ directory and link to the relevant packages
mkdir run && cd run
ln -s $ROOTCOREBIN/data .
ln -s $ROOTCOREBIN/bin/x86_64-slc6-gcc47-opt bin
cp $ROOTCOREBIN/data/TopD3PDAnalysis/settings.txt .
### our files are stored in the folder: /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/
cp /afs/cern.ch/work/v/vsanchez/public/file_list/file_list_5files.txt $ROOTCOREBIN/../run
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/run/settings_noSys.txt . ###to run without systematics
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/run/settings_withSys.txt . ###to run with systematics
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/TopD3PDBoosted/Root/*cxx $ROOTCOREBIN/../TopD3PDBoosted/Root
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/TopD3PDBoosted/TopD3PDBoosted/*h $ROOTCOREBIN/../TopD3PDBoosted/TopD3PDBoosted
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/TopD3PDBoosted/util/*cxx $ROOTCOREBIN/../TopD3PDBoosted/util
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/TopD3PDCorrections/data/BTagCalibration.env_IFIC $ROOTCOREBIN/../TopD3PDCorrections/data/BTagCalibration.env
cp /afs/cern.ch/work/v/vsanchez/public/forDan_AnalysisTop/JetUncertainties/Root/JESUncertaintyProvider.cxx $ROOTCOREBIN/../JetUncertainties/Root
cd $ROOTCOREBIN/../TopD3PDBoosted/cmt
make -f Makefile.RootCore
cd $ROOTCOREBIN/../TopD3PDCorrections/cmt
make -f Makefile.RootCore
cd $ROOTCOREBIN/../JetUncertainties/cmt
make -f Makefile.RootCore
cd $ROOTCOREBIN/../run
We can disable systematic variations to make the code run faster. Edit
settings.txt
and uncomment the line
#noSyst 1
. Note that for TopRootCoreRelease-14-00-23 and earlier, the settings file is located in
../TopD3PDAnalysis/control/
.
4. Make a file list of what you want to run over (for boosted)
You need to make a text file (
file_list.txt
) in the
run/ directory containing the filenames of the input DPDs. Use a new line for each file.

Boosted example: Execute the command below inside your
run/ and it'll make a test file for you.
cp /afs/cern.ch/work/v/vsanchez/public/file_list/file_list_5files.txt ./file_list.txt
### if your files are stored on eos: echo root://eosatlas//eos/atlas/FOLDER/FILE.root > file_list.txt
5. Run D3PD2MiniSLBoost locally
Inside the
run/ directory execute the boosted semi-leptonic mini ntuple making code (!!!pay atention to the name of settings.txt file!!!):
////////////////////////////////////////////////
-common -rndmType debug -ttresCutflow.
////////////////////////////////////////////////
D3PD2MiniSLBoost -f file_list.txt -p settings_noSys.txt -mcType fullSim -common -boost -rndmType debug -ttresCutflow -useTruthParticles -saveTruthTopDecay > OUTtruthDebug_noSys_MC.txt
D3PD2MiniSLBoost -f file_list.txt -p settings_withSys.txt -mcType fullSim -common -boost -rndmType debug -ttresCutflow -useTruthParticles -saveTruthTopDecay > OUTtruthdebug_Sys_MC.txt
D3PD2MiniSLBoost -f file_list_dataEgamma.txt -p settings_noSys.txt -dataStream Egamma -common -boost -rndmType debug -ttresCutflow > OUTdebug_dataEgamma.txt
D3PD2MiniSLBoost -f file_list_dataMuons.txt -p settings_noSys.txt -dataStream Muons -common -boost -rndmType debug -ttresCutflow > OUTdebug_dataMuons.txt
////////////////////////////////////////////////
-common
////////////////////////////////////////////////
D3PD2MiniSLBoost -f file_list.txt -p settings_noSys.txt -mcType fullSim -common -boost -useTruthParticles -saveTruthTopDecay > OUT_noSys.txt
D3PD2MiniSLBoost -f file_list.txt -p settings_noSys.txt -mcType atlfast2 -common -boost -useTruthParticles -saveTruthTopDecay > OUT_noSys_atlfast2.txt
////////////////////////////////////////////////
-common -sysOn
////////////////////////////////////////////////
D3PD2MiniSLBoost -f file_list.txt -p settings_withSys.txt -mcType fullSim -common -boost -useTruthParticles -saveTruthTopDecay -sysOn > OUT_withSys.txt
D3PD2MiniSLBoost -f file_list.txt -p settings_withSys.txt -mcType atlfast2 -common -boost -useTruthParticles -saveTruthTopDecay -sysOn > OUT_withSys_atlfast2.txt
////////////////////////////////////////////////
-common -dataStream
////////////////////////////////////////////////
D3PD2MiniSLBoost -f file_list_dataEgamma.txt -p settings_noSys.txt -dataStream Egamma -common -boost > OUT_dataEgamma.txt
D3PD2MiniSLBoost -f file_list_dataMuons.txt -p settings_noSys.txt -dataStream Muons -common -boost > OUT_dataMuons.txt
6. Run D3PD2MiniSLBoost on the grid
7. Produced samples
The samples will be stored on
eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014
eos quota | grep -A 4 "Quota Node: /eos/atlas/user/$" | head -5
eos ls -lh eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014
drwx--s--+ 1 vsanchez zp 0 May 31 11:07 Backgrounds
drwx--s--+ 1 vsanchez zp 0 May 31 11:07 Data
drwx--s--+ 1 vsanchez zp 0 May 31 11:07 SMe1728nominal
drwx--s--+ 1 vsanchez zp 0 May 31 11:07 Systematics
FILE=mu.root
xrdcp $FILE root://eosatlas.cern.ch//eos/atlas/user/v/vsanchez/.../$FILE
eos cp -r /afs/cern.ch/work/v/vsanchez/public/Samples_NEW_ttreso_2014/Slices/ /eos/atlas/user/v/vsanchez/Samples_NEW_ttreso_2014/Slices/
xrdcp root://eosatlas.cern.ch//eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/SMe1728nominal/$FILE .
xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014
FOLDER=Systematics
root://eosatlas.cern.ch//eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/$FOLDER/el.root ###Accessing an EOS file from ROOT
eos cp -r /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/ /tmp/vsanchez/Backgrounds/hola/
eos cp -r /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/ ./
@@ Boosted ntuple production - Test samples
These are some "private test samples" produced with
TopRootCoreRelease-14-00-18 &
TopD3PDBoosted-14-00-08 &
Root-5.34.10.
They're stored on eos:
xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/TRC_testSamples_February2014/.
The
DATA and
MC input samples are listed in these twikis.
BACKGROUNDS
ttbar
SM ttbar:
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/SMe1728nominal/
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/EWttbar/
systematics/cross-check samples:
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Systematics/*
W+jets (Alpgen+Pyhia)
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/Wjets/*
W+jets Akt10 filtered samples (Alpgen+Pyhia)
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/WjetsAkt10/*
Z+jets
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/Zjets/*
Single-top
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/Singletop_***
Diboson
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/Diboson_***
ttbar+V
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Backgrounds/ttbarV/*
SIGNALS
KKGluon
eos
Zprime
eos
DATA

data:
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Data/Egamma/
eos ls /eos/atlas/user/v/vsanchez/Samples_AnalysisTop-1.5.0_June2014/Data/Muons/
@@ Unfolding
To unfold the samples, we've used the
!PyFBU-0.0.2(alpha version, 14 April 2014) package and it works in both environments python and ipython. This python module has been created by Davide Gerbaudo (gerbaudo), Clement Helsens (chelsens) and Francesco Rubbo (francescorubbo).
Community e-group: fbu-users@cernSPAMNOTNOSPAMPLEASE.ch
PyFBU is an implementation of the Fully Bayesian Unfolding algorithm described in
physics.data-an/1201.4612 . The software is based on the Markov Chain Monte Carlo sampling toolkit PyMC.
- PyFBU - Installation of the actual FBU python module (fbu 0.0.1)
- quickstart - Installation and quick start instructions
- tutorial - Simple tutorial
- source - to download fbu-0.0.1.tar.gz (md5)
Necessary files:
@ Preparing the inputs: Analysis-00-00-04
The samples are stored on
/afs/cern.ch/work/v/vsanchez/SAMPLES/testSamplesViki_February2014/ntuples (also on eos space:
xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/TRC_testSamples_February2014/)
We need to first make the histograms that can be used as inputs for the unfolding
~> ssh -Y vsanchez@lxplus.cern.ch
cd /afs/cern.ch/work/v/vsanchez/
RELEASE=Analysis-00-00-04
svn co svn+ssh://$CERN_USER@svn.cern.ch/reps/atlasinst/Institutes/IFAE_Barcelona/TopPhys/Asymmetry/Analysis/tags/$RELEASE $RELEASE
cd $RELEASE
source setup.sh
emacs python/runbatch.py &
emacs python/analyzer.py &
emacs python/Histogrammer.py &
mkdir bash
python python/runbatch.py
/afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04/data/histos/truth/map_dy_powheg.root
IMPORTANT!!! First time --> ### "reweight = False" inside analyzer.py
if you want to clean the last outputs:
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
cd data/histos/nominal/
rm -rf el/
rm -rf mu/
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
cd data/json/
rm map_*.json
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
rm bash/*
python python/runbatch.py
cd bash && source run_el_nominal_0tagin.sh ### inside is this line: python python/analyzer.py el nominal 0tagin
### output --> data/histos/nominal/el/map_dy_0tagin.root with four TH2D: data bckg reco resmat
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
cd bash && source run_mu_nominal_0tagin.sh ### inside is this line: python python/analyzer.py mu nominal 0tagin
### output --> data/histos/nominal/mu/map_dy_0tagin.root with four TH2D: data bckg reco resmat
~> ssh -Y vsanchez@lxplus.cern.ch
source setup.sh
### tagin0 means 0<bTagCat<4 --> ALL 3 categories selected
### tagin1 means bTagCat==1 --> category1 selected
### tagin2 means bTagCat==2 --> category2 selected
### tagin3 means bTagCat==3 --> category3 selected
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
### "reweight = False" inside analyzer.py.
python python/analyzer.py el nominal 0tagin ### output --> data/histos/nominal/el/map_dy_0tagin.root with four TH2D: data bckg reco resmat
python python/analyzer.py mu nominal 0tagin ### output --> data/histos/nominal/mu/map_dy_0tagin.root with four TH2D: data bckg reco resmat
### "reweight = True" inside analyzer.py. This will calculate your 'protos' histogram, which will be reweighted to a particular asymmetry,
### using an axigluon sample. The six TH2D new 'protos' histograms (protosA6neg protosA4neg protosA2neg protosA6pos protosA4pos protosA2pos)
### are added inside Analysis-00-00-04/data/histos/nominal/*/map_dy_0tagin.root
python python/analyzer.py el nominal 0tagin
python python/analyzer.py mu nominal 0tagin
mkdir -p data/histos/nominal/muel
cd data/histos/nominal/muel
hadd map_dy_0tagin.root ../el/map_dy_0tagin.root ../mu/map_dy_0tagin.root
cd /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04
python python/histo2json.py muel map_dy 0tagin
#python python/histo2json.py el map_dy 0tagin ### to convert the root file to a json and then you use that as the input to runFBU.py
#python python/histo2json.py mu map_dy 0tagin
###python/histo2json.py: #datanames = ['data','reco','protosA2pos']
analyzer.py -->
Config.py -->
Config.pyc -->
filltruthhisto.py -->
fitwjets.py -->
Functions.py -->
histo2json.py -->
histo2json_syst.py -->
Histogrammer.py --> dy = tree.reco_DeltaYtops,tree.truth_DeltaYTopsALL
plotnuisances.py -->
plotsyst.py -->
Reweight.py -->
runbatch.py -->
rundata.py -->
runfbu.py -->
scanwjets.py -->
systdict.py -->
utils.py -->
utils.pyc -->
wjetscalib.py -->
@ Getting started: PyFBU-0.0.2 (alpha version 14/04/2014) (july 2014)
Instructions to get started quickly.
To do the first time (MANDATORY: install in a clean lxplus login! Avoid cvmfs setups):
~> ssh -Y vsanchez@lxplus.cern.ch
cd /afs/cern.ch/work/v/vsanchez/public
virtualenv fbu_0.0.2
cd fbu_0.0.2/
source bin/activate
pip install numpy==1.7.0 ###(~5min)
pip install fbu ###(~15min)
cp ???/utils.py .
cp ???/runFBU.py .
cp ???/computeAsymmetry.py .
ln -s /afs/cern.ch/work/v/vsanchez/public/Analysis-00-00-04/data/ .
To do from then on:
~> ssh -Y vsanchez@lxplus.cern.ch
cd /afs/cern.ch/work/v/vsanchez/public/fbu_0.0.2
source bin/activate
...
### inside VIKI_runFBU.py, choose the dataNAME='map_dy_data_combine123Categ.json' or whatever you want!
python VIKI_runFBU.py data/json ### the output information is saved in trace.npy
...
###Then, you can finally calculate the unfolded asymmetry from the resulting trace.npy file.
python VIKI_computeAsymmetry.py > out_asymmetries.txt ### output mean_inc_withReg_combined.txt (Ac) and std_inc_withReg_combined.txt (Ac error)
...
...
...
bin/deactivate
mkdir MakeHistos && cd MakeHistos/
python VIKI_histo_maker.py ### the output is MakeHistos/OUThistos.root
cp ???/map_dy_powheg.root .
python VIKI_truth_histo_maker.py ### the output is added inside OUThistos.root
root VIKI_plot_histos.C
@@ Systematics
To Do...
@@ W+jets SF
To Do...
@@ Backgrounds
To Do...
@@ Resolution
To Do...
@@ "hadded" samples
***In: mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.merge.NTUP_COMMON.e1728_s1581_s1586_r3658_r3549_p1562/
***Out: user.vsanchez.117050.PowhegPythia_P2011C_ttbar.boosted.e1728_s1581_s1586_r3658_r3549_p1562._BasuraAnalysisTop3/
user.vsanchez.117050.PowhegPythia_P2011C_ttbar.boostedHADD.e1728_s1581_s1586_r3658_r3549_p1562._BasuraAnalysisTop3_el_HADD/
user.vsanchez.117050.PowhegPythia_P2011C_ttbar.boostedHADD.e1728_s1581_s1586_r3658_r3549_p1562._BasuraAnalysisTop3_mu_HADD/
@@ Relationship between DSid, samples, CrossSections...
Go to
TwikiMCsamplesDSid to see this.
...
Using TopRootCore and TopD3PDBoosted to produce the boosted ntuples necessary for the
boosted lepton+jets analysis.
Twikis:
Communities e-group:
Working at: lxplus
Data & MC: mc12_8TeV - NTUP_COMMON p1562-p1575-p1606...
Recommended by ttbar resonances searches in one lepton channel & TopD3PDBoosted: TopRootCoreRelease-14-00-23 &
TopD3PDBoosted-14-00-15 &
Root-5.34.14
Neccessary files:
empezarROOT53414.sh
AppBaseBoosted.cxx
AppBaseBoosted.h
BoostedEventInfo.h
MiniSLBoosted.cxx
MiniSLBoosted.h
MiniSLOrig.cxx
MiniSLOrig.h
MiniSLRunBoosted.cxx
BTagCalibration.env
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez
~> source empezarROOT53414.sh ### copy here: empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> TRCR=TopRootCoreRelease-14-00-23
~> mkdir TopRootCore_14-00-23 && cd TopRootCore_14-00-23
~> svn co svn+ssh://$CERN_USER@svn.cern.ch/reps/atlasoff/PhysicsAnalysis/TopPhys/TopRootCoreRelease/tags/$TRCR/ $TRCR
###https://svnweb.cern.ch/trac/atlasoff/browser/PhysicsAnalysis/TopPhys/TopRootCoreRelease/tags
~> cd $TRCR/share
~> ./build-all.sh
~> cd TopRootCore_14-00-23/TopD3PDCorrections/data
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDCorrections/data/BTagCalibration.env .
~> exit
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez
~> source empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> cd TopRootCore_14-00-23
~> source RootCore/scripts/setup.sh
~> mkdir run && cd run
~> ln -s ../RootCore/data .
~> ln -s ../TopD3PDAnalysis/control .
~> ln -s ../RootCore/bin/x86_64-slc6-gcc47-opt bin ### OLD: ln -s ../TopD3PDAnalysis/bin .
~> D3PD2MiniSLBoost .........
For the boosted analysis, you may download the attached files above and copy them inside TopD3PDBoosted/Root/ or TopD3PDBoosted/TopD3PDBoosted/:
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez
~> source empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> cd TopRootCore_14-00-23
~> source RootCore/scripts/setup.sh
~> cd TopD3PDBoosted
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/Root/*.cxx Root/
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/TopD3PDBoosted/*.h TopD3PDBoosted/
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/util/*.cxx util/
~> cd cmt
~> make -f Makefile.RootCore
~> cd ../../
~> cd TopD3PDCorrections
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDCorrections/Root/TriggerScale.cxx Root/
~> cd cmt
~> make -f Makefile.RootCore
~> cd ../../
~> cd run/
~> D3PD2MiniSLBoost .........
@ TTbar resonances boosted cut flow - few samples
- Spreadsheet with cut flow for NTUP_COMMON_p1562 117050.PowhegPythia
- Dataset: mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.merge.NTUP_COMMON.e1728_s1581_s1586_r3658_r3549_p1562/
- Files: NTUP_COMMON.01313638._000400.root.1 ; NTUP_COMMON.01313638._000401.root.1 ; NTUP_COMMON.01313638._000402.root.1 ; NTUP_COMMON.01313638._000403.root.1 ; NTUP_COMMON.01313638._000404.root.1
To get the ttbar resonances cutflow, just run the next command in your
run/ directory (mandatory:
-rndmType debug -ttresCutflow
, only for cutflow!):
~> D3PD2MiniSLBoost -f file_list.txt -mcType fullSim -common -boost -useTruthParticles -saveTruthTopDecay -rndmType debug -ttresCutflow
lepton corrections + jet corrections + MET recalculation + No Reweighting / SF - official (Jiahang Zhong, Oxford)
Our results:
lepton corrections + jet corrections + MET recalculation + Reweighting / SF - official (Jiahang Zhong, Oxford)
Our results:

Here are two useful MakeClass-files (
file.C and
file.h) to get the boosted cut flow numbers. Just type:
~> root -l -q macro_printBoostedCutFlow_VIKI.C+
~> root
root [0] .L macro_printBoostedCutFlow_VIKI.C+
root [1] macro_printBoostedCutFlow_VIKI* t = new macro_printBoostedCutFlow_VIKI(); t->Loop()

To get the numbers of C13_1, C13_2 and C13_3 cuts, use this (
plot_Yields_getBoostedCutflow.C).
~> root plot_Yields_getBoostedCutflow.C -b -q ###don't draw any canvas using -b!!!
###for Electron channel, put--> std::string TypesOfChannel[1]={"el"}
###for Muon channel, put--> std::string TypesOfChannel[1]={"mu"}
### for NO weights, put--> sprintf(weights,"KFactor");
### for Reweighting, put--> sprintf(weights,"KFactor*totalScale");
DATA common D3PDs
- xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/FilesForCutflow
- Spreadsheet with cut flow for NTUP_COMMON_p1562 Egamma and Muons Data files
- Egamma Dataset: data12_8TeV.00203169.physics_Egamma.merge.NTUP_COMMON.r4065_p1278_p1562_tid01312703_00/
- Egamma Files: NTUP_COMMON.01312703._000001.root.1; NTUP_COMMON.01312703._000002.root.1 ; NTUP_COMMON.01312703._000003.root.1 ; NTUP_COMMON.01312703._000004.root.1
- Muons Dataset: data12_8TeV.00203169.physics_Muons.merge.NTUP_COMMON.r4065_p1278_p1562/
- Muons Files: NTUP_COMMON.01312774._000001.root.1 ; NTUP_COMMON.01312774._000002.root.1 ; NTUP_COMMON.01312774._000003.root.1 ; NTUP_COMMON.01312774._000004.root.1
To get the ttbar resonances cutflow, just run the next command in your
run/ directory (mandatory:
-rndmType debug -ttresCutflow
, only for cutflow!):
~> D3PD2MiniSLBoost -f file_list_dataEgamma.txt -dataStream Egamma -common -boost -rndmType debug -ttresCutflow
~> D3PD2MiniSLBoost -f file_list_dataMuons.txt -dataStream Muons -common -boost -rndmType debug -ttresCutflow
lepton corrections + jet corrections + MET recalculation + No Reweighting / SF - official (Samuel Calvet, LPC Clermont-Ferrand)
Our results:
lepton corrections + NO jet corrections + MET recalculation + NO Reweighting / SF - official (Christoph Wasicki, DESY)
Our results:
@ TTbar resonances boosted cut flow - all samples
MC

Official results - Jiahang Zhong (Oxford)

Our results

This is a useful -files (
plot_Yields_Cutflow.C) to get the reweighted boosted events. Just type:
~> root -b -q plot_Yields_Cutflow.C
###for Electron channel, put--> std::string TypesOfChannel[1]={"el"}; ///CHANNEL
###for Muon channel, put--> std::string TypesOfChannel[1]={"mu"}; ///CHANNEL
DATA

Official results - Tobias Heck (Mainz)

Our results
@ Producing boosted ntuples
From then on (also, to produce your new ntuples):
~> D3PD2MiniSLBoost -f file_list.txt -mcType fullSim -common -boost -useTruthParticles -saveTruthTopDecay ### for SM, signals
~> D3PD2MiniSLBoost -f file_list.txt -mcType fullSim -common -boost -useTruthParticles -saveTruthTopDecay -sysOn ### for systematics
~> D3PD2MiniSLBoost -f file_list.txt -mcType fullSim -common -boost -useTruthParticles ### for backgrounds
~> D3PD2MiniSLBoost -f file_list_dataEgamma.txt -dataStream Egamma -common -boost ### for Egamma data
~> D3PD2MiniSLBoost -f file_list_dataMuons.txt -dataStream Muons -common -boost ### for Muons data
-useTruthParticles
flag: it saves and fills all the mc_* branches.
-saveTruthTopDecay
flag: it saves and fills all the branches related to Top Decay (truth_*).

Be careful!!!
To run TopRootCore on the grid, $ROOTCOREDIR is not the same than
$ROOTCOREBIN!!! The last one is the most suitable to avoid grid errors and problems reading files. In our case, you have to replace it inside
TopD3PDBoosted/Root/MiniSLRunBoosted.cxx:
char *rootcoreDir = getenv("ROOTCOREDIR"); by
char *rootcoreDir = getenv("ROOTCOREBIN");
and compile
TopD3PDBoosted again.

Be careful!!!
To run TopRootCore on the grid, you must take into account:
- Samples with "a-flags" (for instance, mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.merge.NTUP_COMMON.e1727_a188_a171_r3549_p1575/) are "ATLFAST" samples. This means you must run "-mcType atlfast2"
- Samples with "s-flags" (for instance, mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.merge.NTUP_COMMON.e1728_s1581_s1586_r3658_r3549_p1562/) are "FullSimulation" samples. This means you must run "-mcType fullSim"

Running on the grid:
submitShort_prun_viki.sh

This is a grid script example:
#!/bin/bash
echo
echo "---------------------------- beginning ----------------------------"
date +"VIKI %x %r"
echo
export CERN_USER=vsanchez
echo $CERN_USER
WantToRun="backgrounds" ### SMsignals backgrounds systematics dataEL dataMU
DATE=2014_04_11
TIPE=testSMsyst
VERSION=v000_test39
#DESTINATION=IFIC-LCG2_LOCALGROUPDISK ###--destSE=$DESTINATION
OUTdataset=user.$CERN_USER.$TIPE.$DATE._$VERSION/
if [ "$WantToRun" = "SMsignals" ]; then
LIST="listMC_backgrounds_ttbar1728.txt" ###only Powheg117050 with e1728
LIST="listMC_signals_KKgluon.txt"
LIST="listMC_signals_zprime.txt"
echo
fi
if [ "$WantToRun" = "systematics" ]; then
LIST="listMC_ALLsystematics.txt"
LIST="listMC_Powheg1727systematics.txt" ###only Powheg117050 with e1727
echo
fi
if [ "$WantToRun" = "backgrounds" ]; then
LIST="listMC_backgrounds_Wjets"
LIST="listMC_backgrounds_WjetsAkt10"
LIST="listMC_backgrounds_Zjets"
LIST="listMC_backgrounds_SingleTop"
LIST="listMC_backgrounds_Diboson"
echo
fi
if [ "$WantToRun" = "dataEL" ]; then
LIST="listDATA_Egamma.txt"
echo
fi
if [ "$WantToRun" = "dataMU" ]; then
LIST="listDATA_Muons.txt"
echo
fi
echo "========= setting up DQ2 ========="
echo
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
echo
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
echo
setupATLAS
echo
export RUCIO_ACCOUNT=$CERN_USER
localSetupDQ2Client
echo
export DQ2_LOCAL_SITE_ID=IFIC-LCG2_LOCALGROUPDISK
echo
voms-proxy-init -voms atlas
echo
echo
FILESperJOB=1
MAXFILESIZE=104857600
rootVERSION=5.34.14
#####################################################################
echo
for dataset in `cat $LIST`;
do
### mc12_8TeV . 117050 . PowhegPythia_P2011C_ttbar . merge . NTUP_COMMON . e1727_a188_a171_r3549_p1575/
#mc12_8TeV .
#f2=117050 ID=`echo $dataset | cut -d '.' -f2`
#f3=PowhegPythia_P2011C_ttbar . Description=`echo $dataset | cut -d '.' -f3`
#f4=merge .
#f5=NTUP_COMMON .
#f6=e1727_a188_a171_r3549_p1575 Tags=`echo $dataset | cut -d '.' -f6`
IDnumber=`echo $dataset | cut -d '.' -f2`
Description=`echo $dataset | cut -d '.' -f3`
Tags=`echo $dataset | cut -d '.' -f6`
#OUTdataset=user.${CERN_USER}.${IDnumber}.${Description}.${Tags}._$VERSION/
InputToTxt="InputToTxt.txt"
if [ "$WantToRun" = "SMsignals" ]; then
OUTPUTS="el.root,mu.root"
EXECUT="D3PD2MiniSLBoost -f $InputToTxt -p control/settings.txt -boost -common -mcType fullSim -useTruthParticles -saveTruthTopDecay"
fi
if [ "$WantToRun" = "systematics" ]; then
OUTPUTS="*.root"
EXECUT="D3PD2MiniSLBoost -f $InputToTxt -p control/settings.txt -boost -common -mcType fullSim -useTruthParticles -saveTruthTopDecay -sysOn"
fi
if [ "$WantToRun" = "backgrounds" ]; then
OUTPUTS="el.root,mu.root"
EXECUT="D3PD2MiniSLBoost -f $InputToTxt -p control/settings.txt -boost -common -ttresCutflow -mcType fullSim -useTruthParticles"
fi
if [ "$WantToRun" = "dataEL" ]; then
OUTPUTS="el.root"
EXECUT="D3PD2MiniSLBoost -f $InputToTxt -p control/settings.txt -boost -common -ttresCutflow -dataStream Egamma"
fi
if [ "$WantToRun" = "dataMU" ]; then
OUTPUTS="mu.root"
EXECUT="D3PD2MiniSLBoost -f $InputToTxt -p control/settings.txt -boost -common -ttresCutflow -dataStream Muons"
fi
echo "************ we're running: $WantToRun *************"
echo " input dataset = $dataset"
echo "output dataset = $OUTdataset"
echo
echo
prun --inDS=$dataset --useRootCore --outDS=$OUTdataset --outputs=$OUTPUTS --forceStaged --nFilesPerJob=$FILESperJOB --maxFileSize=$MAXFILESIZE --nGBPerJob=MAX --writeInputToTxt=IN:$InputToTxt --rootVer=$rootVERSION --cmtConfig=x86_64-slc6-gcc47-opt --exec="ln -s \$ROOTCOREBIN/data .; ln -s \$ROOTCOREBIN/bin/x86_64-slc6-gcc47-opt bin; ln -s \$ROOTCOREBIN/../TopD3PDAnalysis/control .; echo >> $InputToTxt; $EXECUT"
done
#--noSubmit
#--destSE=$DESTINATION
echo
date +"VIKI %x %r"
echo "---------------------------- END ----------------------------"
echo

The samples will be stored on eos space:
xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/Samples_TopRootCore_14-00-23
d---(002) 1 2014-05-05 14:28:14 /eos/atlas/user/v/vsanchez/Samples_TopRootCore_14-00-23/SMsignals
xrd eosatlas dirlist /eos/atlas/user/v/vsanchez/Samples_TopRootCore_14-00-23/SMsignals
d---(002) 0 2014-05-05 14:27:42 /eos/atlas/user/v/vsanchez/Samples_TopRootCore_14-00-23/SMsignals/PowhegNominal1728_117050
xrdcp root://eosatlas.cern.ch//eos/atlas/user/v/vsanchez/Samples_TopRootCore_14-00-23/SMsignals/PowhegNominal1728_117050/$FILE .
...
Using TopRootCore and TopD3PDBoosted to produce the boosted ntuples necessary for the
boosted lepton+jets analysis.
Twikis:
Communities e-group:
Working at: lxplus
Data & MC: mc12_8TeV - NTUP_COMMON p1562-p1575-p1606...
Recommended by ttbar resonances searches in one lepton channel & TopD3PDBoosted: TopRootCoreRelease-14-00-23 &
TopD3PDBoosted-14-00-15 &
Root-5.34.14
Neccessary file:
packages_customized.txt
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez && kinit $CERN_USER@CERN.CH
~> source empezarROOT53414.sh ### copy here: empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> TRCR=TopRootCoreRelease-14-00-23
~> mkdir TopRootCore_ttbarResonances && cd TopRootCore_ttbarResonances
~> svn co svn+ssh://$CERN_USER@svn.cern.ch/reps/atlasoff/PhysicsAnalysis/TopPhys/TopRootCoreRelease/tags/$TRCR/ $TRCR
~> cd $TRCR/share
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/ttbarResonances/packages.txt .
~> ./build-all.sh
~> cd ../../TopD3PDCorrections/data
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDCorrections/data/BTagCalibration.env .
~> exit
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez
~> source empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> cd TopRootCore_ttbarResonances
~> source RootCore/scripts/setup.sh
~> mkdir run && cd run
~> ln -s ../RootCore/data .
~> ln -s ../TopD3PDAnalysis/control .
~> ln -s ../RootCore/bin/x86_64-slc6-gcc47-opt bin
~> D3PD2MiniSLBoost .........
For the boosted analysis, you may download the attached files above and copy them inside TopD3PDBoosted/Root/ or TopD3PDBoosted/TopD3PDBoosted/:
ssh -Y vsanchez@lxplus.cern.ch
~> export CERN_USER=vsanchez
~> source empezarROOT53414.sh
~> WORKdirectory=/afs/cern.ch/work/v/vsanchez/
~> cd $WORKdirectory
~> cd TopRootCore_ttbarResonances
~> source RootCore/scripts/setup.sh
~> cd TopD3PDBoosted
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/Root/*.cxx Root/
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/TopD3PDBoosted/*.h TopD3PDBoosted/
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDBoosted/util/*.cxx util/
~> cd cmt
~> make -f Makefile.RootCore
~> cd ../../
~> cd TopD3PDCorrections
~> cp /afs/cern.ch/work/v/vsanchez/public/forDan/TopD3PDCorrections/Root/TriggerScale.cxx Root/
~> cd cmt
~> make -f Makefile.RootCore
~> cd ../../
~> cd run/
~> D3PD2MiniSLBoost .........

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Boosted Charge Asymmetry Group
--- IFIC Valencia ---
contact person - email
--- Michigan ---
contact person - email

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.