Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-05-09 22:40:13

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 
0004 # Primary Vertex Producer: Defines the collection of primary vertices to be included in the NANOAOD

0005 primaryVertexBPH = cms.EDProducer(
0006     "PrimaryVertexMerger",
0007     vertices = cms.InputTag("offlineSlimmedPrimaryVertices"),
0008     beamSpot = cms.InputTag("offlineBeamSpot"),
0009     minNdof  = cms.double(4.0),  # Minimum degrees of freedom for vertex

0010     maxZ     = cms.double(24.0), # Maximum Z coordinate [cm]

0011     maxRho   = cms.double(2.0)   # Maximum transverse distance from beamline [cm]

0012 )
0013 
0014 # Primary Vertex Table: Flattens the primary vertex information into a table format suitable for NANOAOD

0015 primaryVertexBPHTable = cms.EDProducer(
0016     "SimpleCandidateFlatTableProducer",
0017     src  = cms.InputTag("primaryVertexBPH"),
0018     cut  = cms.string(""), # No additional selection applied to vertices

0019     name = cms.string("PrimaryVertex"),
0020     doc  = cms.string("Offline primary vertices after basic selection"),
0021     singleton = cms.bool(False), # Variable number of entries

0022     extension = cms.bool(False), # This is the main table for primary vertices

0023     variables = cms.PSet(
0024         x       = Var("position().x()", float, doc="x coordinate of vertex position [cm]", precision=10),
0025         y       = Var("position().y()", float, doc="y coordinate of vertex position [cm]", precision=10),
0026         z       = Var("position().z()", float, doc="z coordinate of vertex position [cm]", precision=10),
0027         ndof    = Var("vertexNdof()", float, doc="Number of degrees of freedom of the vertex fit", precision=10),
0028         chi2    = Var("vertexChi2()", float, doc="Chi-squared of the vertex fit", precision=10),
0029         trkSize = Var("numberOfDaughters()", int, doc="Number of associated tracks", precision=10),
0030         covXX   = Var("vertexCovariance(0, 0)", float, doc="Covariance of x with x", precision=10),
0031         covYY   = Var("vertexCovariance(1, 1)", float, doc="Covariance of y with y", precision=10),
0032         covZZ   = Var("vertexCovariance(2, 2)", float, doc="Covariance of z with z", precision=10),
0033         covXY   = Var("vertexCovariance(0, 1)", float, doc="Covariance of x with y", precision=10),
0034         covXZ   = Var("vertexCovariance(0, 2)", float, doc="Covariance of x with z", precision=10),
0035         covYZ   = Var("vertexCovariance(1, 2)", float, doc="Covariance of y with z", precision=10),
0036     ),
0037 )
0038 
0039 primaryVertexBPHSequence = cms.Sequence(primaryVertexBPH)
0040 primaryVertexBPHTables   = cms.Sequence(primaryVertexBPHTable)