Skip to content

Commit

Permalink
recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaustuvdatta committed Apr 19, 2021
1 parent ede7bc4 commit cb02d11
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
11 changes: 6 additions & 5 deletions Skimmer/python/skimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, channel='elmu', leptonSF={}, year='2017'):

self.minLepWPt = 150. #to select boosted topologies in semi-leptonic ttbar
self.minSDMassW = 60.
self.maxSDMassW = 115.
self.maxSDMassW = 120.

### Kinematics Cuts AK4Jets ###
self.minAK4JetPt = 25.
Expand Down Expand Up @@ -280,7 +280,7 @@ def boostedWSelection(self, event):
if WcandLep.Pt() < self.minLepWPt: return False

#Minimal selection on AK4 jets, requiring at least 2 jets satisfying the minimal criteria in the event
recoAK4 = [ x for x in Jets if x.pt > self.minAK4JetPt and abs(x.p4().Eta()) < self.maxAK4JetEta and (x.jetId & 2)]
recoAK4 = [ x for x in Jets if x.pt > self.minAK4JetPt and abs(x.p4().Eta()) < self.maxAK4JetEta and (x.jetId>=2)]
if not len(recoAK4) > 1: return False

# Commenting out requirement of scalar sum of pT of all minimally selected AK4 jets in the event(i.e., H_T) to be greater than 250 GeV, but keeping the value for later cuts/control plots if necessary
Expand All @@ -290,11 +290,11 @@ def boostedWSelection(self, event):
minAK4MetDPhi = min([ abs(x.p4().DeltaPhi(MET)) for x in recoAK4]) if len(recoAK4) >= 1 else -1.

#To progress further, keeping the non-btagged AK4 jet(s) is not necessary; so we drop them effectively requiring that there is at least one b-tagged AK4 jet, and also requiring an angular separation of the prompt lepton and b-tagged jet
recoAK4 = [ x for x in recoAK4 if x.btagDeepFlavB > self.minBDisc and abs(x.p4().DeltaPhi(lepton.p4())<2.)]
recoAK4 = [ x for x in recoAK4 if x.btagDeepFlavB > self.minBDisc and abs(x.p4().DeltaPhi(lepton.p4()))<2.]
if not len(recoAK4) > 0: return False

#Selection for AK8 jet
recoAK8 = [ x for x in FatJets if x.pt > self.minAK8JetPt and abs(x.eta) < self.maxAK8JetEta and x.tau1 > 0. and x.tau2 > 0. and (x.jetId & 2) and x.p4().DeltaPhi(lepton.p4())>2.] #and x.msoftdrop > self.minSDMassW and x.msoftdrop<self.maxSDMassW
recoAK8 = [ x for x in FatJets if x.pt > self.minAK8JetPt and abs(x.eta) < self.maxAK8JetEta and x.tau1 > 0. and x.tau2 > 0. and (x.jetId>=2) and abs(x.p4().DeltaPhi(lepton.p4()))>2. and x.msoftdrop > self.minSDMassW and x.msoftdrop<self.maxSDMassW] #
if not len(recoAK8) > 0: return False
recoAK8.sort(key=lambda x:x.pt,reverse=True)

Expand Down Expand Up @@ -395,7 +395,8 @@ def boostedWSelection(self, event):
if dR < 0.6: # changed from 0.8 for tighter matching criterion (as per CMS-JME-18-002)
nDau +=1
self.isW = 1

print (recoAK8[0].pt, recoAK8[0].msoftdrop, recoAK4[0].pt, event.event, event.luminosityBlock)

#Fill output branches
self.out.fillBranch("passingAK4_HT", recoAK4_HT)
self.out.fillBranch("genmatchedAK8", self.isW)
Expand Down
3 changes: 2 additions & 1 deletion Skimmer/test/PSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
)
process.source.fileNames = [
#'root://cms-xrd-global.cern.ch///store/mc/RunIISummer19UL17NanoAOD/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/NANOAODSIM/106X_mc2017_realistic_v6-v1/100000/B8E8D3C6-B111-DB43-92B7-2FD447A95C87.root',
'root://cms-xrd-global.cern.ch///store/mc/RunIISummer19UL17NanoAOD/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/NANOAODSIM/106X_mc2017_realistic_v6-v2/280000/64225131-61AB-7649-8D04-7511E4FA3F9B.root'
'root://cms-xrd-global.cern.ch///store/user/kadatta/PFNano/106X_v1/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/RunIISummer19UL17PFNanoAOD-106X_mc2017_realistic_v6-v2/210120_093555/0000/nano106X_on_mini106X_2017_mc_NANO_1.root',
#'root://cms-xrd-global.cern.ch///store/mc/RunIISummer19UL17NanoAOD/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/NANOAODSIM/106X_mc2017_realistic_v6-v2/280000/64225131-61AB-7649-8D04-7511E4FA3F9B.root'
#'root://xrootd-cms.infn.it//store/group/lpctlbsm/NanoAODJMAR_2019_V1/Production/CRAB/TTJets_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/TTJetsTuneCUETP8M113TeV-madgraphMLM-pythia8RunIISummer16MiniAODv3-PUMoriond1794XmcRun2/190321_164456/0000/nano102x_on_mini94x_2016_mc_NANO_12.root',
#'root://cms-xrd-global.cern.ch///store/mc/RunIISummer19UL17NanoAOD/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/NANOAODSIM/106X_mc2017_realistic_v6-v1/70000/FF73DD72-FFB2-CB41-AE38-261D7B69E049.root',
#'root://cms-xrd-global.cern.ch///store/mc/RunIIAutumn18NanoAODv7/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/NANOAODSIM/Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/60000/EF3977F7-2F3E-7F44-9DE3-73895A82D5BD.root',
Expand Down
2 changes: 1 addition & 1 deletion Skimmer/test/boostedWtaggingSF_skimNanoAOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
modulesToRun.append( btagSF2018() )
if args.year=='2017':
modulesToRun.append( puAutoWeight_2017() )
print "Running with btag SF calc."
print "Not running with btag SF calc."
modulesToRun.append( btagSF2017() )
if args.year=='2016':
modulesToRun.append( puWeight_2016() )
Expand Down
38 changes: 20 additions & 18 deletions Skimmer/test/multicrab_boostedWtaggingSF.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ def submitJobs( job, inputFiles, unitJobs ):
config.section_("Data")
#config.Data.publication = True
#config.Data.publishDBS = 'phys03'
config.Data.inputDBS = 'global'
#config.Data.ignoreLocality = True
config.Data.allowNonValidInputDataset = True
config.Data.inputDBS = 'phys03' #'global'
config.Data.ignoreLocality = True
#config.Data.allowNonValidInputDataset = True

config.section_("Site")
config.Site.storageSite = options.storageSite
#config.Site.whitelist = ['T1_US_FNAL','T2_CH_CSCS','T3_US_FNALLPC']
config.Site.whitelist = ['T1_US_FNAL','T2_CH_CSCS','T3_US_FNALLPC']
#config.Site.blacklist = ['T2_US_Florida','T3_TW_*','T2_BR_*','T2_GR_Ioannina','T2_BR_SPRACE','T2_RU_IHEP','T2_PL_Swierk','T2_KR_KNU','T3_TW_NTU_HEP']

def submit(config):
Expand Down Expand Up @@ -153,7 +153,22 @@ def submit(config):


dictSamples = {}

dictSamples['UL17_TTToSemiLeptonic-powheg-pythia8'] = [ '/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/kadatta-RunIISummer19UL17PFNanoAOD-106X_mc2017_realistic_v6-v2-8f037877c18053811b946b7194702f97/USER',1]
#dictSamples['UL17_SingleMuon_D'] = ['/SingleMuon/Run2017D-UL2017_02Dec2019-v1/NANOAOD', 1 ]
dictSamples['UL17_SingleMuon_D'] = ['/SingleMuon/kadatta-Run2017D-09Aug2019_UL2017-v1_PFNanoAOD-711e27fd71aadb4a77ae7e6321a59353/USER',1]

'''
######## UL17 samples #######
dictSamples['UL17_W1JetsToLNu-madgraphMLM-pythia8'] = ['/W1JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W2JetsToLNu-madgraphMLM-pythia8'] = ['/W2JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W3JetsToLNu-madgraphMLM-pythia8'] = ['/W3JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W4JetsToLNu-madgraphMLM-pythia8'] = ['/W4JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
#dictSamples['UL17_WZ-pythia8'] = ['/WZ_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
#dictSamples['UL17_ZZ-pythia8'] = ['/ZZ_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
#dictSamples['UL17_WW-pythia8'] = ['/WW_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
#dictSamples['UL17_TT_PFNano_Test2'] = [ '/TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8/algomez-RunIISummer19UL17PFNanoAOD-106X_mc2017_realistic_v6-v2-830c141d7b4aa70b88c71a25d598b0f2/USER', 1 ]
dictSamples['UL17_WW-pythia8'] = ['/WW_TuneCP5_13TeV-pythia8/kadatta-RunIISummer19UL17PFNanoAOD-106X_mc2017_realistic_v6-v2-830c141d7b4aa70b88c71a25d598b0f2/USER',1]
Expand All @@ -164,7 +179,6 @@ def submit(config):
#dictSamples['UL17_TTJets-amcatnloFXFX-pythia8'] = [ '/TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v1/NANOAODSIM', 1 ]
dictSamples['UL17_SingleMuon_B'] = ['/SingleMuon/Run2017B-UL2017_02Dec2019-v1/NANOAOD', 1 ]
dictSamples['UL17_SingleMuon_C'] = ['/SingleMuon/Run2017C-UL2017_02Dec2019-v1/NANOAOD', 1 ]
dictSamples['UL17_SingleMuon_D'] = ['/SingleMuon/Run2017D-UL2017_02Dec2019-v1/NANOAOD', 1 ]
dictSamples['UL17_SingleMuon_E'] = ['/SingleMuon/Run2017E-UL2017_02Dec2019-v1/NANOAOD', 1 ]
dictSamples['UL17_SingleMuon_F'] = ['/SingleMuon/Run2017F-UL2017_02Dec2019-v1/NANOAOD', 1 ]
Expand Down Expand Up @@ -192,18 +206,6 @@ def submit(config):
dictSamples['UL17_ST_tW_antitop-powheg-pythia8'] = ['/ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v1/NANOAODSIM', 1 ]
'''
######## UL17 samples #######
dictSamples['UL17_W1JetsToLNu-madgraphMLM-pythia8'] = ['/W1JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W2JetsToLNu-madgraphMLM-pythia8'] = ['/W2JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W3JetsToLNu-madgraphMLM-pythia8'] = ['/W3JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
dictSamples['UL17_W4JetsToLNu-madgraphMLM-pythia8'] = ['/W4JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8/RunIISummer19UL17NanoAOD-106X_mc2017_realistic_v6-v2/NANOAODSIM', 1 ]
#dictSamples['UL17_WZ-pythia8'] = ['/WZ_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
#dictSamples['UL17_ZZ-pythia8'] = ['/ZZ_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
#dictSamples['UL17_WW-pythia8'] = ['/WW_TuneCP5_13TeV-pythia8/RunIIAutumn18NanoAODv7-Nano02Apr2020_102X_upgrade2018_realistic_v21-v1/NANOAODSIM', 1 ]
'''

Expand Down

0 comments on commit cb02d11

Please sign in to comment.