00013 :
00014 """
00015 _repackProcess_
00016
00017 Creates and returns a repack process
00018
00019 supported options:
00020
00021 - outputs : defines output modules
00022
00023 """
00024 process = cms.Process("REPACK")
00025 process.load("FWCore.MessageLogger.MessageLogger_cfi")
00026
00027 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
00028
00029 process.configurationMetadata = cms.untracked.PSet(
00030 name = cms.untracked.string("repack-config"),
00031 version = cms.untracked.string("none"),
00032 annotation = cms.untracked.string("auto generated configuration")
00033 )
00034
00035 process.options = cms.untracked.PSet(
00036 Rethrow = cms.untracked.vstring("ProductNotFound","TooManyProducts","TooFewProducts"),
00037 wantSummary = cms.untracked.bool(False)
00038 )
00039
00040 process.source = cms.Source(
00041 "NewEventStreamFileReader",
00042 fileNames = cms.untracked.vstring()
00043 )
00044
00045 outputs = args.get('outputs', [])
00046
00047 if len(outputs) > 0:
00048 process.outputPath = cms.EndPath()
00049
00050 for output in outputs:
00051
00052 moduleLabel = output['moduleLabel']
00053 selectEvents = output.get('selectEvents', None)
00054 maxSize = output.get('maxSize', None)
00055
00056 outputModule = cms.OutputModule(
00057 "PoolOutputModule",
00058 fileName = cms.untracked.string("%s.root" % moduleLabel)
00059 )
00060
00061 outputModule.dataset = cms.untracked.PSet(dataTier = cms.untracked.string("RAW"))
00062
00063 if maxSize != None:
00064 outputModule.maxSize = cms.untracked.int32(maxSize)
00065
00066 if selectEvents != None:
00067 outputModule.SelectEvents = cms.untracked.PSet(
00068 SelectEvents = cms.vstring(selectEvents)
00069 )
00070
00071 setattr(process, moduleLabel, outputModule)
00072
00073 process.outputPath += outputModule
00074
00075 return process