Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:00

0001 import os, sys
0002 from ROOT import gSystem, gROOT, TFile, TCanvas, gPad, TBrowser, TH2F
0003 
0004 
0005 gROOT.Macro( os.path.expanduser( '~/rootlogon.C' ) )
0006 
0007 def loadFWLite():
0008     gSystem.Load("libFWCoreFWLite")
0009     gROOT.ProcessLine('FWLiteEnabler::enable();')
0010     gSystem.Load("libFWCoreFWLite")
0011 
0012 
0013 
0014 def init(events):
0015     
0016     events.SetAlias('vertex','recoVertexs_offlinePrimaryVertices__RECO')
0017     events.SetAlias('pu','recoPFCandidates_pfPileUp__PF2PAT')
0018     events.SetAlias('nopu','recoPFCandidates_pfNoPileUp__PF2PAT')
0019 
0020     events.SetAlias('tvnopu', 'nopu.obj.vertex()')
0021     events.SetAlias('tvrhonopu','sqrt(tvnopu.x()*tvnopu.x()+tvnopu.y()*tvnopu.y())')
0022     
0023     events.SetAlias('run','EventAuxiliary.id().run()')
0024     events.SetAlias('lumi','EventAuxiliary.id().luminosityBlock()')
0025 
0026     events.SetAlias('dzpu','pu.obj.vertex().z()-vertex.obj[0].z()')
0027     events.SetAlias('dznopu','nopu.obj.vertex().z()-vertex.obj[0].z()')
0028 
0029     return events
0030 
0031 loadFWLite()
0032 
0033 file = TFile( sys.argv[1] )
0034 events = file.Get('Events')
0035 init(events)
0036 
0037 events.Draw('dznopu','abs(dznopu)<1')