Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-12 09:07:48

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 
0004 beamSpotTable = cms.EDProducer("SimpleBeamspotFlatTableProducer",
0005     src = cms.InputTag("offlineBeamSpot"),
0006     name = cms.string("BeamSpot"),
0007     doc = cms.string("offlineBeamSpot, the offline reconstructed beamspot"),
0008     singleton = cms.bool(True),  # there's always exactly one MET per event
0009     extension = cms.bool(False), # this is the main table for the MET
0010     variables = cms.PSet(
0011        type = Var("type()","int8",doc="BeamSpot type (Unknown = -1, Fake = 0, LHC = 1, Tracker = 2)"),
0012        z = Var("position().z()",float,doc="BeamSpot center, z coordinate (cm)",precision=-1),
0013        zError = Var("z0Error()",float,doc="Error on BeamSpot center, z coordinate (cm)",precision=-1),
0014        sigmaZ = Var("sigmaZ()",float,doc="Width of BeamSpot in z (cm)",precision=-1),
0015        sigmaZError = Var("sigmaZ0Error()",float,doc="Error on width of BeamSpot in z (cm)",precision=-1),
0016     ),
0017 )
0018 
0019 rhoTable = cms.EDProducer("GlobalVariablesTableProducer",
0020     name = cms.string("Rho"),
0021     variables = cms.PSet(
0022         fixedGridRhoAll = ExtVar( cms.InputTag("fixedGridRhoAll"), "double", doc = "rho from all PF Candidates, no foreground removal (for isolation of prompt photons)" ),
0023         fixedGridRhoFastjetAll = ExtVar( cms.InputTag("fixedGridRhoFastjetAll"), "double", doc = "rho from all PF Candidates, used e.g. for JECs" ),
0024         fixedGridRhoFastjetCentralNeutral = ExtVar( cms.InputTag("fixedGridRhoFastjetCentralNeutral"), "double", doc = "rho from neutral PF Candidates with |eta| < 2.5, used e.g. for rho corrections of some lepton isolations" ),
0025         fixedGridRhoFastjetCentralCalo = ExtVar( cms.InputTag("fixedGridRhoFastjetCentralCalo"), "double", doc = "rho from calo towers with |eta| < 2.5, used e.g. egamma PFCluster isolation" ),
0026         fixedGridRhoFastjetCentral = ExtVar( cms.InputTag("fixedGridRhoFastjetCentral"), "double", doc = "rho from all PF Candidates for central region, used e.g. for JECs" ),
0027         fixedGridRhoFastjetCentralChargedPileUp = ExtVar( cms.InputTag("fixedGridRhoFastjetCentralChargedPileUp"), "double", doc = "rho from charged PF Candidates for central region, used e.g. for JECs" ),
0028     )
0029 )
0030 
0031 puTable = cms.EDProducer("NPUTablesProducer",
0032         src = cms.InputTag("slimmedAddPileupInfo"),
0033         pvsrc = cms.InputTag("offlineSlimmedPrimaryVertices"),
0034         zbins = cms.vdouble( [0.0,1.7,2.6,3.0,3.5,4.2,5.2,6.0,7.5,9.0,12.0] ),
0035         savePtHatMax = cms.bool(False), 
0036 )
0037 
0038 genTable  = cms.EDProducer("SimpleGenEventFlatTableProducer",
0039         src = cms.InputTag("generator"),
0040         cut = cms.string(""), 
0041         name= cms.string("Generator"),
0042         doc = cms.string("Generator information"),
0043         singleton = cms.bool(True), 
0044         extension = cms.bool(False),
0045     variables = cms.PSet(
0046         x1 = Var( "?hasPDF?pdf().x.first:-1", float, doc="x1 fraction of proton momentum carried by the first parton",precision=14 ),
0047         x2 = Var( "?hasPDF?pdf().x.second:-1", float, doc="x2 fraction of proton momentum carried by the second parton",precision=14 ),
0048         xpdf1 = Var( "?hasPDF?pdf().xPDF.first:-1", float, doc="x*pdf(x) for the first parton", precision=14 ),
0049         xpdf2 = Var( "?hasPDF?pdf().xPDF.second:-1", float, doc="x*pdf(x) for the second parton", precision=14 ),
0050         id1 = Var( "?hasPDF?pdf().id.first:-1", int, doc="id of first parton", precision=6 ),
0051         id2 = Var( "?hasPDF?pdf().id.second:-1", int, doc="id of second parton", precision=6 ),
0052         scalePDF = Var( "?hasPDF?pdf().scalePDF:-1", float, doc="Q2 scale for PDF", precision=14 ),
0053         binvar = Var("?hasBinningValues()?binningValues()[0]:-1", float, doc="MC generation binning value", precision=14),
0054         weight = Var("weight()", float,doc="MC generator weight", precision=14),
0055         ),
0056 )
0057 
0058 genFilterTable = cms.EDProducer("SimpleGenFilterFlatTableProducerLumi",
0059         src = cms.InputTag("genFilterEfficiencyProducer"),
0060         cut = cms.string(""), 
0061         name= cms.string("GenFilter"),
0062         doc = cms.string("Generator filter information"),
0063         singleton = cms.bool(True), 
0064         extension = cms.bool(False),
0065     variables = cms.PSet(
0066         numEventsTotal        = Var("numEventsTotal()",        int,   doc="generator filter: total number of events",  precision=6),
0067         numEventsPassed       = Var("numEventsPassed()",       int,   doc="generator filter: passed number of events", precision=6),
0068         filterEfficiency      = Var("filterEfficiency()",      float, doc="generator filter: efficiency",              precision=14),
0069         filterEfficiencyError = Var("filterEfficiencyError()", float, doc="generator filter: efficiency error",        precision=14),
0070         ),
0071 )
0072 
0073 globalTablesTask = cms.Task(beamSpotTable, rhoTable)
0074 globalTablesMCTask = cms.Task(puTable,genTable,genFilterTable)