Table Reader Class


For the Z+Jet cross section analysis 2011-12, we developed a simple class to read the scalefactors and associated erros, indexed with pT and eta of the lepton.

Source Code and Input Tables

  1. Source Code: A preliminary version of the class can be seen here.
  2. Copy-Paste the class from the link shown in above bullet , into a file called table.h.
  3. Input Tables: An example of the table format is given below:
    ptLow, ptHigh, etaLow, etaHi, effi, effErrLow, effErrHi
    An example of table in valid format is placed here

Using Table Reader

This class can be used inside a root analysis macro. There are two actions: (a)loading the table, (b)accessing scaleFactor for a given &mu(pT,η).
  1. Loading Tree (Outside Event Loop): table Mu2Wp("PfToId.txt");
  2. Accessing Scale Factor (Inside Event Loop):
double ptMu = XXX;
double etaMu = YYY;

double scalFac = Mu2Wp.Val(ptMu, etaMu);
double sFErr = Mu2Wp.Err(ptMu, etaMu);

A Dummy Example

#include "Example.h"
#include "table.h"
table Mu2Wp("PfToId.txt");

void Example::Loop()
Long64_t nentries = fChain->GetEntriesFast();
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=in; jentry<fin;jentry++) {
Long64_t ientry = LoadTree(jentry);
if (ientry < 0) break;
nb = fChain->GetEntry(jentry); nbytes += nb;

TLorentzVector mu1(px,py,pz,en);//From tree branches
double ptMu = mu1.Pt();
double etaMu = mu1.Eta()

double sFac = Mu2Wp.Val(ptMu,etaMu);
double sFErr = Mu2Wp.Err(ptMu,etaMu);


Developed and Tested a simple utility class for reading scale-factors indexed using pt and eta of the lepton.

-- LovedeepKaurSaini - 04-Jul-2012

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2012-07-04 - unknown
    • 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