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