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  process.options = cms.untracked.PSet(
24  wantSummary = cms.untracked.bool(True)
25  )
26 
27  #Overwriting the fileNames to be used by the MixingModule
28  #when invoking cmsDriver.py with the --PU option
29  process.mix.input.fileNames = cms.untracked.vstring('file:../INPUT_PILEUP_EVENTS.root')
30 
31 
32  #Add the configuration for the Igprof running to dump profile snapshots:
33  process.IgProfService = cms.Service("IgProfService",
34  reportFirstEvent = cms.untracked.int32(1),
35  reportEventInterval = cms.untracked.int32(50),
36  reportToFileAtPostEvent = cms.untracked.string("| gzip -c > IgProf.%I.gz")
37  )
38 
39 
40  return(process)
return(e1-e2)*(e1-e2)+dp *dp