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