def makeProcess(numEvents = 200): """ _makeProcess_ Create a new Process instance """ proc = Process("HLT") proc.include("FWCore/MessageLogger/data/MessageLogger.cfi") configName = "fake-streamer-config" configVersion = timestamp() configAnnot = "auto generated fake streamer config" proc.configurationMetadata = CmsTypes.untracked(CmsTypes.PSet()) proc.configurationMetadata.name = CmsTypes.untracked(CmsTypes.string( configName)) proc.configurationMetadata.version = CmsTypes.untracked(CmsTypes.string( configVersion)) proc.configurationMetadata.annotation = CmsTypes.untracked(CmsTypes.string( configAnnot)) proc.options = CmsTypes.untracked(CmsTypes.PSet()) proc.options.wantSummary = CmsTypes.untracked(CmsTypes.bool(True)) proc.source = Source("EmptySource") proc.maxEvents = CmsTypes.untracked(CmsTypes.PSet()) proc.maxEvents.input = CmsTypes.untracked(CmsTypes.int32(numEvents)) proc.prod = EDProducer("StreamThingProducer") proc.prod.array_size = CmsTypes.int32(2500) proc.prod.instance_count = CmsTypes.int32(150) proc.prod.apply_bit_mask = CmsTypes.untracked(CmsTypes.bool(True)) proc.prod.bit_mask = CmsTypes.untracked( CmsTypes.uint32( 16777215)) proc.add_(Service("RandomNumberGeneratorService")) svc = proc.services["RandomNumberGeneratorService"] svc.moduleSeeds = CmsTypes.PSet() proc.makeData = Path(proc.prod) return proc
def addOutputModule(process, fileName): """ _addOutputModule_ """ outMod = OutputModule("EventStreamFileWriter") outMod.max_event_size = CmsTypes.untracked(CmsTypes.int32(7000000)) outMod.max_queue_depth = CmsTypes.untracked(CmsTypes.int32(5)) outMod.use_compression = CmsTypes.untracked(CmsTypes.bool(True)) outMod.compression_level = CmsTypes.untracked(CmsTypes.int32(1)) streamer = "%s.dat" % fileName indexFile = "%s.ind" % fileName outMod.fileName = CmsTypes.untracked(CmsTypes.string(streamer)) outMod.indexFileName = CmsTypes.untracked(CmsTypes.string(indexFile)) process.out = outMod process.o = EndPath(process.out) return