'/store/user/lpcsusyhad/53X_ntuples/ZJetsToNuNu_400_HT_inf_ext_TuneZ2Star_8TeV_madgraph_Summer12/dhare/ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph_ext/Summer12_DR53X-PU_S10_V7A-v1_NOCUTS_12Oct2012V3/b9d339f81100b66394e7e5c0a998fe80/susypat_9_1_gtL.root',
        '/store/user/lpcsusyhad/53X_ntuples/ZJetsToNuNu_400_HT_inf_ext_TuneZ2Star_8TeV_madgraph_Summer12/dhare/ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph_ext/Summer12_DR53X-PU_S10_V7A-v1_NOCUTS_12Oct2012V3/b9d339f81100b66394e7e5c0a998fe80/susypat_99_1_MVz.root',
        '/store/user/lpcsusyhad/53X_ntuples/ZJetsToNuNu_400_HT_inf_ext_TuneZ2Star_8TeV_madgraph_Summer12/dhare/ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph_ext/Summer12_DR53X-PU_S10_V7A-v1_NOCUTS_12Oct2012V3/b9d339f81100b66394e7e5c0a998fe80/susypat_999_1_zY9.root',
        '/store/user/lpcsusyhad/53X_ntuples/ZJetsToNuNu_400_HT_inf_ext_TuneZ2Star_8TeV_madgraph_Summer12/dhare/ZJetsToNuNu_400_HT_inf_TuneZ2Star_8TeV_madgraph_ext/Summer12_DR53X-PU_S10_V7A-v1_NOCUTS_12Oct2012V3/b9d339f81100b66394e7e5c0a998fe80/susypat_985_1_8cs.root',
    )
)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000) )
process.source.skipEvents = cms.untracked.uint32(0)
process.GlobalTag.globaltag = "START53_V7F::All"
#========================= analysis module =====================================

scaleF = 6.26*10*1000/5105710.
from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
process.eventWeight = weightProducer.clone(
    weight = cms.double(scaleF),
)
from RA2Classic.WeightProducer.puWeightProducer_cfi import puWeightProducer
process.puWeight = puWeightProducer.clone(
    weight = cms.double(1.0),
)
from ZInvisibleBkgds.Photons.treemaker_cfi import zvvTree
process.analysis = zvvTree.clone(
#    Debug           = cms.bool(False),
    ScaleFactor     = cms.double(scaleF),

    metSource       = cms.InputTag("patMETsPF"),

    runTopTagger           = cms.bool(True),
    looseTopTaggerSource   = cms.string("zInvTopTagger5Loose"),
    nominalTopTaggerSource = cms.string("zInvTopTagger5M"),
def makeTreeFromSignalScan(process,
                           globalTag,
                           smsModel,
                           smsMotherMass,
                           smsLSPMass,
                           SMStopol,
                           xs=1,
                           numEvtsInSample=1,
                           lumi=5.088,
                           reportEveryEvt=5000,
                           testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root",
                           numProcessedEvt=20):
    

    #-- Meta data to be logged in DBS ---------------------------------------------
    process.configurationMetadata = cms.untracked.PSet(
        version = cms.untracked.string('$Revision: 1.1 $'),
        name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $'),
        annotation = cms.untracked.string('SUSY pattuple definition')
        )


    #-- Message Logger ------------------------------------------------------------
    process.MessageLogger.categories.append('PATSummaryTables')
    process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet(
        limit = cms.untracked.int32(-1),
        reportEvery = cms.untracked.int32(1)
        )
    process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt


    #-- Input Source --------------------------------------------------------------
    process.maxEvents.input = numProcessedEvt
    process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck')
    process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName))


    #-- SUSYPAT specifics ---------------------------------------------------------
    from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands

    hltMenu = 'REDIGI'

    theJetColls = ['AK5PF']

    jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute']

    process.GlobalTag.globaltag = globalTag

    addDefaultSUSYPAT(process,
                      mcInfo=True,
                      HLTMenu=hltMenu,
                      jetMetCorrections=jetMetCorr,
                      mcVersion='',
                      theJetNames=theJetColls,
                      doSusyTopProjection=False)

    # Remove the PAT cleaning and filtering sequences
    process.patDefaultSequence.remove(process.selectedPatCandidates)
    process.patDefaultSequence.remove(process.cleanPatCandidates)
    process.patDefaultSequence.remove(process.countPatCandidates)
    
    # Disable embedment so that lepton cleaning method works
    process.patJetsAK5PF.embedCaloTowers = False
    process.patJetsAK5PF.embedPFCandidates = False
    process.patJetsPF.embedCaloTowers = False
    process.patJetsPF.embedPFCandidates = False 
    
    #-- Adjust collections to use PFNoPU jets -------------------------------------
    
    # do not use Z-mass window for PU subtraction
    # such that JEC works properly
    process.pfPileUpPF.checkClosestZVertex = cms.bool(False)
    
    # do not remove muons and electrons from the jet clustering input
    # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections)
    process.pfIsolatedElectronsPF.isolationCut = -1
    process.pfIsolatedMuonsPF.isolationCut = -1

    # make loose clones of the original electron collection
    process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone()
    process.pfRelaxedElectronsPF.isolationCut = 9999
    process.pfElectronsFromVertexPF.dzCut = 9999.0
    process.pfElectronsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedElectronsPF.cut = ""
    process.patElectronsPF.pfElectronSource  = "pfRelaxedElectronsPF"
    process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF,
                                         process.pfIsolatedElectronsPF + 
                                         process.pfRelaxedElectronsPF)
    
    # make loose clones of the original muon collection
    process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone()
    process.pfRelaxedMuonsPF.isolationCut = 9999
    process.pfMuonsFromVertexPF.dzCut = 9999.0
    process.pfMuonsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedMuonsPF.cut = ""
    process.patMuonsPF.pfMuonSource  = "pfRelaxedMuonsPF"
    process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF,
                                     process.pfIsolatedMuonsPF + 
                                     process.pfRelaxedMuonsPF)
    

    # do not remove taus from the jet collection
    process.pfTausPF.discriminators = cms.VPSet()
    process.pfUnclusteredTausPF = process.pfTausPF.clone(
        cut = cms.string("pt < 0")
    )
    process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF)
    process.pfNoTauPF.topCollection = "pfUnclusteredTausPF"
    #------------------------------------------------------------------------------

    #-- Overwrite default output content ------------------------------------------
    from SandBox.Skims.RA2Content_cff import getRA2PATOutput
    process.out.outputCommands = getRA2PATOutput(process)
    process.out.dropMetaData = cms.untracked.string('DROPPED')
    

    #-- RA2 filtering -------------------------------------------------------------
    process.prefilterCounter        = cms.EDProducer("EventCountProducer")
    process.postStdCleaningCounter  = cms.EDProducer("EventCountProducer")
    process.postPostCleaningCounter = cms.EDProducer("EventCountProducer")
    process.postPFchsJetsCounter    = cms.EDProducer("EventCountProducer")
    process.postPFchsHTCounter      = cms.EDProducer("EventCountProducer")
    process.postPFchsMHTCounter     = cms.EDProducer("EventCountProducer")

    process.load('SandBox.Skims.RA2Objects_cff')
    process.load('SandBox.Skims.RA2Selection_cff')
    process.load('SandBox.Skims.RA2Cleaning_cff')

    # Adjust object filters for signal-scan values
    process.htPFchsFilter.MinHT               = cms.double(300.0)
    process.mhtPFchsFilter.MinMHT             = cms.double(100.0)
    process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2)

    ## please comment this block to remove tagging mode of
    ##filters and reject events failing any of following filters
    process.eeNoiseFilter.taggingMode         = False
    process.trackingFailureFilter.taggingMode = False
    process.beamHaloFilter.taggingMode        = False
    process.ra2NoiseCleaning.remove(process.HBHENoiseFilter)
    process.inconsistentMuons.taggingMode     = False
    process.greedyMuons.taggingMode           = False
    process.ra2EcalTPFilter.taggingMode       = False
    process.ra2EcalBEFilter.taggingMode       = False
    process.hcalLaserEventFilter.taggingMode  = False
    process.eeBadScFilter.taggingMode         = False

    process.load("SandBox.Skims.provInfoMuons_cfi")
    process.load("SandBox.Skims.provInfoElectrons_cfi")

    process.cleanpatseq = cms.Sequence(
        process.susyPatDefaultSequence *
        process.prefilterCounter *
        process.ra2StdCleaning *
        process.postStdCleaningCounter *
        process.ra2Objects *
        process.provInfoMuons *
        process.provInfoElectrons *
        process.ra2PostCleaning *
        process.postPostCleaningCounter
        )


    ## --- Setup WeightProducer --------------------------------------------
    from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
    process.WeightProducer = weightProducer.clone(
        weight     = cms.double(-1.0),
        Method     = cms.string("Constant"),
        XS         = cms.double(xs),
        NumberEvts = cms.double(numEvtsInSample),
        Lumi       = cms.double(lumi),
        LumiScale  = cms.double(1.0),
        FileNamePUDataDistribution = cms.string("NONE"),
        PU         = cms.int32(0)
        )


    ## --- SMS Model Filter ------------------------------------------------
    # Filter files for specified signal point out of dataset
    # Code from UserCode/seema/SusyAnalysis/AnalysisUtils
    from SusyAnalysis.AnalysisUtils.smsModelFilter_cfi import smsModelFilter
    process.SMSModelFilter = smsModelFilter.clone(
        SusyScanTopology   = cms.string(smsModel),
        SusyScanMotherMass = cms.double(smsMotherMass),
        SusyScanLSPMass    = cms.double(smsLSPMass),
        SusyScanFracLSP    = cms.double(0.0)
        )
    
    
    #---JL
    #--for PDF sys
    process.pdfWeight = cms.EDProducer("PdfWeightProducer",
                                       PdfInfoTag = cms.untracked.InputTag("generator"),
                                       PdfSetNames = cms.untracked.vstring("cteq66.LHgrid","MSTW2008nlo68cl.LHgrid","NNPDF20_100.LHgrid")
                                       #PdfSetNames = cms.untracked.vstring("NNPDF20_100.LHgrid")
                                       )
    #---for ISR sys
    process.lastParticles = cms.EDProducer("ISRProducer")
    process.ISRsys = cms.Sequence(process.lastParticles)
    
    #---put the susy params
    process.load("RA2Classic.SUSYParams.susyparams_cfi")
    process.susyparams.Model = cms.string(SMStopol)
    #-- end JL

    ## --- Setup of TreeMaker ----------------------------------------------
    process.TFileService = cms.Service(
        "TFileService",
        fileName = cms.string("RA2Selection.root")
        )

    from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker
    process.RA2TreeMaker = TreeMaker.clone(
        TreeName          = cms.string("RA2PreSelection"),
        VertexCollection  = cms.InputTag('goodVertices'),
        HT                = cms.InputTag('htPFchs'),
        HTJets            = cms.InputTag('patJetsPFchsPt50Eta25'),
        MHT               = cms.InputTag('mhtPFchs'),
        MHTJets           = cms.InputTag('patJetsPFchsPt30'),
        VarsDouble        = cms.VInputTag(cms.InputTag('WeightProducer:weight'),"susyparams:m0","susyparams:m12","susyparams:evtProcID"),
        VarsDoubleNamesInTree = cms.vstring('Weight',"massMom","massDau","procID"),
        CandidateCollections  = cms.VInputTag('patJetsPFchsPt30','patMuonsPFIDIso','patElectronsIDIso'),
        CandidateNamesInTree  = cms.vstring('Jets','PATMuonsPFIDIso','PATElectronsIDIso'),
        VarsDoubleV = cms.VInputTag("pdfWeight:cteq66","pdfWeight:MSTW2008nlo68cl","pdfWeight:NNPDF20"),
        VarsDoubleNamesInTreeV = cms.vstring("cteq66","MSTW2008nlo68cl","NNPDF20")
        )

    #process.dump   = cms.EDAnalyzer("EventContentAnalyzer")

    process.ppfchs = cms.Path(
        process.SMSModelFilter *
        process.cleanpatseq *
        process.countJetsPFchsPt50Eta25 *
        process.postPFchsJetsCounter *
        process.htPFchsFilter *
        process.postPFchsHTCounter *
        process.mhtPFchsFilter *
        process.postPFchsMHTCounter *
        process.WeightProducer *
        #--JL
        process.pdfWeight*
        process.ISRsys*
        process.susyparams*
        #--end JL
        process.RA2TreeMaker
        )

    process.schedule = cms.Schedule(process.ppfchs)
        '/store/user/lpcsusyhad/53X_ntuples/PhotonHad_Run2012B_13Jul2012_v1_lpc1/seema/PhotonHad/PhotonHad_Run2012B-13Jul2012-v1_NoHepTopTagger_NOCUTS_HLTPhoton70Inc_12Oct2012V3/99a0a4592ef1c8847e1b2c860def8e8c/susypat_99_1_eMs.root',
        '/store/user/lpcsusyhad/53X_ntuples/PhotonHad_Run2012B_13Jul2012_v1_lpc1/seema/PhotonHad/PhotonHad_Run2012B-13Jul2012-v1_NoHepTopTagger_NOCUTS_HLTPhoton70Inc_12Oct2012V3/99a0a4592ef1c8847e1b2c860def8e8c/susypat_999_1_nry.root',
        '/store/user/lpcsusyhad/53X_ntuples/PhotonHad_Run2012B_13Jul2012_v1_lpc1/seema/PhotonHad/PhotonHad_Run2012B-13Jul2012-v1_NoHepTopTagger_NOCUTS_HLTPhoton70Inc_12Oct2012V3/99a0a4592ef1c8847e1b2c860def8e8c/susypat_998_1_nuM.root',
        '/store/user/lpcsusyhad/53X_ntuples/PhotonHad_Run2012B_13Jul2012_v1_lpc1/seema/PhotonHad/PhotonHad_Run2012B-13Jul2012-v1_NoHepTopTagger_NOCUTS_HLTPhoton70Inc_12Oct2012V3/99a0a4592ef1c8847e1b2c860def8e8c/susypat_997_1_g94.root',
        '/store/user/lpcsusyhad/53X_ntuples/PhotonHad_Run2012B_13Jul2012_v1_lpc1/seema/PhotonHad/PhotonHad_Run2012B-13Jul2012-v1_NoHepTopTagger_NOCUTS_HLTPhoton70Inc_12Oct2012V3/99a0a4592ef1c8847e1b2c860def8e8c/susypat_996_1_Uhb.root',
    )
)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(5000) )
process.source.skipEvents = cms.untracked.uint32(0)
#========================= analysis module =====================================

scaleF = 1.
from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
process.eventWeight = weightProducer.clone(
    weight = cms.double(1.0),
)
from RA2Classic.WeightProducer.puWeightProducer_cfi import puWeightProducer
process.puWeight = puWeightProducer.clone(
    weight = cms.double(1.0),
)
from ZInvisibleBkgds.Photons.treemaker_cfi import photonTree
process.analysisID = photonTree.clone(
    Debug           = cms.bool(False),
    Data            = cms.bool(True),
    ScaleFactor     = cms.double(scaleF),
    DoPUReweight    = cms.bool(False),

    metSource          = cms.InputTag("pfType1MetNoPhotonID","pfcand"),

    runTopTagger           = cms.bool(True),
# $Id: $
#
# Example: stores a double variable 'puWeightProducer:weight' in the event
# which can be used to reweight the sample according to the
# specified pile-up scenario.

import FWCore.ParameterSet.Config as cms

from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer

puWeightProducer = weightProducer.clone(
    # Data PU distribution. If a file name is specified,
    # a multiplicative PU weight factor is applied.
    FileNamePUDataDistribution=cms.string(
        "RA2Classic/AdditionalInputFiles/DataPileupHistogram_RA2Summer12_190456-196531_8TeV_PromptReco_WOLowPU.root"
    ),
    ## use this for different PU distributions 0 Flat10 PU; 1 for Fall11; 2 for Summer12
    PU=cms.int32(2),
)
Beispiel #5
0
    SusyScanLSPMass=cms.double(smsLSPMass),
    SusyScanFracLSP=cms.double(0.0))

###############################################################################
##
## WEIGHT PRODUCER
##
###############################################################################

## --- Setup WeightProducer --------------------------------------------
from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
process.WeightProducer = weightProducer.clone(
    weight=cms.double(-1.0),
    Method=cms.string("Constant"),
    XS=cms.double(xs),
    NumberEvts=cms.double(numEvtsInSample),
    Lumi=cms.double(lumi),
    LumiScale=cms.double(1.0),
    FileNamePUDataDistribution=cms.string("NONE"),
    PU=cms.int32(0))

###############################################################################
##
## EVENT INFO
##
###############################################################################

## --- Pile-Up Info ----------------------------------------------------
from RA2Classic.SUSYParams.puInfo_cfi import PUInfo
process.PUInfo = PUInfo.clone()
    )
)

process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )

process.source.skipEvents = cms.untracked.uint32(0)

#========================= analysis module =====================================

scaleF = -1.0
from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
process.eventWeight = weightProducer.clone(
    weight = cms.double(scaleF),
    Method = cms.string("PtHat"),
    XS = cms.double(2.99913994E10),
    NumberEvts = cms.double(9998151),
    Lumi = cms.double(10000.),
    Exponent = cms.double(-4.5),
    LumiScale = cms.double( 1.0 ),
)
from RA2Classic.WeightProducer.puWeightProducer_cfi import puWeightProducer
process.puWeight = puWeightProducer.clone(
    weight = cms.double(1.0),
)
from ZInvisibleBkgds.Photons.genstudytree_cfi import *
process.directPhotonsID = genstudytree.clone(
    debug            = cms.bool(False),
    genSrc           = cms.InputTag("zinvBkgdDirectPhotons"),
    debugString      = cms.string("direct photons"),
    ScaleFactor      = cms.double(scaleF),
    recoPhotonSrc    = cms.InputTag("patPhotonsID"),
Beispiel #7
0
# $Id: puWeightProducer_cfi.py,v 1.1 2012/08/08 09:32:47 mschrode Exp $
#
# Example: stores a double variable 'puWeightProducer:weight' in the event
# which can be used to reweight the sample according to the
# specified pile-up scenario.

import FWCore.ParameterSet.Config as cms

from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer

puWeightProducer = weightProducer.clone(
	# Data PU distribution. If a file name is specified,
	# a multiplicative PU weight factor is applied.
	FileNamePUDataDistribution = cms.string("RA2Classic/AdditionalInputFiles/DataPileupHistogram_RA2Summer12_190456-196531_8TeV_PromptReco_WOLowPU.root"),   
	## use this for different PU distributions 0 Flat10 PU; 1 for Fall11; 2 for Summer12
	PU = cms.int32(2)
)
Beispiel #8
0


###############################################################################
##
## WEIGHT PRODUCER
##
###############################################################################

## --- Setup WeightProducer --------------------------------------------
from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
process.WeightProducer = weightProducer.clone(
    weight     = cms.double(-1.0),
    Method     = cms.string("Constant"),
    XS         = cms.double(xs),
    NumberEvts = cms.double(numEvtsInSample),
    Lumi       = cms.double(lumi),
    LumiScale  = cms.double(1.0),
    FileNamePUDataDistribution = cms.string("NONE"),
    PU         = cms.int32(0)
    )



###############################################################################
##
## EVENT INFO
##
###############################################################################

## --- Pile-Up Info ----------------------------------------------------
from RA2Classic.SUSYParams.puInfo_cfi import PUInfo
Beispiel #9
0
def makeTreeFromSignalScan(
        process,
        globalTag,
        smsModel,
        smsMotherMass,
        smsLSPMass,
        SMStopol,
        xs=1,
        numEvtsInSample=1,
        lumi=5.088,
        reportEveryEvt=5000,
        testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root",
        numProcessedEvt=20):

    #-- Meta data to be logged in DBS ---------------------------------------------
    process.configurationMetadata = cms.untracked.PSet(
        version=cms.untracked.string('$Revision: 1.1 $'),
        name=cms.untracked.string(
            '$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $'
        ),
        annotation=cms.untracked.string('SUSY pattuple definition'))

    #-- Message Logger ------------------------------------------------------------
    process.MessageLogger.categories.append('PATSummaryTables')
    process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet(
        limit=cms.untracked.int32(-1), reportEvery=cms.untracked.int32(1))
    process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt

    #-- Input Source --------------------------------------------------------------
    process.maxEvents.input = numProcessedEvt
    process.source.duplicateCheckMode = cms.untracked.string(
        'noDuplicateCheck')
    process.source = cms.Source("PoolSource",
                                fileNames=cms.untracked.vstring(testFileName))

    #-- SUSYPAT specifics ---------------------------------------------------------
    from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands

    hltMenu = 'REDIGI'

    theJetColls = ['AK5PF']

    jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute']

    process.GlobalTag.globaltag = globalTag

    addDefaultSUSYPAT(process,
                      mcInfo=True,
                      HLTMenu=hltMenu,
                      jetMetCorrections=jetMetCorr,
                      mcVersion='',
                      theJetNames=theJetColls,
                      doSusyTopProjection=False)

    # Remove the PAT cleaning and filtering sequences
    process.patDefaultSequence.remove(process.selectedPatCandidates)
    process.patDefaultSequence.remove(process.cleanPatCandidates)
    process.patDefaultSequence.remove(process.countPatCandidates)

    # Disable embedment so that lepton cleaning method works
    process.patJetsAK5PF.embedCaloTowers = False
    process.patJetsAK5PF.embedPFCandidates = False
    process.patJetsPF.embedCaloTowers = False
    process.patJetsPF.embedPFCandidates = False

    #-- Adjust collections to use PFNoPU jets -------------------------------------

    # do not use Z-mass window for PU subtraction
    # such that JEC works properly
    process.pfPileUpPF.checkClosestZVertex = cms.bool(False)

    # do not remove muons and electrons from the jet clustering input
    # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections)
    process.pfIsolatedElectronsPF.isolationCut = -1
    process.pfIsolatedMuonsPF.isolationCut = -1

    # make loose clones of the original electron collection
    process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone()
    process.pfRelaxedElectronsPF.isolationCut = 9999
    process.pfElectronsFromVertexPF.dzCut = 9999.0
    process.pfElectronsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedElectronsPF.cut = ""
    process.patElectronsPF.pfElectronSource = "pfRelaxedElectronsPF"
    process.pfElectronSequencePF.replace(
        process.pfIsolatedElectronsPF,
        process.pfIsolatedElectronsPF + process.pfRelaxedElectronsPF)

    # make loose clones of the original muon collection
    process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone()
    process.pfRelaxedMuonsPF.isolationCut = 9999
    process.pfMuonsFromVertexPF.dzCut = 9999.0
    process.pfMuonsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedMuonsPF.cut = ""
    process.patMuonsPF.pfMuonSource = "pfRelaxedMuonsPF"
    process.pfMuonSequencePF.replace(
        process.pfIsolatedMuonsPF,
        process.pfIsolatedMuonsPF + process.pfRelaxedMuonsPF)

    # do not remove taus from the jet collection
    process.pfTausPF.discriminators = cms.VPSet()
    process.pfUnclusteredTausPF = process.pfTausPF.clone(
        cut=cms.string("pt < 0"))
    process.pfTauSequencePF.replace(
        process.pfTausPF, process.pfTausPF + process.pfUnclusteredTausPF)
    process.pfNoTauPF.topCollection = "pfUnclusteredTausPF"
    #------------------------------------------------------------------------------

    #-- Overwrite default output content ------------------------------------------
    from SandBox.Skims.RA2Content_cff import getRA2PATOutput
    process.out.outputCommands = getRA2PATOutput(process)
    process.out.dropMetaData = cms.untracked.string('DROPPED')

    #-- RA2 filtering -------------------------------------------------------------
    process.prefilterCounter = cms.EDProducer("EventCountProducer")
    process.postStdCleaningCounter = cms.EDProducer("EventCountProducer")
    process.postPostCleaningCounter = cms.EDProducer("EventCountProducer")
    process.postPFchsJetsCounter = cms.EDProducer("EventCountProducer")
    process.postPFchsHTCounter = cms.EDProducer("EventCountProducer")
    process.postPFchsMHTCounter = cms.EDProducer("EventCountProducer")

    process.load('SandBox.Skims.RA2Objects_cff')
    process.load('SandBox.Skims.RA2Selection_cff')
    process.load('SandBox.Skims.RA2Cleaning_cff')

    # Adjust object filters for signal-scan values
    process.htPFchsFilter.MinHT = cms.double(300.0)
    process.mhtPFchsFilter.MinMHT = cms.double(100.0)
    process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2)

    ## please comment this block to remove tagging mode of
    ##filters and reject events failing any of following filters
    process.eeNoiseFilter.taggingMode = False
    process.trackingFailureFilter.taggingMode = False
    process.beamHaloFilter.taggingMode = False
    process.ra2NoiseCleaning.remove(process.HBHENoiseFilter)
    process.inconsistentMuons.taggingMode = False
    process.greedyMuons.taggingMode = False
    process.ra2EcalTPFilter.taggingMode = False
    process.ra2EcalBEFilter.taggingMode = False
    process.hcalLaserEventFilter.taggingMode = False
    process.eeBadScFilter.taggingMode = False

    process.load("SandBox.Skims.provInfoMuons_cfi")
    process.load("SandBox.Skims.provInfoElectrons_cfi")

    process.cleanpatseq = cms.Sequence(
        process.susyPatDefaultSequence * process.prefilterCounter *
        process.ra2StdCleaning * process.postStdCleaningCounter *
        process.ra2Objects * process.provInfoMuons *
        process.provInfoElectrons * process.ra2PostCleaning *
        process.postPostCleaningCounter)

    ## --- Setup WeightProducer --------------------------------------------
    from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
    process.WeightProducer = weightProducer.clone(
        weight=cms.double(-1.0),
        Method=cms.string("Constant"),
        XS=cms.double(xs),
        NumberEvts=cms.double(numEvtsInSample),
        Lumi=cms.double(lumi),
        LumiScale=cms.double(1.0),
        FileNamePUDataDistribution=cms.string("NONE"),
        PU=cms.int32(0))

    ## --- SMS Model Filter ------------------------------------------------
    # Filter files for specified signal point out of dataset
    # Code from UserCode/seema/SusyAnalysis/AnalysisUtils
    from SusyAnalysis.AnalysisUtils.smsModelFilter_cfi import smsModelFilter
    process.SMSModelFilter = smsModelFilter.clone(
        SusyScanTopology=cms.string(smsModel),
        SusyScanMotherMass=cms.double(smsMotherMass),
        SusyScanLSPMass=cms.double(smsLSPMass),
        SusyScanFracLSP=cms.double(0.0))

    #---JL
    #--for PDF sys
    process.pdfWeight = cms.EDProducer(
        "PdfWeightProducer",
        PdfInfoTag=cms.untracked.InputTag("generator"),
        PdfSetNames=cms.untracked.vstring("cteq66.LHgrid",
                                          "MSTW2008nlo68cl.LHgrid",
                                          "NNPDF20_100.LHgrid")
        #PdfSetNames = cms.untracked.vstring("NNPDF20_100.LHgrid")
    )
    #---for ISR sys
    process.lastParticles = cms.EDProducer("ISRProducer")
    process.ISRsys = cms.Sequence(process.lastParticles)

    #---put the susy params
    process.load("RA2Classic.SUSYParams.susyparams_cfi")
    process.susyparams.Model = cms.string(SMStopol)
    #-- end JL

    ## --- Setup of TreeMaker ----------------------------------------------
    process.TFileService = cms.Service(
        "TFileService", fileName=cms.string("RA2Selection.root"))

    from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker
    process.RA2TreeMaker = TreeMaker.clone(
        TreeName=cms.string("RA2PreSelection"),
        VertexCollection=cms.InputTag('goodVertices'),
        HT=cms.InputTag('htPFchs'),
        HTJets=cms.InputTag('patJetsPFchsPt50Eta25'),
        MHT=cms.InputTag('mhtPFchs'),
        MHTJets=cms.InputTag('patJetsPFchsPt30'),
        VarsDouble=cms.VInputTag(cms.InputTag('WeightProducer:weight'),
                                 "susyparams:m0", "susyparams:m12",
                                 "susyparams:evtProcID"),
        VarsDoubleNamesInTree=cms.vstring('Weight', "massMom", "massDau",
                                          "procID"),
        CandidateCollections=cms.VInputTag('patJetsPFchsPt30',
                                           'patMuonsPFIDIso',
                                           'patElectronsIDIso'),
        CandidateNamesInTree=cms.vstring('Jets', 'PATMuonsPFIDIso',
                                         'PATElectronsIDIso'),
        VarsDoubleV=cms.VInputTag("pdfWeight:cteq66",
                                  "pdfWeight:MSTW2008nlo68cl",
                                  "pdfWeight:NNPDF20"),
        VarsDoubleNamesInTreeV=cms.vstring("cteq66", "MSTW2008nlo68cl",
                                           "NNPDF20"))

    #process.dump   = cms.EDAnalyzer("EventContentAnalyzer")

    process.ppfchs = cms.Path(
        process.SMSModelFilter * process.cleanpatseq *
        process.countJetsPFchsPt50Eta25 * process.postPFchsJetsCounter *
        process.htPFchsFilter * process.postPFchsHTCounter *
        process.mhtPFchsFilter * process.postPFchsMHTCounter *
        process.WeightProducer *
        #--JL
        process.pdfWeight * process.ISRsys * process.susyparams *
        #--end JL
        process.RA2TreeMaker)

    process.schedule = cms.Schedule(process.ppfchs)
Beispiel #10
0
def makeTreeFromFSIM(process,
                     globalTag,
                     reportEveryEvt=5000,
                     testFileName="/store/mc/Summer12/WJetsToLNu_HT-400ToInf_8TeV-madgraph/AODSIM/PU_S7_START52_V9-v1/0000/041CF749-57A0-E111-B6DD-0026189438DA.root",
                     numProcessedEvt=20):
    

    #-- Meta data to be logged in DBS ---------------------------------------------
    process.configurationMetadata = cms.untracked.PSet(
        version = cms.untracked.string('$Revision: 1.2 $'),
        name = cms.untracked.string('$Source: /local/reps/CMSSW/UserCode/kheine/RA2Classic/TreeMaker/python/makeTreeFromSignalScan_cff.py,v $'),
        annotation = cms.untracked.string('SUSY pattuple definition')
        )


    #-- Message Logger ------------------------------------------------------------
    process.MessageLogger.categories.append('PATSummaryTables')
    process.MessageLogger.cerr.PATSummaryTables = cms.untracked.PSet(
        limit = cms.untracked.int32(-1),
        reportEvery = cms.untracked.int32(1)
        )
    process.MessageLogger.cerr.FwkReport.reportEvery = reportEveryEvt


    #-- Input Source --------------------------------------------------------------
    process.maxEvents.input = numProcessedEvt
    process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck')
    process.source = cms.Source("PoolSource",fileNames = cms.untracked.vstring(testFileName))


    #-- SUSYPAT specifics ---------------------------------------------------------
    from PhysicsTools.Configuration.SUSY_pattuple_cff import addDefaultSUSYPAT, getSUSY_pattuple_outputCommands

    hltMenu = 'REDIGI'

    theJetColls = ['AK5PF']

    jetMetCorr = ['L1FastJet', 'L2Relative', 'L3Absolute']

    process.GlobalTag.globaltag = globalTag

    addDefaultSUSYPAT(process,
                      mcInfo=True,
                      HLTMenu=hltMenu,
                      jetMetCorrections=jetMetCorr,
                      mcVersion='',
                      theJetNames=theJetColls,
                      doSusyTopProjection=False)

    # Remove the PAT cleaning and filtering sequences
    process.patDefaultSequence.remove(process.selectedPatCandidates)
    process.patDefaultSequence.remove(process.cleanPatCandidates)
    process.patDefaultSequence.remove(process.countPatCandidates)
    
    # Disable embedment so that lepton cleaning method works
    process.patJetsAK5PF.embedCaloTowers = False
    process.patJetsAK5PF.embedPFCandidates = False
    process.patJetsPF.embedCaloTowers = False
    process.patJetsPF.embedPFCandidates = False 
    
    #-- Adjust collections to use PFNoPU jets -------------------------------------
    
    # do not use Z-mass window for PU subtraction
    # such that JEC works properly
    process.pfPileUpPF.checkClosestZVertex = cms.bool(False)
    
    # do not remove muons and electrons from the jet clustering input
    # (patMuons and patElectrons use relaxed pfMuon and pfElectron collections)
    process.pfIsolatedElectronsPF.isolationCut = -1
    process.pfIsolatedMuonsPF.isolationCut = -1

    # make loose clones of the original electron collection
    process.pfRelaxedElectronsPF = process.pfIsolatedElectronsPF.clone()
    process.pfRelaxedElectronsPF.isolationCut = 9999
    process.pfElectronsFromVertexPF.dzCut = 9999.0
    process.pfElectronsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedElectronsPF.cut = ""
    process.patElectronsPF.pfElectronSource  = "pfRelaxedElectronsPF"
    process.pfElectronSequencePF.replace(process.pfIsolatedElectronsPF,
                                         process.pfIsolatedElectronsPF + 
                                         process.pfRelaxedElectronsPF)
    
    # make loose clones of the original muon collection
    process.pfRelaxedMuonsPF = process.pfIsolatedMuonsPF.clone()
    process.pfRelaxedMuonsPF.isolationCut = 9999
    process.pfMuonsFromVertexPF.dzCut = 9999.0
    process.pfMuonsFromVertexPF.d0Cut = 9999.0
    process.pfSelectedMuonsPF.cut = ""
    process.patMuonsPF.pfMuonSource  = "pfRelaxedMuonsPF"
    process.pfMuonSequencePF.replace(process.pfIsolatedMuonsPF,
                                     process.pfIsolatedMuonsPF + 
                                     process.pfRelaxedMuonsPF)
    

    # do not remove taus from the jet collection
    process.pfTausPF.discriminators = cms.VPSet()
    process.pfUnclusteredTausPF = process.pfTausPF.clone(
        cut = cms.string("pt < 0")
    )
    process.pfTauSequencePF.replace(process.pfTausPF, process.pfTausPF+ process.pfUnclusteredTausPF)
    process.pfNoTauPF.topCollection = "pfUnclusteredTausPF"
    #------------------------------------------------------------------------------

    #-- Overwrite default output content ------------------------------------------
    from SandBox.Skims.RA2Content_cff import getRA2PATOutput
    process.out.outputCommands = getRA2PATOutput(process)
    process.out.dropMetaData = cms.untracked.string('DROPPED')
    

    #-- RA2 filtering -------------------------------------------------------------
    process.prefilterCounter        = cms.EDProducer("EventCountProducer")
    process.postStdCleaningCounter  = cms.EDProducer("EventCountProducer")
    process.postPostCleaningCounter = cms.EDProducer("EventCountProducer")
    process.postPFchsJetsCounter    = cms.EDProducer("EventCountProducer")
    process.postPFchsHTCounter      = cms.EDProducer("EventCountProducer")
    process.postPFchsMHTCounter     = cms.EDProducer("EventCountProducer")

    process.load('SandBox.Skims.RA2Objects_cff')
    process.load('SandBox.Skims.RA2Selection_cff')
    process.load('SandBox.Skims.RA2Cleaning_cff')

    # Adjust object filters for signal-scan values
    process.htPFchsFilter.MinHT               = cms.double(300.0)
    process.mhtPFchsFilter.MinMHT             = cms.double(100.0)
    process.countJetsPFchsPt50Eta25.minNumber = cms.uint32(2)

    ## RA2 cleaning
    process.ra2NoiseCleaning.remove(process.HBHENoiseFilterRA2)     # Not in FASTSIM
    process.ra2NoiseCleaning.remove(process.HBHENoiseFilter)     # Not in FASTSIM
    process.ra2NoiseCleaning.remove(process.beamHaloFilter)     # Not in FASTSIM
    process.trackingFailureFilter.taggingMode = False
    process.inconsistentMuons.taggingMode     = False
    process.greedyMuons.taggingMode           = False
    process.ra2EcalTPFilter.taggingMode       = False
    process.ra2EcalBEFilter.taggingMode       = False
    process.hcalLaserEventFilter.taggingMode  = False
    process.ecalLaserCorrFilter.taggingMode   = False
    process.eeBadScFilter.taggingMode         = False

    process.manystripclus53X.taggedMode       = cms.untracked.bool(False)
    process.toomanystripclus53X.taggedMode      = cms.untracked.bool(False)
    process.logErrorTooManyClusters.taggedMode  = cms.untracked.bool(False)
    process.trackingPOGCleaning = cms.Sequence(
        ~process.manystripclus53X *
        ~process.toomanystripclus53X *
        ~process.logErrorTooManyClusters
        )
    #process.ra2NoiseCleaning += process.trackingPOGCleaning

    process.ra2NoiseCleaning += process.ra2PBNR

    from SandBox.Skims.hoNoiseFilter_cfi import hoNoiseFilter
    process.RA2HONoiseFilter = hoNoiseFilter.clone(
        patJetsInputTag = cms.InputTag('patJetsPFchsPt30'),
        jetPtMin        = cms.double(30),
        jetEtaMax       = cms.double(5),
        maxHOEfrac      = cms.double(0.4),
        taggingMode     = cms.bool(False)
        )
    process.ra2NoiseCleaning += process.RA2HONoiseFilter

    process.load("SandBox.Skims.provInfoMuons_cfi")
    process.load("SandBox.Skims.provInfoElectrons_cfi")

    process.cleanpatseq = cms.Sequence(
        process.susyPatDefaultSequence *
        process.prefilterCounter *
        process.ra2StdCleaning *
        process.postStdCleaningCounter *
        process.ra2Objects *
        process.provInfoMuons *
        process.provInfoElectrons *
        process.ra2PostCleaning *
        process.postPostCleaningCounter
        )

    ## Lepton veto
    process.load('SandBox.Skims.RA2Leptons_cff')
    process.LeptonVeto = cms.Sequence(
        process.ra2PFMuonVeto *
        process.ra2ElectronVeto
        )



    ## --- Setup WeightProducer --------------------------------------------
    from RA2Classic.WeightProducer.weightProducer_cfi import weightProducer
    process.WeightProducer = weightProducer.clone(
        weight     = cms.double(-1.0),
        Method     = cms.string("Constant"),
        XS         = cms.double(1),
        NumberEvts = cms.double(1),
        Lumi       = cms.double(1),
        LumiScale  = cms.double(1.0),
        PU                         = cms.int32(2), # PU Summer12S7
        FileNamePUDataDistribution = cms.string("RA2Classic/WeightProducer/data/DataPileupHistogram_RA2Summer12_190456-208686_ABCD.root")
        )



    ## --- Setup of TreeMaker ----------------------------------------------
    process.TFileService = cms.Service(
        "TFileService",
        fileName = cms.string("RA2Selection.root")
        )

    from RA2Classic.TreeMaker.treemaker_cfi import TreeMaker
    process.RA2TreeMaker = TreeMaker.clone(
        TreeName          = cms.string("RA2Selection"),
        VertexCollection  = cms.InputTag('goodVertices'),
        HT                = cms.InputTag('htPFchs'),
        HTJets            = cms.InputTag('patJetsPFchsPt50Eta25'),
        MHT               = cms.InputTag('mhtPFchs'),
        MHTJets           = cms.InputTag('patJetsPFchsPt30'),
        VarsDouble        = cms.VInputTag(cms.InputTag('WeightProducer:weight')),
        VarsDoubleNamesInTree = cms.vstring('Weight'),
        )

    #process.dump   = cms.EDAnalyzer("EventContentAnalyzer")

    process.ppfchs = cms.Path(
        process.cleanpatseq *
        process.LeptonVeto *
        process.countJetsPFchsPt50Eta25 *
        process.postPFchsJetsCounter *
        process.htPFchsFilter *
        process.postPFchsHTCounter *
        process.mhtPFchsFilter *
        process.postPFchsMHTCounter *
        process.WeightProducer *
        process.RA2TreeMaker
        )

    process.schedule = cms.Schedule(process.ppfchs)