Skip to content

Commit

Permalink
RoccoR with official nano-tools (#27)
Browse files Browse the repository at this point in the history
* RoccoRUpdate

* Delete KalmanMuonCalibrationsProducer/data/roccor.Run2.v5 directory

---------

Co-authored-by: yuji <[email protected]>
  • Loading branch information
YujiLee301 and yuji authored Nov 29, 2023
1 parent e010717 commit 580b4d4
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 84,678 deletions.
16 changes: 2 additions & 14 deletions H4LCppModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,10 @@ def __init__(self,year,cfgFile,isMC,isFSR):
ROOT.gSystem.Load("libPhysicsToolsNanoAODTools.so")
ROOT.gROOT.ProcessLine(
".L %s/interface/H4LTools.h" % base)
if "/RoccoR_cc.so" not in ROOT.gSystem.GetLibraries():
base = "$CMSSW_BASE//src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim"
if base:
ROOT.gROOT.ProcessLine(
".L %s/src/RoccoR.cc+O" % base)
else:
base = "$CMSSW_BASE/src/PhysicsTools/NanoAODTools"
ROOT.gSystem.Load("libPhysicsToolsNanoAODTools.so")
ROOT.gROOT.ProcessLine(
".L %s/interface/RoccoR.h" % base)
self.year = year
with open(cfgFile, 'r') as ymlfile:
cfg = yaml.load(ymlfile)
RoccoRPath = cfg['RoccoRPath']
self.worker = ROOT.H4LTools(self.year, RoccoRPath)
self.worker = ROOT.H4LTools(self.year)
self.worker.InitializeElecut(cfg['Electron']['pTcut'],cfg['Electron']['Etacut'],cfg['Electron']['Sip3dcut'],cfg['Electron']['Loosedxycut'],cfg['Electron']['Loosedzcut'],
cfg['Electron']['Isocut'],cfg['Electron']['BDTWP']['LowEta']['LowPT'],cfg['Electron']['BDTWP']['MedEta']['LowPT'],cfg['Electron']['BDTWP']['HighEta']['LowPT'],
cfg['Electron']['BDTWP']['LowEta']['HighPT'],cfg['Electron']['BDTWP']['MedEta']['HighPT'],cfg['Electron']['BDTWP']['HighEta']['HighPT'])
Expand Down Expand Up @@ -194,15 +183,14 @@ def analyze(self, event):
self.worker.SetElectrons(xe.pt, xe.eta, xe.phi, xe.mass, xe.dxy,
xe.dz, xe.sip3d, xe.mvaFall17V2Iso, xe.pdgId, xe.pfRelIso03_all)
for xm in muons:
self.worker.SetMuons(xm.pt, xm.eta, xm.phi, xm.mass, xm.isGlobal, xm.isTracker,
self.worker.SetMuons(xm.corrected_pt, xm.eta, xm.phi, xm.mass, xm.isGlobal, xm.isTracker,
xm.dxy, xm.dz, xm.sip3d, xm.ptErr, xm.nTrackerLayers, xm.isPFcand,
xm.pdgId, xm.charge, xm.pfRelIso03_all)
for xf in fsrPhotons:
self.worker.SetFsrPhotons(xf.dROverEt2,xf.eta,xf.phi,xf.pt,xf.relIso03)
for xj in jets:
self.worker.SetJets(xj.pt,xj.eta,xj.phi,xj.mass,xj.jetId, xj.btagCSVV2, xj.puId)

self.worker.MuonPtCorrection(isMC)
self.worker.LeptonSelection()
if ((self.worker.nTightEle<2)&(self.worker.nTightMu<2)):
pass
Expand Down
2 changes: 0 additions & 2 deletions Input_2017.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Triggers:
- event.HLT_Ele40_WPTight_Gsf
- event.HLT_IsoMu27

RoccoRPath:
KalmanMuonCalibrationsProducer/data/roccor.Run2.v5/RoccoR2017UL.txt

Zmass:
91.1876
Expand Down
3 changes: 0 additions & 3 deletions Input_2018.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ Triggers:
- event.HLT_Ele32_WPTight_Gsf
- event.HLT_IsoMu24

RoccoRPath:
KalmanMuonCalibrationsProducer/data/roccor.Run2.v5/RoccoR2018UL.txt

Zmass:
91.1876
MZ1cut:
Expand Down
124 changes: 0 additions & 124 deletions KalmanMuonCalibrationsProducer/data/roccor.Run2.v5/README

This file was deleted.

Loading

0 comments on commit 580b4d4

Please sign in to comment.