CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Configuration/EcalTB/python/reco_application_tbsim_DetSim-Digi_cfg.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 process = cms.Process("ECALTBH4-GEN-SIM-DIGI")
00004 
00005 process.load("FWCore.MessageLogger.MessageLogger_cfi")
00006 
00007 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
00008 
00009 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
00010     saveFileName = cms.untracked.string(''),
00011     generator = cms.PSet(
00012         initialSeed = cms.untracked.uint32(123456789),      
00013         engineName = cms.untracked.string('HepJamesRandom') 
00014     ),                                                      
00015     VtxSmeared = cms.PSet(
00016         initialSeed = cms.untracked.uint32(98765432),
00017         engineName = cms.untracked.string('HepJamesRandom')
00018     ),
00019     g4SimHits = cms.PSet(
00020         initialSeed = cms.untracked.uint32(11),
00021         engineName = cms.untracked.string('HepJamesRandom')
00022     ),
00023     SimEcalTBG4Object = cms.PSet(
00024         initialSeed = cms.untracked.uint32(12),
00025         engineName = cms.untracked.string('HepJamesRandom')
00026     ),
00027     mix = cms.PSet(
00028         initialSeed = cms.untracked.uint32(12345),
00029         engineName = cms.untracked.string('HepJamesRandom')
00030     ),
00031     simEcalUnsuppressedDigis = cms.PSet(
00032         initialSeed = cms.untracked.uint32(1234567),
00033         engineName = cms.untracked.string('HepJamesRandom')
00034     ),
00035 )
00036 
00037 process.RandomEngineStateProducer = cms.EDProducer("RandomEngineStateProducer")
00038 
00039 
00040 process.maxEvents = cms.untracked.PSet(
00041     input = cms.untracked.int32(10)
00042 )
00043 
00044 #Geometry
00045 
00046 process.load("SimG4CMS.EcalTestBeam.crystal248_cff")
00047 process.load("Geometry.EcalTestBeam.TBH4GeometryXML_cfi")
00048 
00049 process.load("Geometry.CaloEventSetup.CaloGeometry_cff")
00050 process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
00051 process.CaloGeometryBuilder.SelectedCalos = ['EcalBarrel']
00052 
00053 # No magnetic field
00054 
00055 process.load("MagneticField.Engine.uniformMagneticField_cfi")
00056 
00057 process.source = cms.Source("EmptySource")
00058 
00059 process.generator = cms.EDProducer("FlatRandomEGunProducer",
00060     PGunParameters = cms.PSet(
00061         process.common_beam_direction_parameters,
00062         PartID = cms.vint32(11),
00063         MinE = cms.double(119.99),
00064         MaxE = cms.double(120.01)
00065     ),
00066     Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
00067 
00068     psethack = cms.string('single electron'),
00069     AddAntiParticle = cms.bool(False),
00070 )
00071 
00072 process.ProductionFilterSequence = cms.Sequence(process.generator)
00073 
00074 from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
00075 
00076 #
00077 # this module takes input in the units of *cm* and *radian*!!!
00078 #
00079 
00080 process.VtxSmeared = cms.EDProducer("BeamProfileVtxGenerator",
00081     process.common_beam_direction_parameters,
00082     VtxSmearedCommon,
00083     BeamSigmaX = cms.double(2.4),
00084     BeamSigmaY = cms.double(2.4),
00085     GaussianProfile = cms.bool(False),
00086     BinX = cms.int32(50),
00087     BinY = cms.int32(50),
00088     File       = cms.string('beam.profile'),
00089     UseFile    = cms.bool(False),
00090     TimeOffset = cms.double(0.)                      
00091 )
00092 
00093 # Geant4, ECAL test beam specific OscarProducer configuration
00094 
00095 process.load("SimG4Core.Application.g4SimHits_cfi")
00096 
00097 process.g4SimHits.UseMagneticField = cms.bool(False)
00098 process.g4SimHits.Physics.DefaultCutValue = 1.
00099 process.g4SimHits.NonBeamEvent = cms.bool(True)
00100 process.g4SimHits.generator.HepMCProductLabel = cms.string('generator')
00101 process.g4SimHits.generator.ApplyPCuts = cms.bool(False)
00102 process.g4SimHits.generator.ApplyEtaCuts = cms.bool(True)
00103 process.g4SimHits.generator.ApplyPhiCuts = cms.bool(False)
00104 process.g4SimHits.generator.MaxEtaCut = cms.double(1.5)
00105 process.g4SimHits.generator.MinEtaCut = cms.double(0.0)
00106 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
00107 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
00108 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
00109 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
00110 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
00111 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
00112 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
00113 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
00114     type = cms.string('EcalTBH4Trigger'),
00115     verbose = cms.untracked.bool(False),
00116     #IMPORTANT    #    #    #    #    #    #    #    # NUMBER OF EVENTS TO BE TRIGGERED 
00117     trigEvents = cms.untracked.int32(5)
00118 ))
00119 
00120 
00121 # Test Beam ECAL specific MC info
00122 
00123 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
00124     process.common_beam_direction_parameters,
00125     CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
00126     moduleLabelVtx = cms.untracked.string('generator')
00127 )
00128 
00129 # Test Beam ECAL hodoscope raw data simulation
00130 
00131 process.SimEcalTBHodoscope = cms.EDProducer("TBHodoActiveVolumeRawInfoProducer")
00132 
00133 # Test Beam ECAL Event header filling
00134 
00135 process.SimEcalEventHeader = cms.EDProducer("FakeTBEventHeaderProducer",
00136     EcalTBInfoLabel = cms.untracked.string('SimEcalTBG4Object')
00137 )
00138 
00139 # Digitization
00140 
00141 # no pileup
00142 
00143 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
00144 
00145 # fake TB conditions
00146 
00147 process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetrieverTB_cfi")
00148 
00149 # Test beam unsuppressed digis
00150 
00151 process.load("SimCalorimetry.EcalTestBeam.ecaldigi_testbeam_cfi")
00152 
00153 # Output
00154 
00155 process.output = cms.OutputModule("PoolOutputModule",
00156     outputCommands = cms.untracked.vstring('keep *', 
00157         'drop PSimHits_g4SimHits_*_Sim', 
00158         'keep PCaloHits_g4SimHits_EcalHitsEB_Sim', 
00159         'keep PCaloHits_g4SimHits_CaloHitsTk_Sim', 
00160         'keep PCaloHits_g4SimHits_EcalTBH4BeamHits_Sim'),
00161     fileName = cms.untracked.string('ECALH4TB_detsim_digi.root')
00162 )
00163 
00164 # sequences
00165 
00166 process.doSimHits = cms.Sequence(process.ProductionFilterSequence*process.VtxSmeared*process.g4SimHits)
00167 process.doSimTB = cms.Sequence(process.SimEcalTBG4Object*process.SimEcalTBHodoscope*process.SimEcalEventHeader)
00168 process.doEcalDigis = cms.Sequence(process.mix*process.simEcalUnsuppressedDigis)
00169 process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis)
00170 process.outpath = cms.EndPath(process.output)
00171 
00172 
00173 # modify the default behavior of the MessageLogger
00174     
00175 process.MessageLogger.destinations=cms.untracked.vstring('cout'
00176                                                          ,'cerr'
00177                                                          ,'G4msg'
00178                                                          )
00179 process.MessageLogger.categories=cms.untracked.vstring('FwkJob'
00180                                                        ,'FwkReport'
00181                                                        ,'FwkSummary'
00182                                                        ,'Root_NoDictionary'
00183                                                        ,'TimeReport'
00184                                                        ,'TimeModule'
00185                                                        ,'TimeEvent'
00186                                                        ,'MemoryCheck'
00187                                                        ,'PhysicsList'
00188                                                        ,'G4cout'
00189                                                        ,'G4cerr'
00190                                                        ,'BeamProfileVtxGenerator'
00191                                                        )
00192 
00193 process.MessageLogger.debugModules = cms.untracked.vstring('g4SimHits','VtxSmeared')
00194 
00195 #Configuring the G4msg.log output
00196 process.MessageLogger.G4msg =  cms.untracked.PSet(
00197     noTimeStamps = cms.untracked.bool(True)
00198     #First eliminate unneeded output
00199     ,threshold = cms.untracked.string('INFO')
00200     #,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
00201     ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
00202     ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00203     ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00204     ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
00205     ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
00206     ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
00207     ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
00208     ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
00209     ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
00210     #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
00211     #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
00212     #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
00213     #
00214     #Then add the wanted ones:
00215     ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00216     ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00217     ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00218     ,BeamProfileVtxGenerator = cms.untracked.PSet(limit = cms.untracked.int32(-1))
00219     )
00220 
00221 #Add these 3 lines to put back the summary for timing information at the end of the logfile
00222 #(needed for TimeReport report)
00223 process.options = cms.untracked.PSet(
00224     wantSummary = cms.untracked.bool(True)
00225 )
00226 
00227 #process.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')