def addMetFilterFlags(process, options):
    # https://twiki.cern.ch/twiki/bin/view/CMS/MissingETOptionalFilters
    from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter
    from RecoMET.METFilters.hcalLaserEventFilter_cfi import hcalLaserEventFilter
    from RecoMET.METFilters.inconsistentMuonPFCandidateFilter_cfi import inconsistentMuonPFCandidateFilter
    from RecoMET.METFilters.greedyMuonPFCandidateFilter_cfi import greedyMuonPFCandidateFilter
    from RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi import EcalDeadCellTriggerPrimitiveFilter
    from RecoMET.METFilters.EcalDeadCellBoundaryEnergyFilter_cfi import EcalDeadCellBoundaryEnergyFilter
    from RecoMET.METFilters.eeBadScFilter_cfi import eeBadScFilter

    process.trackingFailureFilterFlag = trackingFailureFilter.clone(
        taggingMode=True)  #, quiet = True)
    process.hcalLaserEventFilterFlag = hcalLaserEventFilter.clone(
        taggingMode=True, vetoByRunEventNumber=False, vetoByHBHEOccupancy=True)
    process.greedyMuonPFCandidateFilterFlag = greedyMuonPFCandidateFilter.clone(
        taggingMode=True)
    process.inconsistentMuonPFCandidateFilterFlag = inconsistentMuonPFCandidateFilter.clone(
        taggingMode=True)
    process.ecalDeadCellTPFilterFlag = EcalDeadCellTriggerPrimitiveFilter.clone(
        taggingMode=True)
    process.ecalDeadCellBEFilterFlag = EcalDeadCellBoundaryEnergyFilter.clone(
        taggingMode=True,
        cutBoundEnergyDeadCellsEB=10.0,
        cutBoundEnergyDeadCellsEE=10.0,
        cutBoundEnergyGapEB=100.0,
        cutBoundEnergyGapEE=100.0,
        enableGap=False,
        limitDeadCellToChannelStatusEB=cms.vint32(12, 14),
        limitDeadCellToChannelStatusEE=cms.vint32(12, 14))
    process.eeBadScFilterFlag = eeBadScFilter.clone(taggingMode=True)

    process.goodVertices = cms.EDFilter(
        "VertexSelector",
        filter=cms.bool(False),
        src=cms.InputTag("offlinePrimaryVertices"),
        cut=cms.string(
            "!isFake && ndof > 4 && abs(z) <= 24 && position.rho < 2"))

    return cms.Path(
        process.goodVertices * process.trackingFailureFilterFlag *
        process.hcalLaserEventFilterFlag *
        process.greedyMuonPFCandidateFilterFlag *
        process.inconsistentMuonPFCandidateFilterFlag *
        process.ecalDeadCellTPFilterFlag * process.eeBadScFilterFlag
        # * process.ecalDeadCellBEFilterFlag # product not found : EcalRecHitsEB
    )
    def MetFilterFlags(self) :
        # https://twiki.cern.ch/twiki/bin/view/CMS/MissingETOptionalFilters
        from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter
        from RecoMET.METFilters.hcalLaserEventFilter_cfi import hcalLaserEventFilter
        from RecoMET.METFilters.inconsistentMuonPFCandidateFilter_cfi import inconsistentMuonPFCandidateFilter
        from RecoMET.METFilters.greedyMuonPFCandidateFilter_cfi import greedyMuonPFCandidateFilter
        from RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi import EcalDeadCellTriggerPrimitiveFilter
        from RecoMET.METFilters.EcalDeadCellBoundaryEnergyFilter_cfi import EcalDeadCellBoundaryEnergyFilter
        from RecoMET.METFilters.eeBadScFilter_cfi import eeBadScFilter
        from RecoMET.METFilters.ecalLaserCorrFilter_cfi import ecalLaserCorrFilter

        self.process.goodVertices = cms.EDFilter("VertexSelector",
                                                 filter = cms.bool(False),
                                                 src = cms.InputTag("offlinePrimaryVertices"),
                                                 cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.rho < 2")
        )

        self.process.trackingFailureFilterFlag = trackingFailureFilter.clone(taggingMode = True)#, quiet = True)
        self.process.hcalLaserEventFilterFlag = hcalLaserEventFilter.clone(taggingMode = True)
        self.process.greedyMuonPFCandidateFilterFlag = greedyMuonPFCandidateFilter.clone(taggingMode = True)
        self.process.inconsistentMuonPFCandidateFilterFlag = inconsistentMuonPFCandidateFilter.clone(taggingMode = True)
        self.process.ecalDeadCellTPFilterFlag = EcalDeadCellTriggerPrimitiveFilter.clone(taggingMode = True)
        self.process.ecalDeadCellBEFilterFlag = EcalDeadCellBoundaryEnergyFilter.clone(taggingMode = True,
                                                                              cutBoundEnergyDeadCellsEB = 10.0,
                                                                              cutBoundEnergyDeadCellsEE = 10.0,
                                                                              cutBoundEnergyGapEB = 100.0,
                                                                              cutBoundEnergyGapEE = 100.0,
                                                                              enableGap = False,
                                                                              limitDeadCellToChannelStatusEB = cms.vint32(12,14),
                                                                              limitDeadCellToChannelStatusEE = cms.vint32(12,14))
        self.process.eeBadScFilterFlag = eeBadScFilter.clone(taggingMode = True)
        self.process.ecalLaserCorrFilterFlag = ecalLaserCorrFilter.clone(taggingMode = True)

        return (cms.Sequence( self.process.goodVertices *
                     self.process.trackingFailureFilterFlag *
                     self.process.hcalLaserEventFilterFlag *
                     self.process.greedyMuonPFCandidateFilterFlag *
                     self.process.inconsistentMuonPFCandidateFilterFlag *
                     self.process.ecalDeadCellTPFilterFlag *
                     self.process.ecalDeadCellBEFilterFlag *
                     self.process.eeBadScFilterFlag *
                     self.process.ecalLaserCorrFilterFlag
                     ))
def addMetFilterFlags(process, options) :
    # https://twiki.cern.ch/twiki/bin/view/CMS/MissingETOptionalFilters
    from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter
    from RecoMET.METFilters.hcalLaserEventFilter_cfi import hcalLaserEventFilter
    from RecoMET.METFilters.inconsistentMuonPFCandidateFilter_cfi import inconsistentMuonPFCandidateFilter
    from RecoMET.METFilters.greedyMuonPFCandidateFilter_cfi import greedyMuonPFCandidateFilter
    from RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi import EcalDeadCellTriggerPrimitiveFilter
    from RecoMET.METFilters.EcalDeadCellBoundaryEnergyFilter_cfi import EcalDeadCellBoundaryEnergyFilter
    from RecoMET.METFilters.eeBadScFilter_cfi import eeBadScFilter

    process.trackingFailureFilterFlag = trackingFailureFilter.clone(taggingMode = True)#, quiet = True)
    process.hcalLaserEventFilterFlag = hcalLaserEventFilter.clone(taggingMode = True,
                                                                  vetoByRunEventNumber=False,
                                                                  vetoByHBHEOccupancy=True)
    process.greedyMuonPFCandidateFilterFlag = greedyMuonPFCandidateFilter.clone(taggingMode = True)
    process.inconsistentMuonPFCandidateFilterFlag = inconsistentMuonPFCandidateFilter.clone(taggingMode = True)
    process.ecalDeadCellTPFilterFlag = EcalDeadCellTriggerPrimitiveFilter.clone(taggingMode = True)
    process.ecalDeadCellBEFilterFlag = EcalDeadCellBoundaryEnergyFilter.clone(taggingMode = True,
                                                                              cutBoundEnergyDeadCellsEB = 10.0,
                                                                              cutBoundEnergyDeadCellsEE = 10.0,
                                                                              cutBoundEnergyGapEB = 100.0,
                                                                              cutBoundEnergyGapEE = 100.0,
                                                                              enableGap = False,
                                                                              limitDeadCellToChannelStatusEB = cms.vint32(12,14),
                                                                              limitDeadCellToChannelStatusEE = cms.vint32(12,14))
    process.eeBadScFilterFlag = eeBadScFilter.clone(taggingMode = True)

    process.goodVertices = cms.EDFilter("VertexSelector",
                                        filter = cms.bool(False),
                                        src = cms.InputTag("offlinePrimaryVertices"),
                                        cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.rho < 2"))

    return cms.Path( process.goodVertices *
                     process.trackingFailureFilterFlag *
                     process.hcalLaserEventFilterFlag *
                     process.greedyMuonPFCandidateFilterFlag *
                     process.inconsistentMuonPFCandidateFilterFlag *
                     process.ecalDeadCellTPFilterFlag *
                     process.eeBadScFilterFlag
                     # * process.ecalDeadCellBEFilterFlag # product not found : EcalRecHitsEB
                     )
                 'AK7', 'PFCorr',
                 doJTA        = True,
                 doBTagging   = False,
                 jetCorrLabel = ('AK7PF', cms.vstring(['L1FastJet','L2Relative','L3Absolute','L2L3Residual'])),
                 doType1MET   = True,
                 doL1Cleaning = True,
                 doL1Counters = False,
                 genJetCollection=cms.InputTag("ak7GenJets"),
                 doJetID      = True,
                 jetIdLabel   = "ak7"
                 )


# -------- The Tracking failure filter ------#
from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter
process.trackingFailureFilter = trackingFailureFilter.clone()
process.trackingFailureFilter.VertexSource = cms.InputTag('goodOfflinePrimaryVertices')


################### EDAnalyzer ##############################3
process.ak5ak7 = cms.EDAnalyzer('OpenDataTreeProducer',
    ## jet collections ###########################
    pfak7jets       = cms.InputTag('selectedPatJetsAK7PFCorr'),
    pfak5jets       = cms.InputTag('selectedPatJetsAK5PFCorr'),
    ## MET collection ####
    pfmet           = cms.InputTag('pfMET7'),
    ## database entry for the uncertainties ######
    PFPayloadName   = cms.string('AK7PF'),

    ## set the conditions for good Vtx counting ##
    offlineVertices = cms.InputTag('goodOfflinePrimaryVertices'),
Exemple #5
0
from RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi import EcalDeadCellTriggerPrimitiveFilter
process.EcalDeadCellTriggerPrimitiveFilter = EcalDeadCellTriggerPrimitiveFilter.clone(
)
process.EcalDeadCellTriggerPrimitiveFilter.tpDigiCollection = cms.InputTag(
    "ecalTPSkimNA")
process.EcalDeadCellTriggerPrimitiveFilter.taggingMode = cms.bool(True)
#-------- The EE bad SuperCrystal filter -------#
from RecoMET.METFilters.eeBadScFilter_cfi import eeBadScFilter
process.eeBadScFilter = eeBadScFilter.clone()
process.eeBadScFilter.taggingMode = cms.bool(True)
# ------- The  Halo Filter ----------------- #
from RecoMET.METFilters.CSCTightHaloFilter_cfi import CSCTightHaloFilter
process.CSCBasedHaloFilter = CSCTightHaloFilter.clone()
# -------- The Tracking failure filter ------#
from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter
process.trackingFailureFilter = trackingFailureFilter.clone()
process.trackingFailureFilter.VertexSource = cms.InputTag(
    'goodOfflinePrimaryVertices')
# --------------- The scrapping filter ------------#
process.scrapingVeto = cms.EDFilter("FilterOutScraping",
                                    applyfilter=cms.untracked.bool(True),
                                    debugOn=cms.untracked.bool(False),
                                    numtrack=cms.untracked.uint32(10),
                                    thresh=cms.untracked.double(0.25))

################### declaring the EDAnalyzer ##############################3

process.ak7 = cms.EDAnalyzer(
    'ProcessedTreeProducer',
    ## jet collections ###########################
    pfjets=cms.InputTag('selectedPatJetsAK7PFCorr'),