ATLAS logo black and blue

ATLAS Data and Tool example notebook

Created: March, 2016. Outreach Team and for more information, visit the CERN OpenData portal site! </CENTER> </br>

An introduction to the ATLAS public datasets

This is a notebook using the ROOT Prompt kernel that using c++ language, is intended to show the internal content and the way to call and interact with the datasets released by the ATLAS experiment with focus in Education and Training activities:

</br>

Description of the real data samples

</br>

The ATLAS detector records data

ATLAS azimuthal view with physics objects

The ATLAS detector records data

</br>

Description of the MonteCarlo (MC) simulated samples

The ATLAS detector records data

ATLAS computational simulated detector

The ATLAS detector records data

</br>

Description of the Variables inside the _mini_ tree in the ATLAS Open Data samples

# variable branchname type description
01 runNumber int runNumber
02 eventNumber int eventNumber
03 channelNumber int channelNumber
04 lbNumber int lbNumber
05 rndRunNumber int randomized run number mimicking run number distribution in data
06 mu float average interactions per bunch crossing
07 mcWeight float weight of an MC event
08 pvxp_n int number of primary vertices
09 isGoodEvent int summary of diverse quality flags like hfor
10 scaleFactor float overall scale factor for the preselected event
11 trigE bool boolean whether a standard trigger has fired in the egamma stream
12 trigM bool boolean whether a standard trigger has fired in the muon stream
13 passGRL bool signifies whether event passes the GRL may be put in isGoodEvent
14 hasGoodVertex bool signifies whether the event has at least one good vertex
15 lep_n int number of preselected leptons
16 lep_truthMatched vector boolean indicating whether the lepton is matched to a truth lepton
17 lep_trigMatched vector boolean signifying whether the lepton is the one triggering the event
18 lep_pt vector transverse momentum of the lepton
19 lep_eta vector pseudo-rapidity of the lepton
20 lep_phi vector azimuthal angle of the lepton
21 lep_E vector energy of the lepton
22 lep_z0 vector z-coordinate of the track associated to the lepton wrt. the primary vertex
23 lep_charge vector charge of the lepton
24 lep_isTight vector boolean indicating whether the lepton is of tight quality
25 lep_flag vector bitmask implementing object cuts of the top group
26 lep_type vector number signifying the lepton type (e, mu, tau) of the lepton
27 lep_ptcone30 vector ptcone30 isolation for the lepton
28 lep_etcone20 vector etcone20 isolation for the lepton
28 lep_trackd0pvunbiased vector d0 of the track associated to the lepton at the point of closest approach (p.o.a.)
29 lep_tracksigd0pvunbiased vector d0 signifcance of the track associated to the lepton at the p.o.a.
30 met_et float Transverse energy of the missing momentum vector
31 met_phi float Azimuthal angle of the missing momentum vector
32 jet_n int number of selected jets
33 jet_pt vector transverse momentum of the jet
34 jet_eta vector pseudorapidity of the jet
35 jet_phi vector azimuthal angle of the jet
36 jet_E vector energy of the jet
37 jet_m vector invariant mass of the jet
38 jet_jvf vector JetVertexFraction of the jet
39 jet_flag vector bitmask implementing object cuts of the top group
40 jet_trueflav vector true flavor of the jet
41 jet_truthMatched vector information whether the jet matches a jet on truth level
42 jet_SV0 vector SV0 weight of the jet
43 jet_MV1 vector MV1 weight of the jet
44 scaleFactor_BTAG float scalefactor for btagging
45 scaleFactor_ELE float scalefactor for electron efficiency
46 scaleFactor_JVFSF float scalefactor for jet vertex fraction
47 scaleFactor_MUON float scalefactor for muon efficiency
48 scaleFactor_PILEUP float scalefactor for pileup reweighting
49 scaleFactor_TRIGGER float scalefactor for trigger
50 scaleFactor_ZVERTEX float scalefactor for z-vertex reweighting

1. We can start creating a TChain for each type of samples to be used. In this way we can add more that one file if they correspond the same family. For example:

1.a A TChain for the real data with electrons/photos filter, so-called: Egamma

1.b ggggg

In [1]:
TChain *InputDataEgamma = new TChain("mini");
TChain *InputDataMuons  = new TChain("mini");
TChain *InputMonteCarlo = new TChain("mini");

2. Now... ATLAS datasets repository ...correspond the same family as in the step before:

In [ ]:
/*
InputDataEgamma->Add("/Users/clitemnestra/Downloads/DataEgammaA.root");
*/

InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaA.root");
/*
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaB.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaC.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaD.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaE.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaG.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaH.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaI.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaJ.root");
InputDataEgamma->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataEgammaL.root");
*/

(Text)

In [ ]:
/*
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsA.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsB.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsC.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsD.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsE.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsG.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsH.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsI.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsJ.root");
InputDataMuons->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/data/DataMuonsL.root");*/

Text

In [ ]:
/*
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_105985.WW.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_105986.ZZ.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_105987.WZ.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110090.stop_tchan_top.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110091.stop_tchan_antitop.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110119.stop_schan.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110140.stop_wtchan.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110899.ZPrime400.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110901.ZPrime500.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110902.ZPrime750.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110903.ZPrime1000.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110904.ZPrime1250.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110905.ZPrime1500.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110906.ZPrime1750.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110907.ZPrime2000.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110908.ZPrime2250.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110909.ZPrime2500.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_110910.ZPrime3000.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_117049.ttbar_had.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_117050.ttbar_lep.root");

InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_147770.Zee.root");

InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_147771.Zmumu.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_147772.Ztautau.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_158020.ZPrime_ee.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_158026.ZPrime_mm.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_160155.ggH125_ZZ4lep.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_160205.VBFH125_ZZ4lep.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_161005.ggH125_WW2lep.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_161055.VBFH125_WW2lep.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167740.WenuWithB.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167741.WenuJetsBVeto.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167742.WenuNoJetsBVeto.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167743.WmunuWithB.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167744.WmunuJetsBVeto.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167745.WmunuNoJetsBVeto.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167746.WtaunuWithB.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167747.WtaunuJetsBVeto.root");
InputMonteCarlo->Add("http://arturos.web.cern.ch/arturos/napoli/OutReach/mc/mc_167748.WtaunuNoJetsBVeto.root");
*/

Text

In [ ]:
Int_t InputEgamma_lep_n;

Float_t InputEgamma_lep_pt[5],
        InputEgamma_lep_eta[5],
        InputEgamma_lep_phi[5],
        InputEgamma_lep_type[5];
In [ ]:
Int_t InputMuons_lep_n;

Float_t InputMuons_lep_pt[5],
        InputMuons_lep_eta[5],
        InputMuons_lep_phi[5],
        InputMuons_lep_type[5];
In [ ]:
Int_t InputMC_lep_n;

Float_t InputMC_lep_pt[5],
        InputMC_lep_eta[5],
        InputMC_lep_phi[5],
        InputMC_lep_type[5];

Text

In [ ]:
InputDataEgamma->SetBranchAddress("lep_n",    &InputEgamma_lep_n);
InputDataEgamma->SetBranchAddress("lep_pt",   &InputEgamma_lep_pt);
InputDataEgamma->SetBranchAddress("lep_eta",  &InputEgamma_lep_eta);
InputDataEgamma->SetBranchAddress("lep_phi",  &InputEgamma_lep_phi);
InputDataEgamma->SetBranchAddress("lep_type", &InputEgamma_lep_type);

Text

In [ ]:
InputDataMuons->SetBranchAddress("lep_n",  &InputMuons_lep_n);
InputDataMuons->SetBranchAddress("lep_pt", &InputMuons_lep_pt);
InputDataMuons->SetBranchAddress("lep_eta",&InputMuons_lep_eta);
InputDataMuons->SetBranchAddress("lep_phi",&InputMuons_lep_phi);
InputDataMuons->SetBranchAddress("lep_type",&InputMuons_lep_type);

Text

In [ ]:
InputMonteCarlo->SetBranchAddress("lep_n",  &InputMC_lep_n);
InputMonteCarlo->SetBranchAddress("lep_pt", &InputMC_lep_pt);
InputMonteCarlo->SetBranchAddress("lep_eta",&InputMC_lep_eta);
InputMonteCarlo->SetBranchAddress("lep_phi",&InputMC_lep_phi);
InputMonteCarlo->SetBranchAddress("lep_type",&InputMC_lep_type);

Text

In [ ]:
TH1F *h_lep_pt   = new TH1F("h_lep_pt","h_lep_pt",100,0,250000);
TH1F *h_lep_pt_2 = new TH1F("h_lep_pt_2","h_lep_pt",100,0,250000);
TH1F *h_lep12_IM = new TH1F("h_lep12_IM","h_lep12_IM",100,0,800000);
TH1I *h_lep12_type = new TH1I("h_lep12_type","h_lep12_type",40,-20,20);

Text

In [ ]:
h_lep_pt->SetMarkerStyle(8);
h_lep_pt->SetMarkerSize(0.5);
h_lep_pt_2->SetLineColor(0);

h_lep_pt_2->SetMarkerStyle(8);
h_lep_pt_2->SetMarkerSize(0.5);
h_lep_pt_2->SetLineColor(2);

Text

In [ ]:
int nentries,nbytes,i;
nentries=(Int_t)InputDataEgamma->GetEntries();

// Variables for...
float M;

for (i = 0;i<nentries;i++) {
    nbytes = InputDataEgamma->GetEntry(i);
        
    //Uncut histogram
    h_lep_pt->Fill(InputEgamma_lep_pt[0]);
    h_lep12_type->Fill(InputEgamma_lep_type[0]);
    

    //Cut histogram
    if (InputEgamma_lep_n>1 && InputEgamma_lep_pt[1]>15000.)
    {
        h_lep_pt_2->Fill(InputEgamma_lep_pt[1]);
        
        // Calculation of the invarriant mass of the two leading leptons, using:
        // InvMass^2 = 2.pt_{lep1}.pt_{lep2}.(\cosh{(eta_{lep1}.eta_{lep2})} - \cos{(phi_{lep1}.phi_{lep2})})
        M = sqrt(2*InputEgamma_lep_pt[0]*InputEgamma_lep_pt[1]*
                 (  TMath::CosH(InputEgamma_lep_eta[0]*InputEgamma_lep_eta[1]) 
                  - TMath::Cos(InputEgamma_lep_phi[0]*InputEgamma_lep_phi[1])));
        
        
      //Fill ...
      h_lep12_IM->Fill(M);
      h_lep12_type->Fill(InputEgamma_lep_type[1]);
    }
  }

Text

In [ ]:
TCanvas *c1 = new TCanvas("c1","c1",50,50,800,600);
c1->SetFillColor(0);
//gStyle->SetOptStat(0);
gStyle->SetPalette(1);

TCanvas *c2 = new TCanvas("c2","c2",50,50,800,600);
c2->SetFillColor(0);

Text

In [ ]:
TLegend *leg = new TLegend(0.8,0.8,0.98,0.98);
  leg->AddEntry(h_lep_pt,"Uncut","P");
  leg->AddEntry(h_lep_pt_2,"Cut","P");

Text

In [ ]:
c1->cd();
  h_lep_pt->Draw();
  h_lep_pt_2->Draw("same");
  //leg->Draw();

Text

In [ ]:
c1->Draw();

Legend of the plot

In [ ]:
c2->cd();
  h_lep12_IM->Draw();

Text

In [ ]:
c2->Draw();

Figure 2: Invariant mass (InvMass) of the di-lepton system. For this calculation we use the equation as described in Ref[4]: $$InvMass^2 = 2.pt_{lep1}.pt_{lep2}.(\cosh{(eta_{lep1}.eta_{lep2})} - \cos{(phi_{lep1}.phi_{lep2})})$$

$$c = \sqrt{a^2 + b^2}$$

References

  1. primera
  2. segunda
  3. tercera
  4. Wikipedia

Notes

  • This notebook can be very large but fter it can be "include" in other to reduce the amount of repetitive work as creating TChain and/or charge their varibles.
  • Definition of runNumber variable (01)
  • Example brought to you by the ATLAS Outreach Data&Tools group with the help of CERN!

    In [ ]: