Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:24:01

0001 # THIS CONFIGURATION IS BROKEN. SINCE 2015 Geometry_cff has been deleted
0002 # and it is a fatal error to load it. And because of this I did not bother
0003 # to convert it to use tasks in 2017 when Tasks where implemented for unscheduled
0004 # mode (or remove the allowUnscheduled flag which no longer does anything).
0005 # Modules which are supposed to run unscheduled will not run.  Someone should
0006 # probably either fix or delete this ...
0007 
0008 import FWCore.ParameterSet.Config as cms
0009 
0010 process = cms.Process("S2")
0011 process.source = cms.Source("PoolSource",
0012     fileNames = cms.untracked.vstring("file:patTuple_mini.root")
0013 )
0014 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarPileUpMINIAODSIM
0015 process.source.fileNames = filesRelValProdTTbarPileUpMINIAODSIM
0016 
0017 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0018 
0019 from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
0020 from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets
0021 from RecoMET.METProducers.pfMet_cfi import pfMet
0022 
0023 #select isolated collections
0024 process.selectedMuons = cms.EDFilter("CandPtrSelector", src = cms.InputTag("slimmedMuons"), cut = cms.string('''abs(eta)<2.5 && pt>10. &&
0025    (pfIsolationR04().sumChargedHadronPt+
0026     max(0.,pfIsolationR04().sumNeutralHadronEt+
0027     pfIsolationR04().sumPhotonEt-
0028     0.50*pfIsolationR04().sumPUPt))/pt < 0.20 && 
0029     (isPFMuon && (isGlobalMuon || isTrackerMuon) )'''))
0030 process.selectedElectrons = cms.EDFilter("CandPtrSelector", src = cms.InputTag("slimmedElectrons"), cut = cms.string('''abs(eta)<2.5 && pt>20. &&
0031     gsfTrack.isAvailable() &&
0032     gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\') < 2 &&
0033     (pfIsolationVariables().sumChargedHadronPt+
0034     max(0.,pfIsolationVariables().sumNeutralHadronEt+
0035     pfIsolationVariables().sumPhotonEt-
0036     0.5*pfIsolationVariables().sumPUPt))/pt < 0.15'''))
0037 
0038 #do projections
0039 process.load("CommonTools.ParticleFlow.pfCHS_cff")
0040 process.pfNoMuonCHS =  cms.EDProducer("CandPtrProjector", src = cms.InputTag("pfCHS"), veto = cms.InputTag("selectedMuons"))
0041 process.pfNoElectronsCHS = cms.EDProducer("CandPtrProjector", src = cms.InputTag("pfNoMuonCHS"), veto =  cms.InputTag("selectedElectrons"))
0042 
0043 process.pfNoMuon =  cms.EDProducer("CandPtrProjector", src = cms.InputTag("packedPFCandidates"), veto = cms.InputTag("selectedMuons"))
0044 process.pfNoElectrons = cms.EDProducer("CandPtrProjector", src = cms.InputTag("pfNoMuon"), veto =  cms.InputTag("selectedElectrons"))
0045 
0046 
0047 
0048 process.ak4PFJets = ak4PFJets.clone(src = 'pfNoElectrons', doAreaFastjet = True) # no idea while doArea is false by default, but it's True in RECO so we have to set it
0049 process.ak4PFJetsCHS = ak4PFJets.clone(src = 'pfNoElectronsCHS', doAreaFastjet = True) # no idea while doArea is false by default, but it's True in RECO so we have to set it
0050 process.ak4GenJets = ak4GenJets.clone(src = 'packedGenParticles')
0051 
0052 
0053 # The following is make patJets, but EI is done with the above
0054 process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff")
0055 process.load("Configuration.EventContent.EventContent_cff")
0056 process.load('Configuration.StandardSequences.Geometry_cff')
0057 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0058 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0059 from Configuration.AlCa.GlobalTag import GlobalTag
0060 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0061 
0062 
0063 from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
0064 addJetCollection(
0065    process,
0066    postfix   = "",
0067    labelName = 'AK4PFCHS',
0068    jetSource = cms.InputTag('ak4PFJetsCHS'),
0069    pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
0070    pfCandidates = cms.InputTag('packedPFCandidates'),
0071    svSource = cms.InputTag('slimmedSecondaryVertices'),
0072    jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-2'),
0073    btagDiscriminators = [ 'pfCombinedSecondaryVertexBJetTags', 'pfCombinedInclusiveSecondaryVertexV2BJetTags' ],
0074    genJetCollection=cms.InputTag('ak4GenJets'),
0075    genParticles=cms.InputTag('prunedGenParticles')
0076    )
0077 addJetCollection(
0078    process,
0079    postfix   = "",
0080    labelName = 'AK4PF',
0081    jetSource = cms.InputTag('ak4PFJets'),
0082    pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
0083    pfCandidates = cms.InputTag('packedPFCandidates'),
0084    svSource = cms.InputTag('slimmedSecondaryVertices'),
0085    jetCorrections = ('AK4PF', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-2'),
0086    btagDiscriminators = [ 'pfCombinedSecondaryVertexBJetTags', 'pfCombinedInclusiveSecondaryVertexV2BJetTags' ],
0087    genJetCollection=cms.InputTag('ak4GenJets'),
0088    genParticles=cms.InputTag('prunedGenParticles')
0089    )
0090 
0091 # if using legacy jet flavour (not used by default)
0092 process.patJetPartonsLegacy.skipFirstN = cms.uint32(0) # do not skip first 6 particles, we already pruned some!
0093 process.patJetPartonsLegacy.acceptNoDaughters = cms.bool(True) # as we drop intermediate stuff, we need to accept quarks with no siblings
0094 
0095 
0096 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0097 process.MessageLogger.cerr.FwkReport.reportEvery = 10
0098 process.MessageLogger.suppressWarning = cms.untracked.vstring('ecalLaserCorrFilter','manystripclus53X','toomanystripclus53X')
0099 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0100 process.options.allowUnscheduled = cms.untracked.bool(True)
0101 
0102 process.OUT = cms.OutputModule("PoolOutputModule",
0103     fileName = cms.untracked.string('test.root'),
0104     outputCommands = cms.untracked.vstring(['drop *','keep patJets_patJetsAK4PF_*_*','keep patJets_patJetsAK4PFCHS_*_*','keep *_*_*_PAT'])
0105 )
0106 process.endpath= cms.EndPath(process.OUT)
0107