CMS 3D CMS Logo

G4StepStatistics.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 def customise(process):
3  #Adding SimpleMemoryCheck service:
4  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
5  ignoreTotal=cms.untracked.int32(1),
6  oncePerEventMode=cms.untracked.bool(True))
7  #Adding Timing service:
8  process.Timing=cms.Service("Timing")
9 
10  #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
11  #print process.MessageLogger.__dict__
12  #Configuring the G4msg.log output
13  process.MessageLogger.files = dict(G4msg = cms.untracked.PSet(
14  noTimeStamps = cms.untracked.bool(True)
15  #First eliminate unneeded output
16  ,threshold = cms.untracked.string('INFO')
17  ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
18  ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
19  ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
20  ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
21  ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
22  ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
23  ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
24  ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
25  ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
26  #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
27  #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
28  #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
29  #
30  #Then add the wanted ones:
31  ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
32  ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
33  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
34  )
35 )
36 
37  #Add these 3 lines to put back the summary for timing information at the end of the logfile
38  #(needed for TimeReport report)
39  process.options = cms.untracked.PSet(
40  wantSummary = cms.untracked.bool(True)
41  )
42 
43  process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
44  type = cms.string('G4StepStatistics'),
45  verbose = cms.untracked.bool(True)
46  ))
47 
48  process.TFileService = cms.Service("TFileService",
49  fileName = cms.string("G4StepStatistics.root"),
50  closeFileFast = cms.untracked.bool(True)
51  )
52  return(process)
53 
return((rh ^ lh) &mask)
def customise(process)