CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
Repack Namespace Reference

Functions

def repackProcess
 

Function Documentation

def Repack.repackProcess (   args)
_repackProcess_

Creates and returns a repack process

supported options:

- outputs      : defines output modules

Definition at line 12 of file Repack.py.

Referenced by Scenario.Scenario.repack().

12 
13 def repackProcess(**args):
14  """
15  _repackProcess_
16 
17  Creates and returns a repack process
18 
19  supported options:
20 
21  - outputs : defines output modules
22 
23  """
24  process = cms.Process("REPACK")
25  process.load("FWCore.MessageLogger.MessageLogger_cfi")
26 
27  process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
28 
29  process.configurationMetadata = cms.untracked.PSet(
30  name = cms.untracked.string("repack-config"),
31  version = cms.untracked.string("none"),
32  annotation = cms.untracked.string("auto generated configuration")
33  )
34 
35  process.options = cms.untracked.PSet(
36  Rethrow = cms.untracked.vstring("ProductNotFound","TooManyProducts","TooFewProducts"),
37  wantSummary = cms.untracked.bool(False)
38  )
39 
40  process.source = cms.Source(
41  "NewEventStreamFileReader",
42  fileNames = cms.untracked.vstring()
43  )
44 
45  outputs = args.get('outputs', [])
46 
47  if len(outputs) > 0:
48  process.outputPath = cms.EndPath()
49 
50  for output in outputs:
51 
52  moduleLabel = output['moduleLabel']
53  selectEvents = output.get('selectEvents', None)
54  maxSize = output.get('maxSize', None)
55 
56  outputModule = cms.OutputModule(
57  "PoolOutputModule",
58  fileName = cms.untracked.string("%s.root" % moduleLabel)
59  )
60 
61  outputModule.dataset = cms.untracked.PSet(dataTier = cms.untracked.string("RAW"))
62 
63  if maxSize != None:
64  outputModule.maxSize = cms.untracked.int32(maxSize)
65 
66  if selectEvents != None:
67  outputModule.SelectEvents = cms.untracked.PSet(
68  SelectEvents = cms.vstring(selectEvents)
69  )
70 
71  setattr(process, moduleLabel, outputModule)
72 
73  process.outputPath += outputModule
74 
75  return process
def repackProcess
Definition: Repack.py:12