File indexing completed on 2024-04-06 12:23:59
0001
0002 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0003
0004
0005
0006 process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff")
0007 patAlgosToolsTask.add(process.patCandidatesTask)
0008
0009 process.patTaus.skipMissingTauID = True
0010
0011 process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff")
0012 patAlgosToolsTask.add(process.selectedPatCandidatesTask)
0013
0014
0015 from PhysicsTools.PatAlgos.tools.trackTools import *
0016
0017 makeTrackCandidates(process,
0018 label = 'TrackCands',
0019 tracks = cms.InputTag('generalTracks'),
0020 particleType = 'pi+',
0021 preselection = 'pt > 10',
0022 selection = 'pt > 10',
0023 isolation = {'tracker':0.3},
0024 isoDeposits = [],
0025 mcAs = 'muon'
0026 )
0027
0028
0029 process.bestVertex = cms.EDFilter(
0030 "PATSingleVertexSelector",
0031 mode = cms.string("nearestToCandidate"),
0032 fallbacks = cms.vstring("fromCandidate", "beamSpot"),
0033 vertices = cms.InputTag("offlinePrimaryVerticesWithBS"),
0034 vertexPreselection = cms.vstring("(chi2prob(chi2,ndf) > 0.01) && (trackSize >= 3)"),
0035 candidates = cms.VInputTag(cms.InputTag('gedGsfElectrons'), cms.InputTag('muons')),
0036 candidatePreselection = cms.string("pt > 5"),
0037 beamSpot = cms.InputTag('offlineBeamSpot'),
0038 )
0039 patAlgosToolsTask.add(process.bestVertex)
0040
0041
0042 process.patTrackVertexInfo = cms.EDProducer(
0043 "PATVertexAssociationProducer",
0044 candidates = cms.VInputTag(
0045 cms.InputTag('gedGsfElectrons'),
0046 cms.InputTag('muons'),
0047 cms.InputTag('patAODTrackCands'),
0048 ),
0049 useTracks = cms.bool(True),
0050 vertices = cms.InputTag('bestVertex'),
0051 )
0052 patAlgosToolsTask.add(process.patTrackVertexInfo)
0053
0054
0055 process.patTrackCands.vertexing = cms.PSet(
0056 vertexAssociations = cms.InputTag("patTrackVertexInfo"),
0057 )
0058
0059
0060 process.out.outputCommands.append('keep *_selectedPatTrackCands_*_*')
0061 process.out.outputCommands.append('keep *_patTrackVertexInfo_*_*')
0062 process.out.outputCommands.append('keep *_bestVertex_*_*')
0063
0064
0065
0066
0067
0068
0069
0070
0071 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0072 process.source.fileNames = filesRelValProdTTbarAODSIM
0073
0074 process.maxEvents.input = 10
0075
0076
0077
0078 process.out.fileName = 'patTuple_addVertexInfo.root'
0079
0080