JetResolution class: Software Guide

Overview

The JetResolution class provides a CMSSW software interface to jet resolutions. The user passes (generator) jet pT and eta and retrieves a TF1* describing the corresponding resolution for jet pT, eta, or phi. The parametrizations are stored in text files. The standard text files which are available correspond to resolutions derived from MC truth information, see e.g. AN 2010/121.

Installation

To checkout the code from CVS, compile it, and run a simple demonstration, do:

cmsrel CMSSW_3_9_0_pre5
cd CMSSW_3_9_0_pre5/src
cmsenv
addpkg CondFormats/JetMETObjects
scram b -j4
JetResolution_t

For the 36X series, things are slightly more complicated because the code never made it into any tag or release by mistake:

cmsrel CMSSW_3_6_3_patch1
cd CMSSW_3_6_3_patch1/src
cmsenv
addpkg CondFormats/JetMETObjects
cvs co CondFormats/JetMETObjects/interface/JetResolution.h
cvs co CondFormats/JetMETObjects/src/JetResolution.cc
cvs co CondFormats/JetMETObjects/src/JetCorrectorParameters.cc
cvs co CondFormats/JetMETObjects/data/Spring10_PtResolution_AK5Calo.txt
cvs co CondFormats/JetMETObjects/data/Spring10_EtaResolution_AK5Calo.txt
cvs co CondFormats/JetMETObjects/data/Spring10_PhiResolution_AK5Calo.txt
scram b -j4
JetResolution_t

Interface

Many relevant use cases to use the JetResolution class interface are covered in the example executable JetResolution_t.cc.

To use the class in your own code, first include its header:

#include "CondFormats/JetMETObjects/interface/JetResolution.h"

Then construct the class, passing the name of the text file containing the parameters and a flag indicating whether you want to restrict yourself to Gaussian resolutions or not:

string fileName = "Spring10_PtResolution_AK5Calo.txt";
bool  doGaussian = false;
JetResolution ptResol(fileName, doGaussian);

Given (generator) jet eta and pT values, you can then retrieve the corresponding resolution function as a ROOT TF1* object, and e.g. evaluate it as a PDF using TF1::GetRandom():

float geneta = ...;
float genpt = ...;  
TF1* fPtResol = ptResol.resolutionEtaPt(eta,pt);
float rndm = fPtResol->GetRandom();
float jetpt = rndm*genpt;

You can also get to the functions descriping the pT dependence of each single parameter, for example the Gaussian width sigma:

float eta = ...;
TF1* fSigma = ptResol.parameterEta("sigma",eta);
fSigma->Draw();

-- PhilippSchieferdecker - 19-May-2010

Edit | Attach | Watch | Print version | History: r10 | r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r5 - 2011-05-13 - SalvatoreRRappoccio
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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