Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:32

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("ECALTBH4-GEN-SIM-DIGI")
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(10)
0038 )
0039 
0040 #Geometry
0041 
0042 process.load("SimG4CMS.EcalTestBeam.crystal248_cff")
0043 process.load("Geometry.EcalTestBeam.TBH4GeometryXML_cfi")
0044 
0045 process.load("Geometry.CaloEventSetup.CaloGeometry_cff")
0046 process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
0047 process.CaloGeometryBuilder.SelectedCalos = ['EcalBarrel']
0048 
0049 # No magnetic field
0050 
0051 process.load("MagneticField.Engine.uniformMagneticField_cfi")
0052 
0053 process.source = cms.Source("EmptySource")
0054 
0055 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0056     PGunParameters = cms.PSet(
0057         process.common_beam_direction_parameters,
0058         PartID = cms.vint32(11),
0059         MinE = cms.double(119.99),
0060         MaxE = cms.double(120.01)
0061     ),
0062     Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
0063 
0064     psethack = cms.string('single electron'),
0065     AddAntiParticle = cms.bool(False),
0066 )
0067 
0068 process.ProductionFilterSequence = cms.Sequence(process.generator)
0069 
0070 from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import *
0071 
0072 #
0073 # this module takes input in the units of *cm* and *radian*!!!
0074 #
0075 
0076 process.VtxSmeared = cms.EDProducer("BeamProfileVtxGenerator",
0077     process.common_beam_direction_parameters,
0078     VtxSmearedCommon,
0079     BeamSigmaX = cms.double(2.4),
0080     BeamSigmaY = cms.double(2.4),
0081     GaussianProfile = cms.bool(False),
0082     BinX = cms.int32(50),
0083     BinY = cms.int32(50),
0084     File       = cms.string('beam.profile'),
0085     UseFile    = cms.bool(False),
0086     TimeOffset = cms.double(0.)                      
0087 )
0088 
0089 # Geant4, ECAL test beam specific OscarProducer configuration
0090 
0091 process.load("SimG4Core.Application.g4SimHits_cfi")
0092 
0093 process.g4SimHits.UseMagneticField = cms.bool(False)
0094 process.g4SimHits.Physics.DefaultCutValue = 1.
0095 process.g4SimHits.NonBeamEvent = cms.bool(True)
0096 process.g4SimHits.Generator.HepMCProductLabel = cms.string('generatorSmeared')
0097 process.g4SimHits.Generator.ApplyPCuts = cms.bool(False)
0098 process.g4SimHits.Generator.ApplyEtaCuts = cms.bool(True)
0099 process.g4SimHits.Generator.ApplyPhiCuts = cms.bool(False)
0100 process.g4SimHits.Generator.MaxEtaCut = cms.double(1.5)
0101 process.g4SimHits.Generator.MinEtaCut = cms.double(0.0)
0102 process.g4SimHits.CaloSD.CorrectTOFBeam = cms.bool(True)
0103 process.g4SimHits.CaloSD.BeamPosition = cms.double(-26733.5)
0104 process.g4SimHits.CaloTrkProcessing.TestBeam = cms.bool(True)
0105 process.g4SimHits.StackingAction.MaxTrackTime = cms.double(10000.)
0106 process.g4SimHits.SteppingAction.MaxTrackTime = cms.double(10000.)
0107 process.g4SimHits.CaloSD.TmaxHit = cms.double(10000.)
0108 process.g4SimHits.CaloSD.TmaxHits = cms.vdouble(10000.,10000.,10000.,10000.,10000.)
0109 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0110     type = cms.string('EcalTBH4Trigger'),
0111     verbose = cms.untracked.bool(False),
0112     #IMPORTANT    #    #    #    #    #    #    #    # NUMBER OF EVENTS TO BE TRIGGERED 
0113     trigEvents = cms.untracked.int32(5)
0114 ))
0115 
0116 
0117 # Test Beam ECAL specific MC info
0118 
0119 process.SimEcalTBG4Object = cms.EDProducer("EcalTBMCInfoProducer",
0120     process.common_beam_direction_parameters,
0121     CrystalMapFile = cms.FileInPath('Geometry/EcalTestBeam/data/BarrelSM1CrystalCenterElectron120GeV.dat'),
0122     moduleLabelVtx = cms.untracked.string('generatorSmeared')
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 
0148 # Output
0149 
0150 process.output = cms.OutputModule("PoolOutputModule",
0151     outputCommands = cms.untracked.vstring('keep *', 
0152         'drop PSimHits_g4SimHits_*_Sim', 
0153         'keep PCaloHits_g4SimHits_EcalHitsEB_Sim', 
0154         'keep PCaloHits_g4SimHits_CaloHitsTk_Sim', 
0155         'keep PCaloHits_g4SimHits_EcalTBH4BeamHits_Sim'),
0156     fileName = cms.untracked.string('ECALH4TB_detsim_digi.root')
0157 )
0158 
0159 # sequences
0160 
0161 process.doSimHits = cms.Sequence(process.ProductionFilterSequence*process.VtxSmeared*process.g4SimHits)
0162 process.doSimTB = cms.Sequence(process.SimEcalTBG4Object*process.SimEcalTBHodoscope*process.SimEcalEventHeader)
0163 process.doEcalDigis = cms.Sequence(process.mix)
0164 process.p1 = cms.Path(process.doSimHits*process.doSimTB*process.doEcalDigis)
0165 process.outpath = cms.EndPath(process.output)
0166 
0167 
0168 # modify the default behavior of the MessageLogger
0169     
0170 process.MessageLogger.debugModules = cms.untracked.vstring('g4SimHits','generatorSmeared')
0171 
0172 #Configuring the G4msg.log output
0173 process.MessageLogger.files = dict( G4msg =  cms.untracked.PSet(
0174     noTimeStamps = cms.untracked.bool(True)
0175     #First eliminate unneeded output
0176     ,threshold = cms.untracked.string('INFO')
0177     #,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
0178     ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
0179     ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0180     ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0181     ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0182     ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
0183     ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0184     ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
0185     ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
0186     ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
0187     #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
0188     #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
0189     #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
0190     #
0191     #Then add the wanted ones:
0192     ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0193     ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0194     ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0195     ,BeamProfileVtxGenerator = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0196     )
0197 )
0198 #Add these 3 lines to put back the summary for timing information at the end of the logfile
0199 #(needed for TimeReport report)
0200 process.options = cms.untracked.PSet(
0201     wantSummary = cms.untracked.bool(True)
0202 )
0203 
0204 #process.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')