Example #1
0
genJetCollection = 'ak4GenJetsNoNuNoLepton'
genJetFlavourInfoCollection = 'ak4GenJetFlavourPlusLeptonInfos'

## Create objects
## Details in: PhysicsTools/JetExamples/test/printJetFlavourInfo.cc, PhysicsTools/JetExamples/test/printJetFlavourInfo.py
## and in: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideBTagMCTools#New_jet_flavour_definition

## Supply PDG ID to real name resolution of MC particles
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")

## Input particles for gen jets (stable gen particles to be used in clustering, excluding electrons, muons and neutrinos from hard interaction)
from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
process.genParticlesForJetsNoNuNoLepton = genParticlesForJets.clone(
    src=genJetInputParticleCollection,
    excludeResonances=True,
    excludeFromResonancePids=[11, 12, 13, 14, 16],
)

from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets
process.ak4GenJetsNoNuNoLepton = ak4GenJets.clone(
    src="genParticlesForJetsNoNuNoLepton")

# Ghost particle collection for matching to gen jets (b/c hadrons + leptons)
from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons
process.selectedHadronsAndPartons = selectedHadronsAndPartons.clone(
    particles=genParticleCollection)

# Flavour info: jet collection with all associated ghosts
# For the moment leptons need to be specified explicitely here, until lepton access can be made more generic in miniAOD
# This is only needed as long as the jetConstituents are not accessible directly in miniAOD, then it should be fixed
genJetCollection = 'ak4GenJetsNoNuNoLepton'
genJetFlavourInfoCollection = 'ak4GenJetFlavourPlusLeptonInfos'

## Create objects 
## Details in: PhysicsTools/JetExamples/test/printJetFlavourInfo.cc, PhysicsTools/JetExamples/test/printJetFlavourInfo.py
## and in: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideBTagMCTools#New_jet_flavour_definition  

## Supply PDG ID to real name resolution of MC particles
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")

## Input particles for gen jets (stable gen particles to be used in clustering, excluding electrons, muons and neutrinos from hard interaction)
from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
process.genParticlesForJetsNoNuNoLepton = genParticlesForJets.clone(
    src = genJetInputParticleCollection,
    excludeResonances = True,
    excludeFromResonancePids = [11, 12, 13, 14, 16],
)

from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets
process.ak4GenJetsNoNuNoLepton = ak4GenJets.clone(src = "genParticlesForJetsNoNuNoLepton")

# Ghost particle collection for matching to gen jets (b/c hadrons + leptons)
from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons
process.selectedHadronsAndPartons = selectedHadronsAndPartons.clone(particles = genParticleCollection)

# Flavour info: jet collection with all associated ghosts
# For the moment leptons need to be specified explicitely here, until lepton access can be made more generic in miniAOD
# This is only needed as long as the jetConstituents are not accessible directly in miniAOD, then it should be fixed
# by using the leptons from the constituents, instead of feeding them as ghosts into the jets 
Example #3
0
import FWCore.ParameterSet.Config as cms

from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
from RecoHI.HiJetAlgos.HiSignalParticleProducer_cfi import hiSignalGenParticles
genParticlesForJetsSignal = genParticlesForJets.clone(
    src = cms.InputTag("hiSignalGenParticles"))

myPartons = cms.EDProducer("PartonSelector",
    withLeptons = cms.bool(False),
    src = cms.InputTag("genParticles")
)

signalPartons = myPartons.clone(src = 'hiSignalGenParticles')

from RecoHI.HiJetAlgos.HiGenCleaner_cff import hiPartons
cleanedPartons = hiPartons.clone(src = 'myPartons')

# import gen jet producers
from HeavyIonsAnalysis.JetAnalysis.akGenJets_cfi import (
    ak1GenJets, ak1HiGenJets,
    ak2GenJets, ak2HiGenJets,
    ak3GenJets, ak3HiGenJets,
    ak4GenJets, ak4HiGenJets,
    ak5GenJets, ak5HiGenJets,
    ak6GenJets, ak6HiGenJets)

from RecoHI.HiJetAlgos.HiGenCleaner_cff import heavyIonCleanedGenJets
ak1HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak1HiGenJets")
ak2HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak2HiGenJets")
ak3HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak3HiGenJets")
ak4HiCleanedGenJets = heavyIonCleanedGenJets.clone(src = "ak4HiGenJets")
Example #4
0
    ),
    skipEvents=cms.untracked.uint32(0))

## define maximal number of events to loop over
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(1000))

# Setting input particle collections to be used by the tools
genParticleCollection = ''
genJetInputParticleCollection = ''
genJetCollection = 'ak5GenJetsCustom'
if runOnAOD:
    genParticleCollection = 'genParticles'
    genJetInputParticleCollection = 'genParticlesForJets'
    ## producing a subset of genParticles to be used for jet clustering in AOD
    from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
    process.genParticlesForJets = genParticlesForJets.clone()
else:
    genParticleCollection = 'prunedGenParticles'
    genJetInputParticleCollection = 'packedGenParticles'

# Supplies PDG ID to real name resolution of MC particles
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")

# Producing own jets for testing purposes
from RecoJets.JetProducers.ak5GenJets_cfi import ak5GenJets
process.ak5GenJetsCustom = ak5GenJets.clone(src=genJetInputParticleCollection,
                                            rParam=cms.double(0.5),
                                            jetAlgorithm=cms.string("AntiKt"))

# Ghost particle collection used for Hadron-Jet association
# MUST use proper input particle collection
Example #5
0
## define maximal number of events to loop over
process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1000)
)

# Setting input particle collections to be used by the tools
genParticleCollection = ''
genJetInputParticleCollection = ''
genJetCollection = 'ak4GenJetsCustom'
if options.runOnAOD:
    genParticleCollection = 'genParticles'
    genJetInputParticleCollection = 'genParticlesForJets'
    ## producing a subset of genParticles to be used for jet clustering in AOD
    from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
    process.genParticlesForJets = genParticlesForJets.clone()
else:
    genParticleCollection = 'prunedGenParticles'
    genJetInputParticleCollection = 'packedGenParticles'

# Supplies PDG ID to real name resolution of MC particles
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")

# Producing own jets for testing purposes
from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets
process.ak4GenJetsCustom = ak4GenJets.clone(
    src = genJetInputParticleCollection,
    rParam = cms.double(0.4),
    jetAlgorithm = cms.string("AntiKt")
)
Example #6
0
    fileNames=cms.untracked.vstring(options.inputFiles),
    duplicateCheckMode=cms.untracked.string('noDuplicateCheck'))

# ####### Logger ##########
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'INFO'
process.MessageLogger.categories.append('Ntuple')
process.MessageLogger.cerr.INFO = cms.untracked.PSet(
    limit=cms.untracked.int32(1))
process.MessageLogger.cerr.FwkReport.reportEvery = 1000

####### Redo Jet clustering sequence ##########
from RecoJets.Configuration.GenJetParticles_cff import genParticlesForJets
from RecoJets.Configuration.RecoGenJets_cff import ak8GenJets

process.genParForJets = genParticlesForJets.clone(
    src=cms.InputTag("genParticles"))

process.ak8GenJets = ak8GenJets.clone(src='genParForJets')

process.NjettinessGenAK8 = cms.EDProducer(
    "NjettinessAdder",
    src=cms.InputTag("ak8GenJets"),
    # compute 1-, 2-, 3-, 4- subjettiness
    Njets=cms.vuint32(1, 2, 3, 4),
    # variables for measure definition:
    # CMS default is normalized measure
    measureDefinition=cms.uint32(0),
    # CMS default is 1
    beta=cms.double(1.0),
    # CMS default is jet cone size
    R0=cms.double(0.8),