CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MixingModule.py
Go to the documentation of this file.
1 #G.Benelli
2 #This fragment is used to add the SimpleMemoryCheck
3 #and Timing services output to the log of the simulation
4 #performance candles and add pile-up events at the DIGI level using the MixingModule.
5 #It is meant to be used with the cmsDriver.py option
6 #--customise in the following fashion:
7 #E.g.
8 #./cmsDriver.py MinBias.cfi -n 50 --step=GEN,SIM,DIGI --pileup LowLumiPileUp --customise=Validation/Performance/MixingModule.py >& MINBIAS_GEN,SIM,DIGI_PILEUP.log&
9 
10 import FWCore.ParameterSet.Config as cms
11 def customise(process):
12  #Renaming the process
13  process.__dict__['_Process__name']=process.__dict__['_Process__name']+'-PILEUP'
14  #Adding SimpleMemoryCheck service:
15  process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
16  ignoreTotal=cms.untracked.int32(1),
17  oncePerEventMode=cms.untracked.bool(True))
18  #Adding Timing service:
19  process.Timing=cms.Service("Timing")
20 
21  #Add these 3 lines to put back the summary for timing information at the end of the logfile
22  #(needed for TimeReport report)
23  if hasattr(process,'options'):
24  process.options.wantSummary = cms.untracked.bool(True)
25  else:
26  process.options = cms.untracked.PSet(
27  wantSummary = cms.untracked.bool(True)
28  )
29 
30  #Overwriting the fileNames to be used by the MixingModule
31  #when invoking cmsDriver.py with the --PU option
32  process.mix.input.fileNames = cms.untracked.vstring('file:../INPUT_PILEUP_EVENTS.root')
33 
34 
35  #Add the configuration for the Igprof running to dump profile snapshots:
36  process.IgProfService = cms.Service("IgProfService",
37  reportFirstEvent = cms.untracked.int32(1),
38  reportEventInterval = cms.untracked.int32(50),
39  reportToFileAtPostEvent = cms.untracked.string("| gzip -c > IgProf.%I.gz")
40  )
41 
42 
43  return(process)
return((rh^lh)&mask)