CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
reco_application_tbsim_DetSim-Digi_cfg.py
Go to the documentation of this file.
2 
3 process = cms.Process("ECALTBH4-GEN-SIM-DIGI")
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(10)
42 )
43 
44 #Geometry
45 
46 process.load("SimG4CMS.EcalTestBeam.crystal248_cff")
47 process.load("Geometry.EcalTestBeam.TBH4GeometryXML_cfi")
48 
49 process.load("Geometry.CaloEventSetup.CaloGeometry_cff")
50 process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
51 process.CaloGeometryBuilder.SelectedCalos = ['EcalBarrel']
52 
53 # No magnetic field
54 
55 process.load("MagneticField.Engine.uniformMagneticField_cfi")
56 
57 process.source = cms.Source("EmptySource")
58 
59 process.generator = cms.EDProducer("FlatRandomEGunProducer",
60  PGunParameters = cms.PSet(
61  process.common_beam_direction_parameters,
62  PartID = cms.vint32(11),
63  MinE = cms.double(119.99),
64  MaxE = cms.double(120.01)
65  ),
66  Verbosity = cms.untracked.int32(0), ## set to 1 (or greater) for printouts
67 
68  psethack = cms.string('single electron'),
69  AddAntiParticle = cms.bool(False),
70 )
71 
72 process.ProductionFilterSequence = cms.Sequence(process.generator)
73 
75 
76 #
77 # this module takes input in the units of *cm* and *radian*!!!
78 #
79 
80 process.VtxSmeared = cms.EDProducer("BeamProfileVtxGenerator",
81  process.common_beam_direction_parameters,
82  VtxSmearedCommon,
83  BeamSigmaX = cms.double(2.4),
84  BeamSigmaY = cms.double(2.4),
85  GaussianProfile = cms.bool(False),
86  BinX = cms.int32(50),
87  BinY = cms.int32(50),
88  File = cms.string('beam.profile'),
89  UseFile = cms.bool(False),
90  TimeOffset = cms.double(0.)
91 )
92 
93 # Geant4, ECAL test beam specific OscarProducer configuration
94 
95 process.load("SimG4Core.Application.g4SimHits_cfi")
96 
97 process.g4SimHits.UseMagneticField = cms.bool(False)
98 process.g4SimHits.Physics.DefaultCutValue = 1.
99 process.g4SimHits.NonBeamEvent = cms.bool(True)
100 process.g4SimHits.Generator.HepMCProductLabel = cms.string('generator')
101 process.g4SimHits.Generator.ApplyPCuts = cms.bool(False)
102 process.g4SimHits.Generator.ApplyEtaCuts = cms.bool(True)
103 process.g4SimHits.Generator.ApplyPhiCuts = cms.bool(False)
104 process.g4SimHits.Generator.MaxEtaCut = cms.double(1.5)
105 process.g4SimHits.Generator.MinEtaCut = cms.double(0.0)
106 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
107 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
108 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
109 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
110 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
111 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
112 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
113 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
114  type = cms.string('EcalTBH4Trigger'),
115  verbose = cms.untracked.bool(False),
116  #IMPORTANT # # # # # # # # NUMBER OF EVENTS TO BE TRIGGERED
117  trigEvents = cms.untracked.int32(5)
118 ))
119 
120 
121 # Test Beam ECAL specific MC info
122 
123 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
124  process.common_beam_direction_parameters,
125  CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
126  moduleLabelVtx = cms.untracked.string('generator')
127 )
128 
129 # Test Beam ECAL hodoscope raw data simulation
130 
131 process.SimEcalTBHodoscope = cms.EDProducer("TBHodoActiveVolumeRawInfoProducer")
132 
133 # Test Beam ECAL Event header filling
134 
135 process.SimEcalEventHeader = cms.EDProducer("FakeTBEventHeaderProducer",
136  EcalTBInfoLabel = cms.untracked.string('SimEcalTBG4Object')
137 )
138 
139 # Digitization
140 
141 # no pileup
142 
143 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
144 
145 # fake TB conditions
146 
147 process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetrieverTB_cfi")
148 
149 # Test beam unsuppressed digis
150 
151 process.load("SimCalorimetry.EcalTestBeam.ecaldigi_testbeam_cfi")
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_EcalHitsEB_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(-1))
217  ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
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.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')