Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-11-14 23:29:34

0001 ###############################################################################
0002 # Way to use this:
0003 #   cmsRun runMaterialBudgetVolumeXML_cfg.py type=DDD
0004 #
0005 #   Options for type DDD, DD4hep
0006 #
0007 ###############################################################################
0008 import FWCore.ParameterSet.Config as cms
0009 import os, sys, importlib, re
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011 
0012 ####################################################################
0013 ### SETUP OPTIONS
0014 options = VarParsing.VarParsing('standard')
0015 options.register('type',
0016                  "DDD",
0017                   VarParsing.VarParsing.multiplicity.singleton,
0018                   VarParsing.VarParsing.varType.string,
0019                   "geometry of operations: DDD, DD4hep")
0020 ### get and parse the command line arguments
0021 options.parseArguments()
0022 
0023 print(options)
0024 
0025 ####################################################################
0026 # Use the options
0027 
0028 import FWCore.ParameterSet.Config as cms
0029 
0030 if (options.type == "DDD"):
0031     from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD
0032     process = cms.Process('PROD',Run3_DDD)
0033     geomFile = "Configuration.Geometry.GeometryExtended2021Reco_cff"
0034     fileName = "matbdgRun3dddXML.root"
0035 else:
0036     from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0037     process = cms.Process('PROD',Run3_dd4hep)
0038     geomFile = "Configuration.Geometry.GeometryDD4hepExtended2021Reco_cff"
0039     fileName = "matbdgRun3ddhepXML.root"
0040 
0041 print("Geometry file Name: ", geomFile)
0042 print("Root file Name:     ", fileName)
0043 
0044 process.load(geomFile)
0045 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0046 process.load("Configuration.StandardSequences.MagneticField_cff")
0047 process.load("SimG4Core.Application.g4SimHits_cfi")
0048 process.load("Validation.Geometry.materialBudgetVolume_cfi")
0049 
0050 process.load("IOMC.RandomEngine.IOMC_cff")
0051 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0052 
0053 process.load('FWCore.MessageService.MessageLogger_cfi')
0054 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0055 if hasattr(process,'MessageLogger'):
0056     process.MessageLogger.MaterialBudget=dict()
0057 
0058 process.source = cms.Source("PoolSource",
0059     noEventSort = cms.untracked.bool(True),
0060     duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0061     fileNames = cms.untracked.vstring('file:single_neutrino_random.root')
0062 )
0063 
0064 process.maxEvents = cms.untracked.PSet(
0065     input = cms.untracked.int32(-1)
0066 )
0067 
0068 process.TFileService = cms.Service("TFileService",
0069                                    fileName = cms.string(fileName))
0070 
0071 process.g4SimHits.UseMagneticField = False
0072 process.g4SimHits.Physics.type = 'SimG4Core/Physics/DummyPhysics'
0073 process.g4SimHits.StackingAction.TrackNeutrino = True
0074 process.g4SimHits.Physics.DummyEMPhysics = True
0075 process.g4SimHits.Physics.CutsPerRegion = False
0076 
0077 process.load("Validation.Geometry.materialBudgetVolumeAnalysis_cfi")
0078 process.p1 = cms.Path(process.g4SimHits+process.materialBudgetVolumeAnalysis)