CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Validation/Performance/python/RestoreRandomSeedsDigi.py

Go to the documentation of this file.
00001 #G.Benelli Feb 7 2008
00002 #This fragment is used to have the random generator seeds saved to test
00003 #simulation reproducibility. Anothe fragment then allows to run on the
00004 #root output of cmsDriver.py to test reproducibility.
00005 
00006 import FWCore.ParameterSet.Config as cms
00007 def customise(process):
00008     #Renaming the process
00009     process.__dict__['_Process__name']='DIGIRestoringSeeds'
00010     #Skipping the first 3 events:
00011     process.PoolSource.skipEvents=cms.untracked.uint32(3)
00012     #Adding RandomNumberGeneratorService
00013     process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string('rndmStore')
00014     process.RandomNumberGeneratorService.VtxSmeared.initialSeed = cms.untracked.uint32(1)
00015     process.RandomNumberGeneratorService.g4SimHits.initialSeed = cms.untracked.uint32(1)
00016     process.RandomNumberGeneratorService.mix.initialSeed = cms.untracked.uint32(1)
00017     process.RandomNumberGeneratorService.simSiPixelDigis.initialSeed = cms.untracked.uint32(1)
00018     process.RandomNumberGeneratorService.simSiStripDigis.initialSeed = cms.untracked.uint32(1)
00019     process.RandomNumberGeneratorService.simEcalUnsuppressedDigis.initialSeed = cms.untracked.uint32(1)
00020     process.RandomNumberGeneratorService.simHcalUnsuppressedDigis.initialSeed = cms.untracked.uint32(1)
00021     process.RandomNumberGeneratorService.simMuonCSCDigis.initialSeed = cms.untracked.uint32(1)
00022     process.RandomNumberGeneratorService.simMuonDTDigis.initialSeed = cms.untracked.uint32(1)
00023     process.RandomNumberGeneratorService.simMuonRPCDigis.initialSeed = cms.untracked.uint32(1)
00024     #This line is necessary to eliminate the "theSource" (i.e. source seed) in the python configuration!
00025     del process.RandomNumberGeneratorService.theSource
00026     #Adding the RandomEngine seeds to the content
00027     #process.out_step.outputCommands.append("drop *_*_*_Sim")
00028     process.output.outputCommands.append("keep RandomEngineStates_*_*_*")
00029     #process.g4SimHits_step=cms.Path(process.g4SimHits)
00030     #Modifying the schedule:
00031     #First delete the current one:
00032     del process.schedule[:]
00033     #Then add the wanted sequences
00034     process.schedule.append(process.digitisation_step)
00035     process.schedule.append(process.out_step)
00036     #Adding SimpleMemoryCheck service:
00037     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
00038                                           ignoreTotal=cms.untracked.int32(1),
00039                                           oncePerEventMode=cms.untracked.bool(True))
00040     #Adding Timing service:
00041     process.Timing=cms.Service("Timing")
00042 
00043     #Add these 3 lines to put back the summary for timing information at the end of the logfile
00044     #(needed for TimeReport report)
00045     process.options = cms.untracked.PSet(
00046         wantSummary = cms.untracked.bool(True)
00047         )
00048     
00049     return(process)