CMS 3D CMS Logo

Functions

G4StepStatistics Namespace Reference

Functions

def customise

Function Documentation

def G4StepStatistics::customise (   process)

Definition at line 2 of file G4StepStatistics.py.

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