1 import FWCore.ParameterSet.Config
as cms
3 from PhysicsTools.NanoAOD.simpleCandidateFlatTableProducer_cfi
import simpleCandidateFlatTableProducer
10 vertexTable = cms.EDProducer(
"VertexTableProducer",
11 pvSrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
12 goodPvCut = cms.string(
"!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"),
13 svSrc = cms.InputTag(
"linkedObjects",
"vertices"),
14 svCut = cms.string(
""),
15 dlenMin = cms.double(0),
16 dlenSigMin = cms.double(3),
17 pvName = cms.string(
"PV"),
18 svName = cms.string(
"SV"),
19 svDoc = cms.string(
"secondary vertices from IVF algorithm"),
22 svCandidateTable = simpleCandidateFlatTableProducer.clone(
23 src = cms.InputTag(
"vertexTable"),
24 name = cms.string(
"SV"),
25 extension = cms.bool(
True),
26 variables = cms.PSet(P4Vars,
27 x =
Var(
"position().x()", float, doc =
"secondary vertex X position, in cm",precision=10),
28 y =
Var(
"position().y()", float, doc =
"secondary vertex Y position, in cm",precision=10),
29 z =
Var(
"position().z()", float, doc =
"secondary vertex Z position, in cm",precision=14),
30 ndof =
Var(
"vertexNdof()", float, doc =
"number of degrees of freedom",precision=8),
31 chi2 =
Var(
"vertexNormalizedChi2()", float, doc =
"reduced chi2, i.e. chi/ndof",precision=8),
32 ntracks =
Var(
"numberOfDaughters()",
"uint8", doc =
"number of tracks"),
35 svCandidateTable.variables.pt.precision=10
36 svCandidateTable.variables.phi.precision=12
40 vertexTask = cms.Task()
42 vertexTablesTask = cms.Task( vertexTable, svCandidateTable )
def Var(expr, valtype, doc=None, precision=-1)