CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/SimG4Core/HelpfulWatchers/python/G4StepStatistics.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 def customise(process):
00003         #Adding SimpleMemoryCheck service:
00004     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
00005                                           ignoreTotal=cms.untracked.int32(1),
00006                                           oncePerEventMode=cms.untracked.bool(True))
00007     #Adding Timing service:
00008     process.Timing=cms.Service("Timing")
00009     
00010     #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
00011     #print process.MessageLogger.__dict__
00012     process.MessageLogger.destinations=cms.untracked.vstring('cout'
00013                                                              ,'cerr'
00014                                                              ,'G4msg'
00015                                                              )
00016     process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
00017                                                            ,'FwkReport'
00018                                                            ,'FwkSummary'
00019                                                            ,'Root_NoDictionary'
00020                                                            ,'TimeReport'
00021                                                            ,'TimeModule'
00022                                                            ,'TimeEvent'
00023                                                            ,'MemoryCheck'
00024                                                            ,'PhysicsList'
00025                                                            ,'G4cout'
00026                                                            ,'G4cerr'
00027                                                            )
00028     #Configuring the G4msg.log output
00029     process.MessageLogger.G4msg =  cms.untracked.PSet(
00030         noTimeStamps = cms.untracked.bool(True)
00031         #First eliminate unneeded output
00032         ,threshold = cms.untracked.string('INFO')
00033         ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
00034         ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00035         ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00036         ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00037         ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
00038         ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00039         ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
00040         ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
00041         ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
00042         #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
00043         #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
00044         #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
00045         #
00046         #Then add the wanted ones:
00047         ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00048         ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00049         ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00050         )
00051 
00052     #Add these 3 lines to put back the summary for timing information at the end of the logfile
00053     #(needed for TimeReport report)
00054     process.options = cms.untracked.PSet(
00055         wantSummary = cms.untracked.bool(True)
00056         )
00057 
00058     process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
00059         type = cms.string('G4StepStatistics'),
00060         verbose = cms.untracked.bool(True)
00061         ))
00062 
00063     process.TFileService = cms.Service("TFileService", 
00064       fileName = cms.string("G4StepStatistics.root"),
00065       closeFileFast = cms.untracked.bool(True)
00066     )
00067     return(process)
00068