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.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
0030 process = cms.Process('G4PrintGeometry',Phase2C17I13M9)
0031
0032 geomFile = "Geometry.CMSCommonData.GeometryExtendedRun4D98" + options.type + "Reco_cff"
0033 materialFileName = "matfileD98" + options.type + "DDD.txt"
0034 solidFileName = "solidfileD98" + options.type + "DDD.txt"
0035 lvFileName = "lvfileD98" + options.type + "DDD.txt"
0036 pvFileName = "pvfileD98" + options.type + "DDD.txt"
0037 touchFileName = "touchfileD98" + options.type + "DDD.txt"
0038 regionFileName = "regionfileD98" + options.type + "DDD.txt"
0039
0040 print("Geometry file Name: ", geomFile)
0041 print("Material file Name: ", materialFileName)
0042 print("Solid file Name: ", solidFileName)
0043 print("LV file Name: ", lvFileName)
0044 print("PV file Name: ", pvFileName)
0045 print("Touch file Name: ", touchFileName)
0046 print("Region file Name: ", regionFileName)
0047
0048 process.load(geomFile)
0049 process.load('FWCore.MessageService.MessageLogger_cfi')
0050
0051 from SimG4Core.PrintGeomInfo.g4PrintGeomInfo_cfi import *
0052
0053 process = printGeomInfo(process)
0054
0055 if hasattr(process,'MessageLogger'):
0056 process.MessageLogger.G4cerr=dict()
0057 process.MessageLogger.G4cout=dict()
0058
0059 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0060 DumpSummary = cms.untracked.bool(True),
0061 DumpLVTree = cms.untracked.bool(False),
0062 DumpMaterial = cms.untracked.bool(False),
0063 DumpLVList = cms.untracked.bool(False),
0064 DumpLV = cms.untracked.bool(False),
0065 DumpSolid = cms.untracked.bool(True),
0066 DumpAttributes = cms.untracked.bool(False),
0067 DumpPV = cms.untracked.bool(False),
0068 DumpRotation = cms.untracked.bool(False),
0069 DumpReplica = cms.untracked.bool(False),
0070 DumpTouch = cms.untracked.bool(False),
0071 DumpSense = cms.untracked.bool(False),
0072 DumpRegion = cms.untracked.bool(False),
0073 DD4hep = cms.untracked.bool(False),
0074 Name = cms.untracked.string(''),
0075 Names = cms.untracked.vstring(''),
0076 MaterialFileName = cms.untracked.string(materialFileName),
0077 SolidFileName = cms.untracked.string(solidFileName),
0078 LVFileName = cms.untracked.string(lvFileName),
0079 PVFileName = cms.untracked.string(pvFileName),
0080 TouchFileName = cms.untracked.string(touchFileName),
0081 RegionFileName = cms.untracked.string(regionFileName),
0082 FileDetail = cms.untracked.bool(True),
0083 type = cms.string('PrintGeomInfoAction')
0084 ))
0085
0086 if (options.type == "Tracker"):
0087 process.g4SimHits.OnlySDs = ['TkAccumulatingSensitiveDetector']
0088 elif (options.type == "MTD"):
0089 process.g4SimHits.OnlySDs = ['MtdSensitiveDetector']
0090 elif (options.type == "Muon"):
0091 process.g4SimHits.OnlySDs = ['MuonSensitiveDetector']
0092 else:
0093 process.g4SimHits.OnlySDs = ['CaloTrkProcessing', 'EcalSensitiveDetector', 'HcalSensitiveDetector', 'HGCalSensitiveDetector', 'HFNoseSensitiveDetector', 'HGCScintillatorSensitiveDetector', 'ZdcSensitiveDetector']