Skip to content

Commit

Permalink
Merge pull request cms-sw#29 from mariadalfonso/76Xchanges
Browse files Browse the repository at this point in the history
76x changes
  • Loading branch information
mariadalfonso committed Apr 22, 2016
2 parents 64ed83e + cc036d3 commit a02e4d5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
39 changes: 36 additions & 3 deletions ObjectStudies/cfg/run_MET_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
from CMGTools.RootTools.samples.samples_13TeV_RunIIFall15MiniAODv2 import * #<--miniAOD v2 samples_13TeV_RunIIFall15MiniAODv2
from CMGTools.RootTools.samples.samples_13TeV_DATA2015 import *

from CMGTools.RootTools.samples.triggers_13TeV_Spring15 import triggers_1mu_iso_50ns, triggers_mumu, triggers_ee, triggers_photon30, triggers_photon50, triggers_photon75, triggers_photon90, triggers_photon120
from CMGTools.RootTools.samples.triggers_13TeV_Spring15 import triggers_1mu_iso_50ns, triggers_mumu, triggers_ee, triggers_photon30, triggers_photon50, triggers_photon75, triggers_photon90, triggers_photon120, triggers_dijet, triggers_HT350, triggers_HT475, triggers_HT600, triggers_HT800, triggers_HT900, triggers_Jet80MET90

#-------- INITIAL FLAG
isDiJet=False
isMonoJet=False
isZSkim=False
is1L=False
is1PH=False
isEle = False # default is diMuon
is25ns = True

Expand Down Expand Up @@ -197,9 +198,9 @@
comp.splitFactor = 100
comp.files = comp.files[:]

# WG/ZG
# WG/ZG/TTG
elif test==19:
selectedComponents = [ZGJets, WGJets]
selectedComponents = [ZGJets, WGJets, TTGJets]
is1PH=True
for comp in selectedComponents:
comp.splitFactor = 100
Expand All @@ -219,6 +220,14 @@
comp.splitFactor = 1000
comp.files = comp.files[:]

elif test==25:
isDiJet=True
is25ns=True
selectedComponents = [ TTJets ] + WJetsToLNuHT + ZJetsToNuNuHT + QCDHT
for comp in selectedComponents:
comp.splitFactor = 1000
comp.files = comp.files[:]

# ------------------------------------------------------------------------------------------- #
# ------------------------------------------------------------------------------------------- #

Expand Down Expand Up @@ -266,17 +275,27 @@
ttHZskim.lepId=[11] ## default is set To Muons
metSequence.insert(metSequence.index(lepAna)+1,ttHLepSkim)
metSequence.insert(metSequence.index(lepAna)+2,ttHZskim)
metSequence.remove(photonAna)

if is1L:
ttHLepSkim.minLeptons = 1
metSequence.insert(metSequence.index(lepAna)+1,ttHLepSkim)

if isDiJet:
#vertexAna.keepFailingEvents = True # keep events with no good vertices
ttHJetMETSkim.jetPtCuts = [100,100]
metSequence.insert(metSequence.index(photonAna)+2,ttHJetMETSkim)
metSequence.remove(photonAna)

if isMonoJet:
ttHJetMETSkim.jetPtCuts = [200]
metSequence.insert(metSequence.index(photonAna)+2,ttHJetMETSkim)
metSequence.remove(photonAna)

if is1PH:
met_collections.update({
"selectedPhotons" : NTupleCollection("gamma", photonType, 50, help="photons with pt>20 and loose cut based ID"),
})

if comp.isData:
eventFlagsAna.processName = 'RECO'
Expand All @@ -295,8 +314,22 @@
'Photon75' : triggers_photon75, #["HLT_Photon75_R9Id90_HE10_IsoM_v*"]
'Photon90' : triggers_photon90, #["HLT_Photon90_R9Id90_HE10_IsoM_v*"]
'Photon120': triggers_photon120, #["HLT_Photon120_R9Id90_HE10_IsoM_v*"]
######
'DiJet' : triggers_dijet, #["HLT_DiPFJetAve40_v*", "HLT_DiPFJetAve60_v*"]
'PFHT350_Prescale' : triggers_HT350, #["HLT_PFHT350_v*"] # prescaled
'PFHT475_Prescale' : triggers_HT475, #["HLT_PFHT475_v*"] # prescaled
'PFHT600_Prescale' : triggers_HT600, #["HLT_PFHT600_v*"] # prescaled
'PFHT900' : triggers_HT900, #["HLT_PFHT900_v*"]
'PFHT800' : triggers_HT800, #["HLT_PFHT800_v*"]
'MonoJet' : triggers_Jet80MET90, #["["HLT_MonoCentralPFJet80_PFMETNoMu90_NoiseCleaned_PFMHTNoMu90_IDTight_v*","HLT_MonoCentralPFJet80_PFMETNoMu90_JetIdCleaned_PFMHTNoMu90_IDTight_v*","HLT_MonoCentralPFJet80_PFMETNoMu90_PFMHTNoMu90_IDTight_v*"]

}

## to save prescale uncomment these
#triggerFlagsAna.unrollbits = True
#triggerFlagsAna.saveIsUnprescaled = True
#triggerFlagsAna.checkL1prescale = True


# ------------------------------------------------------------------------------------------- #
##------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions ObjectStudies/python/analyzers/metCoreModules_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@
photonAna = cfg.Analyzer(
PhotonAnalyzer, name='photonAnalyzer',
photons='slimmedPhotons',
doPhotonScaleCorrections=False,
# doPhotonScaleCorrections=False,
doPhotonScaleCorrections = {
'data' : 'EgammaAnalysis/ElectronTools/data/76X_16DecRereco_2015',
'isSync': False
},
ptMin = 30,
etaMax = 2.5,
gammaID = "POG_SPRING15_25ns_Tight",
Expand Down Expand Up @@ -301,7 +305,7 @@
jetLepArbitration = (lambda jet,lepton : lepton), # you can decide which to keep in case of overlaps; e.g. if the jet is b-tagged you might want to keep the jet
cleanSelectedLeptons = True, #Whether to clean 'selectedLeptons' after disambiguation. Treat with care (= 'False') if running Jetanalyzer more than once
minLepPt = 10,
relaxJetId = True,
relaxJetId = False,
doPuId = False, # Not commissioned in 7.0.X
recalibrateJets = True, #'MC', # True, False, 'MC', 'Data'
applyL2L3Residual = True, # Switch to 'Data' when they will become available for Data
Expand Down
9 changes: 6 additions & 3 deletions ObjectStudies/python/analyzers/treeProducerMET.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
## NTupleVariable("ndofPV", lambda ev: ev.goodVertices[0].ndof() , int, help="Degrees of freedom of the fit"),

# ----------------------- lepton info -------------------------------------------------------------------- #

NTupleVariable("nLeptons", lambda x : len(x.leptons) if hasattr(x,'leptons') else 0 , float, mcOnly=False,help="Number of associated leptons"),
NTupleVariable("nLepGood20", lambda ev: sum([l.pt() > 20 for l in ev.selectedLeptons]), int, help="Number of leptons with pt > 20"),
NTupleVariable("nLepGood15", lambda ev: sum([l.pt() > 15 for l in ev.selectedLeptons]), int, help="Number of leptons with pt > 15"),
NTupleVariable("nLepGood10", lambda ev: sum([l.pt() > 10 for l in ev.selectedLeptons]), int, help="Number of leptons with pt > 10"),


NTupleVariable("zll_pt", lambda ev : ev.zll_p4.Pt() if hasattr(ev,'zll_p4') else 0 , help="Pt of di-lepton system"),
NTupleVariable("zll_eta", lambda ev : ev.zll_p4.Eta() if hasattr(ev,'zll_p4') else 0, help="Eta of di-lepton system"),
Expand Down Expand Up @@ -118,6 +121,6 @@
"gentauleps" : NTupleCollection("genLepFromTau", genParticleWithLinksType, 10, help="Generated leptons (e/mu) from decays of taus from W/Z/h decays"),
"gentaus" : NTupleCollection("genTau", genParticleWithLinksType, 10, help="Generated leptons (tau) from W/Z decays"),
"generatorSummary" : NTupleCollection("GenPart", genParticleWithLinksType, 100 , help="Hard scattering particles, with ancestry and links"),
# "selectedLeptons" : NTupleCollection("lep", leptonType, 50, help="Leptons after the preselection", filter=lambda l : l.pt()>10 ),
"selectedPhotons" : NTupleCollection("gamma", photonType, 50, help="photons with pt>20 and loose cut based ID"),
"selectedLeptons" : NTupleCollection("lep", leptonType, 50, help="Leptons after the preselection", filter=lambda l : l.pt()>10 ),
# "selectedPhotons" : NTupleCollection("gamma", photonType, 50, help="photons with pt>20 and loose cut based ID"),
}

0 comments on commit a02e4d5

Please sign in to comment.