Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-29 01:21:40

0001 import FWCore.ParameterSet.Config as cms
0002 from  PhysicsTools.NanoAOD.common_cff import *
0003 
0004 
0005 
0006 ##################### User floats producers, selectors ##########################
0007 
0008 mergedGenParticles = cms.EDProducer("MergedGenParticleProducer",
0009     inputPruned = cms.InputTag("prunedGenParticles"),
0010     inputPacked = cms.InputTag("packedGenParticles"),
0011 )
0012 
0013 genParticles2HepMC = cms.EDProducer("GenParticles2HepMCConverter",
0014     genParticles = cms.InputTag("mergedGenParticles"),
0015     genEventInfo = cms.InputTag("generator"),
0016     signalParticlePdgIds = cms.vint32(),
0017 )
0018 
0019 genParticles2HepMCHiggsVtx = cms.EDProducer("GenParticles2HepMCConverter",
0020      genParticles = cms.InputTag("mergedGenParticles"),
0021      genEventInfo = cms.InputTag("generator"),
0022      signalParticlePdgIds = cms.vint32(25), ## for the Higgs analysis
0023 )
0024 
0025 
0026 particleLevel = cms.EDProducer("ParticleLevelProducer",
0027     src = cms.InputTag("genParticles2HepMC:unsmeared"),
0028     
0029     doJetClustering = cms.bool(False), # Not needed as Rivet jets aren't used currently
0030     usePromptFinalStates = cms.bool(True), # for leptons, photons, neutrinos
0031     excludePromptLeptonsFromJetClustering = cms.bool(False),
0032     excludeNeutrinosFromJetClustering = cms.bool(True),
0033     
0034     particleMinPt  = cms.double(0.),
0035     particleMaxEta = cms.double(5.), # HF range. Maximum 6.0 on MiniAOD
0036     
0037     lepConeSize = cms.double(0.1), # for photon dressing
0038     lepMinPt    = cms.double(1.),
0039     lepMaxEta   = cms.double(2.5),
0040     
0041     jetConeSize = cms.double(0.4),
0042     jetMinPt    = cms.double(10.),
0043     jetMaxEta   = cms.double(999.),
0044     
0045     fatJetConeSize = cms.double(0.8),
0046     fatJetMinPt    = cms.double(170.),
0047     fatJetMaxEta   = cms.double(999.),
0048 
0049     phoIsoConeSize = cms.double(0.4),
0050     phoMaxRelIso = cms.double(0.5),
0051     phoMinPt = cms.double(1.),
0052     phoMaxEta = cms.double(2.5),
0053 )
0054 
0055 rivetProducerHTXS = cms.EDProducer('HTXSRivetProducer',
0056    HepMCCollection = cms.InputTag('genParticles2HepMCHiggsVtx','unsmeared'),
0057    LHERunInfo = cms.InputTag('externalLHEProducer'),
0058    ProductionMode = cms.string('AUTO'),
0059 )
0060 
0061 
0062 ##################### Tables for final output and docs ##########################
0063 rivetLeptonTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0064     src = cms.InputTag("particleLevel:leptons"),
0065     cut = cms.string("pt > 15"),
0066     name= cms.string("GenDressedLepton"),
0067     doc = cms.string("Dressed leptons from Rivet-based ParticleLevelProducer"),
0068     singleton = cms.bool(False), # the number of entries is variable
0069     extension = cms.bool(False), # this is the main table
0070     externalVariables = cms.PSet(
0071         hasTauAnc = ExtVar(cms.InputTag("tautagger"),bool, doc="true if Dressed lepton has a tau as ancestor"),
0072         ),
0073     variables = cms.PSet(
0074         P4Vars,
0075         pdgId = Var("pdgId", int, doc="PDG id"), 
0076     )
0077 )
0078 
0079 rivetPhotonTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0080     src = cms.InputTag("particleLevel:photons"),
0081     cut = cms.string("pt > 10"),
0082     name= cms.string("GenIsolatedPhoton"),
0083     doc = cms.string("Isolated photons from Rivet-based ParticleLevelProducer"),
0084     singleton = cms.bool(False), # the number of entries is variable
0085     extension = cms.bool(False), # this is the main table
0086     variables = cms.PSet(
0087         P4Vars
0088     )
0089 )
0090 
0091 tautagger = cms.EDProducer("GenJetTauTaggerProducer",
0092     src = rivetLeptonTable.src,
0093 )
0094 
0095 #rivetJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0096 #    src = cms.InputTag("particleLevel:jets"),
0097 #    cut = cms.string(""),
0098 #    name= cms.string("RivetJet"),
0099 #    doc = cms.string("AK4 jets from Rivet-based ParticleLevelProducer"),
0100 #    singleton = cms.bool(False), # the number of entries is variable
0101 #    extension = cms.bool(False),
0102 #    variables = cms.PSet(
0103 #        # Identical to GenJets, so we just extend their flavor information
0104 #        P4Vars,
0105 #        hadronFlavour = Var("pdgId", int, doc="PDG id"),
0106 #    )
0107 #)
0108 
0109 #rivetFatJetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0110 #    src = cms.InputTag("particleLevel:fatjets"),
0111 #    cut = cms.string(""),
0112 #    name= cms.string("GenFatJet"),
0113 #    doc = cms.string("AK8 jets from Rivet-based ParticleLevelProducer"),
0114 #    singleton = cms.bool(False), # the number of entries is variable
0115 #    extension = cms.bool(False), # this is the main table
0116 #    variables = cms.PSet(
0117 #        P4Vars,
0118 #        hadronFlavour = Var("pdgId", int, doc="PDG id"), 
0119 #    )
0120 #)
0121 
0122 #rivetTagTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0123 #    src = cms.InputTag("particleLevel:tags"),
0124 #    cut = cms.string(""),
0125 #    name= cms.string("RivetTag"),
0126 #    doc = cms.string("Tag particles from Rivet-based ParticleLevelProducer, momenta scaled down by 10e-20"),
0127 #    singleton = cms.bool(False), # the number of entries is variable
0128 #    extension = cms.bool(False), # this is the main table
0129 #    variables = cms.PSet(
0130 #        P4Vars,
0131 #        pdgId = Var("pdgId", int, doc="PDG id"), 
0132 #    )
0133 #)
0134 
0135 rivetMetTable = cms.EDProducer("SimpleCandidateFlatTableProducer",
0136     src = cms.InputTag("particleLevel:mets"),
0137     name = cms.string("MET"),
0138     doc = cms.string("MET from Rivet-based ParticleLevelProducer in fiducial volume abs(eta)<5"),
0139     singleton = cms.bool(True),  # there's always exactly one MET per event
0140     extension = cms.bool(True), # this is the main table
0141     variables = cms.PSet(
0142        fiducialGenPt  = Var("pt",  float, precision=10),
0143        fiducialGenPhi = Var("phi", float, precision=10),
0144     ),
0145 )
0146 
0147 HTXSCategoryTable = cms.EDProducer("SimpleHTXSFlatTableProducer",
0148     src = cms.InputTag("rivetProducerHTXS","HiggsClassification"),
0149     cut = cms.string(""),
0150     name = cms.string("HTXS"),
0151     doc = cms.string("HTXS classification"),
0152     singleton = cms.bool(True),
0153     extension = cms.bool(False),
0154     variables=cms.PSet(
0155         stage_0 = Var("stage0_cat",int, doc="HTXS stage-0 category"),
0156         stage_1_pTjet30 = Var("stage1_cat_pTjet30GeV",int, doc="HTXS stage-1 category (jet pt>30 GeV)"),
0157         stage_1_pTjet25 = Var("stage1_cat_pTjet25GeV",int, doc="HTXS stage-1 category (jet pt>25 GeV)"),
0158         stage1_1_cat_pTjet30GeV = Var("stage1_1_cat_pTjet30GeV",int,doc="HTXS stage-1.1 category(jet pt>30 GeV)"),
0159         stage1_1_cat_pTjet25GeV = Var("stage1_1_cat_pTjet25GeV",int,doc="HTXS stage-1.1 category(jet pt>25 GeV)"),
0160         stage1_1_fine_cat_pTjet30GeV = Var("stage1_1_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.1-fine category(jet pt>30 GeV)"),
0161         stage1_1_fine_cat_pTjet25GeV = Var("stage1_1_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.1-fine category(jet pt>25 GeV)"),
0162         stage1_2_cat_pTjet30GeV = Var("stage1_2_cat_pTjet30GeV",int,doc="HTXS stage-1.2 category(jet pt>30 GeV)"),
0163         stage1_2_cat_pTjet25GeV = Var("stage1_2_cat_pTjet25GeV",int,doc="HTXS stage-1.2 category(jet pt>25 GeV)"),
0164         stage1_2_fine_cat_pTjet30GeV = Var("stage1_2_fine_cat_pTjet30GeV",int,doc="HTXS stage-1.2-fine category(jet pt>30 GeV)"),
0165         stage1_2_fine_cat_pTjet25GeV = Var("stage1_2_fine_cat_pTjet25GeV",int,doc="HTXS stage-1.2-fine category(jet pt>25 GeV)"),
0166         Higgs_pt = Var("higgs.Pt()",float, doc="pt of the Higgs boson as identified in HTXS", precision=14),
0167         Higgs_y = Var("higgs.Rapidity()",float, doc="rapidity of the Higgs boson as identified in HTXS", precision=12),
0168         njets30 = Var("jets30.size()","uint8", doc="number of jets with pt>30 GeV as identified in HTXS"),
0169         njets25 = Var("jets25.size()","uint8", doc="number of jets with pt>25 GeV as identified in HTXS"),
0170    )
0171 )
0172 
0173 lheInfoTable = cms.EDProducer("LHETablesProducer",
0174      lheInfo = cms.VInputTag(cms.InputTag("externalLHEProducer"), cms.InputTag("source")),
0175      precision = cms.int32(14),
0176      storeLHEParticles = cms.bool(True)
0177  )
0178 
0179 particleLevelTask = cms.Task(mergedGenParticles,genParticles2HepMC,particleLevel,tautagger,genParticles2HepMCHiggsVtx,rivetProducerHTXS)
0180 particleLevelTablesTask = cms.Task(rivetLeptonTable,rivetPhotonTable,rivetMetTable,HTXSCategoryTable,lheInfoTable)