-
Notifications
You must be signed in to change notification settings - Fork 2
MttTools how to
#Presentation
These tools correspond to the Mtt analysis itself. Here, we select the events of interest ; we search for the best fit for the PDF of the signal ; we fit the background distribution. This is done for the nominal datasets and the datasets used for the systematics.
#Step1: PreSkim
MttTools> cd PreSkim
At this step, we do a preselection on the events, that is:
- we only keep events that passed our selections in Extractor (
isSel == 1
); - we impose a cut on the pt lepton: pt(lepton) > ptLeptonCut (
ptLeptonCut = 26 GeV
if the lepton is a muon andptLeptonCut = 30 GeV
if the lepton is an electron) ; - The TOP reference selection excludes electron with SuperCluster eta between 1.4442 and 1.5660. The TopTrigger efficiency does the same thing, but using electron eta instead of SuperCluster eta. That's why, in the step, we redo a cut on electron eta (we require
fabs(etaLepton) < 1.442 && fabs(etaLepton) >= 1.5660
) ; - we ask for at least one iteration for the MVA or Chi2 algorithm (used to find the best combination of the jets to reconstruct mtt).
The script containing this preselection and all the histogramms at generator level is preSkim.cpp
. It is the script you have to edit if you want to change the preselection or add a generator-level histogram. The python files correspond to the configuration files which have to be tuned to run on your own datasets.
The script preSkim.cpp
takes as inputs the list of the Extractuples (.list
file) and returns a .root
output file. You have to put the list of the Extractuples you want to run on in the configuration files: skimMC.py
for MC and skimData.py
for data.
You can make a symbolic link of the Extractuples lists you have generated after the Extractor step (see the instructions here). If we consider that the the folder containing the lists of your Extractuples, as given in the example, is /<path>/MyListsFolder1
, you can create a symbolic link just by typing these few commands:
PreSkim> mkdir lists
PreSkim> cd lists
lists> ln -s /<path>/MyListsFolder1/*.list .
lists> cd ../
Now, edit the skimMC.py
and skimData.py
scripts and complete them with the correct informations as explained below.
The script is built like that:
files = [
["mySkimOutputFile1.root", "lists/myDataset1.list", "type"],
["mySkimOutputFile2.root", "lists/myDataset2.list", "type"]
]
where
- myOutputFile1.root is the name of your output rootfile, called a skim. It will be stored in the skims// directory (the script generates automatically the directories "" and "" where aDate is the date when you create your directory and aCategory can be data, semimu or semie) ;
- lists/myDataset1.list the lists of the Extractuples you have just linked ;
- "type" is an option to specify if your dataset is a semi-muonic or a semi-electronic channel ;
Just adapt the script to run on your own datasets.
The script is built like that:
files = [
["mySkimOutputFile1.root", "lists/myDataset1_%s.list"],
["mySkimOutputFile2.root", "lists/myDataset2_%s.list"]
]
where
- myOutputFile1.root is the name of your output rootfile, called a skim. It will be stored in the skims// directory (the script generates automatically the directories "" and "" where aDate is the date when you create your directory and aCategory can be data, semimu or semie) ;
- lists/myDataset1.list the lists of the Extractuples you have just linked. Note that here, you don't have to specify the type (semimu or semie): %s stands for it (don't forget to remove "semie" or "semimu" from your lists name and replace it by "%s") and the script replaces it by corresponding types.
Just adapt the script to run on your own datasets.
Now you are ready to run the script. Type the following commands:
PreSkim> make
PreSkim> ./skimMC.py
PreSkim> ./skimData.py
PreSkim> cd ../Extractor2Histo
The aim of this step is to convert the Extractuples into histograms. At this point, you also do the full selection (implementation of the different cut variable, choice of MVA or Chi2 method...).
The script that fills this role is Extractor2Histo.cpp
. You can feed the script directly with the Extractuples lists or with the skims you created in step 2. The python files correspond to the configuration files which have to be tuned to run on your own datasets.
Usually, you feed the script with the skims created at the step before. So, the first thing you have to do is to build a symbolic link pointing on your step 2 skims in the corresponding folder, as you have already done before in step 2.
Extractor2Histo> mkdir skims
Extractor2Histo> cd skims
skims> mkdir data
skims> mkdir semie
skims> mkdir semimu
skims> cd data
data> ln -s ../../../PreSkim/skims/<aDate>/data/* .
data> cd ../semie
semie> ln -s ../../../PreSkim/skims/<aDate>/semie/* .
semie> cd ../semimu
semimu> ln -s ../../../PreSkim/skims/<aDate>/semimu/* .
semimu> cd ../../
Now edit the python configuration files to adapt the script to your own datasets.
With extractDataFromSkim.py:
The script extractDataFromSkim.py
is built like that:
files = [
["myHistoOutputFile1.root", "skims/data/mySkimOutputFile1.root", "type"],
["myHistoOutputFile2.root", "skims/data/mySkimOutputFile2.root", "type"]
]
where
- myHistoOutputFile1.root is the name of your output rootfile. It will be stored in the plots//1-btag/data/ and plots//2-btag/data/ directories, where 1-btag and 2-btag corresponds to your selection "requiring exactly one b-tagged jet" or "requiring at least 2 b-tagged jets". The script generates automatically the directories /, and aCategory stands for semimu or semie ;
- skims/data/mySkimOutputFile1.root the skims created in step 2 you have just linked ;
- "type" is an option to specify if your dataset is a semi-muonic or a semi-electronic channel ;
With extractMCFromSkim.py:
The script extractMCFromSkim.py
is built like that:
files = [
["myHistoOutputFile1.root", "skims/%s/mySkimOutputFile1.root"],
["myHistoOutputFile2.root", "skims/%s/mySkimOutputFile2.root"]
]
where
- myHistoOutputFile1.root is the name of your output rootfile. It will be stored in the plots//1-btag// and plots//2-btag// directories, where 1-btag and 2-btag corresponds to your selection "requiring exactly one b-tagged jet" or "requiring at least 2 b-tagged jets". The script generates automatically the directories /. ;
- skims/data/mySkimOutputFile1.root the skims created in step 2 you have just linked ;
- "type" is an option to specify if your dataset is a semi-muonic or a semi-electronic channel ;