Skip to content

Commit

Permalink
Merge pull request cms-sw#25 from mariadalfonso/metFilter_AAAA
Browse files Browse the repository at this point in the history
Met filters 76X +  AAA
  • Loading branch information
mariadalfonso committed Apr 5, 2016
2 parents 465d9ad + 22af5af commit 39fdb85
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 41 deletions.
2 changes: 1 addition & 1 deletion HToZZ4L/cfg/run_hzz4l_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#Load all analyzers
from CMGTools.HToZZ4L.analyzers.hzz4lCore_modules_cff import *
from CMGTools.HToZZ4L.tools.configTools import *

from CMGTools.RootTools.samples.autoAAAconfig import *

#-------- SAMPLES AND TRIGGERS -----------

Expand Down
2 changes: 1 addition & 1 deletion HToZZ4L/cfg/run_onia2l_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from CMGTools.HToZZ4L.analyzers.hzz4lCore_modules_cff import *
from CMGTools.HToZZ4L.analyzers.hzz4lExtra_modules_cff import *
from CMGTools.HToZZ4L.tools.configTools import *

from CMGTools.RootTools.samples.autoAAAconfig import *

#-------- SEQUENCE
sequence = cfg.Sequence(hzz4lPreSequence + [ fastSkim2Mu3 ] + hzz4lObjSequence + [
Expand Down
1 change: 1 addition & 0 deletions HToZZ4L/cfg/run_z2l_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from CMGTools.HToZZ4L.analyzers.hzz4lCore_modules_cff import *
from CMGTools.HToZZ4L.analyzers.hzz4lExtra_modules_cff import *
from CMGTools.HToZZ4L.tools.configTools import *
from CMGTools.RootTools.samples.autoAAAconfig import *

#-------- SEQUENCE
sequence = cfg.Sequence(hzz4lPreSequence + [ fastSkim2L ] + hzz4lObjSequence + [
Expand Down
2 changes: 1 addition & 1 deletion HToZZ4L/cfg/run_z2ltnp_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from CMGTools.HToZZ4L.analyzers.hzz4lCore_modules_cff import *
from CMGTools.HToZZ4L.analyzers.hzz4lExtra_modules_cff import *
from CMGTools.HToZZ4L.tools.configTools import *

from CMGTools.RootTools.samples.autoAAAconfig import *


#-------- SEQUENCE
Expand Down
2 changes: 1 addition & 1 deletion HToZZ4L/cfg/run_z3l_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from CMGTools.HToZZ4L.analyzers.hzz4lCore_modules_cff import *
from CMGTools.HToZZ4L.analyzers.hzz4lExtra_modules_cff import *
from CMGTools.HToZZ4L.tools.configTools import *

from CMGTools.RootTools.samples.autoAAAconfig import *


#-------- SEQUENCE
Expand Down
17 changes: 0 additions & 17 deletions HToZZ4L/python/tools/configTools.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
from PhysicsTools.HeppyCore.framework.heppy_loop import getHeppyOption

def autoAAA(selectedComponents):
import re, os
from CMGTools.Production import changeComponentAccessMode
from CMGTools.Production.localityChecker import LocalityChecker
tier2Checker = LocalityChecker("T2_CH_CERN", datasets="/*/*/MINIAOD*")
for comp in selectedComponents:
if len(comp.files) == 0: print "ERROR, comp %s (dataset %s) has no files!" % (comp.name, getattr(comp,'dataset',None))
if not hasattr(comp,'dataset'): continue
if not re.match("/[^/]+/[^/]+/MINIAOD(SIM)?", comp.dataset): continue
if "/store/" not in comp.files[0]: continue
if re.search("/store/(group|user|cmst3)/", comp.files[0]): continue
if not tier2Checker.available(comp.dataset):
print "Dataset %s is not available, will use AAA" % comp.dataset
changeComponentAccessMode.convertComponent(comp, "root://cms-xrd-global.cern.ch/%s")
if 'X509_USER_PROXY' not in os.environ or "/afs/" not in os.environ['X509_USER_PROXY']:
raise RuntimeError, "X509_USER_PROXY not defined or not pointing to /afs"

def redefineRunRange(selectedComponents,run_range):
from CMGTools.HToZZ4L.samples.samples_13TeV_Fall15 import kreator
from math import ceil
Expand Down
6 changes: 5 additions & 1 deletion ObjectStudies/cfg/run_MET_cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import PhysicsTools.HeppyCore.framework.config as cfg

from CMGTools.RootTools.samples.autoAAAconfig import *

#-------- SAMPLES AND TRIGGERS -----------
from CMGTools.RootTools.samples.samples_13TeV_RunIIFall15MiniAODv2 import * #<--miniAOD v2 samples_13TeV_RunIIFall15MiniAODv2
from CMGTools.RootTools.samples.samples_13TeV_DATA2015 import *
Expand Down Expand Up @@ -185,7 +187,7 @@
is1PH=True
for comp in selectedComponents:
comp.splitFactor = 100
comp.files = comp.files[:]
comp.files = comp.files[:]

# GJets
elif test==18:
Expand Down Expand Up @@ -377,6 +379,8 @@
#from PhysicsTools.Heppy.utils.cmsswPreprocessor import CmsswPreprocessor
#preprocessor = CmsswPreprocessor(preprocessorFile)

autoAAA(selectedComponents)

#printComps(config.components, True)
config = cfg.Config( components = selectedComponents,
sequence = metSequence,
Expand Down
27 changes: 10 additions & 17 deletions ObjectStudies/python/analyzers/metCoreModules_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,22 @@
processName = 'PAT',
outprefix = 'Flag',
triggerBits = {
### "HBHENoiseFilter" : [ "Flag_HBHENoiseFilter" ], ## temporary replacement
"goodVertices" : [ "Flag_goodVertices" ],
"HBHENoiseFilter" : [ "Flag_HBHENoiseFilter" ],
"HBHENoiseIsoFilter" : [ "Flag_HBHENoiseIsoFilter" ],
"CSCTightHaloFilter" : [ "Flag_CSCTightHaloFilter" ],
"hcalLaserEventFilter" : [ "Flag_hcalLaserEventFilter" ],
"EcalDeadCellTriggerPrimitiveFilter" : [ "Flag_EcalDeadCellTriggerPrimitiveFilter" ],
"goodVertices" : [ "Flag_goodVertices" ],
"trackingFailureFilter" : [ "Flag_trackingFailureFilter" ],
"CSCTightHalo2015Filter" : [ "Flag_CSCTightHalo2015Filter" ],
"eeBadScFilter" : [ "Flag_eeBadScFilter" ],
"ecalLaserCorrFilter" : [ "Flag_ecalLaserCorrFilter" ],
"trkPOGFilters" : [ "Flag_trkPOGFilters" ],
"trkPOG_manystripclus53X" : [ "Flag_trkPOG_manystripclus53X" ],
"trkPOG_toomanystripclus53X" : [ "Flag_trkPOG_toomanystripclus53X" ],
"trkPOG_logErrorTooManyClusters" : [ "Flag_trkPOG_logErrorTooManyClusters" ],
"METFilters" : [ "Flag_METFilters" ],
"EcalDeadCellTriggerPrimitiveFilter" : [ "Flag_EcalDeadCellTriggerPrimitiveFilter" ],
}
)


from CMGTools.TTHAnalysis.analyzers.hbheAnalyzer import hbheAnalyzer
hbheFilterAna = cfg.Analyzer(
hbheAnalyzer, name = 'hbheAnalyzer',
IgnoreTS4TS5ifJetInLowBVRegion = False
)
#from CMGTools.TTHAnalysis.analyzers.hbheAnalyzer import hbheAnalyzer
#hbheFilterAna = cfg.Analyzer(
# hbheAnalyzer, name = 'hbheAnalyzer',
# IgnoreTS4TS5ifJetInLowBVRegion = False
#)

# Select a list of good primary vertices (generic)
vertexAna = cfg.Analyzer(
Expand Down Expand Up @@ -414,7 +407,7 @@
metAna,
metPuppiAna,
eventFlagsAna,
hbheFilterAna,
## hbheFilterAna,
##### tree
## treeProducer,
]
5 changes: 3 additions & 2 deletions ObjectStudies/python/analyzers/treeProducerMET.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

# ----------------------- MET filter information (temporary) -------------------------------------------------------------------- #

NTupleVariable("Flag_HBHENoiseFilter", lambda ev: ev.hbheFilterNew, help="HBEHE temporary filter decision"),
NTupleVariable("Flag_HBHEIsoNoiseFilter", lambda ev: ev.hbheFilterIso, help="HBEHE isolation temporary filter decision"),
# comment to use the official as stored in miniAOD 76
# NTupleVariable("Flag_HBHENoiseFilter", lambda ev: ev.hbheFilterNew, help="HBEHE temporary filter decision"),
# NTupleVariable("Flag_HBHEIsoNoiseFilter", lambda ev: ev.hbheFilterIso, help="HBEHE isolation temporary filter decision"),

# ----------------------- dedicated met info -------------------------------------------------------------------- #

Expand Down
16 changes: 16 additions & 0 deletions RootTools/python/samples/autoAAAconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def autoAAA(selectedComponents):
import re, os
from CMGTools.Production import changeComponentAccessMode
from CMGTools.Production.localityChecker import LocalityChecker
tier2Checker = LocalityChecker("T2_CH_CERN", datasets="/*/*/MINIAOD*")
for comp in selectedComponents:
if len(comp.files) == 0: print "ERROR, comp %s (dataset %s) has no files!" % (comp.name, getattr(comp,'dataset',None))
if not hasattr(comp,'dataset'): continue
if not re.match("/[^/]+/[^/]+/MINIAOD(SIM)?", comp.dataset): continue
if "/store/" not in comp.files[0]: continue
if re.search("/store/(group|user|cmst3)/", comp.files[0]): continue
if not tier2Checker.available(comp.dataset):
print "Dataset %s is not available, will use AAA" % comp.dataset
changeComponentAccessMode.convertComponent(comp, "root://cms-xrd-global.cern.ch/%s")
if 'X509_USER_PROXY' not in os.environ or "/afs/" not in os.environ['X509_USER_PROXY']:
raise RuntimeError, "X509_USER_PROXY not defined or not pointing to /afs"
1 change: 1 addition & 0 deletions TTHAnalysis/python/analyzers/susyCore_modules_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
triggerBits = {
"HBHENoiseFilter" : [ "Flag_HBHENoiseFilter" ],
"HBHENoiseIsoFilter" : [ "Flag_HBHENoiseIsoFilter" ],
"CSCTightHalo2015Filter" : [ "Flag_CSCTightHalo2015Filter" ],
"CSCTightHaloFilter" : [ "Flag_CSCTightHaloFilter" ],
"hcalLaserEventFilter" : [ "Flag_hcalLaserEventFilter" ],
"EcalDeadCellTriggerPrimitiveFilter" : [ "Flag_EcalDeadCellTriggerPrimitiveFilter" ],
Expand Down

0 comments on commit 39fdb85

Please sign in to comment.