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 runMaterialBudgetVolumeDB_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     fileName = "matbdgRun3dddDB.root"
0034 else:
0035     from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
0036     process = cms.Process('PROD',Run3_dd4hep)
0037     fileName = "matbdgRun3ddhepDB.root"
0038 
0039 print("Root file Name:     ", fileName)
0040 
0041 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0042 process.load('Configuration.StandardSequences.GeometrySimDB_cff')
0043 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0044 from Configuration.AlCa.GlobalTag import GlobalTag
0045 if (options.type == "DDD"):
0046     process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '')
0047 else:
0048     process.GlobalTag = GlobalTag(process.GlobalTag, '120X_mcRun3_2021_realistic_dd4hep_v1', '')
0049 
0050 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0051 process.load("Configuration.StandardSequences.MagneticField_cff")
0052 process.load("SimG4Core.Application.g4SimHits_cfi")
0053 process.load("Validation.Geometry.materialBudgetVolume_cfi")
0054 
0055 process.load("IOMC.RandomEngine.IOMC_cff")
0056 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0057 
0058 process.load('FWCore.MessageService.MessageLogger_cfi')
0059 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0060 if hasattr(process,'MessageLogger'):
0061     process.MessageLogger.MaterialBudget=dict()
0062 
0063 process.source = cms.Source("PoolSource",
0064     noEventSort = cms.untracked.bool(True),
0065     duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0066     fileNames = cms.untracked.vstring('file:single_neutrino_random.root')
0067 )
0068 
0069 process.maxEvents = cms.untracked.PSet(
0070     input = cms.untracked.int32(-1)
0071 )
0072 
0073 process.TFileService = cms.Service("TFileService",
0074     fileName = cms.string(fileName)
0075 )
0076 
0077 process.g4SimHits.UseMagneticField = False
0078 process.g4SimHits.Physics.type = 'SimG4Core/Physics/DummyPhysics'
0079 process.g4SimHits.StackingAction.TrackNeutrino = True
0080 process.g4SimHits.Physics.DummyEMPhysics = True
0081 process.g4SimHits.Physics.CutsPerRegion = False
0082 
0083 process.load("Validation.Geometry.materialBudgetVolumeAnalysis_cfi")
0084 process.p1 = cms.Path(process.g4SimHits+process.materialBudgetVolumeAnalysis)