Mini-ntuple maker

The purpose of the mini-ntuple maker is to able to shrink the official ntuples so that it would be possible to work on them locally rather than having to use a cluster. Also it is faster to work on a smaller ntuple. The process involve discarding variables and objects that are rarely needed in a typical analysis. It contains only the absolute necessary variables and some of these are already pre-computed from variables that are no longer saved. The “objects” that are retained are photons, electrons, muons and jets. The corresponding variables are enumerated below:

Photon

float pt;
float eta;
float phi;
float px;
float py;
float pz;
float energy;
float hOverE;
float sigmaIetaIeta;
float sigmaIphiIphi;
float etaWidth;
float phiWidth;
float r9;
float r5;
float trackerIso;
float ecalIso;
float hcalIso;
float chargedHadronIso;
float neutralHadronIso;
float photonIso;
int iSubdet;
int nPixelSeeds;
int nClusters;
unsigned char electronVetoBit;

Electron

float pt;
float eta;
float phi;
float px;
float py;
float pz;
float energy;
float combRelSubdetIso;
float combRelIso;
float deltaEta;
float deltaPhi;
float sigmaIetaIeta;
float r5; // proxy shower shape variable
float etaWidth;
float phiWidth;
float hOverE;
float d0;
float dz;
float epDiff;
float vtxFitProb;
float dCot;
float dist;
int iSubdet;
int nClusters;
int nPixelHits;
unsigned char isNotConversion;

Muon

float pt;
float eta;
float phi;
float px;
float py;
float pz;
float energy;
float normChi2;
float dxy;
float dz;
float combRelSubdetIso;
float combRelIso;
int iSubdet;
int nMatchedStations;
int nLayersWithMmt;
int nValidMuonHits;
int nValidPixelHits;
unsigned char isGlobalMuon;
unsigned char isPFMuon;
unsigned char hasInnerTrack;
unsigned char hasGlobalTrack;
unsigned char hasBestTrack;

Jet

float pt;
float eta;
float phi;
float px;
float py;
float pz;
float energy;
float chFraction;
float nhFraction;
float ceFraction;
float neFraction;
int nConstituents;
int nCharged;
int iSubdet;

Event Variables

int nVtx;

float met;

float metPhi;

float mht;

float mhtPhi;

float genMet;

float genMetPhi;

float mtElectron;

float mtElectronPhoton;

float mtMuon;

float mtMuonPhoton;

float enuMomentum;

float munuMomentum;


How to Run the Mini-ntuples maker

A) Get and compile the code

cvs co -d CMUAnalysis UserCode/CMUAnalysis

cd CMUAnalysis/Common

make

B) Run the code through root

root

root[0] gSystem->Load("libSusyEvent.so")

//libSusyEvent.so is located in CMSSW_5_3_3/src/SusyAnalysis/SusyNtuplizer/macro/

root[1] gSystem->Load("libCMUCommon.so")

root[2] TChain susyTree("susyTree")

root[3] susyTree.Add("your_files1.root")

root[4] susyTree.Add("your_files2.root")

root[5] susyTree.Add("your_files3.root")

root[6] .x produceSimpleTree.cc+(susyTree, "output_file_name.root")

The output ntuple (mini-ntuple) contains three trees. One is for event-wide variables (e.g. MET) and the other two is for objects (e.g. photons). One object tree only holds selected objects, i.e. ones that pass standard selection defined in ObjectSelector.cc. The other holds all objects.

C) Using mini-ntuples

Use the following code as a template:

sampleAnalysis.cc

root

root[1] .L sampleAnalysis.cc+

root[2] sampleAnalysis()









The output ntuple (mini-ntuple) contains three trees. One is for event-wide variables (like MET) and the other two is for objects (like photons). One object tree only holds selected objects, i.e. ones that pass standard selection defined in ObjectSelector.cc. The other holds all objects.

You can change the behavior of the ntuplizer to store only the selected objects by setting SAVEALL flag at the beginning of the ntuplizer file to false.

To use the trees, you need to bind them together:

$ root mini-ntuples.root

root[0] TTree* eventVars = (TTree*)gDirectory->Get("eventVars")

root[1] TTree* selectedObjects = (TTree*)gDirectory->Get("selectedObjects")

root[2] eventVars->AddFriend(selectedObjects)

After adding the tree of selected (or all) objects to the eventVars, you can use the eventVars as usual, like

root[3] eventVars->Draw(" photon.pt[0]")

The objects are ordered in decreasing Pt within each object tree.

allObjects->MakeClass("objects")

eventVars->MakeClass("events")

These will result in four files:

objects.C

objects.h

events.C

events.h

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2013-05-22 - AristotleCalamba
 
    • 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