Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import Var,ExtVar
0003 from PhysicsTools.NanoAOD.nano_eras_cff import *
0004 
0005 genVertexTable = cms.EDProducer("SimpleXYZPointFlatTableProducer",
0006     src = cms.InputTag("genParticles:xyz0"),
0007     cut = cms.string(""), 
0008     name= cms.string("GenVtx"),
0009     doc = cms.string("Gen vertex"),
0010     singleton = cms.bool(True), 
0011     extension = cms.bool(False), 
0012     variables = cms.PSet(
0013          x = Var("X", float, doc="gen vertex x", precision=10),
0014          y = Var("Y", float, doc="gen vertex y", precision=10),
0015          z = Var("Z", float, doc="gen vertex z", precision=16),
0016     ) 
0017 )
0018 
0019 genVertexT0Table = cms.EDProducer("GlobalVariablesTableProducer",
0020     name = cms.string("GenVtx"),
0021     extension = cms.bool(True), 
0022     variables = cms.PSet(
0023         t0 = ExtVar( cms.InputTag("genParticles:t0"), "float", doc = "gen vertex t0", precision=12),
0024     )
0025 )
0026 
0027 genVertexTablesTask = cms.Task(genVertexTable,genVertexT0Table)
0028 
0029 # GenVertex only stored in newer MiniAOD
0030 (run2_nanoAOD_92X | run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toReplaceWith(genVertexTablesTask, cms.Task())