Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:16:10

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 from PhysicsTools.NanoAOD.simpleCandidateFlatTableProducer_cfi import simpleCandidateFlatTableProducer
0004 
0005 
0006 ##################### User floats producers, selectors ##########################
0007 
0008 
0009 ##################### Tables for final output and docs ##########################
0010 vertexTable = cms.EDProducer("VertexTableProducer",
0011     pvSrc = cms.InputTag("offlineSlimmedPrimaryVertices"),
0012     goodPvCut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), 
0013     svSrc = cms.InputTag("linkedObjects", "vertices"),
0014     svCut = cms.string(""),  # careful: adding a cut here would make the collection matching inconsistent with the SV table
0015     dlenMin = cms.double(0),
0016     dlenSigMin = cms.double(3),
0017     pvName = cms.string("PV"),
0018     svName = cms.string("SV"),
0019     svDoc  = cms.string("secondary vertices from IVF algorithm"),
0020 )
0021 
0022 svCandidateTable =  simpleCandidateFlatTableProducer.clone(
0023     src = cms.InputTag("vertexTable"),
0024     name = cms.string("SV"),
0025     extension = cms.bool(True),
0026     variables = cms.PSet(P4Vars,
0027         x   = Var("position().x()", float, doc = "secondary vertex X position, in cm",precision=10),
0028         y   = Var("position().y()", float, doc = "secondary vertex Y position, in cm",precision=10),
0029         z   = Var("position().z()", float, doc = "secondary vertex Z position, in cm",precision=14),
0030         ndof    = Var("vertexNdof()", float, doc = "number of degrees of freedom",precision=8),
0031         chi2    = Var("vertexNormalizedChi2()", float, doc = "reduced chi2, i.e. chi/ndof",precision=8),
0032         ntracks = Var("numberOfDaughters()", "uint8", doc = "number of tracks"),
0033     ),
0034 )
0035 svCandidateTable.variables.pt.precision=10
0036 svCandidateTable.variables.phi.precision=12
0037 
0038 
0039 #before cross linking
0040 vertexTask = cms.Task()
0041 #after cross linkining
0042 vertexTablesTask = cms.Task( vertexTable, svCandidateTable )
0043