CMS 3D CMS Logo

SaveRandomSeedsDigi.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']='DIGISavingSeeds'
10  #Storing the random seeds
11  process.rndmStore=cms.EDProducer("RandomEngineStateProducer")
12  #Adding the RandomEngine seeds to the content
13  process.output.outputCommands.append("keep RandomEngineStates_*_*_*")
14  process.rndmStore_step=cms.Path(process.rndmStore)
15  #Modifying the schedule:
16  #First delete the current one:
17  del process.schedule[:]
18  #Then add the wanted sequences
19  process.schedule.append(process.digitisation_step)
20  process.schedule.append(process.rndmStore_step)
21  process.schedule.append(process.out_step)
22  #Adding SimpleMemoryCheck service:
23  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
24  ignoreTotal=cms.untracked.int32(1),
25  oncePerEventMode=cms.untracked.bool(True))
26  #Adding Timing service:
27  process.Timing=cms.Service("Timing")
28 
29  #Add these 3 lines to put back the summary for timing information at the end of the logfile
30  #(needed for TimeReport report)
31  if hasattr(process,'options'):
32  process.options.wantSummary = cms.untracked.bool(True)
33  else:
34  process.options = cms.untracked.PSet(
35  wantSummary = cms.untracked.bool(True)
36  )
37 
38  return(process)
return(e1-e2)*(e1-e2)+dp *dp