Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:28

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("EcalTBH4GenSimDigi")
0004 
0005 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0006 
0007 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0008 
0009 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0010     saveFileName = cms.untracked.string(''),
0011     generator = cms.PSet(
0012        initialSeed = cms.untracked.uint32(123456789),      
0013         engineName = cms.untracked.string('HepJamesRandom') 
0014     ),                                                      
0015     VtxSmeared = cms.PSet(
0016         initialSeed = cms.untracked.uint32(98765432),
0017         engineName = cms.untracked.string('HepJamesRandom')
0018     ),
0019     g4SimHits = cms.PSet(
0020         initialSeed = cms.untracked.uint32(11),
0021         engineName = cms.untracked.string('HepJamesRandom')
0022     ),
0023     SimEcalTBG4Object = cms.PSet(
0024         initialSeed = cms.untracked.uint32(12),
0025         engineName = cms.untracked.string('HepJamesRandom')
0026     ),
0027     mix = cms.PSet(
0028         initialSeed = cms.untracked.uint32(12345),
0029         engineName = cms.untracked.string('HepJamesRandom')
0030     ),
0031 )
0032 
0033 process.randomEngineStateProducer = cms.EDProducer("RandomEngineStateProducer")
0034 
0035 
0036 process.maxEvents = cms.untracked.PSet(
0037     input = cms.untracked.int32(1000)
0038 )
0039 
0040 #Geometry
0041 
0042 process.load("Geometry.EcalTestBeam.TBH4_2007_GeometryIdeal_cfi")
0043 
0044 # No magnetic field
0045 
0046 process.load("MagneticField.Engine.uniformMagneticField_cfi")
0047 
0048 process.source = cms.Source("EmptySource")
0049 
0050 # defines common_beam_direction_parameters
0051 process.load("SimG4CMS.EcalTestBeam.ee_PositionParticleGun_cff")
0052 
0053 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0054     PGunParameters = cms.PSet(
0055         process.common_beam_direction_parameters,
0056         PartID = cms.vint32(11),
0057         MinE = cms.double(119.99),
0058         MaxE = cms.double(120.01)
0059     ),
0060     Verbosity = cms.untracked.int32(1), ## set to 1 (or greater)  for printouts
0061 
0062     psethack = cms.string('single electron'),
0063     AddAntiParticle = cms.bool(False),
0064 )
0065 
0066 process.ProductionFilterSequence = cms.Sequence(process.generator)
0067 
0068 from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
0069 
0070 #
0071 # this module takes input in the units of *cm* and *radian*!!!
0072 #
0073 
0074 process.VtxSmeared = cms.EDProducer("BeamProfileVtxGenerator",
0075     process.common_beam_direction_parameters,
0076     VtxSmearedCommon,
0077     BeamSigmaX = cms.double(2.4),
0078     BeamSigmaY = cms.double(2.4),
0079     GaussianProfile = cms.bool(False),
0080     BinX = cms.int32(50),
0081     BinY = cms.int32(50),
0082     File       = cms.string('beam.profile'),
0083     UseFile    = cms.bool(False),
0084     TimeOffset = cms.double(0.)                      
0085 )
0086 
0087 # Geant4, ECAL test beam specific OscarProducer configuration
0088 
0089 process.load("SimG4Core.Application.g4SimHits_cfi")
0090 
0091 process.g4SimHits.UseMagneticField = cms.bool(False)
0092 process.g4SimHits.Physics.DefaultCutValue = 1.
0093 process.g4SimHits.NonBeamEvent = cms.bool(True)
0094 process.g4SimHits.Generator.HepMCProductLabel = cms.string('generatorSmeared')
0095 process.g4SimHits.Generator.ApplyPCuts = cms.bool(False)
0096 process.g4SimHits.Generator.ApplyEtaCuts = cms.bool(True)
0097 process.g4SimHits.Generator.ApplyPhiCuts = cms.bool(False)
0098 process.g4SimHits.Generator.MaxEtaCut = cms.double(2.5)
0099 process.g4SimHits.Generator.MinEtaCut = cms.double(0.0)
0100 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
0101 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
0102 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
0103 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
0104 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
0105 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
0106 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
0107 
0108 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0109     type = cms.string('EcalTBH4Trigger'),
0110     verbose = cms.untracked.bool(False),
0111     #IMPORTANT    #    #    #    #    #    #    #    # NUMBER OF EVENTS TO BE TRIGGERED 
0112     trigEvents = cms.untracked.int32(25)
0113 ))
0114 
0115 
0116 # Test Beam ECAL specific MC info
0117 
0118 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
0119     process.common_beam_direction_parameters,
0120     CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
0121     moduleLabelVtx = cms.untracked.string('generatorSmeared')
0122 )
0123 
0124 # Test Beam ECAL hodoscope raw data simulation
0125 
0126 process.SimEcalTBHodoscope = cms.EDProducer("TBHodoActiveVolumeRawInfoProducer")
0127 
0128 # Test Beam ECAL Event header filling
0129 
0130 process.SimEcalEventHeader = cms.EDProducer("FakeTBEventHeaderProducer",
0131     EcalTBInfoLabel = cms.untracked.string('SimEcalTBG4Object')
0132 )
0133 
0134 # Digitization
0135 
0136 # no pileup
0137 
0138 process.load("SimGeneral.MixingModule.mixNoPU_cfi")
0139 
0140 # fake TB conditions
0141 
0142 process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialCondRetrieverTB_cfi")
0143 
0144 # Test beam unsuppressed digis
0145 
0146 process.load("SimCalorimetry.EcalTestBeam.ecaldigi_testbeam_cfi")
0147 process.mix.digitizers.ecal.doReadout = False
0148 
0149 # Output
0150 
0151 process.output = cms.OutputModule("PoolOutputModule",
0152     outputCommands = cms.untracked.vstring('keep *', 
0153         'drop PSimHits_g4SimHits_*_Sim', 
0154         'keep PCaloHits_g4SimHits_EcalHitsEE_Sim', 
0155         'keep PCaloHits_g4SimHits_CaloHitsTk_Sim', 
0156         'keep PCaloHits_g4SimHits_EcalTBH4BeamHits_Sim'),
0157     fileName = cms.untracked.string('ECALH4TB_detsim_digi.root')
0158 )
0159 
0160 # sequences
0161 
0162 process.doSimHits = cms.Sequence(process.ProductionFilterSequence*process.VtxSmeared*process.g4SimHits)
0163 process.doSimTB = cms.Sequence(process.SimEcalTBG4Object*process.SimEcalTBHodoscope*process.SimEcalEventHeader)
0164 process.doEcalDigis = cms.Sequence(process.mix)
0165 process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis)
0166 process.outpath = cms.EndPath(process.output)
0167 
0168 
0169 # modify the default behavior of the MessageLogger
0170     
0171 process.MessageLogger.debugModules = cms.untracked.vstring('g4SimHits','generatorSmeared')
0172 
0173 #Configuring the G4msg.log output
0174 process.MessageLogger.files = dict(G4msg =  cms.untracked.PSet(
0175     noTimeStamps = cms.untracked.bool(True)
0176     #First eliminate unneeded output
0177     ,threshold = cms.untracked.string('INFO')
0178     #,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
0179     ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
0180     ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0181     ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0182     ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0183     ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
0184     ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0185     ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
0186     ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
0187     ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
0188     #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
0189     #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
0190     #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
0191     #
0192     #Then add the wanted ones:
0193     ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0194     ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(99999))
0195     ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(99999))
0196     ,BeamProfileVtxGenerator = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0197     )
0198 )
0199 
0200 #Add these 3 lines to put back the summary for timing information at the end of the logfile
0201 #(needed for TimeReport report)
0202 process.options = cms.untracked.PSet(
0203     wantSummary = cms.untracked.bool(True)
0204 )
0205 
0206 #process.load("FWCore.MessageLogger.MessageLogger_cfi")
0207 #process.MessageLogger.cout.enable = cms.untracked.bool(True)
0208 #process.MessageLogger.cout.threshold = cms.untracked.string('DEBUG')
0209 #process.MessageLogger.debugModules = cms.untracked.vstring('*')
0210 
0211 
0212 #process.load("Validation.Performance.TimeMemoryG4Info")
0213 
0214 
0215 #process.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')