ATLASNaplesStudentTutorials
Introduction
This tutorial is aimed at (new and old) members of the ATLAS collaboration interested in learning the basics of ATLAS physics analysis tools. There are several introductory lectures aimed at introducing the topics followed by practical sessions.
You need ONLY an atlas UI account on Naples machine
Missing Energy exercise
Go to your accounts on atlas UI
ssh -XY -p5022 <your_user>@atlasui03.na.infn.it
or on lxplus
ssh -XY <your_cern_user>@lxplus.cern.ch
and setup all you need to use ROOT
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
localSetupROOT
Input files can be found here
/data/cirotto/NtupleTutorial_monojet
/afs/cern.ch/work/g/ggustavi/public/MJ135_stuffs/MJ135_minitrees
the directories are public, so you can read the files from here...don't copy it on your directories, they're big and require time!
Now we are ready for the exercises.
Selection criteria
NOTE THAT SOME VARIABLES ARE VECTORS
- trigger:
trigger_HLT_xe70==1
- good events:
last>=X
- leading jet pt:
jet_pt.at(0)/1000 > X
We divide to have it in GeV
- eta jet
TMath::Abs(jet_eta.at(0))<X
- tight leading jet
jet_fch.at(0) / jet_fmax.at(0) > X
- MET:
met_nomuon_tst_et/1000 > X
- lepton veto
n_el==X =n_el_baseline==X n_mu_baseline==X n_mu==X
ALL TOGETHER
- number of jet
n_jet<X
- jet-MET mimim phi:
jet_met_dphi_min > XX
Suggestion : use a MakeClass to read the TTree. You can create it with the following commands:
root -l -b
TChain c
c.Add("/afs/cern.ch/work/g/ggustavi/public/MJ135_stuffs/MJ135_minitrees/run_MJ135_data.root/tree_data")
c.MakeClass("myAnalysis")
for running
root -l -b
.L myAnalysis.C
myAnalysis pippo
pippo.Loop()
Suggestion 2: use a TSelector to read the TTree. You can create it with the following commands:
root -l -b
TChain c
c.Add("/afs/cern.ch/work/g/ggustavi/public/MJ135_stuffs/MJ135_minitrees/run_MJ135_data.root/tree_data")
c.MakeSelector("myAnalysis")
MakeSelector
command produces an output similar to
MakeClass
. There are some differences, which Giuliano will show you.
See here for more information:
Root Guide
, and
Root Guide 2
and and
Root Guide Online
Edit
myAnalysis.C
to book your histograms and using the variable you need. In
myAnalysis.C
remember to add in
Process()
method the following line
fChain->GetEntry(entry);
for running
root -l -b
Exercises
1. Implement the Signal Region selection reading the data TTree and plot the leading jet pt and MET distribution with the 3.21 fb-1 available (you have to count 21447 events).
2. Add to (1) the background MC simulations to make a data/MC comparison
Remember to set the weight correctly. Use the variable
weight
but remember that it is normalized to 1 fb-, so you need to scale the distributions for the proper luminosity.
3. Do the same but in the range 150 GeV < MET < 250 GeV
What do you note? which could be the explanation?
4. Test the behavior of the MET with the pileup plotting the 2D histogram of the average interaction per bunch crossing
VS MET and make the histogram profile.
5. Repeat (1) and (2) in the Control Region with one muon following the same selection of the Signal Region
Add the cut on the (

) transverse mass 30
GeV < mT < 100
GeV. The transverse mass definition is

In this case the muon is a signal muon and not a baseline one.
Since that we are using the MET with the muons treated as invisible particles, which informations does the MET distribution give to us?
Solutions: don't cheat!
The macros and the results are in
/afs/cern.ch/user/g/ggustavi/public/MET_tutorial
N.B. Don’t use those macros because are complex and you don’t need so many features in your plots.
Lepton exercise
With this exercise you will work with lepton variables.
Setup
Go to your accounts on atlas UI
ssh -XY -p5022 <your_user>@atlasui03.na.infn.it
Now copy on your local folder the code for the analysis:
cp -r /data/cirotto/TreeReader_tutorial .
Go in the directory and do de setup
cd TreeReader_tutorial
source setROOT.sh
Now that you completed setup, let's see how to use the code
You will work with
TreeReader code, it's a simple class that reads trees and do plots. You have to create a run macro which exploits
TreeReader methods.
You have a template in your directory,
run.C
.
What you need to do is
- Have a selection to use: this means a trigger and a selection for your region of interest
- Set your luminosity
- Using the doPlot() method for plotting your variable
This is a possible code that you will use
void run()
{
//Don't modify this line
gROOT->ProcessLine(".L TreeReader.cxx+");
TStopwatch p;
p.Start();
//Write your selection and the trigger you want to use
TString selection = " my selection";
TString trigger = " my trigger";
//Tag for your plot
TString tag = " my tag";
//UPDATE YOUR PATH!
TreeReader plot("my path);
//set LUMI for MC
plot.SetLumi(myLumi);
//Set weight for bkg
plot.SetWeight("weight"); //deafult is "weight"
//set weight for signal
plot.SetSigWeight("weight"); //default is weight, set weight for signal as appropriate
//rescale signal (ONLY signal!)
plot.SetSigScale(1); //default is 1
//Set Bkg error on significance calculation
plot.SetBkgError(0.15); //default is 0.
//Set LogScale
plot.SetLogScale(true);
//Draw Plot
plot.doPlot("n_jet","n_jet","n jet", selection + trigger, tag,
6,0,6,
false,"n_jet",3,0,6, false);
plot.DrawPlot();
p.Stop();
p.Print();
}
Let's focus on
doPlot
method. It has the following structure
void TreeReader::doPlot(TString histoTitle, TString var, TString title, TString selection, TString selTag,
Int_t nbins, Double_t xmin, Double_t xmax,
Bool_t doScan, TString cut, Int_t div, Double_t min, Double_t max, Bool_t doRev)
- The variable present in the TTree is the second one,
var
. Be careful to use a variable present in the tree, or you will get a crash!
-
histoTitle
and title
are strings for histogram name and its title
-
selTag
just a string which will give a tag to your file
-
nbins
, xmin
, and xmax
are the number of bins, minimum and maximum in the histograms (you should be familiar since you are experts of TH1!)
- We won't use the last line for now so please set
doScan = false
Some advice
- The access to vector variables it's not like in yesterday's exercises. For example, to get leading jet pt you have to write
jet_pt[0]
and NOT jet_pt.at(0)
. This is because we're passing the string to the tree.
- You will get a file with all the histos you defined in your run macro. (Discard about the histos without name) Suggestion: maybe i can produce my histos with TreeReader when I do this Exercise
How to run
- Open and edit run.C
- Update your selection and your trigger
- Don't forget to set luminosity! We're working with 2.5 fb-1
- Write the variable you want to plot, by using
doPlot
method
- run the code
root -l -b -q run.C
- You can find your plots in a folder called data
- You also have a file with the histogram of variables you plotted (divided for each contribution)
Variables
If you open a file and type
TBrowser
you can see al the variables.
Trigger Variables: trigger_HLT_+name
variable for triggers.
xeXX
refers to MET triggers, for leptons you can find
e
or
mu
in the name
Lepton variables: there are several variable of interest:
-
n_lep
and n_lep_baseline
: where lep can be e
or mu
it's the number of lepton
-
mumu_m
, ee_m
: dilepton invariant mass
-
enu_mT
, munu_mT
: transverse mass on lepton-MET system
-
lep_pt
, lep_eta, where lep can be =e
or mu
, vector variables (pt is in MeV)
MET: met_nomuon_tst_et
,
met_noelectron_tst_et
they're in MeV, remind to divide if you want to have GeV
Exercises
Trigger items
Check if the following trigger items are prescaled in run 267638
- Level1 items: L1_2MU4, L1_2EM15, L1_TAU8, L1_J12, L1_XE70, L1_XE55
- High Level Trigger items: HLT_2mu4, HLT_2mu14, HLT_e17_lhloose, HLT_j15, HLT_j25, HLT_xe70, HLT_xe80
In case some of them are prescaled check if the prescale is constant in all the lumiblocks
Fill a table with trigger items, the physical object(s) to which is related, the trigger items seeds and prescales when there is the condition “stable beam”
Trigger efficiencies
Evaluate trigger efficiency of the following trigger items as a function of the variable X:
- HLT_xe70 and X is the missing energy without muons (X=met_nomuon_tst_et) (hint: use all the event as reference): use Wmunu (/data/cirotto/ NtupleTutorial_monob/SUSY7_tutorial_bkg_Wmunu.root) and compare the results with the data
- HLT_mu26_imedium and X is the leading muon pT (X=mu_pt[0]) (hint: use a proper orthogonal trigger): use Wmunu (/data/cirotto/NtupleTutorial_monob/ SUSY7_tutorial_bkg_Wmunu.root)
Are there eta/phi regions where the efficiency is higher?
You define 3 histograms, numerator, denominator and ratio. See
Here
for dividing histograms
h_num1d->Sumw2(); //numerator
h_den1d->Sumw2(); //denominator
h_ratio->Divide(h_num1d, h_den1d, 1, 1, "B") //B option guarantees the correct errors!
Dilepton invariant mass reconstruction
Use the variables described before to see data/MC comparison of dilepton invariant mass.
What about Z->mumu? We need to selects events with 2 muons and no electrons. The opposite for Z->ee.
Use the following selections:
- Zmumu
- Trigger
trigger_HLT_mu26_imedium
- Selection: number of muons and electrons, 66 < dilepton mass < 116 (in GeV)
- Zee
- Trigger
trigger_HLT_e24_lhmedium_L1EM18VH|| trigger_HLT_e24_lhmedium_L1EM20VH|| trigger_HLT_e60_lhmedium || trigger_HLT_e120_lhloose
- Selection: number of muons and electrons, 66 < dilepton mass < 116 (in GeV)
Lepton-neutrino transverse mass reconstruction
Use the variables described before to see data/MC comparison of transverse mass.
You can reconstruct W->munu and W->enu mass
Use the following selections:
- Wmunu
- Trigger
trigger_HLT_xe70
and MET > 200 GeV
- Selection: number of muons and electrons
- Wenu
- Trigger
trigger_HLT_xe70
and MET > 200 GeV
- Selection: number of muons and electrons
Working with histograms
- What are the main backgrounds for these selections? You can check it by using the root files produced after each run of your code. Open it and retrieve the integral of each histogram.
- Do a ratio plot, divide your data histogram by the TOTAL MC histogram, and see how is the agreement bin per bin
You define 3 histograms, numerator, denominator and ratio. You can clone ratio histogram
h_num1d->Sumw2(); //numerator
h_den1d->Sumw2(); //denominator
TH1F *h_ratio = (TH1F*)h_num1d->Clone();
h_ratio->Divide( h_den1d)
Bonus exercise
Can you reproduce mono jet SR by using
TreeReader? Plot the leading jet pt using the proper cuts. You should find the same number for data!
Suggestion: you should edit the input file in /config/ where to put path to Giuliano's file.
Actually there's already in your folder, so write down the selection in your run.C!
Major updates:
--
ArturoS - 2016-04-15
Responsible:
ArturoS
Subject: outreach