CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
gensimdigi_H4EEtest_cfg.py
Go to the documentation of this file.
2 
3 process = cms.Process("EcalTBH4GenSimDigi")
4 
5 process.load("FWCore.MessageLogger.MessageLogger_cfi")
6 
7 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
8 
9 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
10  saveFileName = cms.untracked.string(''),
11  generator = cms.PSet(
12  initialSeed = cms.untracked.uint32(123456789),
13  engineName = cms.untracked.string('HepJamesRandom')
14  ),
15  VtxSmeared = cms.PSet(
16  initialSeed = cms.untracked.uint32(98765432),
17  engineName = cms.untracked.string('HepJamesRandom')
18  ),
19  g4SimHits = cms.PSet(
20  initialSeed = cms.untracked.uint32(11),
21  engineName = cms.untracked.string('HepJamesRandom')
22  ),
23  SimEcalTBG4Object = cms.PSet(
24  initialSeed = cms.untracked.uint32(12),
25  engineName = cms.untracked.string('HepJamesRandom')
26  ),
27  mix = cms.PSet(
28  initialSeed = cms.untracked.uint32(12345),
29  engineName = cms.untracked.string('HepJamesRandom')
30  ),
31  simEcalUnsuppressedDigis = cms.PSet(
32  initialSeed = cms.untracked.uint32(1234567),
33  engineName = cms.untracked.string('HepJamesRandom')
34  ),
35 )
36 
37 process.randomEngineStateProducer = cms.EDProducer("RandomEngineStateProducer")
38 
39 
40 process.maxEvents = cms.untracked.PSet(
41  input = cms.untracked.int32(1000)
42 )
43 
44 #Geometry
45 
46 process.load("Geometry.EcalTestBeam.TBH4_2007_GeometryIdeal_cfi")
47 
48 # No magnetic field
49 
50 process.load("MagneticField.Engine.uniformMagneticField_cfi")
51 
52 process.source = cms.Source("EmptySource")
53 
54 # defines common_beam_direction_parameters
55 process.load("SimG4CMS.EcalTestBeam.ee_PositionParticleGun_cff")
56 
57 process.generator = cms.EDProducer("FlatRandomEGunProducer",
58  PGunParameters = cms.PSet(
59  process.common_beam_direction_parameters,
60  PartID = cms.vint32(11),
61  MinE = cms.double(119.99),
62  MaxE = cms.double(120.01)
63  ),
64  Verbosity = cms.untracked.int32(1), ## set to 1 (or greater) for printouts
65 
66  psethack = cms.string('single electron'),
67  AddAntiParticle = cms.bool(False),
68 )
69 
70 process.ProductionFilterSequence = cms.Sequence(process.generator)
71 
73 
74 #
75 # this module takes input in the units of *cm* and *radian*!!!
76 #
77 
78 process.VtxSmeared = cms.EDProducer("BeamProfileVtxGenerator",
79  process.common_beam_direction_parameters,
80  VtxSmearedCommon,
81  BeamSigmaX = cms.double(2.4),
82  BeamSigmaY = cms.double(2.4),
83  GaussianProfile = cms.bool(False),
84  BinX = cms.int32(50),
85  BinY = cms.int32(50),
86  File = cms.string('beam.profile'),
87  UseFile = cms.bool(False),
88  TimeOffset = cms.double(0.)
89 )
90 
91 # Geant4, ECAL test beam specific OscarProducer configuration
92 
93 process.load("SimG4Core.Application.g4SimHits_cfi")
94 
95 process.g4SimHits.UseMagneticField = cms.bool(False)
96 process.g4SimHits.Physics.DefaultCutValue = 1.
97 process.g4SimHits.NonBeamEvent = cms.bool(True)
98 process.g4SimHits.Generator.HepMCProductLabel = cms.string('generator')
99 process.g4SimHits.Generator.ApplyPCuts = cms.bool(False)
100 process.g4SimHits.Generator.ApplyEtaCuts = cms.bool(True)
101 process.g4SimHits.Generator.ApplyPhiCuts = cms.bool(False)
102 process.g4SimHits.Generator.MaxEtaCut = cms.double(2.5)
103 process.g4SimHits.Generator.MinEtaCut = cms.double(0.0)
104 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
105 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
106 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
107 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
108 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
109 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
110 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
111 
112 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
113  type = cms.string('EcalTBH4Trigger'),
114  verbose = cms.untracked.bool(False),
115  #IMPORTANT # # # # # # # # NUMBER OF EVENTS TO BE TRIGGERED
116  trigEvents = cms.untracked.int32(25)
117 ))
118 
119 
120 # Test Beam ECAL specific MC info
121 
122 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
123  process.common_beam_direction_parameters,
124  CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
125  moduleLabelVtx = cms.untracked.string('generator')
126 )
127 
128 # Test Beam ECAL hodoscope raw data simulation
129 
130 process.SimEcalTBHodoscope = cms.EDProducer("TBHodoActiveVolumeRawInfoProducer")
131 
132 # Test Beam ECAL Event header filling
133 
134 process.SimEcalEventHeader = cms.EDProducer("FakeTBEventHeaderProducer",
135  EcalTBInfoLabel = cms.untracked.string('SimEcalTBG4Object')
136 )
137 
138 # Digitization
139 
140 # no pileup
141 
142 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
143 
144 # fake TB conditions
145 
146 process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetrieverTB_cfi")
147 
148 # Test beam unsuppressed digis
149 
150 process.load("SimCalorimetry.EcalTestBeam.ecaldigi_testbeam_cfi")
151 process.simEcalUnsuppressedDigis.doReadout = False
152 
153 # Output
154 
155 process.output = cms.OutputModule("PoolOutputModule",
156  outputCommands = cms.untracked.vstring('keep *',
157  'drop PSimHits_g4SimHits_*_Sim',
158  'keep PCaloHits_g4SimHits_EcalHitsEE_Sim',
159  'keep PCaloHits_g4SimHits_CaloHitsTk_Sim',
160  'keep PCaloHits_g4SimHits_EcalTBH4BeamHits_Sim'),
161  fileName = cms.untracked.string('ECALH4TB_detsim_digi.root')
162 )
163 
164 # sequences
165 
166 process.doSimHits = cms.Sequence(process.ProductionFilterSequence*process.VtxSmeared*process.g4SimHits)
167 process.doSimTB = cms.Sequence(process.SimEcalTBG4Object*process.SimEcalTBHodoscope*process.SimEcalEventHeader)
168 process.doEcalDigis = cms.Sequence(process.mix*process.simEcalUnsuppressedDigis)
169 process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis)
170 process.outpath = cms.EndPath(process.output)
171 
172 
173 # modify the default behavior of the MessageLogger
174 
175 process.MessageLogger.destinations=cms.untracked.vstring('cout'
176  ,'cerr'
177  ,'G4msg'
178  )
179 process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
180  ,'FwkReport'
181  ,'FwkSummary'
182  ,'Root_NoDictionary'
183  ,'TimeReport'
184  ,'TimeModule'
185  ,'TimeEvent'
186  ,'MemoryCheck'
187  ,'PhysicsList'
188  ,'G4cout'
189  ,'G4cerr'
190  ,'BeamProfileVtxGenerator'
191  )
192 
193 process.MessageLogger.debugModules = cms.untracked.vstring('g4SimHits','VtxSmeared')
194 
195 #Configuring the G4msg.log output
196 process.MessageLogger.G4msg = cms.untracked.PSet(
197  noTimeStamps = cms.untracked.bool(True)
198  #First eliminate unneeded output
199  ,threshold = cms.untracked.string('INFO')
200  #,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
201  ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
202  ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
203  ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
204  ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
205  ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
206  ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
207  ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
208  ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
209  ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
210  #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
211  #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
212  #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
213  #
214  #Then add the wanted ones:
215  ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
216  ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(99999))
217  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(99999))
218  ,BeamProfileVtxGenerator = cms.untracked.PSet(limit = cms.untracked.int32(-1))
219  )
220 
221 #Add these 3 lines to put back the summary for timing information at the end of the logfile
222 #(needed for TimeReport report)
223 process.options = cms.untracked.PSet(
224  wantSummary = cms.untracked.bool(True)
225 )
226 
227 #process.load("FWCore.MessageLogger.MessageLogger_cfi")
228 #process.MessageLogger.cout.placeholder = cms.untracked.bool(False)
229 #process.MessageLogger.cout.threshold = cms.untracked.string('DEBUG')
230 #process.MessageLogger.debugModules = cms.untracked.vstring('*')
231 
232 
233 #process.load("Validation.Performance.TimeMemoryG4Info")
234 
235 
236 #process.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')