CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  process.MessageLogger.destinations=cms.untracked.vstring('cout'
13  ,'cerr'
14  ,'G4msg'
15  )
16  process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
17  ,'FwkReport'
18  ,'FwkSummary'
19  ,'Root_NoDictionary'
20  ,'TimeReport'
21  ,'TimeModule'
22  ,'TimeEvent'
23  ,'MemoryCheck'
24  ,'PhysicsList'
25  ,'G4cout'
26  ,'G4cerr'
27  )
28  #Configuring the G4msg.log output
29  process.MessageLogger.G4msg = cms.untracked.PSet(
30  noTimeStamps = cms.untracked.bool(True)
31  #First eliminate unneeded output
32  ,threshold = cms.untracked.string('INFO')
33  ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
34  ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
35  ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
36  ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
37  ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
38  ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
39  ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
40  ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
41  ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
42  #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
43  #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
44  #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
45  #
46  #Then add the wanted ones:
47  ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
48  ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
49  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
50  )
51 
52  #Add these 3 lines to put back the summary for timing information at the end of the logfile
53  #(needed for TimeReport report)
54  process.options = cms.untracked.PSet(
55  wantSummary = cms.untracked.bool(True)
56  )
57 
58  process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
59  type = cms.string('G4StepStatistics'),
60  verbose = cms.untracked.bool(True)
61  ))
62 
63  process.TFileService = cms.Service("TFileService",
64  fileName = cms.string("G4StepStatistics.root"),
65  closeFileFast = cms.untracked.bool(True)
66  )
67  return(process)
68 
return(e1-e2)*(e1-e2)+dp *dp