Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #!/usr/bin/env cmsRun
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 process = cms.Process("Geometry")
0006 
0007 readGeometryFromDB = True
0008 
0009 # N.B. for the time being we load the geometry from local
0010 # XML, whle in future we will have to use the DB. This is
0011 # only a temporary hack, since the material description has
0012 # been updated in release via XML and the DB is behind.
0013 if not readGeometryFromDB:
0014   process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')
0015 else:
0016 # GlobalTag and geometry via GT
0017   process.load('Configuration.Geometry.GeometrySimDB_cff')
0018   process.load('Configuration.Geometry.GeometryRecoDB_cff')
0019   process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0020   from Configuration.AlCa.GlobalTag import GlobalTag
0021   process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0022 
0023 process.load('FWCore.MessageService.MessageLogger_cfi')
0024 process.load('Configuration.EventContent.EventContent_cff')
0025 
0026 ## MC Related stuff
0027 process.load('Configuration.StandardSequences.Generator_cff')
0028 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0029 
0030 ### Loading 10GeV neutrino gun generator
0031 process.load("SimTracker.TrackerMaterialAnalysis.single10GeVNeutrino_cfi")
0032 
0033 ### Load vertex generator w/o smearing
0034 from Configuration.StandardSequences.VtxSmeared import VtxSmeared
0035 process.load(VtxSmeared['NoSmear'])
0036 
0037 # detector simulation (Geant4-based) with tracking material accounting 
0038 process.load("SimTracker.TrackerMaterialAnalysis.trackingMaterialProducer_cff")
0039 #For some reason now neutrino are no longer tracked, so we need to force it.
0040 process.trackingMaterialProducer.StackingAction.TrackNeutrino = True
0041 
0042 process.maxEvents = cms.untracked.PSet(
0043     input = cms.untracked.int32(200000)
0044 )
0045 
0046 # Input source
0047 process.source = cms.Source("EmptySource")
0048 
0049 process.out = cms.OutputModule("PoolOutputModule",
0050     outputCommands = cms.untracked.vstring(
0051         'drop *',                                                       # drop all objects
0052         'keep MaterialAccountingTracks_trackingMaterialProducer_*_*'),  # but the material accounting informations
0053     fileName = cms.untracked.string('file:material.root')
0054 )
0055 
0056 process.path = cms.Path(process.generator
0057                         * process.VtxSmeared
0058                         * process.generatorSmeared
0059                         * process.trackingMaterialProducer)
0060 process.outpath = cms.EndPath(process.out)
0061 
0062 def customizeMessageLogger(process):
0063     ### Easy customisation of MessageLogger ###
0064     # 1. Extend MessageLogger to monitor all modules: the * means any
0065     #    label for all defined python modules
0066     process.MessageLogger.debugModules.extend(['*'])
0067     # 2. Define destination and its default logging properties
0068     how_to_debug = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"),
0069                                       DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0070                                       default = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0071                                       )
0072     # 3. Attach destination and its logging properties to the main process
0073     process.MessageLogger.files.debugTrackingMaterialProducer = how_to_debug
0074     # 4. Define and extend the categories we would like to monitor
0075     log_debug_categories = ['TrackingMaterialProducer']
0076     
0077 
0078     # 5. Extend the configuration of the configured destination so that it
0079     #    will trace all messages coming from the list of specified
0080     #    categories.
0081     unlimit_debug = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0082     for val in log_debug_categories:
0083         setattr(process.MessageLogger.files.debugTrackingMaterialProducer, val, unlimit_debug)
0084 
0085     return process
0086 
0087 #process = customizeMessageLogger(process)