示例#1
0
    process.htxsSequence = cms.Sequence()
# END HTXS ====================================================================================================

# Pre-firing weights ==========================================================================================
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1ECALPrefiringWeightRecipe
from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer
if period == "2018":
    process.prefiringweight = cms.Sequence()
else:
    if period == '2016':
        data_era = "2016BtoH"
    elif period == '2017':
        data_era = "2017BtoF"
    process.prefiringweight = l1ECALPrefiringWeightProducer.clone(
        DataEra=cms.string(data_era),
        UseJetEMPt=cms.bool(False),
        PrefiringRateSystematicUncty=cms.double(0.2),
        SkipWarnings=False)
# END Pre-firing weights ======================================================================================

# Trigger list ================================================================================================
# !!!!! WARNING : in 2018 all tau trigger names changed in the middle of the year -> please add also other names -> more information can be found here: https://twiki.cern.ch/twiki/bin/viewauth/CMS/TauTrigger#Trigger_table_for_2018 !!!!
HLTlist = cms.untracked.vstring(
    #SingleMuon
    'HLT_IsoMu20_v',
    'HLT_IsoMu24_v',
    'HLT_IsoMu27_v',
    'HLT_IsoTkMu24_v',
    'HLT_IsoMu22_v',
    'HLT_IsoMu22_eta2p1_v',
    'HLT_IsoTkMu22_v',
示例#2
0
	                                        ### TTRIGGER ###
	                                        triggerResults = cms.InputTag(triggerResultsLabel,"",hltProcess),
	                                        triggerSummary = cms.InputTag(triggerSummaryLabel,"",hltProcess),
	                                        hltJetFilter       = cms.InputTag("hltPFHT"),
	                                        hltPath            = cms.string("HLT_PFHT800"),
	                                        hlt2reco_deltaRmax = cms.double(0.2),
	                                        candSVTagInfos         = cms.string("pfInclusiveSecondaryVertexFinder"),
	                                        jecAK4chsPayloadNames_JetUserData = cms.vstring( jecLevelsAK4chs ),
	                                        vertex_JetUserData = cms.InputTag("offlineSlimmedPrimaryVertices"),
	                                        )

#L1Prefiring
from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer
process.prefiringweight = l1ECALPrefiringWeightProducer.clone(
    DataEra = cms.string("2016BtoH"), #Use 2016BtoH for 2016
    UseJetEMPt = cms.bool(False),
    PrefiringRateSystematicUncty = cms.double(0.2),
    SkipWarnings = False)

process.treeDumper = cms.EDAnalyzer("EDBRTreeMaker",
                                    originalNEvents = cms.int32(1),
                                    crossSectionPb = cms.double(1),
                                    targetLumiInvPb = cms.double(1.0),
                                    EDBRChannel = cms.string("VW_CHANNEL"),
                                    lhe =  cms.InputTag("externalLHEProducer"),
                                    isGen = cms.bool(False),
                                    isJEC = cms.bool(corrJetsOnTheFly),
                                    RunOnMC  = cms.bool(runOnMC),
                                    RunOnSig = cms.bool(runOnSig),
                                    generator =  cms.InputTag("generator"),
                                    genSrc =  cms.InputTag("prunedGenParticles"),
import FWCore.ParameterSet.Config as cms
import os

# Define the CMSSW producer

if os.environ["CMSSW_VERSION"].startswith("CMSSW_10_2_") and int(os.environ["CMSSW_VERSION"].split("_")[3]) >= 10:
	from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer
	prefiringweight = l1ECALPrefiringWeightProducer.clone(
    	DataEra = cms.string("replaceMe"),
    	UseJetEMPt = cms.bool(False),
    	PrefiringRateSystematicUncty = cms.double(0.2),
    	SkipWarnings = False
    )
else:
	prefiringweight = cms.EDProducer("L1ECALPrefiringWeightProducer",
		ThePhotons = cms.InputTag("slimmedPhotons"),
		TheJets = cms.InputTag("slimmedJets"),
		L1Maps = cms.string(os.environ["CMSSW_BASE"] + "/src/L1Prefiring/EventWeightProducer/files/L1PrefiringMaps_new.root"),
		DataEra = cms.string("replaceMe"),
		UseJetEMPt = cms.bool(False), #can be set to true to use jet prefiring maps parametrized vs pt(em) instead of pt
		PrefiringRateSystematicUncty = cms.double(0.2) #Minimum relative prefiring uncty per object
	)

# Call: variableProducers.extend(l1PrefiringWeightVariableProducers)
# *order matters*
l1PrefiringWeightVariableProducers = ['prefiringweight', 'L1PrefiringWeightProducer']
import FWCore.ParameterSet.Config as cms

from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer

prefiringweight = l1ECALPrefiringWeightProducer.clone(SkipWarnings=False)
import FWCore.ParameterSet.Config as cms

from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer

prefiringweight = l1ECALPrefiringWeightProducer.clone(SkipWarnings = False)

示例#6
0
    filter=cms.bool(
        True
    ),  # otherwise it won't filter the events, just produce an empty vertex collection.
)

process.noscraping = cms.EDFilter("FilterOutScraping",
                                  applyfilter=cms.untracked.bool(True),
                                  debugOn=cms.untracked.bool(False),
                                  numtrack=cms.untracked.uint32(10),
                                  thresh=cms.untracked.double(0.25))

from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer
process.prefiringweight = l1ECALPrefiringWeightProducer.clone(
    TheJets=cms.InputTag(
        "slimmedJets"
    ),  #this should be the slimmedJets collection with up to date JECs !
    DataEra=cms.string("2016BtoH"),  #Use 2016BtoH for 2016
    UseJetEMPt=cms.bool(False),
    PrefiringRateSystematicUncty=cms.double(0.2),
    SkipWarnings=False)

from EgammaUser.EgammaPostRecoTools.EgammaPostRecoTools import setupEgammaPostRecoSeq
setupEgammaPostRecoSeq(process, era='2016-Legacy')

newTask = cms.Task()
process.egammaPostRecoSeq.associate(newTask)

process.load("RecoLocalCalo.EcalRecAlgos.EcalSeverityLevelESProducer_cfi")
process.load("ZprimeTo4l.ModifiedHEEP.ModifiedHEEPIdVarValueMapProducer_cfi")
process.load("ZprimeTo4l.ModifiedHEEP.ModifiedEcalRecHitIsolationScone_cfi")
newTask.add(process.ModifiedHEEPIDVarValueMaps)
newTask.add(process.ModifiedEcalRecHitIsolationScone)
示例#7
0
    from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties import runMetCorAndUncFromMiniAOD
    runMetCorAndUncFromMiniAOD(
        process,
        isData=(not isMC),
    )

    #########################
    #### L1Prefire reweight
    #########################

    from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import l1ECALPrefiringWeightProducer
    process.prefiringweight = l1ECALPrefiringWeightProducer.clone(
        DataEra=cms.string("2016BtoH"),  #Use 2016BtoH for 2016
        ThePhotons=cms.InputTag("slimmedPhotons"),
        TheJets=cms.InputTag("slimmedJets"),
        UseJetEMPt=cms.bool(True),
        PrefiringRateSystematicUncty=cms.double(0.2),
        SkipWarnings=False)

    ###########################
    #### Rochester correction
    ###########################
    process.recoTree.roccorPath = cms.string(
        'SKFlatMaker/SKFlatMaker/data/roccor.Run2.v3/RoccoR2016.txt')

    ###########
    #### Path
    ###########

    process.p = cms.Path(process.egammaPostRecoSeq * process.jecSequence *
    filters = cms.vstring(
        'hltSinglePFJet140', 'hltSinglePFJet200', 'hltSinglePFJet260',
        'hltSinglePFJet320', 'hltSinglePFJet400', 'hltSinglePFJet450',
        'hltSinglePFJet500'
    )
)
paths.append(process.pecTriggerObjects)


# L1 ECAL pre-firing weights
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1ECALPrefiringWeightRecipe?rev=11
if not is_data and options.period in ['2016', '2017']:
    from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import \
        l1ECALPrefiringWeightProducer
    process.prefiringWeight = l1ECALPrefiringWeightProducer.clone(
        DataEra = '2016BtoH' if options.period == '2016' else '2017BtoF',
        SkipWarnings = False
    )
    process.eventWeights = cms.EDAnalyzer('EventWeights',
        sources = cms.VInputTag(
            'prefiringWeight:nonPrefiringProb',
            'prefiringWeight:nonPrefiringProbUp',
            'prefiringWeight:nonPrefiringProbDown'
        ),
        storeNames = cms.vstring(
            'prefiring_nominal', 'prefiring_up', 'prefiring_down'
        )
    )
    paths.append(process.prefiringWeight, process.eventWeights)


# Save event ID and relevant objects
示例#9
0
        triggers = cms.vstring(triggerNames),
        filter = cms.bool(not options.disableTriggerFilter),
        savePrescales = cms.bool(False),
        triggerBits = cms.InputTag('TriggerResults', processName=options.triggerProcessName)
    )

paths.append(process.pecTrigger)


# L1 ECAL pre-firing weights
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/L1ECALPrefiringWeightRecipe?rev=11
if not runOnData and options.period in ['2016', '2017']:
    from PhysicsTools.PatUtils.l1ECALPrefiringWeightProducer_cfi import \
        l1ECALPrefiringWeightProducer
    process.prefiringWeight = l1ECALPrefiringWeightProducer.clone(
        DataEra = '2016BtoH' if options.period == '2016' else '2017BtoF',
        SkipWarnings = False
    )
    process.eventWeights = cms.EDAnalyzer('EventWeights',
        sources = cms.VInputTag(
            'prefiringWeight:nonPrefiringProb',
            'prefiringWeight:nonPrefiringProbUp',
            'prefiringWeight:nonPrefiringProbDown'
        ),
        storeNames = cms.vstring(
            'prefiring_nominal', 'prefiring_up', 'prefiring_down'
        )
    )
    paths.append(process.prefiringWeight, process.eventWeights)


# Save event ID and basic event content