Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process('SIM')
0004 
0005 # import of standard configurations
0006 process.load('Configuration/StandardSequences/Services_cff')
0007 process.load('FWCore/MessageService/MessageLogger_cfi')
0008 process.load('Configuration.Geometry.GeometryExtended2015Reco_cff')
0009 process.load('Configuration.Geometry.GeometryExtended2015_cff')
0010 process.load('Configuration/StandardSequences/MagneticField_38T_cff')
0011 process.load('Configuration/StandardSequences/Generator_cff')
0012 process.load('Configuration/StandardSequences/VtxSmearedNoSmear_cff')
0013 process.load('Configuration/StandardSequences/SimExtended_cff')
0014 process.load('Configuration/StandardSequences/EndOfProcess_cff')
0015 process.load('Configuration/EventContent/EventContent_cff')
0016 
0017 process.maxEvents = cms.untracked.PSet(
0018     input = cms.untracked.int32(10)
0019 )
0020 
0021 # Input source
0022 process.source = cms.Source("EmptySource")
0023 
0024 process.generator = cms.EDProducer("FlatRandomEGunProducer",
0025     PGunParameters = cms.PSet(
0026         PartID = cms.vint32(2112),
0027         MinEta = cms.double(5.5),
0028         MaxEta = cms.double(10000),
0029         MinPhi = cms.double(-3.14159265359), ## in radians
0030         MaxPhi = cms.double(3.14159265359),
0031         MinE = cms.double(2499.99),
0032         MaxE = cms.double(2500.01)
0033     ),
0034     Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
0035 
0036     psethack = cms.string('single neutron E 2.5 TeV'),
0037     AddAntiParticle = cms.bool(False),
0038     firstRun = cms.untracked.uint32(1)
0039 )
0040 
0041 process.ProductionFilterSequence = cms.Sequence(process.generator)
0042 
0043 # Output definition
0044 process.output = cms.OutputModule("PoolOutputModule",
0045     outputCommands = process.FEVTDEBUGEventContent.outputCommands,
0046     fileName = cms.untracked.string('simevent.root'),
0047     dataset = cms.untracked.PSet(
0048         dataTier = cms.untracked.string('GEN-SIM'),
0049         filterName = cms.untracked.string('')
0050     ),
0051     SelectEvents = cms.untracked.PSet(
0052         SelectEvents = cms.vstring('generation_step')
0053     )
0054 )
0055 
0056 # Special settings
0057 process.g4SimHits.UseMagneticField = cms.bool(False)
0058 process.g4SimHits.Generator.MinEtaCut = cms.double(-9.0)
0059 process.g4SimHits.Generator.MaxEtaCut =  cms.double(9.0)
0060 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0061     type = cms.string('ZdcTestAnalysis'),
0062     ZdcTestAnalysis = cms.PSet(
0063         Verbosity = cms.int32(0),
0064         StepNtupleFlag = cms.int32(0),
0065         EventNtupleFlag = cms.int32(1),
0066         StepNtupleFileName = cms.string('stepNtuple.root'),
0067         EventNtupleFileName = cms.string('eventNtuple.root')
0068     )       
0069 ))
0070 process.g4SimHits.ZdcSD.UseShowerLibrary = cms.bool(True)
0071 
0072 # Path and EndPath definitions
0073 process.generation_step = cms.Path(process.ProductionFilterSequence+process.pgen)
0074 process.smearing = cms.Path(process.VtxSmeared+process.generatorSmeared)
0075 process.simulation_step = cms.Path(process.psim)
0076 process.endjob_step = cms.Path(process.endOfProcess)
0077 process.out_step = cms.EndPath(process.output)
0078 
0079 # Schedule definition
0080 process.schedule = cms.Schedule(process.generation_step,process.smearing,process.simulation_step,process.endjob_step,process.out_step)
0081 
0082 def customise(process):
0083     #Adding SimpleMemoryCheck service:
0084     process.SimpleMemoryCheck=cms.Service("SimpleMemoryCheck",
0085                                           ignoreTotal=cms.untracked.int32(1),
0086                                           oncePerEventMode=cms.untracked.bool(True))
0087     #Adding Timing service:
0088     process.Timing=cms.Service("Timing")
0089     
0090     #Tweak Message logger to dump G4cout and G4cerr messages in G4msg.log
0091     #print process.MessageLogger.__dict__
0092     process.MessageLogger.debugModules=cms.untracked.vstring('g4SimHits')
0093                                                            
0094     #Configuring the G4msg.log output
0095     process.MessageLogger.files = dict(G4msg =  cms.untracked.PSet(
0096         noTimeStamps = cms.untracked.bool(True)
0097         #First eliminate unneeded output
0098         ,threshold = cms.untracked.string('INFO')
0099         ,INFO = cms.untracked.PSet(limit = cms.untracked.int32(0))
0100         ,DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0))
0101         ,FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0102         ,FwkSummary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0103         ,Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0))
0104         ,FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0))
0105         ,TimeReport = cms.untracked.PSet(limit = cms.untracked.int32(0))
0106         ,TimeModule = cms.untracked.PSet(limit = cms.untracked.int32(0))
0107         ,TimeEvent = cms.untracked.PSet(limit = cms.untracked.int32(0))
0108         ,MemoryCheck = cms.untracked.PSet(limit = cms.untracked.int32(0))
0109         #TimeModule, TimeEvent, TimeReport are written to LogAsbolute instead of LogInfo with a category
0110         #so they cannot be eliminated from any destination (!) unless one uses the summaryOnly option
0111         #in the Timing Service... at the price of silencing the output needed for the TimingReport profiling
0112         #
0113         #Then add the wanted ones:
0114         ,PhysicsList = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0115         ,G4cout = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0116         ,G4cerr = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0117         ,CaloSim = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0118         ,ForwardSim = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0119         )
0120     )
0121     #Add these 3 lines to put back the summary for timing information at the end of the logfile
0122     #(needed for TimeReport report)
0123     process.options = cms.untracked.PSet(
0124         wantSummary = cms.untracked.bool(True)
0125         )
0126 
0127 #    process.g4SimHits.G4Commands = cms.vstring('/tracking/verbose 1')
0128 
0129     return(process)
0130 
0131 # End of customisation function definition
0132 
0133 process = customise(process)