LeptonNtupleAnalysis

-- IoannisNomidis - 03 Dec 2013

Introduction

This twiki page is meant to be used as documentation for the private ntuples used by the Thessaloniki ATLAS group for multilepton analysis.

Ntuple structure

The ntuple has one entry per collision event. There are branches that correspond to information on the event and branches that correspond to information on each lepton or jet found in the event (these are vectors, as multiple leptons or jets may be exist in the event).

   UInt_t          mc_channel_number;  // unique number for each mc sample
   UInt_t          nPV;                        // the number of reconstructed primary vertices with at least three associated tracks
   Float_t         MET_phi;                 // missing transverse energy, phi direction
   Float_t         MET_et;                   // missing transverse energy, phi direction
   Float_t         wEvent;                     // event weight (NLO * pile-up * z-vertex)
   vector<float>   *l_effTrigData;          // needed for trigger efficiency weight
   vector<float>   *l_effTrigDataErr;     // needed for trigger efficiency weight
   vector<float>   *l_effTrigMC;            // needed for trigger efficiency weight
   vector<float>   *l_effTrigMCErr;       // needed for trigger efficiency weight
   vector<float>   *l_wReco;                 // identification & reconstruction weight
   vector<float>   *l_wRecoErr;          // identification & reconstruction weight error
   vector<float>   *l_pt;                         // for lepton four-momentum construction
   vector<float>   *l_eta;
   vector<float>   *l_phi;
   vector<float>   *l_E;
   vector<float>   *l_rawpt;                   // track(muons) or cluster(electrons) parameters
   vector<float>   *l_raweta;
   vector<float>   *l_rawphi;
   vector<int>     *l_pid;                         // particle id (electron / muon, charge)
   vector<int>     *l_recotype;                // reconstruction type (central / forward / calo-tagged)
   vector<int>     *l_recoid;                // identification type (standalone, segment-tagged, combined / loose, medium, tight, multiplepton)
   vector<int>     *l_isTriggerMatched;  // trigger object matching
   vector<float>   *l_d0;                         // track parameters
   vector<float>   *l_d0err;
   vector<float>   *l_z0;
   vector<float>   *l_trkiso20;                // track isolation in cone DeltaR 0.20
   vector<float>   *l_caloiso20;             // calo isolation in cone DeltaR 0.20
   vector<float>   *jet_pt;                       // for jet four-momentum construction
   vector<float>   *jet_eta;
   vector<float>   *jet_phi;
   vector<float>   *jet_E;
   vector<float>   *jet_jvf;                      // jet parameters
   vector<int>     *jet_isBadLooseMinus;

Normalizing a sample

To normalize the MC samples to a value of luminosity, a weight is applied per event using the formula:

     wNorm = Lumi_data / Lumi_mc = Lumi_data / (nEvents_mc / xsection_mc)

where Lumi_data is the integrated luminosity of the data sample (given by the user in picobarns), nEvents_mc is the number of generated events in the MC sample (retrieved from a histogram from the ntuple file, Nominal/pid_xxx/Cutflows) and xsection_mc is the cross-section of the specific process modeled by the MC sample (returned by the function =getNormWeight(mc_channel_number) from NormWeights.h). The full procedure:

//before the event loop:
double Lumi = 20300; // pb-1
vector<pair<int,float> > mcid_N; // to hold the number of events per mc_channel_number
mcid_N = getNumEventsPerMCID(fname);

//inside the event loop
float nEvents=0;
for (int imc=0; imc<mcid_N.size(); imc++) {
   if (mc_channel_number==mcid_N[imc].first) {
      nEvents=mcid_N[imc].second;
      break;
   }   
}   
wNorm = getNormWeight(mcid)/nEvents*Lumi;

Correction weights

In each event in MC samples, the following weights must be applied:

  • wEvent: weight of the event, product of NLO weight * pile-up weight * z-vertex weight
  • identification+reconstruction efficiency weight. It is the product of the weights for each selected lepton. Use branches: l_wReco, l_wRecoErr.
  • trigger efficiency weight. It is obtained from branches: l_effTrigData, l_effTrigMC. To extract the trigger efficiency weight, create a vector with the indices of the fully selected leptons of your reconstructed final state and pass it to this function which returns the scale factor and its error: pair<float,float> trigSF = getTriggerSF(Zleptons);

Lepton identification

To identify the flavour and the charge of a reconstructed lepton in the ntuple, use l_pid (e-: 11, e+: -11, mu-: +13, mu+: -13). To identify the type of the reconstructed lepton use l_recotype and l_recoid according to the tables below.

  l_recotype
  0 1 2
muons central forward calo-tagged
electrons central forward n/a

  l_recoid
  -1 0 1 2
muons n/a standalone segment-tagged combined
central electrons author 1 or 3 multileptonID n/a n/a
forward electrons author 8 looseID mediumID tightID

For convenience, a few simple functions are defined in LeptonReader.h (see Analysis skeleton below) to handle these various types easilly:

isMuon
isCentralMuon
isForwardMuon
isCaloMuon
isStandaloneMuon
isSegmentTaggedMuon
isCombinedMuon
isElectron
isCentralElectron
isForwardElectron

Analysis skeleton

Find attached the NtupleAnalysisSkeleton: an almost empty skeleton - example demonstrating how to write your analysis implementing all the stuff discussed in this twiki page. In this example, a histogram is created, filled using the appropriate weights, normalized according to the luminosity of the data and written it in a file. Some extra goodies are also provided by this skeleton, so consider it a good idea to start writing your code using this skeleton.

Latest version of the NtupleAnalysisSkeleton in svn (requires grid certificate): https://trac.hellasgrid.gr/trac/atlas.physics.auth.gr/browser/nomos/NtupleAnalysisSkeleton/trunk

Where are the ntuples?

Latest version (4/3/2014) in EOS:

root://eosatlas//eos/atlas/user/i/inomidis/ntuples/ZZ/v3/
.

Produced with tag (https://svnweb.cern.ch/trac/atlasinst/browser/Institutes/AUTh/AnalysisZZ_auth/Analysis_ZZ/tags/):

Analysis_ZZ-01-00-00

(See

patches/get_packages_2012.sh
for the list of correction packages used.)

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r6 - 2014-03-04 - IoannisNomidis
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback