CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/Validation/Performance/python/SaveRandomSeedsSim.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']='SIMSavingSeeds'
00010     #Storing the random seeds
00011     #This would no more be necessary, randomEngineStateProducer is always in the configuration
00012     #But I prefer to delete it and call it rndStore:
00013     #del process.randomEngineStateProducer
00014     process.rndmStore=cms.EDProducer("RandomEngineStateProducer")
00015     #Adding the RandomEngine seeds to the content
00016     process.output.outputCommands.append("keep RandomEngineStates_*_*_*")
00017     process.rndmStore_step=cms.Path(process.rndmStore)
00018     #Modifying the schedule:
00019     #First delete the current one:
00020     del process.schedule[:]
00021     #Then add the wanted sequences
00022     process.schedule.append(process.simulation_step)
00023     process.schedule.append(process.rndmStore_step)
00024     process.schedule.append(process.out_step)
00025     #Adding SimpleMemoryCheck service:
00026     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
00027                                           ignoreTotal=cms.untracked.int32(1),
00028                                           oncePerEventMode=cms.untracked.bool(True))
00029     #Adding Timing service:
00030     process.Timing=cms.Service("Timing")
00031     
00032     #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
00033     process.MessageLogger.destinations=cms.untracked.vstring('warnings'
00034                                                              , 'errors'
00035                                                              , 'infos'
00036                                                              , 'debugs'
00037                                                              , 'cout'
00038                                                              , 'cerr'
00039                                                              , 'G4msg'
00040                                                              )
00041     process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
00042                                                            ,'FwkReport'
00043                                                            ,'FwkSummary'
00044                                                            ,'Root_NoDictionary'
00045                                                            ,'G4cout'
00046                                                            ,'G4cerr'
00047                                                            )
00048     process.MessageLogger.cerr = cms.untracked.PSet(
00049         noTimeStamps = cms.untracked.bool(True)
00050         )
00051     process.MessageLogger.G4msg =  cms.untracked.PSet(
00052         noTimeStamps = cms.untracked.bool(True)
00053         ,threshold = cms.untracked.string('INFO')
00054         ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
00055         ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00056         ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00057         )
00058     return(process)