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