CMS 3D CMS Logo

patTemplate_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
3 
4 process = cms.Process("PAT")
5 
6 ## MessageLogger
7 process.load("FWCore.MessageLogger.MessageLogger_cfi")
8 
9 ## Options and Output Report
10 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
11 
12 ## Source
13 process.source = cms.Source("PoolSource",
14  fileNames = cms.untracked.vstring()
15 )
16 ## Maximal Number of Events
17 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
18 
19 ## Geometry and Detector Conditions (needed for a few patTuple production steps)
20 process.load("Configuration.Geometry.GeometryRecoDB_cff")
21 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
22 from Configuration.AlCa.GlobalTag import GlobalTag
23 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
24 process.load("Configuration.StandardSequences.MagneticField_cff")
25 
26 ## Output Module Configuration (expects a path 'p')
27 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
28 process.out = cms.OutputModule("PoolOutputModule",
29  fileName = cms.untracked.string('patTuple.root'),
30  ## save only events passing the full path
31  #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
32  ## save PAT output; you need a '*' to unpack the list of commands
33  ## 'patEventContent'
34  outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning )
35  )
36 
37 patAlgosToolsTask = getPatAlgosToolsTask(process)
38 process.outpath = cms.EndPath(process.out, patAlgosToolsTask)
def getPatAlgosToolsTask(process)
Definition: helpers.py:14