CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RestoreRandomSeedsDigi.py
Go to the documentation of this file.
1 #G.Benelli Feb 7 2008
2 #This fragment is used to have the random generator seeds saved to test
3 #simulation reproducibility. Anothe fragment then allows to run on the
4 #root output of cmsDriver.py to test reproducibility.
5 
6 import FWCore.ParameterSet.Config as cms
7 def customise(process):
8  #Renaming the process
9  process.__dict__['_Process__name']='DIGIRestoringSeeds'
10  #Skipping the first 3 events:
11  process.PoolSource.skipEvents=cms.untracked.uint32(3)
12  #Adding RandomNumberGeneratorService
13  process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string('rndmStore')
14  process.RandomNumberGeneratorService.VtxSmeared.initialSeed = cms.untracked.uint32(1)
15  process.RandomNumberGeneratorService.g4SimHits.initialSeed = cms.untracked.uint32(1)
16  process.RandomNumberGeneratorService.mix.initialSeed = cms.untracked.uint32(1)
17  process.RandomNumberGeneratorService.simSiPixelDigis.initialSeed = cms.untracked.uint32(1)
18  process.RandomNumberGeneratorService.simSiStripDigis.initialSeed = cms.untracked.uint32(1)
19  process.RandomNumberGeneratorService.simEcalUnsuppressedDigis.initialSeed = cms.untracked.uint32(1)
20  process.RandomNumberGeneratorService.simHcalUnsuppressedDigis.initialSeed = cms.untracked.uint32(1)
21  process.RandomNumberGeneratorService.simMuonCSCDigis.initialSeed = cms.untracked.uint32(1)
22  process.RandomNumberGeneratorService.simMuonDTDigis.initialSeed = cms.untracked.uint32(1)
23  process.RandomNumberGeneratorService.simMuonRPCDigis.initialSeed = cms.untracked.uint32(1)
24  #This line is necessary to eliminate the "theSource" (i.e. source seed) in the python configuration!
25  del process.RandomNumberGeneratorService.theSource
26  #Adding the RandomEngine seeds to the content
27  #process.out_step.outputCommands.append("drop *_*_*_Sim")
28  process.output.outputCommands.append("keep RandomEngineStates_*_*_*")
29  #process.g4SimHits_step=cms.Path(process.g4SimHits)
30  #Modifying the schedule:
31  #First delete the current one:
32  del process.schedule[:]
33  #Then add the wanted sequences
34  process.schedule.append(process.digitisation_step)
35  process.schedule.append(process.out_step)
36  #Adding SimpleMemoryCheck service:
37  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
38  ignoreTotal=cms.untracked.int32(1),
39  oncePerEventMode=cms.untracked.bool(True))
40  #Adding Timing service:
41  process.Timing=cms.Service("Timing")
42 
43  #Add these 3 lines to put back the summary for timing information at the end of the logfile
44  #(needed for TimeReport report)
45  process.options = cms.untracked.PSet(
46  wantSummary = cms.untracked.bool(True)
47  )
48 
49  return(process)
return((rh^lh)&mask)