Ejemplo n.º 1
0
def addHLTFilter(process, hltProcess='HLT', mode='mc'):
    "Add HLT filter used to keep datasets orthogonal."
    if mode == 'mc' or mode == 'allmueg':
        ## Give hltFilter a dummy producer (so it always passes).
        ## This will be removed anyway in configureFilters.
        process.hltFilter = cms.EDProducer("EventCountProducer")
        return
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    hltHighLevel.andOr = True # True means 'OR'; False means 'AND'
    hltHighLevel.throw = False # Don't die on unknown path names
    hltHighLevel.TriggerResultsTag = cms.InputTag("TriggerResults", "", hltProcess)
    process.doubleMuonFilter = hltHighLevel.clone()
    process.doubleMuonFilter.HLTPaths = doubleMuonPaths
    process.singleMuonFilter = hltHighLevel.clone()
    process.singleMuonFilter.HLTPaths = singleMuonPaths
    process.doubleElectronFilter = hltHighLevel.clone()
    process.doubleElectronFilter.HLTPaths = doubleElectronPaths
    process.singleElectronFilter = hltHighLevel.clone()
    process.singleElectronFilter.HLTPaths = singleElectronPaths

    if mode == 'doublemu':
        process.hltFilter = cms.Sequence(process.doubleMuonFilter)
    if mode == 'doubleelectron':
        process.hltFilter = cms.Sequence(process.doubleElectronFilter *
                                         ~process.doubleMuonFilter)
    if mode == 'singlemu':
        process.hltFilter = cms.Sequence(process.singleMuonFilter *
                                         ~process.doubleMuonFilter *
                                         ~process.doubleElectronFilter)
    if mode == 'singleelectron':
        process.hltFilter = cms.Sequence(process.singleElectronFilter *
                                         ~process.doubleMuonFilter *
                                         ~process.doubleElectronFilter *
                                         ~process.singleMuonFilter)
Ejemplo n.º 2
0
def addHLTFilter(process, hltProcess='HLT', mode='mc'):
    "Add HLT filter used to keep datasets orthogonal."
    if mode == 'mc' or mode == 'allmueg':
        ## Give hltFilter a dummy producer (so it always passes).
        ## This will be removed anyway in configureFilters.
        process.hltFilter = cms.EDProducer("EventCountProducer")
        return
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    hltHighLevel.andOr = True  # True means 'OR'; False means 'AND'
    hltHighLevel.throw = False  # Don't die on unknown path names
    hltHighLevel.TriggerResultsTag = cms.InputTag("TriggerResults", "",
                                                  hltProcess)
    process.doubleMuonFilter = hltHighLevel.clone()
    process.doubleMuonFilter.HLTPaths = doubleMuonPaths
    process.singleMuonFilter = hltHighLevel.clone()
    process.singleMuonFilter.HLTPaths = singleMuonPaths
    process.doubleElectronFilter = hltHighLevel.clone()
    process.doubleElectronFilter.HLTPaths = doubleElectronPaths
    process.singleElectronFilter = hltHighLevel.clone()
    process.singleElectronFilter.HLTPaths = singleElectronPaths

    if mode == 'doublemu':
        process.hltFilter = cms.Sequence(process.doubleMuonFilter)
    if mode == 'doubleelectron':
        process.hltFilter = cms.Sequence(process.doubleElectronFilter *
                                         ~process.doubleMuonFilter)
    if mode == 'singlemu':
        process.hltFilter = cms.Sequence(process.singleMuonFilter *
                                         ~process.doubleMuonFilter *
                                         ~process.doubleElectronFilter)
    if mode == 'singleelectron':
        process.hltFilter = cms.Sequence(
            process.singleElectronFilter * ~process.doubleMuonFilter *
            ~process.doubleElectronFilter * ~process.singleMuonFilter)
Ejemplo n.º 3
0
def setup_trigger_filter_soup(process, path_name="pevtsel", filt_name="triggerFilter"):
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

    triggerFilter = hltHighLevel.clone()
    setattr(process, filt_name, triggerFilter)
    triggerFilter.HLTPaths = [
        "HLT_PFHT650_v*",
        "HLT_PFHT800_v*",
        "HLT_PFHT900_v*",
        "HLT_PFHT550_4Jet_v*",
        "HLT_PFHT450_SixJet40_PFBTagCSV_v*",
        "HLT_PFHT400_SixJet30_BTagCSV0p5_2PFBTagCSV_v*",
        "HLT_PFHT450_SixJet40_v*",
        "HLT_PFHT400_SixJet30_v*",
        "HLT_QuadJet45_TripleCSV0p5_v*",
        "HLT_QuadJet45_DoubleCSV0p5_v*",
        "HLT_DoubleJet90_Double30_TripleCSV0p5_v*",
        "HLT_DoubleJet90_Double30_DoubleCSV0p5_v*",
        "HLT_HT650_DisplacedDijet80_Inclusive_v*",
        "HLT_HT750_DisplacedDijet80_Inclusive_v*",
        "HLT_HT500_DisplacedDijet40_Inclusive_v*",
        "HLT_HT550_DisplacedDijet40_Inclusive_v*",
        "HLT_HT350_DisplacedDijet40_DisplacedTrack_v*",
        "HLT_HT350_DisplacedDijet80_DisplacedTrack_v*",
        "HLT_HT350_DisplacedDijet80_Tight_DisplacedTrack_v*",
    ]
    triggerFilter.andOr = True  # = OR
    triggerFilter.throw = False  # = HT800 not in MC
    setattr(process, path_name, cms.Path(triggerFilter))
    if hasattr(process, "out"):
        process.out.SelectEvents = cms.untracked.PSet(SelectEvents=cms.vstring(path_name))
def setupTreeMaker(process, options) :
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    process.hltFilter.TriggerResultsTag = cms.InputTag("TriggerResults","",options['HLTProcessName'])
    
    setTagsProbes( process, options )
    setSequences(  process, options )
Ejemplo n.º 5
0
def setModules(process, options):

    process.sampleInfo = cms.EDProducer("tnp::SampleInfoTree",
                                        genInfo = cms.InputTag("generator")
                                        )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    from PhysicsTools.TagAndProbe.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()    

###################################################################
## ELECTRON MODULES
###################################################################
    
    process.goodPhotons = cms.EDFilter("PATPhotonRefSelector",
                                       src = cms.InputTag(options['PHOTON_COLL']),
                                       cut = cms.string(options['PHOTON_CUTS'])    
                                       )

###################################################################
## PHOTON ISOLATION
###################################################################
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

###################################################################
## HLT MATCHING
###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer("PatPhotonTriggerCandProducer",
                                               filterNames = options['TnPHLTTagFilters'],
                                               inputs      = cms.InputTag("goodPhotonsTAGCutBasedTight"),
                                               bits        = cms.InputTag('TriggerResults::HLT'),
                                               objects     = cms.InputTag('selectedPatTrigger'),
                                               dR          = cms.double(0.3),
                                               isAND       = cms.bool(True)
                                               )
    
    process.goodPhotonsProbeHLT = cms.EDProducer("PatPhotonTriggerCandProducer",
                                                 filterNames = options['TnPHLTProbeFilters'],
                                                 inputs      = cms.InputTag("goodPhotons"),
                                                 bits        = cms.InputTag('TriggerResults::HLT'),
                                                 objects     = cms.InputTag('selectedPatTrigger'),
                                                 dR          = cms.double(0.3),
                                                 isAND       = cms.bool(True)
                                                 )

    process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                          decay = cms.string("goodPhotonsTagHLT@+ goodPhotonsProbeHLT@-"), 
                                          checkCharge = cms.bool(False),
                                          cut = cms.string("60<mass<120"),
                                          )
Ejemplo n.º 6
0
def customise(process):

#    process.dtDataIntegrityUnpacker.inputLabel = cms.untracked.InputTag('rawDataCollector')

#    process.DQMOfflineCosmics.remove(process.hcalOfflineDQMSource)

#    process.load("FWCore.Modules.printContent_cfi")
#    process.myPath1 = cms.Path( process.printContent )

    process.options = cms.untracked.PSet(
      wantSummary = cms.untracked.bool(True) 
    )

    #using the DQMROOT means that the reco output will be empty
    process.DQMoutput.outputCommands.append('drop *')
    process.DQMoutput.outputCommands.append('keep *_MEtoEDMConverter_*_*')

#    process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
#     ignoreTotal=cms.untracked.int32(1),
#     oncePerEventMode=cms.untracked.bool(False)
#    )

    # Do not activate by default the logging of where each histogram is booked.
    process.DQMStore.verbose = cms.untracked.int32(2)
    process.load("DQMServices.Components.DQMStoreStats_cfi")
    process.stats = cms.Path(process.dqmStoreStats)
    process.schedule.insert(-1,process.stats)
    #Run only on fat events
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFatEventFilters = hltHighLevel.clone()
    process.hltFatEventFilters.throw = cms.bool(False)
    process.hltFatEventFilters.HLTPaths = cms.vstring('HLT_L1FatEvents_v*')
    #Run L1TReemulation
    from L1Trigger.Configuration.customiseReEmul import L1TReEmulFromRAW 
    process = L1TReEmulFromRAW(process)
    #Put all together into one path, so that reco does not run on non-fat events
    process.p=cms.Path( #process.hltFatEventFilters*
    			process.RawToDigi*
    			process.reconstruction*
    			process.DQMOffline*			
    			process.L1TReEmul
    		)
    process.e=cms.EndPath( process.DQMoutput )
    process.schedule=cms.Schedule(process.p,process.e)
    return(process)
Ejemplo n.º 7
0
def hlt_filter(process, hlt_path):
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.triggerFilter = hltHighLevel.clone()
    process.triggerFilter.HLTPaths = [hlt_path]
    process.triggerFilter.andOr = True # = OR
    process_out = None
    try:
        process_out = process.output
    except AttributeError:
        process_out = process.out
    if hasattr(process_out, 'SelectEvents'):
        raise ValueError('process_out already has SelectEvents: %r' % process_out.SelectEvents)
    process_out.SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring('ptriggerFilter'))
    for name, path in process.paths.items():
        path.insert(0, process.triggerFilter)
    process.ptriggerFilter = cms.Path(process.triggerFilter)
    if hasattr(process, 'schedule'):
        process.schedule.insert(0, process.ptriggerFilter)
Ejemplo n.º 8
0
def addTriggerSequence(process,
                       egmuTriggerFilter='',
                       egtriglist=['HLT_Ele10_LW_L1R'],
                       mutriggerlist=['HLT_Mu9'],
                       trigMenu='HLT'
                       ) :
    
    # single lepton inclusive triggers
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel as trigbit_selector
    trigbit_selector.throw = cms.bool(False)
    process.eg_selector = trigbit_selector.clone()    
    process.eg_selector.TriggerResultsTag = cms.InputTag('TriggerResults', '', trigMenu)
    process.eg_selector.andOr=cms.bool(True)
    process.eg_selector.HLTPaths = cms.vstring(egtriglist)
    process.mu_selector = process.eg_selector.clone()
    process.mu_selector.andOr=cms.bool(True)
    process.mu_selector.HLTPaths = cms.vstring(mutriggerlist)
    process.egmu_selector = process.eg_selector.clone()
    process.egmu_selector.HLTPaths.extend( process.mu_selector.HLTPaths)
    process.egmu_selector.andOr=cms.bool(True)

    process.triggerselection = cms.Sequence()
    #trigger sequences 
    if(egmuTriggerFilter=="inclusive_eg") :
        process.inclusive_eg = cms.Sequence( process.eg_selector )        
        process.triggerselection = cms.Sequence( process.inclusive_eg*process.triggerselection )
    elif(egmuTriggerFilter=="exclusive_eg") :
        process.exclusive_eg = cms.Sequence( ~process.mu_selector*process.eg_selector )        
        process.triggerselection= cms.Sequence( process.exclusive_eg*process.triggerselection )
    elif(egmuTriggerFilter=="inclusive_mu") :
        process.inclusive_mu = cms.Sequence( process.mu_selector )
        process.triggerselection = cms.Sequence( process.inclusive_mu*process.triggerselection )
    elif(egmuTriggerFilter=="exclusive_mu") :
        process.exclusive_mu = cms.Sequence( ~process.eg_selector*process.mu_selector )
        process.triggerselection = cms.Sequence( process.exclusive_mu*process.triggerselection )
    elif(egmuTriggerFilter=="inclusive_egmu") :
        process.inclusive_egmu = cms.Sequence( process.egmu_selector )
        process.triggerselection = cms.Sequence( process.inclusive_egmu*process.triggerselection )
    if(len(egmuTriggerFilter)>0) :
        print '   EG/Mu trigger filter defined as: ' + egmuTriggerFilter
        
    print "   Trigger sequence is: " + str(process.triggerselection)
    print "   Note: process.triggerselection has to be added to your main sequence"
Ejemplo n.º 9
0
def hlt_filter(process, hlt_path):
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.triggerFilter = hltHighLevel.clone()
    process.triggerFilter.HLTPaths = [hlt_path]
    process.triggerFilter.andOr = True  # = OR
    process_out = None
    try:
        process_out = process.output
    except AttributeError:
        process_out = process.out
    if hasattr(process_out, 'SelectEvents'):
        raise ValueError('process_out already has SelectEvents: %r' %
                         process_out.SelectEvents)
    process_out.SelectEvents = cms.untracked.PSet(
        SelectEvents=cms.vstring('ptriggerFilter'))
    for name, path in process.paths.items():
        path.insert(0, process.triggerFilter)
    process.ptriggerFilter = cms.Path(process.triggerFilter)
    if hasattr(process, 'schedule'):
        process.schedule.insert(0, process.ptriggerFilter)
Ejemplo n.º 10
0
def customise(process):

    #    process.dtDataIntegrityUnpacker.inputLabel = cms.untracked.InputTag('rawDataCollector')

    #    process.DQMOfflineCosmics.remove(process.hcalOfflineDQMSource)

    #    process.load("FWCore.Modules.printContent_cfi")
    #    process.myPath1 = cms.Path( process.printContent )

    process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

    #using the DQMROOT means that the reco output will be empty
    process.DQMoutput.outputCommands.append('drop *')
    process.DQMoutput.outputCommands.append('keep *_MEtoEDMConverter_*_*')

    #    process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
    #     ignoreTotal=cms.untracked.int32(1),
    #     oncePerEventMode=cms.untracked.bool(False)
    #    )

    # Do not activate by default the logging of where each histogram is booked.
    process.DQMStore.verbose = cms.untracked.int32(2)
    process.load("DQMServices.Components.DQMStoreStats_cfi")
    process.stats = cms.Path(process.dqmStoreStats)
    process.schedule.insert(-1, process.stats)
    #Run only on fat events
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFatEventFilters = hltHighLevel.clone()
    process.hltFatEventFilters.throw = cms.bool(False)
    process.hltFatEventFilters.HLTPaths = cms.vstring('HLT_L1FatEvents_v*')
    #Run L1TReemulation
    from L1Trigger.Configuration.customiseReEmul import L1TReEmulFromRAW
    process = L1TReEmulFromRAW(process)
    #Put all together into one path, so that reco does not run on non-fat events
    process.p = cms.Path(process.hltFatEventFilters * process.RawToDigi *
                         process.reconstruction * process.DQMOffline *
                         process.L1TReEmul)
    process.e = cms.EndPath(process.DQMoutput)
    process.schedule = cms.Schedule(process.p, process.e)
    return (process)
Ejemplo n.º 11
0
def setModules(process, options):

    process.sampleInfo = cms.EDAnalyzer(
        "tnp::SampleInfoTree",
        vertexCollection=cms.InputTag("offlineSlimmedPrimaryVertices"),
        genInfo=cms.InputTag("generator"))

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']

    process.pileupReweightingProducer = cms.EDProducer(
        "PileupWeightProducer",
        hardcodedWeights=cms.untracked.bool(True),
        pileupInfoTag=cms.InputTag("addPileupInfo"))

    process.GsfDRToNearestTauProbe = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag(options['PHOTON_COLL']),
        objects=cms.InputTag('prunedGenParticles'),
        objectSelection=cms.string("abs(pdgId)==15"),
    )

    process.GsfDRToNearestTauSC = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag("superClusterCands"),
        objects=cms.InputTag('prunedGenParticles'),
        objectSelection=cms.string("abs(pdgId)==15"),
    )

    process.GsfDRToNearestTauTag = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag(options['PHOTON_COLL']),
        objects=cms.InputTag('prunedGenParticles'),
        objectSelection=cms.string("abs(pdgId)==15"),
    )
    ###################################################################
    ## ELECTRON MODULES
    ###################################################################

    process.goodPhotons = cms.EDFilter("PATPhotonRefSelector",
                                       src=cms.InputTag(
                                           options['PHOTON_COLL']),
                                       cut=cms.string(options['PHOTON_CUTS']))

    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load(
        "RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

    ###################################################################
    ## HLT MATCHING
    ###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer(
        "PatPhotonTriggerCandProducer",
        filterNames=options['TnPHLTTagFilters'],
        inputs=cms.InputTag("goodPhotonsTAGCutBasedTight"),
        bits=cms.InputTag('TriggerResults::HLT'),
        objects=cms.InputTag('selectedPatTrigger'),
        dR=cms.double(0.3),
        isAND=cms.bool(True))

    process.goodPhotonsProbeHLT = cms.EDProducer(
        "PatPhotonTriggerCandProducer",
        filterNames=options['TnPHLTProbeFilters'],
        inputs=cms.InputTag("goodPhotons"),
        bits=cms.InputTag('TriggerResults::HLT'),
        objects=cms.InputTag('selectedPatTrigger'),
        dR=cms.double(0.3),
        isAND=cms.bool(True))

    process.tagTightRECO = cms.EDProducer(
        "CandViewShallowCloneCombiner",
        decay=cms.string("goodPhotonsTagHLT@+ goodPhotonsProbeHLT@-"),
        checkCharge=cms.bool(False),
        cut=cms.string("40<mass<1000"),
    )

    ###################################################################
    ## MC MATCHING
    ###################################################################

    process.McMatchTag = cms.EDProducer(
        "MCTruthDeltaRMatcherNew",
        matchPDGId=cms.vint32(11),
        src=cms.InputTag("goodPhotonsTAGCutBasedTight"),
        distMin=cms.double(0.2),
        matched=cms.InputTag("prunedGenParticles"),
        checkCharge=cms.bool(False))

    process.McMatchRECO = cms.EDProducer(
        "MCTruthDeltaRMatcherNew",
        matchPDGId=cms.vint32(11),
        src=cms.InputTag("goodPhotons"),
        distMin=cms.double(0.2),
        matched=cms.InputTag("prunedGenParticles"),
        checkCharge=cms.bool(False))
Ejemplo n.º 12
0
        #"file:///home/ltsai/Data/mcStep3_LbTJPsipK_13TeV_withoutPileUp_180524/BPH-RunIISpring16DR80-00058_17.root",
        #"file:///home/ltsai/Data/mcStep3_LbTJPsipK_13TeV_withoutPileUp_180524/BPH-RunIISpring16DR80-00058_18.root",
        #"file:///home/ltsai/Data/mcStep3_LbTJPsipK_13TeV_withoutPileUp_180524/BPH-RunIISpring16DR80-00058_19.root",
    ),
    duplicateCheckMode=cms.untracked.string('noDuplicateCheck'))
from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
process.GlobalTag = GlobalTag(process.GlobalTag,
                              '80X_dataRun2_2016LegacyRepro_v3', '')
#process.GlobalTag = GlobalTag(process.GlobalTag, '94X_dataRun2_ReReco_EOY17_v1', '')

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
    'HLT_DoubleMu4_JpsiTrk_Displaced_v*',
    'HLT_DoubleMu4_3_Jpsi_Displaced_v*',
    'HLT_Dimuon20_Jpsi_v*',
    'HLT_Dimuon16_Jpsi_v*',
))

# preselect pat muon and pat tracks choose for CMSSW version
process.load("BPHAnalysis.PreselectFilter.FilterConf9_cfi")
#process.load("BPHAnalysis.PreselectFilter.FilterConf8_cfi")

# remove MC dependence
from PhysicsTools.PatAlgos.tools.coreTools import *

removeMCMatching(process, names=['All'], outputModules=[])

from BPHAnalysis.SpecificDecay.LbrecoSelectForWrite_cfi import recoSelect

process.lbWriteSpecificDecay = cms.EDProducer(
Ejemplo n.º 13
0
import FWCore.ParameterSet.Config as cms

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel as hlt_selector
hlt_selector.throw = cms.bool(False)
TauSkimMuTauMETHLT = hlt_selector.clone()
TauSkimMuTauMETHLT.TriggerResultsTag = cms.InputTag('TriggerResults', '', 'HLT')
TauSkimMuTauMETHLT.andOr=cms.bool(True)
TauSkimMuTauMETHLT.HLTPaths = cms.vstring("HLT_IsoMu15_eta2p1_L1ETM20_v*", "HLT_IsoMu15Rho_eta2p1_L1ETM20_v*")

TauSkimPFTausSelected = cms.EDFilter("PFTauSelector",
   src = cms.InputTag("hpsPFTauProducer"),
   discriminators = cms.VPSet(
    cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByDecayModeFinding"),
		   selectionCut=cms.double(0.5)           
	),
    cms.PSet( discriminator=cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr"),
		   selectionCut=cms.double(0.5)           
	),
   ),
   cut = cms.string('pt > 22. && abs(eta) < 2.3') 
)

TauSkimPFTauSkimmedBy1 = cms.EDFilter("CandViewCountFilter",
 src = cms.InputTag('TauSkimPFTausSelected'),
 minNumber = cms.uint32(1)
)

TauSkimPFTauSkimmedBy2 = cms.EDFilter("CandViewCountFilter",
 src = cms.InputTag('TauSkimPFTausSelected'),
 minNumber = cms.uint32(2)
)
                        process.filterConfig.name.value()))

mc_mode = False
# Check if we need to modify triggers for MC running
if 'GR' not in conditions:
    print "Using MC mode"
    mc_mode = True
    process.filterConfig.hltPaths = cms.vstring(
        process.filterConfig.hltPaths[0])

# Get the files specified for this filter
readFiles.extend(process.filterConfig.testFiles)

# The basic HLT requirement
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.trigger = hltHighLevel.clone()
process.trigger.HLTPaths = process.filterConfig.hltPaths  # <-- defined in filterType.py
process.trigger.throw = False
print process.trigger.HLTPaths

#################################################################
# Select good data events - based on TauCommissinon sequence
# https://twiki.cern.ch/twiki/bin/view/CMS/Collisions2010Recipes
#################################################################

# Require "Physics declared"
process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'

# Filter beam scraping events
process.noscraping = cms.EDFilter("FilterOutScraping",
Ejemplo n.º 15
0
#my_id_modules = ['RecoEgamma.PhotonIdentification.Identification.mvaPhotonID_Fall17_94X_V1_cff']
for idmod in my_id_modules:
    setupAllVIDIdsInModule(process, idmod, setupVIDPhotonSelection)
#process.flashggPhotons.effAreasConfigFile = cms.FileInPath("RecoEgamma/PhotonIdentification/data/Fall17/effAreaPhotons_cone03_pfPhotons_90percentBased_TrueVtx.txt")
#process.flashggPhotons.egmMvaValuesMap = cms.InputTag("photonMVAValueMapProducer:PhotonMVAEstimatorRunIIFall17v1Values")

process.RandomNumberGeneratorService = cms.Service(
    "RandomNumberGeneratorService")
process.RandomNumberGeneratorService.flashggRandomizedPhotons = cms.PSet(
    initialSeed=cms.untracked.uint32(16253245))

process.stdPhotonJetSeq *= process.egmPhotonIDSequence

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

process.hltHighLevel = hltHighLevel.clone(
    HLTPaths=cms.vstring("HLT_Photon50_v*"))

if options.isData:
    process.stdPhotonJetSeq *= process.hltHighLevel

process.commissioning = cms.EDAnalyzer(
    'PhotonJetValidationTreeMaker',
    PhotonJetTag=cms.InputTag('flashggPhotonJet'),
    vertexTag=cms.InputTag('offlineSlimmedPrimaryVertices'),
    GenEventInfo=cms.InputTag('generator'),
    BeamSpotTag=cms.InputTag('offlineBeamSpot'),
    PileUpTag=cms.InputTag('slimmedAddPileupInfo'),
    TriggerTag=cms.InputTag('TriggerResults::HLT'),
    pathName=cms.string("HLT_Photon50"),
    evWeight=cms.double(1.00000)  #Data
    #                                       evWeight = cms.double(1.00000) #GJets_HT-40To100
Ejemplo n.º 16
0
import FWCore.ParameterSet.Config as cms

# ================ Physics Declared Bit ================
physDeclFilter = cms.EDFilter("PhysDecl",
              applyfilter = cms.untracked.bool(False),
              HLTriggerResults = cms.InputTag("TriggerResults","","HLT")
              )

# ================ HLT Filters =========================
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

hltMinBias = hltHighLevel.clone(
    HLTPaths = cms.vstring('HLT_HIMinBiasHfOrBSC'),
    andOr = cms.bool(True)
    )

hltJets = hltHighLevel.clone(
    HLTPaths = cms.vstring('HLT_L1Jet6U','HLT_Jet15U','HLT_Jet30U'),
    andOr = cms.bool(True)
    )


minBiasBscFilter = cms.Sequence(hltMinBias)

# ================ Spike Cleaning =========================
#ECAL cleaning
from CmsHi.PhotonAnalysis.hiEcalRecHitSpikeFilter_cfi import *
hiEcalRecHitSpikeFilter.minEt = 20.0

#HCAL cleaning
#from JetMETAnalysis.HcalReflagging.hbherechitreflaggerJETMET_cfi import *
Ejemplo n.º 17
0
    process.load("RecoHI.HiJetAlgos.HiBadParticleFilter_cfi")
    process.pfBadCandAnalyzer = process.pfcandAnalyzer.clone(
        pfCandidateLabel=cms.InputTag("filteredParticleFlow", "cleaned"))
    process.pfFilter = cms.Path(process.filteredParticleFlow +
                                process.pfBadCandAnalyzer)

### FILTERS ###
# Trigger Filter
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltFilter = hltHighLevel.clone(HLTPaths=[
    'HLT_HIUPC_DoubleEG2_NotMBHF2AND_v1',
    'HLT_HIUPC_DoubleEG2_NotMBHF2AND_SinglePixelTrack_v1',
    'HLT_HIUPC_DoubleEG2_NotMBHF2AND_SinglePixelTrack_MaxPixelTrack_v1',
    'HLT_HIUPC_DoubleEG5_NotMBHF2AND_v1',
    'HLT_HIUPC_DoubleEG5_NotMBHF2AND_SinglePixelTrack_v1',
    'HLT_HIUPC_DoubleEG5_NotMBHF2AND_SinglePixelTrack_MaxPixelTrack_v1'
],
                                       TriggerResultsTag=cms.InputTag(
                                           "TriggerResults", "", "HLT"),
                                       throw=False,
                                       andOr=True,
                                       eventSetupPathsKey=cms.string(''))
process.triggerSelection = cms.Sequence(process.hltFilter)

#########################
# Main analysis list
#########################

#import HLTrigger.HLTfilters.hltHighLevel_cfi
#process.hltfilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone()
#process.hltfilter.HLTPaths = ["HLT_HIUPCL1DoubleEG*","HLT_HIUPCL1SingleEG*"]
Ejemplo n.º 18
0
# Require standard diphoton trigger

# debugging

# print'customize = ',customize
# print'customize.datasetName() = ',customize.datasetName()

#

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
hlt_paths = []
for dset in customize.metaConditions["TriggerPaths"]:
    if dset in customize.datasetName():
        hlt_paths.extend(customize.metaConditions["TriggerPaths"][dset])
process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(hlt_paths))

process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
    process.dataRequirements += process.hltHighLevel

# Split WH and ZH
process.genFilter = cms.Sequence()
if ((customize.processId.count("wh") or customize.processId.count("zh"))
        and not (customize.processId.count("powheg"))
    ) and not customize.processId.count("wzh"):
    print "enabling vh filter!!!!!"
    process.load("flashgg/Systematics/VHFilter_cfi")
    process.genFilter += process.VHFilter
Ejemplo n.º 19
0
 def getHltFilter(self,process):
     if not hasattr(process,"hltHighLevel"):
         process.hltHighLevel = hltHighLevel.clone(throw=cms.bool(False))
     process.hltHighLevel.throw=False
     return process.hltHighLevel
Ejemplo n.º 20
0
            'dr'  : 0.3,
        },
        'taus' : {
            'cut' : 'pt>20 && abs(eta)<2.3 && tauID("byMediumCombinedIsolationDeltaBetaCorr3Hits")>0.5 && tauID("decayModeFinding")>0.5',
            'dr'  : 0.3,
        },
    },
}

# filters
filters = []

# met filters
if options.runMetFilter:
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    hltFilter = hltHighLevel.clone()
    # PAT if miniaod by itself (MC) and RECO if at the same time as reco (data)
    hltFilter.TriggerResultsTag = cms.InputTag('TriggerResults', '', 'PAT') if options.isMC else cms.InputTag('TriggerResults', '', 'RECO')
    hltFilter.throw = cms.bool(True)
    for flag in ["HBHENoiseFilter", "HBHENoiseIsoFilter", "CSCTightHalo2015Filter", "EcalDeadCellTriggerPrimitiveFilter", "goodVertices", "eeBadScFilter"]:
        mod = hltFilter.clone(HLTPaths=cms.vstring('Flag_{0}'.format(flag)))
        modName = 'filter{0}'.format(flag)
        setattr(process,modName,mod)
        filters += [getattr(process,modName)]

# now do any customization/cleaning
from DevTools.Ntuplizer.customizeElectrons import customizeElectrons
collections = customizeElectrons(
    process,
    collections,
    isMC=bool(options.isMC),
Ejemplo n.º 21
0
customize.setDefault("maxEvents", 5000)  # max-number of events
customize.setDefault("targetLumi", 1.00e+3)  # define integrated lumi
customize(process)

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27WPTight_v*") )
#process.options      = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

# Logic from Yacine's file
#from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
if customize.processId == "Data":
    process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
        #"HLT_Ele27WPTight_v*"
        "HLT_Ele27_WPTight_Gsf_v*"))

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag(
    "reducedEgamma",
    "reducedEERecHits")  # Saved MicroAOD Collection (data only)
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
    process.dataRequirements += process.hltHighLevel
    process.dataRequirements += process.eeBadScFilter

# Split WH and ZH
process.genFilter = cms.Sequence()
if (customize.processId.count("wh") or customize.processId.count("zh")
Ejemplo n.º 22
0
version = 'v8'

global_tag(process, '76X_mcRun2_asymptotic_v12' if is_mc else '76X_dataRun2_v15')
process.maxEvents.input = 1000
process.source.fileNames = ['/store/mc/RunIISpring15DR74/WJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/80000/CA0ABB76-43FC-E411-A207-1CC1DE1CEDB2.root' if is_mc else '/store/data/Run2015D/SingleMuon/MINIAOD/PromptReco-v3/000/256/630/00000/BCD78EF7-2B5F-E511-A3A3-02163E0170B5.root']
#process.source.fileNames = ['/store/user/tucker/WJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/trigeff_htskim_v7/151203_184423/0000/htskim_1.root']
#process.options.wantSummary = True
process.TFileService.fileName = 'eff.root'

if not is_mc:
    from JMTucker.Tools.Sample import DataSample
    from FWCore.PythonUtilities.LumiList import LumiList
    process.source.lumisToProcess = LumiList(DataSample.JSON).getVLuminosityBlockRange()

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.mutrig = hltHighLevel.clone()
process.mutrig.HLTPaths = ['HLT_IsoMu20_v*']
process.mutrig.andOr = True # = OR

process.load('JMTucker.MFVNeutralino.EmulateHT800_cfi')
from JMTucker.Tools.L1GtUtils_cff import l1GtUtilsTags
from JMTucker.Tools.PATTupleSelection_cfi import jtupleParams

process.num = cms.EDFilter('MFVTriggerEfficiency',
                           l1GtUtilsTags,
                           require_trigger = cms.bool(False), # just from EmulateHT800 filter, need to split out
                           require_muon = cms.bool(True),
                           muons_src = cms.InputTag('slimmedMuons'),
                           muon_cut = cms.string(jtupleParams.semilepMuonCut.value() + ' && pt > 24'),
                           jets_src = cms.InputTag('slimmedJets'),
                           jet_cut = jtupleParams.jetCut,
                                tagFlags = cms.PSet(LowPtTriggerFlagsPhysics,
                                                    LowPtTriggerFlagsEfficiencies,
                                                    ),
                                isMC           = cms.bool(False),
                                addRunLumiInfo = cms.bool(True),

                                )



#from HLTrigger.HLTfilters.hltHighLevelDev_cfi import hltHighLevelDev
#process.fastFilter = hltHighLevelDev.clone(HLTPaths = ['HLT_Mu3_Track0_Jpsi'], HLTPathsPrescales = [1])
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.fastFilter = hltHighLevel.clone(HLTPaths = ['HLT_Mu*_L2Mu*', 'HLT_Mu*_Track*_Jpsi*'],
                                        andOr = cms.bool(True),  # True: OR - False: AND
                                        throw = cms.bool(False), # Don't throw exception if trigger name is unkown
                                        )




process.tnpSimpleSequence = cms.Sequence(
 
    
    process.muonDxyPVdzmin      +
    process.nverticesModule    +
    process.tagProbeSeparation +
    process.tpTree             
)

process.tagAndProbe = cms.Path( 
Ejemplo n.º 24
0
def setModules(process, options):

    process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree", )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(False)
    process.hltFilter.HLTPaths = options['TnPPATHS']

    from PhysicsTools.TagAndProbe.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()

    ###################################################################
    ## ELECTRON MODULES
    ###################################################################

    #produces photons for tag+probe
    process.photonFromDiPhotons = cms.EDProducer(
        "FlashggPhotonFromDiPhotonProducer",
        src=cms.InputTag(options['DIPHOTON_COLL']),
        cut=cms.string(options['PHOTON_CUTS']),
        leadingPreselection=cms.string(options['LEADING_PRESELECTION']),
        subleadingPreselection=cms.string(options['SUBLEADING_PRESELECTION']),
        vertexSelection=cms.int32(
            -1
        ),  # -1 means take the chosen vertex, otherwise use the index to select 2it                                
        #diPhotonMVATag = cms.InputTag("flashggUpdatedIdMVADiPhotons"),
        diPhotonMVATag=cms.InputTag("flashggDiPhotonMVA"),
        diphotonMVAThreshold=cms.double(-0.6))

    #produces tag collection from diphotons
    process.goodPhotonTags = cms.EDFilter(
        "FlashggPhotonRefSelector",
        src=cms.InputTag("photonFromDiPhotons"),
        cut=cms.string(options['PHOTON_TAG_CUTS']))

    #produces probe collection from diphotons
    process.goodPhotonProbes = cms.EDFilter(
        "FlashggPhotonRefSelector",
        src=cms.InputTag("photonFromDiPhotons"),
        cut=cms.string(options['PHOTON_PROBE_CUTS']))

    ###################################################################

    #IDMVA for probes
    process.goodPhotonProbesIDMVA = cms.EDProducer(
        "FlashggPhotonSelectorByDoubleValueMap",
        input=cms.InputTag("goodPhotonProbes"),
        cut=cms.string(options['PHOTON_PROBE_CUTS']),
        selection=cms.InputTag("photonFromDiPhotons:idmva"),
        id_cut=cms.double(-0.9))
    process.goodPhotonsProbeTnPprobe = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options['TnPHLTProbeFilters'],
        inputs=cms.InputTag("goodPhotonProbesIDMVA"),
        bits=cms.InputTag(options['TRIGGER_RES']),
        objects=cms.InputTag(options['PAT_TRIG']),
        dR=cms.double(0.3),
        isAND=cms.bool(False))
    #numerator for Preselection
    process.goodPhotonProbesPreselection = cms.EDProducer(
        "FlashggPhotonSelectorByValueMap",
        input=cms.InputTag("goodPhotonsProbeTnPprobe"),
        cut=cms.string(options['PHOTON_PROBE_CUTS']),
        selection=cms.InputTag("photonFromDiPhotons:preselection"),
        id_cut=cms.bool(True))

    #probes match to l1
    #process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
    process.goodPhotonProbesL1 = cms.EDProducer(
        "FlashggPhotonL1Stage2CandProducer",
        inputs=cms.InputTag("goodPhotonProbesPreselection"),
        #isoObjects = cms.InputTag("l1extraParticles:Isolated"),
        #nonIsoObjects = cms.InputTag("l1extraParticles:NonIsolated"),
        #objects = cms.InputTag("hltCaloStage2Digis:EGamma"),
        objects=cms.InputTag("caloStage2Digis:EGamma"),
        #minET = cms.double(15), #lead eff only
        minET=cms.double(10),  #sublead eff only
        dRmatch=cms.double(
            0.2),  #defined to match L1 online matching to hlt (0.261)
        dRmatchEE=cms.double(
            0.2
        ),  #defined to match L1 online matching to hlt (should probably be tightened for stage2)
        isolatedOnly=cms.bool(False))

    #numerator passing HLT requiring preselection and L1
    process.goodPhotonsProbeHLT = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options['HLTFILTERTOMEASURE'],
        inputs=cms.InputTag("goodPhotonProbesPreselection"),
        bits=cms.InputTag(options['TRIGGER_RES']),
        objects=cms.InputTag(options['PAT_TRIG']),
        dR=cms.double(0.3),
        isAND=cms.bool(False))

    ###################################################################
    #IDMVA for tags
    process.goodPhotonTagsIDMVA = cms.EDProducer(
        "FlashggPhotonSelectorByDoubleValueMap",
        input=cms.InputTag("goodPhotonTags"),
        cut=cms.string(options['PHOTON_TAG_CUTS']),
        selection=cms.InputTag("photonFromDiPhotons:idmva"),
        id_cut=cms.double(-0.5))
    #preselection for tags
    process.goodPhotonTagsPreselection = cms.EDProducer(
        "FlashggPhotonSelectorByValueMap",
        input=cms.InputTag("goodPhotonTagsIDMVA"),
        cut=cms.string(options['PHOTON_TAG_CUTS']),
        selection=cms.InputTag("photonFromDiPhotons:preselection"),
        id_cut=cms.bool(True))

    #good match to lead HggFilter tag photons for denominator PRESELECTED
    process.goodPhotonsTagLeadMatch = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options['TagLeadMatchFilters'],
        inputs=cms.InputTag("goodPhotonTagsPreselection"),
        bits=cms.InputTag(options['TRIGGER_RES']),
        objects=cms.InputTag(options['PAT_TRIG']),
        dR=cms.double(0.3),
        isAND=cms.bool(False))
    #good preselected tag photons for denominator
    process.goodPhotonsTagHLT = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options['TnPHLTTagFilters'],
        inputs=cms.InputTag("goodPhotonsTagLeadMatch"),
        bits=cms.InputTag(options['TRIGGER_RES']),
        objects=cms.InputTag(options['PAT_TRIG']),
        dR=cms.double(0.3),
        isAND=cms.bool(False))

    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load(
        "RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")
    process.noL1RECO = cms.EDProducer(
        "CandViewShallowCloneCombiner",
        decay=cms.string("goodPhotonsTagHLT goodPhotonProbesPreselection"),
        #decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"),
        checkCharge=cms.bool(False),
        cut=cms.string("40<mass<180"),
    )

    #efficiency for HLT with L1 requirement in denominator
    process.L1RECO = cms.EDProducer(
        "CandViewShallowCloneCombiner",
        decay=cms.string("goodPhotonsTagHLT goodPhotonProbesL1"),
        checkCharge=cms.bool(False),
        cut=cms.string("40<mass<180"),
    )
Ejemplo n.º 25
0
customize.setDefault("maxEvents" ,  5000        ) # max-number of events
customize.setDefault("targetLumi",  1.00e+3  ) # define integrated lumi
customize(process)

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27WPTight_v*") )
#process.options      = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

# Logic from Yacine's file
#from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
if customize.processId == "Data":
    process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring(
        #"HLT_Ele27WPTight_v*"
        "HLT_Ele27_WPTight_Gsf_v*"
    ) )

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag("reducedEgamma","reducedEERecHits") # Saved MicroAOD Collection (data only)
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
    process.dataRequirements += process.hltHighLevel
    process.dataRequirements += process.eeBadScFilter

# Split WH and ZH
process.genFilter = cms.Sequence()
if (customize.processId.count("wh") or customize.processId.count("zh")) and not customize.processId.count("wzh"):
    process.load("flashgg/Systematics/VHFilter_cfi")
    process.genFilter += process.VHFilter
Ejemplo n.º 26
0
from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, options.GT, '')

##jet energy corrections
from ExoAnalysis.cmsWR.JEC_cff import *
JEC_correction(process, options.GT)

from ExoAnalysis.cmsWR.heepSelector_cfi import loadHEEPIDSelector
loadHEEPIDSelector(process)
process.load("ExoAnalysis.cmsWR.heepSelector_cfi")

#################################
#Filters
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.trigFilt = hltHighLevel.clone()
#process.trigFilt.HLTPaths = ['HLT_Mu30_Ele30_CaloIdL_GsfTrkIdVL_v*']
process.trigFilt.HLTPaths = ['HLT_Mu45_eta2p1_v*']
process.trigFilt.andOr = True  #if True, then multiple HLT paths will be combined with OR logic

#################################
#Analyzers

## analyze the kinematic distributions of lepton and jet candidates using these modules
process.recoAnalyzerOne = cms.EDAnalyzer(
    'unmatchedAnalyzerForMixedLeptonFlavor',
    treeName=cms.string("recoObjectsAllCuts"),
    doDileptonMassCut=cms.bool(True),
    minDileptonMass=cms.double(200),
    leptonsOneCollection=cms.InputTag(
        "emuRecoFourObjMass", "leptonsOnePassingFourObjMassCut"),  #electrons
Ejemplo n.º 27
0
def setModules(process, options):

    process.sampleInfo = cms.EDAnalyzer("tnp::SampleInfoTree",
                                        vertexCollection = cms.InputTag("offlineSlimmedPrimaryVertices"),
                                        genInfo = cms.InputTag("generator")
                                        )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    process.pileupReweightingProducer = cms.EDProducer("PileupWeightProducer",
                                                       hardcodedWeights = cms.untracked.bool(True)
                                                       )
    
    process.GsfDRToNearestTauProbe = cms.EDProducer("DeltaRNearestGenPComputer",
                                                    probes = cms.InputTag("photonFromDiPhotons"),
                                                    objects = cms.InputTag('flashggPrunedGenParticles'),
                                                    objectSelection = cms.string("abs(pdgId)==15"),
                                                    )
    
    process.GsfDRToNearestTauSC = cms.EDProducer("DeltaRNearestGenPComputer",
                                                 probes = cms.InputTag("superClusterCands"),
                                                 objects = cms.InputTag('flashggPrunedGenParticles'),
                                                 objectSelection = cms.string("abs(pdgId)==15"),
                                                 )
    
    process.GsfDRToNearestTauTag = cms.EDProducer("DeltaRNearestGenPComputer",
                                                  probes = cms.InputTag("photonFromDiPhotons"),
                                                  objects = cms.InputTag('flashggPrunedGenParticles'),
                                                  objectSelection = cms.string("abs(pdgId)==15"),
                                                  )
    ###################################################################
    ## ELECTRON MODULES
    ###################################################################
    
    process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer",
                                                 src = cms.InputTag(options['DIPHOTON_COLL']),
                                                 cut = cms.string(options['PHOTON_CUTS']),
                                                 leadingPreselection = cms.string(options['LEADING_PRESELECTION']),
                                                 subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']),
                                                 vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it
                                                 diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"),
                                                 diphotonMVAThreshold = cms.double(-0.6)
                                                 )

    process.goodPhotonTagL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
                                             inputs = cms.InputTag("goodPhotonTags"),
                                             isoObjects = cms.InputTag("goodPhotonTags"),
                                             nonIsoObjects = cms.InputTag(""),
                                             minET = cms.double(25),
                                             dRmatch = cms.double(0.2),
                                             isolatedOnly = cms.bool(False)
                                             )
    
    process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector",
                                          src = cms.InputTag("photonFromDiPhotons"),
                                          cut = cms.string(options['PHOTON_TAG_CUTS'])
                                          )
    
    process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector",
                                            src = cms.InputTag("photonFromDiPhotons"),
                                            cut = cms.string(options['PHOTON_CUTS'])
                                            )
    
    ###################################################################
    
    process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap",
                                                          input     = cms.InputTag("goodPhotonProbes"),
                                                          cut       = cms.string(options['PHOTON_CUTS']),
                                                          selection = cms.InputTag("photonFromDiPhotons:preselection"),
                                                          id_cut    = cms.bool(True)
                                                          )
    
    process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                   input     = cms.InputTag("goodPhotonProbes"),
                                                   cut       = cms.string(options['PHOTON_CUTS']),
                                                   selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                   id_cut    = cms.double(0.2)
                                                   )
    
    process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                 input     = cms.InputTag("goodPhotonTags"),
                                                 cut       = cms.string(options['PHOTON_CUTS']),
                                                 selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                 id_cut    = cms.double(0.2)
                                                 )
    
    ###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                               filterNames = options['TnPHLTTagFilters'],
                                               inputs      = cms.InputTag("goodPhotonTags"),
                                               bits        = cms.InputTag('TriggerResults::HLT'),
                                               objects     = cms.InputTag('selectedPatTrigger'),
                                               dR          = cms.double(0.3),
                                               isAND       = cms.bool(True)
                                               )
    
    process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                 filterNames = options['TnPHLTProbeFilters'],
                                                 inputs      = cms.InputTag("goodPhotonProbes"),
                                                 bits        = cms.InputTag('TriggerResults::HLT'),
                                                 objects     = cms.InputTag('selectedPatTrigger'),
                                                 dR          = cms.double(0.3),
                                                 isAND       = cms.bool(True)
                                                 )
    
    process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
                                                inputs = cms.InputTag("goodPhotonProbes"),
                                                isoObjects = cms.InputTag("l1extraParticles:Isolated"),
                                                nonIsoObjects = cms.InputTag("l1extraParticles:NonIsolated"),
                                                minET = cms.double(40),
                                                dRmatch = cms.double(0.2),
                                                isolatedOnly = cms.bool(False)
                                                )
    
    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

    process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                      decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), 
                                      checkCharge = cms.bool(False),
                                      cut = cms.string("40<mass<1000"),
                                      )

    
    ###################################################################
    ## MC MATCHING
    ###################################################################

    process.McMatchTag = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                        matchPDGId = cms.vint32(11),
                                        src = cms.InputTag("goodPhotonTags"),
                                        distMin = cms.double(0.2),
                                        matched = cms.InputTag("flashggPrunedGenParticles"),
                                        checkCharge = cms.bool(False)
                                        )
    
    process.McMatchRECO = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                         matchPDGId = cms.vint32(11),
                                         src = cms.InputTag("goodPhotonProbes"),
                                         distMin = cms.double(0.2),
                                         matched = cms.InputTag("flashggPrunedGenParticles"),
                                         checkCharge = cms.bool(False)
                                         )
Ejemplo n.º 28
0
        # mc
        # "root://node12.datagrid.cea.fr//store/user/gnegro/cmsWR/cmsWR2016/dafne/WR-ToLNu-ToEEJJ_GEN_SIM_13TeV-2016/cmsWR2016-dafne-v0-gnegro-WR-3200_ToLNu-1600_ToEEJJ_miniAOD_13TeV-2016-b59cb78551aff289588aa5c69db4a3a1/161027_124028/0000/dafneMicroAOD_1.root"
        # "root://node12.datagrid.cea.fr//store/user/gnegro/cmsWR/cmsWR2016/dafne/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/cmsWR2016-dafne-v0-RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2_v0-v1/161027_121933/0000/dafneMicroAOD_107.root"
        # "/store/user/gnegro/cmsWR/cmsWR2016-signal/dafne-v1/WRToEEJJ_MW-2400_MNu-1200_TuneCUETP8M1_13TeV-pythia8/cmsWR2016-signal-dafne-v1-v0-gnegro-RunIIWinter16_80X_mcRun2_asymptotic_2016_miniAODv2_v1_MINIAODSIM-9232bfa9d7b25477dcde67f5060ed55b/170106_094339/0000/dafneMicroAOD_1.root"
        # "/store/user/gnegro/cmsWR/cmsWR2016-bkg/dafne-v1/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8/cmsWR2016-bkg-dafne-v1-v0-RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2_v0-v1/170106_095719/0000/dafneMicroAOD_1.root"
        "file:/afs/cern.ch/work/g/gnegro/NuAnalysis-Moriond17/CMSSW_8_0_26_patch1/src/flashgg/myMicroAODOutputFile_MultiLeptonMultiJet.root"
    ))

## HLT filter
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel = hltHighLevel.clone(
    HLTPaths=cms.vstring("HLT_DoubleEle33_CaloIdL_MW_v*",
                         "HLT_DoubleEle33_CaloIdL_GsfTrkIdVL_MW_v*",
                         "HLT_Mu50_v*", "HLT_TkMu50_v*",
                         "HLT_Mu33_Ele33_CaloIdL_GsfTrkIdVL_v*",
                         "HLT_Ele27_WPTight_Gsf_v*", "HLT_IsoMu24_v*",
                         "HLT_IsoMu27_v*"),
    throw=False
    # andOr    = cms.bool(True) # True = or between triggers
)

# import flashgg customization to check if we have signal or background
from flashgg.MetaData.JobConfig import customize
customize.parse()

# # flashgg tag sequence (for dipho MVA) and jet collections
process.load("flashgg/Taggers/flashggTagSequence_cfi")
# process.load("dafne/Taggers/flashggDiLeptonDiJetTagSequence_cfi") #uso questa?
# process.flashggTagSequence.remove(process.flashggUpdatedIdMVADiPhotons) # Needs to be run before systematics
# massSearchReplaceAnyInputTag(process.flashggTagSequence,cms.InputTag("flashggUpdatedIdMVADiPhotons"),cms.InputTag("flashggDiPhotonSystematics"))
                 ApplyCentralValue=cms.bool(True),
                 Debug=cms.untracked.bool(False)),
        cms.PSet(PhotonMethodName=cms.string("FlashggPhotonScale"),
                 MethodName=cms.string("FlashggDiPhotonFromPhoton"),
                 Label=cms.string("DataScale"),
                 NSigmas=cms.vint32(0, 0),
                 OverallRange=cms.string("1"),
                 BinList=scaleBinsRereco,
                 NoCentralShift=cms.bool(False),
                 ApplyCentralValue=cms.bool(True),
                 Debug=cms.untracked.bool(False))))

#process.flashggPreselectedDiPhotons.src = cms.InputTag("flashggDiPhotonSmeared")

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
    "HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*"))

from flashgg.Taggers.flashggTagOutputCommands_cff import tagDefaultOutputCommand

process.TFileService = cms.Service("TFileService",
                                   fileName=cms.string("histo.root"),
                                   closeFileFast=cms.untracked.bool(True))

process.flashggUntagged.Boundaries = cms.vdouble(-2)

# customization for job splitting, lumi weighting, etc.
from flashgg.MetaData.JobConfig import customize
customize.setDefault("maxEvents", -1)
#customize.setDefault("processIndex",5)
customize.setDefault("targetLumi", 1.e+3)
Ejemplo n.º 30
0
                           classname=tagName,
                           cutbased=cutstring,
                           subcats=tagCats, 
                           variables=currentVariables,
                           histograms=minimalHistograms,
                           binnedOnly=isBinnedOnly,
                           dumpPdfWeights=dumpPdfWeights,
                           nPdfWeights=nPdfWeights,
                           nAlphaSWeights=nAlphaSWeights,
                           nScaleWeights=nScaleWeights
                           )

# Require standard diphoton trigger
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*",
#                                                                "HLT_Diphoton30PV_18PV_R9Id_AND_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1",
#                                                                "HLT_Diphoton30EB_18EB_R9Id_OR_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1"
                                                                ))

process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag("reducedEgamma","reducedEERecHits") # Saved MicroAOD Collection (data only)
# Bad Muon filter
process.load('RecoMET.METFilters.badGlobalMuonTaggersMiniAOD_cff')
process.badGlobalMuonTagger.muons = cms.InputTag("flashggSelectedMuons")
process.cloneGlobalMuonTagger.muons = cms.InputTag("flashggSelectedMuons")
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
        process.dataRequirements += process.hltHighLevel
        process.dataRequirements += process.eeBadScFilter
Ejemplo n.º 31
0
import FWCore.ParameterSet.Config as cms

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

hcalfilter = hltHighLevel.clone(
    TriggerResultsTag=cms.InputTag('TriggerResults'),
    HLTPaths=cms.vstring('user_step'))

hcalfilterSeq = cms.Sequence(hcalfilter)
Ejemplo n.º 32
0
                           histograms=minimalHistograms,
                           binnedOnly=isBinnedOnly,
                           dumpPdfWeights=dumpPdfWeights,
                           nPdfWeights=nPdfWeights,
                           nAlphaSWeights=nAlphaSWeights,
                           nScaleWeights=nScaleWeights
                           )

# Require standard diphoton trigger
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#process.hltHighLevel= hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*",
#                                                                "HLT_Diphoton30PV_18PV_R9Id_AND_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1",
#                                                                "HLT_Diphoton30EB_18EB_R9Id_OR_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1"
#                                                                ))
#process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*"))
process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring("HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v*"))

process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag("reducedEgamma","reducedEERecHits") # Saved MicroAOD Collection (data only)
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
        process.dataRequirements += process.hltHighLevel
        process.dataRequirements += process.eeBadScFilter

# Split WH and ZH
process.genFilter = cms.Sequence()
if (customize.processId.count("wh") or customize.processId.count("zh")) and not customize.processId.count("wzh"):
    process.load("flashgg/Systematics/VHFilter_cfi")
Ejemplo n.º 33
0
cfgTools.addCategories(process.ZPlusJetTagDumper,
                       cats,
                       variables  = all_variables,
                       histograms = []
)

process.ZPlusJetTagDumper.nameTemplate = "$PROCESS_$SQRTS_$CLASSNAME_$SUBCAT_$LABEL"

customize.setDefault("maxEvents" ,  5000        ) # max-number of events
customize.setDefault("targetLumi",  1.00e+3  ) # define integrated lumi
customize(process)

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*") )
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v*") )
process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*") )
process.options      = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

# Logic from Yacine's file
#from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#if customize.runOnZee:
#    if customize.processId == "Data":
#        process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*") )
#    else:
#        process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WP75_Gsf_v*") )
#else:
#    process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*"))


# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
def setModules(process, options):

    process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree",
                                        )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(False)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    from PhysicsTools.TagAndProbe.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()    

    ###################################################################
    ## ELECTRON MODULES
    ###################################################################
    
    process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer",
                                                 src = cms.InputTag(options['DIPHOTON_COLL']),
                                                 cut = cms.string(options['PHOTON_CUTS']),
                                                 leadingPreselection = cms.string(options['LEADING_PRESELECTION']),
                                                 subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']),
                                                 vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it
                                                 diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"),
                                                 diphotonMVAThreshold = cms.double(-0.6) #Previous value was -1.0
                                                 )

    process.goodPhotonTagL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
                                             inputs = cms.InputTag("goodPhotonTags"),
                                             isoObjects = cms.InputTag("goodPhotonTags"),
                                             nonIsoObjects = cms.InputTag(""),
                                             minET = cms.double(25),
                                             dRmatch = cms.double(0.2),
                                             isolatedOnly = cms.bool(False)
                                             )
    
    process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector",
                                          src = cms.InputTag("photonFromDiPhotons"),
                                          cut = cms.string(options['PHOTON_TAG_CUTS'])
                                          )
    
    process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector",
                                            src = cms.InputTag("photonFromDiPhotons"),
                                            cut = cms.string(options['PHOTON_CUTS'])
                                            )
    
    ###################################################################
    
    process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap",
                                                          input     = cms.InputTag("goodPhotonProbes"),
                                                          cut       = cms.string(options['PHOTON_CUTS']),
                                                          selection = cms.InputTag("photonFromDiPhotons:preselection"),
                                                          id_cut    = cms.bool(True)
                                                          )
    
    process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                   input     = cms.InputTag("goodPhotonProbes"),
                                                   cut       = cms.string(options['PHOTON_CUTS']),
                                                   selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                   id_cut    = cms.double(-0.9)
                                                   )
    
    process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                 input     = cms.InputTag("goodPhotonTags"),
                                                 cut       = cms.string(options['PHOTON_CUTS']),
                                                 selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                 id_cut    = cms.double(-0.6)
                                                 )
    
    ###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                               filterNames = options['TnPHLTTagFilters'],
                                               inputs      = cms.InputTag("goodPhotonTagsIDMVA"),
                                               bits        = cms.InputTag('TriggerResults::HLT'),
                                               objects     = cms.InputTag('selectedPatTrigger'),
                                               dR          = cms.double(0.3),
                                               isAND       = cms.bool(True)
                                               )
    
    process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                 filterNames = options['TnPHLTProbeFilters'],
                                                 inputs      = cms.InputTag("goodPhotonProbes"),
                                                 bits        = cms.InputTag('TriggerResults::HLT'),
                                                 objects     = cms.InputTag('selectedPatTrigger'),
                                                 dR          = cms.double(0.3),
                                                 isAND       = cms.bool(True)
                                                 )
    
    process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer",
                                                inputs = cms.InputTag("goodPhotonProbes"),
                                                objects = cms.InputTag("caloStage2Digis:EGamma"),
                                                minET = cms.double(40),
                                                dRmatch = cms.double(0.2),
                                                dRmatchEE = cms.double(0.2),
                                                isolatedOnly = cms.bool(False)
                                                )
    
    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

    process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                      decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), 
                                      checkCharge = cms.bool(False),
                                      cut = cms.string("40<mass<130"),
                                      )
Ejemplo n.º 35
0
from RecoTauTag.TauAnalysisTools.TauNtupleProducer_cfi import *

'''

Tag and probe tau ntuple production for Heavy Flavor QCD fake rate studies

Author: Evan Friis, UC Davis ([email protected])

Strategy: Unbias trigger selection by requiring an HLT moun, matched to a
global muon, with pt > 9

'''

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

muonTrigger = hltHighLevel.clone()
muonTrigger.HLTPaths = cms.vstring('HLT_Mu9')

tagMuons = cms.EDFilter("MuonRefSelector",
      src = cms.InputTag("muons"),
      cut = cms.string('isGlobalMuon > 0 && pt > 9.0 && abs(eta) < 2.1')
)

# temp test
#tagMuons = cms.EDFilter("CandViewRefSelector",
#      src = cms.InputTag("shrinkingConePFTauProducer"),
#      cut = cms.string('charge() == 1')
#)

atLeastOneTagMuon = cms.EDFilter("CandViewCountFilter",
      src = cms.InputTag('tagMuons'),
Ejemplo n.º 36
0
cats += [("ZPlusJet", "1", 0)]

cfgTools.addCategories(process.ZPlusJetTagDumper,
                       cats,
                       variables=all_variables,
                       histograms=[])

process.ZPlusJetTagDumper.nameTemplate = "$PROCESS_$SQRTS_$CLASSNAME_$SUBCAT_$LABEL"

customize.setDefault("maxEvents", 5000)  # max-number of events
customize.setDefault("targetLumi", 1.00e+3)  # define integrated lumi
customize(process)

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
#process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v*") )
process.hltHighLevel = hltHighLevel.clone(
    HLTPaths=cms.vstring("HLT_Ele17_Ele12_CaloIdL_TrackIdL_IsoVL_DZ_v*"))
process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag(
    "reducedEgamma",
    "reducedEERecHits")  # Saved MicroAOD Collection (data only)
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
    process.dataRequirements += process.hltHighLevel
    process.dataRequirements += process.eeBadScFilter

# Split WH and ZH
process.genFilter = cms.Sequence()
if (customize.processId.count("wh") or customize.processId.count("zh")
    ),
    isMC=cms.bool(True),
    tagMatches=cms.InputTag("tagMuonsMCMatch"),
    probeMatches=cms.InputTag("probeMuonsMCMatch"),
    motherPdgId=cms.vint32(443),
    makeMCUnbiasTree=cms.bool(True),
    checkMotherInUnbiasEff=cms.bool(True),
    allProbes=cms.InputTag("probeMuons"),
)

#from HLTrigger.HLTfilters.hltHighLevelDev_cfi import hltHighLevelDev
#process.fastFilter = hltHighLevelDev.clone(HLTPaths = ['HLT_Mu3_Track0_Jpsi'], HLTPathsPrescales = [1])
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.fastFilter = hltHighLevel.clone(
    HLTPaths=['HLT_Mu*_L2Mu0', 'HLT_Mu3_Track*_Jpsi*', 'HLT_Mu5_Track*_Jpsi*'],
    andOr=cms.bool(True),  # True: OR - False: AND
    throw=cms.bool(False),  # Don't throw exception if trigger name is unkown
)

process.tnpSimpleSequence = cms.Sequence(process.tagMuonsMCMatch +
                                         process.probeMuonsMCMatch +
                                         process.muonDxyPVdzmin +
                                         process.nverticesModule +
                                         process.tagProbeSeparation +
                                         process.tpTree)

process.tagAndProbe = cms.Path(process.fastFilter + process.tnpSimpleSequence)

process.TFileService = cms.Service(
    "TFileService", fileName=cms.string("tnpTree_FromOniaMuMuPAT_Test.root"))
Ejemplo n.º 38
0
def setModules(process, options):

    process.sampleInfo = cms.EDProducer(
        "tnp::SampleInfoTree",
        #vertexCollection = cms.InputTag("offlinePrimaryVertices"),
        genInfo=cms.InputTag("generator"))

    #process.eleVarHelper = cms.EDProducer("GsfElectronVariableHelper",
    #                                      probes = cms.InputTag(options['ELECTRON_COLL']),
    #                                      vertexCollection = cms.InputTag("offlinePrimaryVertices")
    #                                      )

    #process.eleVarHelper = cms.EDProducer("PatElectronVariableHelper",
    #                                      probes = cms.InputTag(options['ELECTRON_COLL']),
    #                                      vertexCollection = cms.InputTag("offlineSlimmedPrimaryVertices")
    #                                      )

    #process.hltVarHelper = cms.EDProducer("GsfElectronHLTVariableHelper",
    #                                      probes = cms.InputTag(options['ELECTRON_COLL']),
    #                                      hltCandidateCollection = cms.InputTag("hltEgammaCandidates"),
    #                                      mapOutputNames = cms.vstring("hltsieie",
    #                                                                   "hltecaliso",
    #                                                                   "hlthcaliso",
    #                                                                   "hlthoe",
    #                                                                   "hlttkiso",
    #                                                                   "hltdeta",
    #                                                                   "hltdetaseed",
    #                                                                   "hltdphi",
    #                                                                   "hlteop",
    #                                                                   "hltmishits"),
    #                                      mapInputTags = cms.VInputTag("hltEgammaClusterShape:sigmaIEtaIEta5x5",
    #                                                                   "hltEgammaEcalPFClusterIso",
    #                                                                   "hltEgammaHcalPFClusterIso",
    #                                                                   "hltEgammaHoverE",
    #                                                                   "hltEgammaEleGsfTrackIso",
    #                                                                   "hltEgammaGsfTrackVars:Deta",
    #                                                                   "hltEgammaGsfTrackVars:DetaSeed",
    #                                                                   "hltEgammaGsfTrackVars:Dphi",
    #                                                                   "hltEgammaGsfTrackVars:OneOESuperMinusOneOP",
    #                                                                   "hltEgammaGsfTrackVars:MissingHits")
    #                                      )

    process.hltVarHelper = cms.EDProducer(
        "PATElectronHLTVariableHelper",
        probes=cms.InputTag(options['ELECTRON_COLL']),
        hltCandidateCollection=cms.InputTag("hltEgammaCandidates"),
        mapOutputNames=cms.vstring("hltsieie", "hltecaliso", "hlthcaliso",
                                   "hlthoe", "hlttkiso", "hltdeta",
                                   "hltdetaseed", "hltdphi", "hlteop",
                                   "hltmishits"),
        mapInputTags=cms.VInputTag(
            "hltEgammaClusterShape:sigmaIEtaIEta5x5",
            "hltEgammaEcalPFClusterIso", "hltEgammaHcalPFClusterIso",
            "hltEgammaHoverE", "hltEgammaEleGsfTrackIso",
            "hltEgammaGsfTrackVars:Deta", "hltEgammaGsfTrackVars:DetaSeed",
            "hltEgammaGsfTrackVars:Dphi",
            "hltEgammaGsfTrackVars:OneOESuperMinusOneOP",
            "hltEgammaGsfTrackVars:MissingHits"))

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']

    #### MC PU DISTRIBUTIONS
    from SimGeneral.MixingModule.mix_2015_25ns_Startup_PoissonOOTPU_cfi import mix as mix_2015_25ns
    from SimGeneral.MixingModule.mix_2015_50ns_Startup_PoissonOOTPU_cfi import mix as mix_2015_50ns
    pu_distribs = {
        "74X_mcRun2_asymptotic_v2":
        mix_2015_25ns.input.nbPileupEvents.probValue
    }

    #### DATA PU DISTRIBUTIONS
    data_pu_distribs = {
        "Jamboree_golden_JSON": [
            5.12e+04, 3.66e+05, 5.04e+05, 4.99e+05, 7.5e+05, 1.1e+06, 2.53e+06,
            9.84e+06, 4.4e+07, 1.14e+08, 1.94e+08, 2.63e+08, 2.96e+08,
            2.74e+08, 2.06e+08, 1.26e+08, 6.38e+07, 2.73e+07, 1.1e+07, 5.2e+06,
            3.12e+06, 1.87e+06, 9.35e+05, 3.64e+05, 1.1e+05, 2.64e+04,
            5.76e+03, 1.53e+03, 594, 278, 131, 59.8, 26, 10.8, 4.29, 1.62,
            0.587, 0.203, 0.0669, 0.0211, 0.00633, 0.00182, 0.000498, 0.00013,
            3.26e-05, 7.77e-06, 1.77e-06, 3.85e-07, 7.99e-08, 1.58e-08, 3e-09,
            5.43e-10
        ]
    }

    process.pileupReweightingProducer = cms.EDProducer(
        "PileupWeightProducer",
        #hardcodedWeights = cms.untracked.bool(True),
        pileupInfoTag=cms.InputTag("slimmedAddPileupInfo"),
        PileupMC=cms.vdouble(pu_distribs["74X_mcRun2_asymptotic_v2"]),
        PileupData=cms.vdouble(data_pu_distribs["Jamboree_golden_JSON"]),
    )

    ###################################################################
    ## ELECTRON MODULES
    ###################################################################

    #process.goodElectrons = cms.EDFilter("GsfElectronRefSelector",
    #                                     src = cms.InputTag(options['ELECTRON_COLL']),
    #                                     cut = cms.string(options['ELECTRON_CUTS'])
    #                                     )

    process.goodElectrons = cms.EDFilter(
        "PATElectronRefSelector",
        src=cms.InputTag(options['ELECTRON_COLL']),
        cut=cms.string(options['ELECTRON_CUTS']))

    ###################################################################
    ## TRIGGER MATCHING
    ###################################################################

    #process.goodElectronsTagHLT = cms.EDProducer("GsfElectronTriggerCandProducerOnTheFly",
    #                                             filterNames = cms.vstring(options['TnPHLTTagFilters']),
    #                                             inputs      = cms.InputTag("goodElectronsTAGCutBasedTight"),
    #                                             #bits        = cms.InputTag('TriggerResults::HLT'),
    #                                             #objects     = cms.InputTag('hltTriggerSummaryAOD'),
    #                                             dR          = cms.double(0.3),
    #                                             isAND       = cms.bool(True)
    #                                             )

    #process.goodElectronsProbeHLT = cms.EDProducer("GsfElectronTriggerCandProducerOnTheFly",
    #                                               filterNames = cms.vstring(options['TnPHLTProbeFilters']),
    #                                               inputs      = cms.InputTag("goodElectrons"),
    #                                               #bits        = cms.InputTag('TriggerResults::HLT'),
    #                                               #objects     = cms.InputTag('hltTriggerSummaryAOD'),
    #                                               dR          = cms.double(0.3),
    #                                               isAND       = cms.bool(True)
    #                                               )

    process.goodElectronsTagHLT = cms.EDProducer(
        "PATElectronTriggerCandProducerOnTheFly",
        filterNames=cms.vstring(options['TnPHLTTagFilters']),
        inputs=cms.InputTag("goodElectronsTAGCutBasedTight"),
        #bits        = cms.InputTag('TriggerResults::HLT'),
        #objects     = cms.InputTag('hltTriggerSummaryAOD'),
        dR=cms.double(0.3),
        isAND=cms.bool(True))

    process.goodElectronsProbeHLT = cms.EDProducer(
        "PATElectronTriggerCandProducerOnTheFly",
        filterNames=cms.vstring(options['TnPHLTProbeFilters']),
        inputs=cms.InputTag("goodElectrons"),
        #bits        = cms.InputTag('TriggerResults::HLT'),
        #objects     = cms.InputTag('hltTriggerSummaryAOD'),
        dR=cms.double(0.3),
        isAND=cms.bool(True))

    ###################################################################
    ## TnP PAIRS
    ###################################################################

    process.tagTightRECO = cms.EDProducer(
        "CandViewShallowCloneCombiner",
        decay=cms.string("goodElectronsTagHLT@+ goodElectronsProbeHLT@-"),
        checkCharge=cms.bool(True),
        cut=cms.string("60<mass<120"),
    )
Ejemplo n.º 39
0
def setModules(process, options):

    #process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree")

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(False)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()    

    ###################################################################
    ## ELECTRON MODULES
    ###################################################################
    
    process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer",
                                                 src = cms.InputTag(options['DIPHOTON_COLL']),
                                                 cut = cms.string(options['PHOTON_CUTS']),
                                                 leadingPreselection = cms.string(options['LEADING_PRESELECTION']),
                                                 subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']),
                                                 vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it
                                                 diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"),
                                                 diphotonMVAThreshold = cms.double(-0.6) #Previous value was -1.0
                                                 )

    process.goodPhotonTagL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
                                             inputs = cms.InputTag("goodPhotonTags"),
                                             isoObjects = cms.InputTag("goodPhotonTags"),
                                             nonIsoObjects = cms.InputTag(""),
                                             minET = cms.double(25),
                                             dRmatch = cms.double(0.2),
                                             isolatedOnly = cms.bool(False)
                                             )
    
    process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector",
                                          src = cms.InputTag("photonFromDiPhotons"),
                                          cut = cms.string(options['PHOTON_TAG_CUTS'])
                                          )
    
    process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector",
                                            src = cms.InputTag("photonFromDiPhotons"),
                                            cut = cms.string(options['PHOTON_CUTS'])
                                            )
    
    ###################################################################
    
    process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap",
                                                          input     = cms.InputTag("goodPhotonProbes"),
                                                          cut       = cms.string(options['PHOTON_CUTS']),
                                                          selection = cms.InputTag("photonFromDiPhotons:preselection"),
                                                          id_cut    = cms.bool(True)
                                                          )
    
    process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                   input     = cms.InputTag("goodPhotonProbes"),
                                                   cut       = cms.string(options['PHOTON_CUTS']),
                                                   selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                   id_cut    = cms.double(-0.9)
                                                   )
    
    process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                 input     = cms.InputTag("goodPhotonTags"),
                                                 cut       = cms.string(options['PHOTON_CUTS']),
                                                 selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                 id_cut    = cms.double(-0.6)
                                                 )
    
    ###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                               filterNames = options['TnPHLTTagFilters'],
                                               inputs      = cms.InputTag("goodPhotonTagsIDMVA"),
                                               bits        = cms.InputTag('TriggerResults::HLT'),
                                               objects     = cms.InputTag('slimmedPatTrigger'),
                                               dR          = cms.double(0.3),
                                               isAND       = cms.bool(True)
                                               )
    
    process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                 filterNames = options['TnPHLTProbeFilters'],
                                                 inputs      = cms.InputTag("goodPhotonProbes"),
                                                 bits        = cms.InputTag('TriggerResults::HLT'),
                                                 objects     = cms.InputTag('slimmedPatTrigger'),
                                                 dR          = cms.double(0.3),
                                                 isAND       = cms.bool(True)
                                                 )
    
    process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer",
                                                inputs = cms.InputTag("goodPhotonProbes"),
                                                objects = cms.InputTag("caloStage2Digis:EGamma"),
                                                minET = cms.double(40),
                                                dRmatch = cms.double(0.2),
                                                dRmatchEE = cms.double(0.2),
                                                isolatedOnly = cms.bool(False)
                                                )
    
    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

    process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                      decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"), 
                                      checkCharge = cms.bool(False),
                                      cut = cms.string("40<mass<130"),
                                      )
Ejemplo n.º 40
0
bscNoHalo = hltLevel1GTSeed.clone(
    L1TechTriggerSeeding = cms.bool(True),
    L1SeedsLogicalExpression = cms.string('NOT (36 OR 37 OR 38 OR 39)')
    )

bscOrBptxOr = l1Filter.clone(
    algorithms = ["L1_BscMinBiasOR_BptxPlusORMinus"]
    )


# ================ HLT Filters =====================
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

hltMinBias = hltHighLevel.clone(
    HLTPaths = cms.vstring('HLT_L1_BscMinBiasOR_BptxPlusORMinus'),
    andOr = cms.bool(True)
    )

hltJets = hltHighLevel.clone(
    HLTPaths = cms.vstring('HLT_L1Jet6U','HLT_Jet15U','HLT_Jet30U'),
    andOr = cms.bool(True)
    )


# ================ Monster Event Rejection ==============
purityFractionFilter = cms.EDFilter("FilterOutScraping",
    applyfilter = cms.untracked.bool(True),
    debugOn = cms.untracked.bool(False),
    numtrack = cms.untracked.uint32(10),
    thresh = cms.untracked.double(0.25)
    )
def setModules(process, options):

    process.sampleInfo = cms.EDAnalyzer(
        "tnp::SampleInfoTree",
        vertexCollection=cms.InputTag("offlineSlimmedPrimaryVertices"),
        genInfo=cms.InputTag("generator"),
    )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options["TnPPATHS"]

    process.pileupReweightingProducer = cms.EDProducer(
        "PileupWeightProducer", hardcodedWeights=cms.untracked.bool(True)
    )

    process.GsfDRToNearestTauProbe = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag("photonFromDiPhotons"),
        objects=cms.InputTag("flashggPrunedGenParticles"),
        objectSelection=cms.string("abs(pdgId)==15"),
    )

    process.GsfDRToNearestTauSC = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag("superClusterCands"),
        objects=cms.InputTag("flashggPrunedGenParticles"),
        objectSelection=cms.string("abs(pdgId)==15"),
    )

    process.GsfDRToNearestTauTag = cms.EDProducer(
        "DeltaRNearestGenPComputer",
        probes=cms.InputTag("photonFromDiPhotons"),
        objects=cms.InputTag("flashggPrunedGenParticles"),
        objectSelection=cms.string("abs(pdgId)==15"),
    )
    ###################################################################
    ## ELECTRON MODULES
    ###################################################################

    process.photonFromDiPhotons = cms.EDProducer(
        "FlashggPhotonFromDiPhotonProducer",
        src=cms.InputTag(options["DIPHOTON_COLL"]),
        cut=cms.string(options["PHOTON_CUTS"]),
        leadingPreselection=cms.string(options["LEADING_PRESELECTION"]),
        subleadingPreselection=cms.string(options["SUBLEADING_PRESELECTION"]),
        vertexSelection=cms.int32(-1),  # -1 means take the chosen vertex, otherwise use the index to select 2it
        diPhotonMVATag=cms.InputTag("flashggDiPhotonMVA"),
        diphotonMVAThreshold=cms.double(-0.6),
    )

    process.goodPhotonTagL1 = cms.EDProducer(
        "FlashggPhotonL1CandProducer",
        inputs=cms.InputTag("goodPhotonTags"),
        isoObjects=cms.InputTag("goodPhotonTags"),
        nonIsoObjects=cms.InputTag(""),
        minET=cms.double(25),
        dRmatch=cms.double(0.2),
        isolatedOnly=cms.bool(False),
    )

    process.goodPhotonTags = cms.EDFilter(
        "FlashggPhotonRefSelector", src=cms.InputTag("photonFromDiPhotons"), cut=cms.string(options["PHOTON_TAG_CUTS"])
    )

    process.goodPhotonProbes = cms.EDFilter(
        "FlashggPhotonRefSelector", src=cms.InputTag("photonFromDiPhotons"), cut=cms.string(options["PHOTON_CUTS"])
    )

    ###################################################################

    process.goodPhotonProbesPreselection = cms.EDProducer(
        "FlashggPhotonSelectorByValueMap",
        input=cms.InputTag("goodPhotonProbes"),
        cut=cms.string(options["PHOTON_CUTS"]),
        selection=cms.InputTag("photonFromDiPhotons:preselection"),
        id_cut=cms.bool(True),
    )

    process.goodPhotonProbesIDMVA = cms.EDProducer(
        "FlashggPhotonSelectorByDoubleValueMap",
        input=cms.InputTag("goodPhotonProbes"),
        cut=cms.string(options["PHOTON_CUTS"]),
        selection=cms.InputTag("photonFromDiPhotons:idmva"),
        id_cut=cms.double(0.2),
    )

    process.goodPhotonTagsIDMVA = cms.EDProducer(
        "FlashggPhotonSelectorByDoubleValueMap",
        input=cms.InputTag("goodPhotonTags"),
        cut=cms.string(options["PHOTON_CUTS"]),
        selection=cms.InputTag("photonFromDiPhotons:idmva"),
        id_cut=cms.double(0.2),
    )

    ###################################################################

    process.goodPhotonsTagHLT = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options["TnPHLTTagFilters"],
        inputs=cms.InputTag("goodPhotonTags"),
        bits=cms.InputTag("TriggerResults::HLT"),
        objects=cms.InputTag("selectedPatTrigger"),
        dR=cms.double(0.3),
        isAND=cms.bool(True),
    )

    process.goodPhotonsProbeHLT = cms.EDProducer(
        "FlashggPhotonTriggerCandProducer",
        filterNames=options["TnPHLTProbeFilters"],
        inputs=cms.InputTag("goodPhotonProbes"),
        bits=cms.InputTag("TriggerResults::HLT"),
        objects=cms.InputTag("selectedPatTrigger"),
        dR=cms.double(0.3),
        isAND=cms.bool(True),
    )

    process.goodPhotonProbesL1 = cms.EDProducer(
        "FlashggPhotonL1CandProducer",
        inputs=cms.InputTag("goodPhotonProbes"),
        isoObjects=cms.InputTag("l1extraParticles:Isolated"),
        nonIsoObjects=cms.InputTag("l1extraParticles:NonIsolated"),
        minET=cms.double(40),
        dRmatch=cms.double(0.2),
        isolatedOnly=cms.bool(False),
    )

    ###################################################################
    ## PHOTON ISOLATION
    ###################################################################
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")

    process.tagTightRECO = cms.EDProducer(
        "CandViewShallowCloneCombiner",
        decay=cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"),
        checkCharge=cms.bool(False),
        cut=cms.string("40<mass<1000"),
    )

    ###################################################################
    ## MC MATCHING
    ###################################################################

    process.McMatchTag = cms.EDProducer(
        "MCTruthDeltaRMatcherNew",
        matchPDGId=cms.vint32(11),
        src=cms.InputTag("goodPhotonTags"),
        distMin=cms.double(0.2),
        matched=cms.InputTag("flashggPrunedGenParticles"),
        checkCharge=cms.bool(False),
    )

    process.McMatchRECO = cms.EDProducer(
        "MCTruthDeltaRMatcherNew",
        matchPDGId=cms.vint32(11),
        src=cms.InputTag("goodPhotonProbes"),
        distMin=cms.double(0.2),
        matched=cms.InputTag("flashggPrunedGenParticles"),
        checkCharge=cms.bool(False),
    )
Ejemplo n.º 42
0
def defineBasePreSelection(process,
                           useTechTriggerBits=False,
                           filterHBHEnoise=True,
                           egmuTriggerFilter='',
                           egtriglist=['HLT_Ele10_LW_L1R'],
                           mutriggerlist=['HLT_Mu9'],
                           jettriglist=['HLT_Jet15U'],
                           trigMenu='HLT') :

    #
    # pre-selection sequences
    #
    
    # cut on monster events (may low quality tracks) -------------------------------
    process.load("HLTrigger.special.hltPhysicsDeclared_cfi")
    process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'
    process.noScraping= cms.EDFilter("FilterOutScraping",
                                     applyfilter = cms.untracked.bool(True),
                                     debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
                                     numtrack = cms.untracked.uint32(10),
                                     thresh = cms.untracked.double(0.25)
                                     )

    # good vertex filter ---------------------------------------------------------
    process.primaryVertexFilter = cms.EDFilter("GoodVertexFilter",
                                               vertexCollection = cms.InputTag('offlinePrimaryVertices'),
                                               minimumNDOF = cms.uint32(3),
                                               maxAbsZ = cms.double(24),
                                               maxd0 = cms.double(2) )


    print "*** Base preselection will remove PKAM and filter primary vertices"
    process.basePreSel = cms.Sequence(process.hltPhysicsDeclared*process.noScraping*process.primaryVertexFilter)
    
    # BSC activity ---------------------------------------------------------------
    if(useTechTriggerBits) :
        process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
        process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
        process.hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
        # process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('(0 AND 9) AND (40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')
        #process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('0 AND NOT (36 OR 37 OR 38 OR 39)')
        process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('0')
        print "   Adding technical trigger bits: " + str(process.hltLevel1GTSeed.L1SeedsLogicalExpression)
        process.basePreSel = cms.Sequence( process.basePreSel*process.hltLevel1GTSeed )
        
        
    # HB/HE noise filter ----------------------------------------------------
    if(filterHBHEnoise) :
        process.load('CommonTools.RecoAlgos.HBHENoiseFilter_cfi')
        process.HBHENoiseFilter.minIsolatedNoiseSumE = cms.double(999999.)
        process.HBHENoiseFilter.minNumIsolatedNoiseChannels = cms.int32(999999)
        process.HBHENoiseFilter.minIsolatedNoiseSumEt = cms.double(999999.)
        print "    Adding HB/HE noise filter"      
        process.basePreSel = cms.Sequence( process.basePreSel*process.HBHENoiseFilter )
         
    # single lepton inclusive triggers
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel as trigbit_selector
    trigbit_selector.throw = cms.bool(False)
    process.eg_selector = trigbit_selector.clone()    
    process.eg_selector.TriggerResultsTag = cms.InputTag('TriggerResults', '', trigMenu)
    process.eg_selector.andOr=cms.bool(True)
    process.eg_selector.HLTPaths = cms.vstring(egtriglist)
    process.mu_selector = process.eg_selector.clone()
    process.mu_selector.andOr=cms.bool(True)
    process.mu_selector.HLTPaths = cms.vstring(mutriggerlist)
    process.egmu_selector = process.eg_selector.clone()
    process.egmu_selector.HLTPaths.extend( process.mu_selector.HLTPaths)
    process.egmu_selector.andOr=cms.bool(True)
    process.jet_selector = process.eg_selector.clone()
    process.jet_selector.andOr=cms.bool(True)
    process.jet_selector.HLTPaths = cms.vstring(jettriglist)
    
    #trigger sequences 
    if(egmuTriggerFilter=="inclusive_eg") :
        process.inclusive_eg = cms.Sequence( process.eg_selector )        
        process.basePreSel = cms.Sequence( process.inclusive_eg*process.basePreSel )
    elif(egmuTriggerFilter=="exclusive_eg") :
        process.exclusive_eg = cms.Sequence( ~process.mu_selector*process.eg_selector )        
        process.basePreSel = cms.Sequence( process.exclusive_eg*process.basePreSel )
    elif(egmuTriggerFilter=="inclusive_mu") :
        process.inclusive_mu = cms.Sequence( process.mu_selector )
        process.basePreSel = cms.Sequence( process.inclusive_mu*process.basePreSel )
    elif(egmuTriggerFilter=="exclusive_mu") :
        process.exclusive_mu = cms.Sequence( ~process.eg_selector*process.mu_selector )
        process.basePreSel = cms.Sequence( process.exclusive_mu*process.basePreSel )
    elif(egmuTriggerFilter=="inclusive_egmu") :
        process.inclusive_egmu = cms.Sequence( process.egmu_selector )
        process.basePreSel = cms.Sequence( process.inclusive_egmu*process.basePreSel )
    elif(egmuTriggerFilter=="inclusive_jet") :
        process.inclusive_jet = cms.Sequence( process.jet_selector )
        process.basePreSel = cms.Sequence(process.inclusive_jet*process.basePreSel )    
    if(len(egmuTriggerFilter)>0) :
        print '   EG/Mu trigger filter defined as: ' + egmuTriggerFilter

    print "   Data preselection sequence is: " + str(process.basePreSel)
    print "   Note: process.basePreSel has to be added to your main sequence"
if dumpJetSysTrees:
    for syst in jetsystlabels:
        systcutstring = "hasSyst(\"%s\") " % syst
        cats += [("VBFDiJet_%s" % syst, systcutstring, 0)]

cats += [("VBFDiJet", "1", 0)]

cfgTools.addCategories(process.vbfTagDumper,
                       cats,
                       variables=all_variables,
                       histograms=[])
process.vbfTagDumper.nameTemplate = "$PROCESS_$SQRTS_$CLASSNAME_$SUBCAT_$LABEL"
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
if customize.runOnZee:
    if customize.processId == "Data":
        process.hltHighLevel = hltHighLevel.clone(
            HLTPaths=cms.vstring("HLT_Ele27_eta2p1_WPLoose_Gsf_v*"))
        #else:
        #process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Ele27_eta2p1_WP75_Gsf_v*") )
else:
    process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
        "HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*"))

process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag("reducedEgamma",
                                                    "reducedEERecHits")

process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
Ejemplo n.º 44
0
 def getHltFilter(self,process):
     if not hasattr(process,"hltHighLevel"):
         process.hltHighLevel = hltHighLevel.clone()
     return process.hltHighLevel
Ejemplo n.º 45
0
#
# if customize.outputFile:
#     outputFile = customize.outputFile

#customize.parse()
# process.TFileService = cms.Service("TFileService",
#                                    fileName = cms.string("output.root"),
#                                    closeFileFast = cms.untracked.bool(True)
# )

# Require diphoton triggers
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
    "HLT_Diphoton30_22_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90*"  # 2017 Hgg HLT path 
    # "HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*" # 2016 Hgg HLT path
    #"HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90"
    # "HLT_Diphoton30_18_PVrealAND_R9Id_AND_IsoCaloId_AND_HE_R9Id_PixelVeto_Mass55*",
    # "HLT_Diphoton30_18_PVrealAND_R9Id_AND_IsoCaloId_AND_HE_R9Id_NoPixelVeto_Mass55*"
))

process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

# #to check which triggers are present ---remove if not needed
# process.TriggerAnalyzer = cms.EDAnalyzer("MiniAODTriggerAnalyzer",
# bits = cms.InputTag("TriggerResults","","HLT")
# )
# process.TriggerAnalyzerPath = cms.Path(process.TriggerAnalyzer)

#############   Geometry  ###############
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
process.load("Geometry.CaloEventSetup.CaloGeometry_cfi")
Ejemplo n.º 46
0
                             classname=tagName,
                             cutbased=cutstring,
                             subcats=tagCats,
                             variables=currentVariables,
                             histograms=minimalHistograms,
                             binnedOnly=isBinnedOnly,
                             dumpPdfWeights=dumpPdfWeights,
                             nPdfWeights=nPdfWeights,
                             nAlphaSWeights=nAlphaSWeights,
                             nScaleWeights=nScaleWeights)

# Require standard diphoton trigger
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel = hltHighLevel.clone(HLTPaths=cms.vstring(
    "HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90_v*",
    #                                                                "HLT_Diphoton30PV_18PV_R9Id_AND_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1",
    #                                                                "HLT_Diphoton30EB_18EB_R9Id_OR_IsoCaloId_AND_HE_R9Id_DoublePixelVeto_Mass55_v1"
))

process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

# ee bad supercluster filter on data
process.load('RecoMET.METFilters.eeBadScFilter_cfi')
process.eeBadScFilter.EERecHitSource = cms.InputTag(
    "reducedEgamma",
    "reducedEERecHits")  # Saved MicroAOD Collection (data only)
process.dataRequirements = cms.Sequence()
if customize.processId == "Data":
    process.dataRequirements += process.hltHighLevel
    process.dataRequirements += process.eeBadScFilter
Ejemplo n.º 47
0
   fileNames = cms.untracked.vstring( *mylist),
   eventsToProcess = cms.untracked.VEventRange(run_list) 
)


# =============== Other Statements =====================
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(True))
process.GlobalTag.globaltag = 'GR10_P_V12::All' 

# =============== Trigger selection ====================
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

process.whateverHLT = hltHighLevel.clone(
    #HLTPaths = cms.vstring('HLT_HIJet90U'), 
    HLTPaths = cms.vstring('HLT_HIMinBiasHF'),
    andOr = cms.bool(True)
)

from HLTrigger.HLTfilters.hltLevel1GTSeed_cfi import hltLevel1GTSeed
process.whateverL1 = hltLevel1GTSeed.clone(
    L1TechTriggerSeeding = cms.bool(True),
    L1SeedsLogicalExpression = cms.string('35')
    )

#process.eventFilter_step = cms.Path(process.whateverHLT)
#process.eventFilter_step = cms.Path(process.whateverL1)

# =============== Trigger summary =======================
# L1
process.load('L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi')
Ejemplo n.º 48
0
def setModules(process, options):

    #process.sampleInfo = cms.EDProducer("tnp::FlashggSampleInfoTree",
    #                                    )

    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(False)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    from EgammaAnalysis.TnPTreeProducer.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()    

    ###################################################################
    ## ELECTRON MODULES
    ###################################################################
    

    #produces photons for tag+probe                                                                                                                                                       
    process.photonFromDiPhotons = cms.EDProducer("FlashggPhotonFromDiPhotonProducer",
                                                 src = cms.InputTag(options['DIPHOTON_COLL']),
                                                 cut = cms.string(options['PHOTON_CUTS']),
                                                 leadingPreselection = cms.string(options['LEADING_PRESELECTION']),
                                                 subleadingPreselection = cms.string(options['SUBLEADING_PRESELECTION']),
                                                 vertexSelection = cms.int32(-1), # -1 means take the chosen vertex, otherwise use the index to select 2it                                
                                                 #diPhotonMVATag = cms.InputTag("flashggUpdatedIdMVADiPhotons"),                                                                          
                                                 diPhotonMVATag = cms.InputTag("flashggDiPhotonMVA"),
                                                 diphotonMVAThreshold = cms.double(-0.6)
                                                 )

    #produces tag collection from diphotons                                                                                                                                               
    process.goodPhotonTags = cms.EDFilter("FlashggPhotonRefSelector",
                                          src = cms.InputTag("photonFromDiPhotons"),
                                          cut = cms.string(options['PHOTON_TAG_CUTS'])
                                          )


    #produces probe collection from diphotons                                                                                                                                             
    process.goodPhotonProbes = cms.EDFilter("FlashggPhotonRefSelector",
                                            src = cms.InputTag("photonFromDiPhotons"),
                                            cut = cms.string(options['PHOTON_PROBE_CUTS'])
                                            )

    ###################################################################                                                                                                                   
    
#IDMVA for probes                                                                                                                                                                     
    process.goodPhotonProbesIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                   input     = cms.InputTag("goodPhotonProbes"),
                                                   cut       = cms.string(options['PHOTON_PROBE_CUTS']),
                                                   selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                   id_cut    = cms.double(-0.9)
                                                   )
    process.goodPhotonsProbeTnPprobe = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                      filterNames = options['TnPHLTProbeFilters'],
                                                      inputs      = cms.InputTag("goodPhotonProbesIDMVA"),
                                                      bits        = cms.InputTag(options['TRIGGER_RES']),
                                                      objects     = cms.InputTag(options['PAT_TRIG']),
                                                      dR          = cms.double(0.3),
                                                      isAND       = cms.bool(False)
                                                      )
    #numerator for Preselection                                                                                                                                                           
    process.goodPhotonProbesPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap",
                                                          input     = cms.InputTag("goodPhotonsProbeTnPprobe"),
                                                          cut       = cms.string(options['PHOTON_PROBE_CUTS']),
                                                          selection = cms.InputTag("photonFromDiPhotons:preselection"),
                                                          id_cut    = cms.bool(True)
                                                          )
    
    #probes match to l1                                                                                                                                                                   
    process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1CandProducer",
    #process.goodPhotonProbesL1 = cms.EDProducer("FlashggPhotonL1Stage2CandProducer",
                                                inputs = cms.InputTag("goodPhotonProbesPreselection"),
                                                #isoObjects = cms.InputTag("l1extraParticles:Isolated"),
                                                #nonIsoObjects = cms.InputTag("l1extraParticles:NonIsolated"),
                                                #objects = cms.InputTag("hltCaloStage2Digis:EGamma"),
                                                objects = cms.InputTag("caloStage2Digis:EGamma"),
                                                #minET = cms.double(15), #lead eff only
                                                minET = cms.double(10), #sublead eff only
                                                dRmatch = cms.double(0.2), #defined to match L1 online matching to hlt (0.261)
                                                #dRmatchEE = cms.double(0.2), #defined to match L1 online matching to hlt (should probably be tightened for stage2)
                                                isolatedOnly = cms.bool(False)
                                                )

    #numerator passing HLT requiring preselection and L1  
    process.goodPhotonsProbeHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                    filterNames = options['HLTFILTERTOMEASURE'],
                                                    inputs      = cms.InputTag("goodPhotonProbesPreselection"),
                                                    bits        = cms.InputTag(options['TRIGGER_RES']),
                                                    objects     = cms.InputTag(options['PAT_TRIG']),
                                                    dR          = cms.double(0.3),
                                                    isAND       = cms.bool(False)
                                                    )
    
    
    ###################################################################                                                                                                                   
    #IDMVA for tags                                                                                                                                                                       
    process.goodPhotonTagsIDMVA = cms.EDProducer("FlashggPhotonSelectorByDoubleValueMap",
                                                 input     = cms.InputTag("goodPhotonTags"),
                                                 cut       = cms.string(options['PHOTON_TAG_CUTS']),
                                                 selection = cms.InputTag("photonFromDiPhotons:idmva"),
                                                 id_cut    = cms.double(-0.5)
                                                 )
    #preselection for tags                                                                                                                                                                
    process.goodPhotonTagsPreselection = cms.EDProducer("FlashggPhotonSelectorByValueMap",
                                                          input     = cms.InputTag("goodPhotonTagsIDMVA"),
                                                          cut       = cms.string(options['PHOTON_TAG_CUTS']),
                                                          selection = cms.InputTag("photonFromDiPhotons:preselection"),
                                                          id_cut    = cms.bool(True)
                                                          )


    #good match to lead HggFilter tag photons for denominator PRESELECTED                                    
    process.goodPhotonsTagLeadMatch = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                        filterNames = options['TagLeadMatchFilters'],
                                                        inputs      = cms.InputTag("goodPhotonTagsPreselection"),
                                                        bits        = cms.InputTag(options['TRIGGER_RES']),
                                                        objects     = cms.InputTag(options['PAT_TRIG']),
                                                        dR          = cms.double(0.3),
                                                        isAND       = cms.bool(False)
                                                        )
    #good preselected tag photons for denominator                                                                                                                                         
    process.goodPhotonsTagHLT = cms.EDProducer("FlashggPhotonTriggerCandProducer",
                                                  filterNames = options['TnPHLTTagFilters'],
                                                  inputs      = cms.InputTag("goodPhotonsTagLeadMatch"),
                                                  bits        = cms.InputTag(options['TRIGGER_RES']),
                                                  objects     = cms.InputTag(options['PAT_TRIG']),
                                                  dR          = cms.double(0.3),
                                                  isAND       = cms.bool(False)
                                                  )




    ###################################################################                                                                                                                   
    ## PHOTON ISOLATION                                                                                                                                                                   
    ###################################################################            
    process.load("RecoEgamma/PhotonIdentification/PhotonIDValueMapProducer_cfi")
    process.noL1RECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                      decay = cms.string("goodPhotonsTagHLT goodPhotonProbesPreselection"),
                                      #decay = cms.string("goodPhotonsTagHLT goodPhotonsProbeHLT"),
                                      checkCharge = cms.bool(False),
                                      cut = cms.string("40<mass<180"),
                                      )
    
    #efficiency for HLT with L1 requirement in denominator                                                                                                                                
    process.L1RECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                    decay = cms.string("goodPhotonsTagHLT goodPhotonProbesL1"),
                                    checkCharge = cms.bool(False),
                                    cut = cms.string("40<mass<180"),
                                    )
process.RawToDigi.remove(process.castorDigis)
process.RawToDigi.remove(process.scalersRawToDigi)
process.RawToDigi.remove(process.tcdsDigis)
process.RawToDigi.remove(process.totemTriggerRawToDigi)
process.RawToDigi.remove(process.totemRPRawToDigi)
process.RawToDigi.remove(process.ctppsDiamondRawToDigi)
process.RawToDigi.remove(process.ctppsPixelDigis)

process.rawToDigiPath = cms.Path(process.RawToDigi)

#--------------------------------------------------
# Stage2 Unpacker and DQM Path

# Filter fat events
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltFatEventFilter = hltHighLevel.clone()
process.hltFatEventFilter.throw = cms.bool(False)
# HLT_Physics now has the event % 107 filter as well as L1FatEvents
process.hltFatEventFilter.HLTPaths = cms.vstring('HLT_L1FatEvents_v*',
                                                 'HLT_Physics_v*')

# This can be used if HLT filter not available in a run
process.selfFatEventFilter = cms.EDFilter(
    "HLTL1NumberFilter",
    invert=cms.bool(False),
    period=cms.uint32(107),
    rawInput=cms.InputTag("rawDataCollector"),
    fedId=cms.int32(1024))

process.load("DQM.L1TMonitor.L1TStage2_cff")
def setModules(process, options):
    
    process.sampleInfo = cms.EDProducer("tnp::SampleInfoTree",
                                        #vertexCollection = cms.InputTag("offlineSlimmedPrimaryVertices"),
                                        genInfo = cms.InputTag("generator")
                                        )
    
    process.eleVarHelper = cms.EDProducer("PatElectronVariableHelper",
                                          probes = cms.InputTag(options['ELECTRON_COLL']),
                                          vertexCollection = cms.InputTag("offlineSlimmedPrimaryVertices"),
                                          mvaValuesMap = cms.InputTag("electronMVAValueMapProducer:ElectronMVAEstimatorRun2Spring15NonTrig25nsV1Values"),
                                          photonSrc = cms.InputTag("packedPFCandidates"),
                                          packedPFCandidates = cms.InputTag("packedPFCandidates")
                                          )
    
    from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
    process.hltFilter = hltHighLevel.clone()
    process.hltFilter.throw = cms.bool(True)
    process.hltFilter.HLTPaths = options['TnPPATHS']
    
    from PhysicsTools.TagAndProbe.pileupConfiguration_cfi import pileupProducer
    process.pileupReweightingProducer = pileupProducer.clone()
    
###################################################################                                                                               
## ELECTRON MODULES                                                                                                                                    
###################################################################                                    
    
    process.goodElectrons = cms.EDFilter("PATElectronRefSelector",
                                         src = cms.InputTag(options['ELECTRON_COLL']),
                                         cut = cms.string(options['ELECTRON_CUTS'])
                                         )
    
###################################################################                                                                     
## SUPERCLUSTER MODULES                                                     
###################################################################         
    
    process.superClusterCands = cms.EDProducer("ConcreteEcalCandidateProducer",
                                               src = cms.InputTag(options['SUPERCLUSTER_COLL']),
                                               particleType = cms.int32(11),
                                               )
    
    process.goodSuperClusters = cms.EDFilter("RecoEcalCandidateRefSelector",
                                             src = cms.InputTag("superClusterCands"),
                                             cut = cms.string(options['SUPERCLUSTER_CUTS']),
                                             filter = cms.bool(True)
                                             )
    
    process.GsfMatchedSuperClusterCands = cms.EDProducer("ElectronMatchedCandidateProducer",
                                                         src     = cms.InputTag("superClusterCands"),
                                                         ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
                                                         cut = cms.string(options['SUPERCLUSTER_CUTS'])
                                                         )
    
###################################################################
## TRIGGER MATCHING
###################################################################
    
    process.goodElectronsTagHLT = cms.EDProducer("PatElectronTriggerCandProducer",
                                                 filterNames = cms.vstring(options['TnPHLTTagFilters']),
                                                 inputs      = cms.InputTag("goodElectronsTAGCutBasedTight"),
                                                 bits        = cms.InputTag('TriggerResults::HLT'),
                                                 objects     = cms.InputTag('selectedPatTrigger'),
                                                 dR          = cms.double(0.3),
                                                 isAND       = cms.bool(True)
                                                 )
    
    process.goodElectronsProbeHLT = cms.EDProducer("PatElectronTriggerCandProducer",
                                                   filterNames = cms.vstring(options['TnPHLTProbeFilters']),
                                                   inputs      = cms.InputTag("goodElectrons"),
                                                   bits        = cms.InputTag('TriggerResults::HLT'),
                                                   objects     = cms.InputTag('selectedPatTrigger'),
                                                   dR          = cms.double(0.3),
                                                   isAND       = cms.bool(True)
                                                   )
    
    process.goodElectronsProbeMeasureHLT = cms.EDProducer("PatElectronTriggerCandProducer",
                                                          filterNames = cms.vstring(options['TnPHLTProbeFilters']),
                                                          inputs      = cms.InputTag("goodElectrons"),
                                                          bits        = cms.InputTag('TriggerResults::HLT'),
                                                          objects     = cms.InputTag('selectedPatTrigger'),
                                                          dR          = cms.double(0.3),
                                                          isAND       = cms.bool(True)
                                                          )
    
    process.goodElectronsMeasureHLT = cms.EDProducer("PatElectronTriggerCandProducer",
                                                     filterNames = cms.vstring(options['HLTFILTERTOMEASURE']),
                                                     inputs      = cms.InputTag("goodElectronsProbeMeasureHLT"),
                                                     bits        = cms.InputTag('TriggerResults::HLT'),
                                                     objects     = cms.InputTag('selectedPatTrigger'),
                                                     dR          = cms.double(0.3),
                                                     isAND       = cms.bool(False)
                                                     )
    
    process.goodSuperClustersHLT = cms.EDProducer("RecoEcalCandidateTriggerCandProducer",
                                                  filterNames  = cms.vstring(options['TnPHLTProbeFilters']),
                                                  inputs       = cms.InputTag("goodSuperClusters"),
                                                  bits         = cms.InputTag('TriggerResults::HLT'),
                                                  objects      = cms.InputTag('selectedPatTrigger'),
                                                  dR           = cms.double(0.3),
                                                  isAND        = cms.bool(True)
                                                  )
    
###################################################################
## MC MATCHES
###################################################################
    
    process.McMatchHLT = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                        matchPDGId = cms.vint32(11),
                                        src = cms.InputTag("goodElectrons"),
                                        distMin = cms.double(0.3),
                                        matched = cms.InputTag("prunedGenParticles"),
                                        checkCharge = cms.bool(True)
                                        )
    
    process.McMatchSC = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                       matchPDGId = cms.vint32(11),
                                       src = cms.InputTag("goodSuperClusters"),
                                       distMin = cms.double(0.3),
                                       matched = cms.InputTag("prunedGenParticles"),
                                       checkCharge = cms.bool(False)
                                       )
    
    process.McMatchTag = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                        matchPDGId = cms.vint32(11),
                                        src = cms.InputTag("goodElectronsTAGCutBasedTight"),
                                        distMin = cms.double(0.2),
                                        matched = cms.InputTag("prunedGenParticles"),
                                        checkCharge = cms.bool(True)
                                        )
    
    process.McMatchRECO = cms.EDProducer("MCTruthDeltaRMatcherNew",
                                         matchPDGId = cms.vint32(11),
                                         src = cms.InputTag("goodElectrons"),
                                         distMin = cms.double(0.2),
                                         matched = cms.InputTag("prunedGenParticles"),
                                         checkCharge = cms.bool(True)
                                         )
    
###################################################################
## TnP PAIRS
###################################################################
    
    process.tagTightHLT = cms.EDProducer("CandViewShallowCloneCombiner",
                                         decay = cms.string("goodElectronsTagHLT@+ goodElectronsProbeMeasureHLT@-"), 
                                         checkCharge = cms.bool(True),
                                         cut = cms.string("40<mass<1000"),
                                         )
    
    process.tagTightSC = cms.EDProducer("CandViewShallowCloneCombiner",
                                        decay = cms.string("goodElectronsTagHLT goodSuperClustersHLT"), 
                                        checkCharge = cms.bool(False),
                                        cut = cms.string("40<mass<1000"),
                                        )
    
    process.tagTightRECO = cms.EDProducer("CandViewShallowCloneCombiner",
                                          decay = cms.string("goodElectronsTagHLT@+ goodElectronsProbeHLT@-"), 
                                          checkCharge = cms.bool(True),
                                          cut = cms.string("40<mass<1000"),
                                          )
import FWCore.ParameterSet.Config as cms

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

hcalfilter = hltHighLevel.clone(
    TriggerResultsTag = cms.InputTag('TriggerResults'),
    HLTPaths = cms.vstring('user_step' )
    )

hcalfilterSeq = cms.Sequence( hcalfilter )
    process.dqmSaver
)

#--------------------------------------------------
# Standard Unpacking Path

process.load("Configuration.StandardSequences.RawToDigi_Data_cff")    

process.rawToDigiPath = cms.Path(process.RawToDigi)

#--------------------------------------------------
# Stage2 DQM Paths

# Filter fat events
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltFatEventFilter = hltHighLevel.clone()
process.hltFatEventFilter.throw = cms.bool(False)
process.hltFatEventFilter.HLTPaths = cms.vstring('HLT_L1FatEvents_v*')

# This can be used if HLT filter not available in a run
process.selfFatEventFilter = cms.EDFilter("HLTL1NumberFilter",
        invert = cms.bool(False),
        period = cms.uint32(107),
        rawInput = cms.InputTag("rawDataCollector"),
        fedId = cms.int32(1024)
        )

process.load("DQM.L1TMonitor.L1TStage2Emulator_cff")

process.l1tEmulatorMonitorPath = cms.Path(
    process.hltFatEventFilter +
Ejemplo n.º 53
0
from RecoTauTag.Configuration.RecoPFTauTag_cff import *

'''

Tag and probe tau ntuple production for Heavy Flavor QCD fake rate studies

Author: Evan Friis, UC Davis ([email protected])

Strategy: Unbias trigger selection by requiring an HLT moun, matched to a
global muon, with pt > 15

'''

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel

jetTrigger = hltHighLevel.clone()
jetTrigger.HLTPaths = cms.vstring('HLT_L1Jet15')

# Simple selection on the potential probe taus
# No PFTauRef dictionary??
#probeTauJets = cms.EDProducer("PFTauRefSelector",
#      src = cms.InputTag('shrinkingConePFTauProducer'),
#      cut = cms.string('abs(eta) < 2.5 && pfTauTagInfoRef().pfjetRef().pt() > 5.0')
#)

# Kinematically select taus
probeTauJets = cms.EDProducer("CandViewRefSelector",
      src = cms.InputTag('shrinkingConePFTauProducer'),
      cut = cms.string('abs(eta) < 2.5 && pt() > 5')
)
process.RawToDigi.remove(process.scalersRawToDigi)
process.RawToDigi.remove(process.tcdsDigis)
process.RawToDigi.remove(process.totemTriggerRawToDigi)
process.RawToDigi.remove(process.totemRPRawToDigi)
process.RawToDigi.remove(process.ctppsDiamondRawToDigi)
process.RawToDigi.remove(process.ctppsPixelDigis)

process.rawToDigiPath = cms.Path(process.RawToDigi)

#--------------------------------------------------
# Stage2 Unpacker and DQM Path

# Filter fat events
from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltFatEventFilter = hltHighLevel.clone(
    throw=False,
    # HLT_Physics now has the event % 107 filter as well as L1FatEvents
    HLTPaths=['HLT_L1FatEvents_v*', 'HLT_Physics_v*'])

# This can be used if HLT filter not available in a run
process.selfFatEventFilter = cms.EDFilter(
    "HLTL1NumberFilter",
    invert=cms.bool(False),
    period=cms.uint32(107),
    rawInput=cms.InputTag("rawDataCollector"),
    fedId=cms.int32(1024))

process.load("DQM.L1TMonitor.L1TStage2_cff")

process.l1tMonitorPath = cms.Path(process.l1tStage2OnlineDQM +
                                  process.hltFatEventFilter +
                                  #    process.selfFatEventFilter +
Ejemplo n.º 55
0
 def getHltFilter(self, process):
     if not hasattr(process, "hltHighLevel"):
         process.hltHighLevel = hltHighLevel.clone()
     return process.hltHighLevel
                       variables  = all_variables,
                       histograms = []
)

print cats


#process.vbfTagDumper.nameTemplate ="$PROCESS_$SQRTS_$LABEL_$SUBCAT_$CLASSNAME"
process.vbfTagDumper.nameTemplate = "$PROCESS_$SQRTS_$CLASSNAME_$SUBCAT_$LABEL"

customize.setDefault("maxEvents" , -1     ) # max-number of events
customize.setDefault("targetLumi", 1.00e+3  ) # define integrated lumi
customize(process)

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.hltHighLevel = hltHighLevel.clone(HLTPaths = cms.vstring("HLT_Diphoton30_18_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass95_v1") )
process.options      = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )

process.hltRequirement = cms.Sequence()
if customize.processId == "Data" and requireTriggerOnData:
        process.hltRequirement += process.hltHighLevel

if doSystematics:
    process.p1 = cms.Path(
        process.hltRequirement*
        process.flashggDiPhotonSystematics*
        (process.flashggUnpackedJets*process.jetSystematicsSequence)*
        (process.flashggTagSequence+process.systematicsTagSequences)*
        process.flashggVBFTagMerger*
        process.vbfTagDumper
        )
Ejemplo n.º 57
0
import os, sys
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process, add_analyzer

#process.MessageLogger.cerr.FwkReport.reportEvery = 1
process.maxEvents.input = 100
process.source.fileNames = ['file:pat.root']
process.TFileService.fileName = 'resolutions_histos.root'

########################################################################

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.goodDataFilter = hltHighLevel.clone()
process.goodDataFilter.TriggerResultsTag = cms.InputTag('TriggerResults', '', 'PAT')
process.goodDataFilter.HLTPaths = ['eventCleaningAll'] # can set to just 'goodOfflinePrimaryVertices', for example
process.goodDataFilter.andOr = False # = AND

process.triggerFilter = hltHighLevel.clone()
process.triggerFilter.HLTPaths = ['HLT_QuadJet50_v*']
process.triggerFilter.andOr = True # = OR

########################################################################

process.load('JMTucker.Tools.ResolutionsHistogrammer_cfi')

for x in ['WithTrigger']:
    setattr(process, 'histos' + x, process.histos.clone())

########################################################################

process.p0 = cms.Path(                        process.histos)
process.p1 = cms.Path(process.triggerFilter * process.histosWithTrigger)
Ejemplo n.º 58
0
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process

process.source.fileNames = '''/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_1_1_X2h.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_2_2_vbl.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_3_2_yEE.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_4_1_vkj.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_5_3_Tce.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_6_1_a0t.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_7_2_Qv8.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_8_1_3WZ.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_9_1_ANl.root
/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_10_1_VPN.root'''.split('\n')
process.TFileService.fileName = 'cosmic_muons.root'

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
process.triggerFilter = hltHighLevel.clone()
process.triggerFilter.HLTPaths = ['HLT_QuadJet50_v*']
process.triggerFilter.andOr = True # = OR

process.CosmicMuons = cms.EDAnalyzer('CosmicMuons',
                                     track_src = cms.InputTag('globalCosmicMuons'),
                                     primary_vertex_src = cms.InputTag('goodOfflinePrimaryVertices'),
                                     beamspot_src = cms.InputTag('offlineBeamSpot'),
                                     general_track_src = cms.InputTag('generalTracks'),
                                     gen_particle_src = cms.InputTag('genParticles'),
                                     min_pt = cms.double(1),
                                     max_eta = cms.double(2.4),
                                     min_npxhits = cms.int32(1),
                                     min_nsthits = cms.int32(6),
                                     min_nmuhits = cms.int32(2),
                                     min_dxy = cms.double(0.01),
process.GlobalTag.globaltag = 'START44_V7::All'

process.source = cms.Source(
    "PoolSource",
    fileNames=cms.untracked.vstring(
        #'file:patTuple.root'
        'file:tupleMC.root'))

process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(5000))
process.options = cms.untracked.PSet(wantSummary=cms.untracked.bool(True))

process.TFileService = cms.Service('TFileService',
                                   fileName=cms.string('plots_simple.root'))

from HLTrigger.HLTfilters.hltHighLevel_cfi import hltHighLevel
reskim = hltHighLevel.clone(
    TriggerResultsTag=cms.InputTag('TriggerResults', '', ''))
process.recoMu = reskim.clone(HLTPaths=['skim_RecoMu'], )
process.bscMinBias = hltHighLevel.clone(
    HLTPaths=['HLT_L1_BscMinBiasOR_BptxPlusORMinus'], )

## Common plots
loose_cut = 'isGlobalMuon  '

## trigger_match = '(' \
##                 ' triggerMatchesByPath("HLT_Mu9").at(0).pt() > 15) || ' \
##                 '!triggerObjectMatchesByPath("HLT_Mu15_v1").empty()' \
##                 ')'

trigger_match = ' '

my_cut = ' && isTrackerMuon ' \