CMS 3D CMS Logo

globals_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from PhysicsTools.NanoAOD.globalVariablesTableProducer_cfi import globalVariablesTableProducer
4 from PhysicsTools.NanoAOD.simpleBeamspotFlatTableProducer_cfi import simpleBeamspotFlatTableProducer
5 from PhysicsTools.NanoAOD.simpleGenEventFlatTableProducer_cfi import simpleGenEventFlatTableProducer
6 from PhysicsTools.NanoAOD.simpleGenFilterFlatTableProducerLumi_cfi import simpleGenFilterFlatTableProducerLumi
7 
8 beamSpotTable = simpleBeamspotFlatTableProducer.clone(
9  src = cms.InputTag("offlineBeamSpot"),
10  name = cms.string("BeamSpot"),
11  doc = cms.string("offlineBeamSpot, the offline reconstructed beamspot"),
12  variables = cms.PSet(
13  type = Var("type()","int8",doc="BeamSpot type (Unknown = -1, Fake = 0, LHC = 1, Tracker = 2)"),
14  z = Var("position().z()",float,doc="BeamSpot center, z coordinate (cm)",precision=-1),
15  zError = Var("z0Error()",float,doc="Error on BeamSpot center, z coordinate (cm)",precision=-1),
16  sigmaZ = Var("sigmaZ()",float,doc="Width of BeamSpot in z (cm)",precision=-1),
17  sigmaZError = Var("sigmaZ0Error()",float,doc="Error on width of BeamSpot in z (cm)",precision=-1),
18  ),
19 )
20 
21 rhoTable = globalVariablesTableProducer.clone(
22  name = cms.string("Rho"),
23  variables = cms.PSet(
24  fixedGridRhoAll = ExtVar( cms.InputTag("fixedGridRhoAll"), "double", doc = "rho from all PF Candidates, no foreground removal (for isolation of prompt photons)" ),
25  fixedGridRhoFastjetAll = ExtVar( cms.InputTag("fixedGridRhoFastjetAll"), "double", doc = "rho from all PF Candidates, used e.g. for JECs" ),
26  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" ),
27  fixedGridRhoFastjetCentralCalo = ExtVar( cms.InputTag("fixedGridRhoFastjetCentralCalo"), "double", doc = "rho from calo towers with |eta| < 2.5, used e.g. egamma PFCluster isolation" ),
28  fixedGridRhoFastjetCentral = ExtVar( cms.InputTag("fixedGridRhoFastjetCentral"), "double", doc = "rho from all PF Candidates for central region, used e.g. for JECs" ),
29  fixedGridRhoFastjetCentralChargedPileUp = ExtVar( cms.InputTag("fixedGridRhoFastjetCentralChargedPileUp"), "double", doc = "rho from charged PF Candidates for central region, used e.g. for JECs" ),
30  )
31 )
32 
33 puTable = cms.EDProducer("NPUTablesProducer",
34  src = cms.InputTag("slimmedAddPileupInfo"),
35  pvsrc = cms.InputTag("offlineSlimmedPrimaryVertices"),
36  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] ),
37  savePtHatMax = cms.bool(False),
38 )
39 
40 genTable = simpleGenEventFlatTableProducer.clone(
41  src = cms.InputTag("generator"),
42  name= cms.string("Generator"),
43  doc = cms.string("Generator information"),
44  variables = cms.PSet(
45  x1 = Var( "?hasPDF?pdf().x.first:-1", float, doc="x1 fraction of proton momentum carried by the first parton",precision=14 ),
46  x2 = Var( "?hasPDF?pdf().x.second:-1", float, doc="x2 fraction of proton momentum carried by the second parton",precision=14 ),
47  xpdf1 = Var( "?hasPDF?pdf().xPDF.first:-1", float, doc="x*pdf(x) for the first parton", precision=14 ),
48  xpdf2 = Var( "?hasPDF?pdf().xPDF.second:-1", float, doc="x*pdf(x) for the second parton", precision=14 ),
49  id1 = Var( "?hasPDF?pdf().id.first:-1", int, doc="id of first parton", precision=6 ),
50  id2 = Var( "?hasPDF?pdf().id.second:-1", int, doc="id of second parton", precision=6 ),
51  scalePDF = Var( "?hasPDF?pdf().scalePDF:-1", float, doc="Q2 scale for PDF", precision=14 ),
52  binvar = Var("?hasBinningValues()?binningValues()[0]:-1", float, doc="MC generation binning value", precision=14),
53  weight = Var("weight()", float,doc="MC generator weight", precision=14),
54  ),
55 )
56 
57 genFilterTable = simpleGenFilterFlatTableProducerLumi.clone(
58  src = cms.InputTag("genFilterEfficiencyProducer"),
59  name= cms.string("GenFilter"),
60  doc = cms.string("Generator filter information"),
61  variables = cms.PSet(
62  numEventsTotal = Var("numEventsTotal()", int, doc="generator filter: total number of events", precision=6),
63  numEventsPassed = Var("numEventsPassed()", int, doc="generator filter: passed number of events", precision=6),
64  filterEfficiency = Var("filterEfficiency()", float, doc="generator filter: efficiency", precision=14),
65  filterEfficiencyError = Var("filterEfficiencyError()", float, doc="generator filter: efficiency error", precision=14),
66  ),
67 )
68 
69 globalTablesTask = cms.Task(beamSpotTable, rhoTable)
70 globalTablesMCTask = cms.Task(puTable,genTable,genFilterTable)
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:27
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16