File indexing completed on 2024-11-07 06:13:05
0001
0002
0003
0004
0005
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
0014 options = VarParsing.VarParsing('standard')
0015 options.register('type',
0016 "Tracker",
0017 VarParsing.VarParsing.multiplicity.singleton,
0018 VarParsing.VarParsing.varType.string,
0019 "type of operations: Tracker, Calo, MTD, Muon")
0020
0021
0022 options.parseArguments()
0023
0024 print(options)
0025
0026
0027
0028
0029 from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
0030 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0031 process = cms.Process('G4PrintGeometry',Phase2C17I13M9,dd4hep)
0032
0033 geomFile = "Geometry.CMSCommonData.GeometryDD4hepExtendedRun4D98" + options.type + "Reco_cff"
0034 materialFileName = "matfileD98" + options.type + "DD4hep.txt"
0035 solidFileName = "solidfileD98" + options.type + "DD4hep.txt"
0036 lvFileName = "lvfileD98" + options.type + "DD4hep.txt"
0037 pvFileName = "pvfileD98" + options.type + "DD4hep.txt"
0038 touchFileName = "touchfileD98" + options.type + "DD4hep.txt"
0039 regionFileName = "regionfileD98" + options.type + "DD4hep.txt"
0040
0041 print("Geometry file Name: ", geomFile)
0042 print("Material file Name: ", materialFileName)
0043 print("Solid file Name: ", solidFileName)
0044 print("LV file Name: ", lvFileName)
0045 print("PV file Name: ", pvFileName)
0046 print("Touch file Name: ", touchFileName)
0047 print("Region file Name: ", regionFileName)
0048
0049 process.load(geomFile)
0050 process.load('FWCore.MessageService.MessageLogger_cfi')
0051
0052 from SimG4Core.PrintGeomInfo.g4PrintGeomInfo_cfi import *
0053
0054 process = printGeomInfo(process)
0055
0056 if hasattr(process,'MessageLogger'):
0057 process.MessageLogger.G4cerr=dict()
0058 process.MessageLogger.G4cout=dict()
0059
0060 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0061 DumpSummary = cms.untracked.bool(True),
0062 DumpLVTree = cms.untracked.bool(False),
0063 DumpMaterial = cms.untracked.bool(False),
0064 DumpLVList = cms.untracked.bool(False),
0065 DumpLV = cms.untracked.bool(False),
0066 DumpSolid = cms.untracked.bool(True),
0067 DumpAttributes = cms.untracked.bool(False),
0068 DumpPV = cms.untracked.bool(False),
0069 DumpRotation = cms.untracked.bool(False),
0070 DumpReplica = cms.untracked.bool(False),
0071 DumpTouch = cms.untracked.bool(False),
0072 DumpSense = cms.untracked.bool(False),
0073 DumpRegion = cms.untracked.bool(False),
0074 DD4hep = cms.untracked.bool(False),
0075 Name = cms.untracked.string(''),
0076 Names = cms.untracked.vstring(''),
0077 MaterialFileName = cms.untracked.string(materialFileName),
0078 SolidFileName = cms.untracked.string(solidFileName),
0079 LVFileName = cms.untracked.string(lvFileName),
0080 PVFileName = cms.untracked.string(pvFileName),
0081 TouchFileName = cms.untracked.string(touchFileName),
0082 RegionFileName = cms.untracked.string(regionFileName),
0083 FileDetail = cms.untracked.bool(True),
0084 type = cms.string('PrintGeomInfoAction')
0085 ))
0086
0087 if (options.type == "Tracker"):
0088 process.g4SimHits.OnlySDs = ['TkAccumulatingSensitiveDetector']
0089 elif (options.type == "MTD"):
0090 process.g4SimHits.OnlySDs = ['MtdSensitiveDetector']
0091 elif (options.type == "Muon"):
0092 process.g4SimHits.OnlySDs = ['MuonSensitiveDetector']
0093 else:
0094 process.g4SimHits.OnlySDs = ['CaloTrkProcessing', 'EcalSensitiveDetector', 'HcalSensitiveDetector', 'HGCalSensitiveDetector', 'HFNoseSensitiveDetector', 'HGCScintillatorSensitiveDetector', 'ZdcSensitiveDetector']