Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-27 14:08:04

0001 #!/usr/bin/env cmsRun
0002 
0003 # cmsRun trackingMaterialProducer.py nEvents=1000 fromDB=False
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 from FWCore.ParameterSet.VarParsing import VarParsing
0007 
0008 from Configuration.Eras.Modifier_phase2_common_cff import phase2_common
0009 process = cms.Process("Geometry",phase2_common)
0010 
0011 process.load('FWCore.MessageService.MessageLogger_cfi')
0012 process.MessageLogger.files.debugTrackingMaterialProducer = dict()
0013 process.MessageLogger.TrackingMaterialProducer=dict()
0014 
0015 process.load('Configuration.EventContent.EventContent_cff')
0016 
0017 ## MC Related stuff
0018 process.load('Configuration.StandardSequences.Generator_cff')
0019 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0020 
0021 ### Loading 10GeV neutrino gun generator
0022 process.load("SimTracker.TrackerMaterialAnalysis.single10GeVNeutrino_cfi")
0023 
0024 ### Load vertex generator w/o smearing
0025 from Configuration.StandardSequences.VtxSmeared import VtxSmeared
0026 process.load(VtxSmeared['NoSmear'])
0027 
0028 # detector simulation (Geant4-based) with tracking material accounting 
0029 process.load("SimTracker.TrackerMaterialAnalysis.trackingMaterialProducer_cff")
0030 #For some reason now neutrino are no longer tracked, so we need to force it.
0031 process.trackingMaterialProducer.StackingAction.TrackNeutrino = True
0032 
0033 options = VarParsing('analysis')
0034 
0035 options.register('nEvents',
0036                  200000,
0037                  VarParsing.multiplicity.singleton,
0038                  VarParsing.varType.int,
0039                  "Maximum number of events"
0040 )
0041 
0042 options.register('fromDB',
0043                  False,
0044                  VarParsing.multiplicity.singleton,
0045                  VarParsing.varType.bool,
0046                  "Read from Geometry DB?",
0047 )
0048 
0049 options.parseArguments()
0050 
0051 if options.fromDB :
0052    process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0053    from Configuration.AlCa.GlobalTag import GlobalTag
0054    process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0055 else:
0056    process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0057 
0058 process.maxEvents = cms.untracked.PSet(
0059     input = cms.untracked.int32(options.nEvents)
0060 )
0061 
0062 # Input source
0063 process.source = cms.Source("EmptySource")
0064 
0065 process.out = cms.OutputModule("PoolOutputModule",
0066     outputCommands = cms.untracked.vstring(
0067         'drop *',                                                       # drop all objects
0068         'keep MaterialAccountingTracks_trackingMaterialProducer_*_*'),  # but the material accounting information
0069     fileName = cms.untracked.string('file:material.root')
0070 )
0071 
0072 process.path = cms.Path(process.generator
0073                         * process.VtxSmeared
0074                         * process.generatorSmeared
0075                         * process.trackingMaterialProducer)
0076 process.outpath = cms.EndPath(process.out)
0077