|
| 1 | +############################################################################### |
| 2 | +# Way to use this: |
| 3 | +# cmsRun g4HGCalPringLV_cfg.py geometry=D121 tol=0.01 |
| 4 | +# |
| 5 | +# Options for geometry D110, D121 |
| 6 | +# |
| 7 | +############################################################################### |
| 8 | +import FWCore.ParameterSet.Config as cms |
| 9 | +import os, sys, importlib, re |
| 10 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 11 | + |
| 12 | +#################################################################### |
| 13 | +### SETUP OPTIONS |
| 14 | +options = VarParsing.VarParsing('standard') |
| 15 | +options.register('geometry', |
| 16 | + "D121", |
| 17 | + VarParsing.VarParsing.multiplicity.singleton, |
| 18 | + VarParsing.VarParsing.varType.string, |
| 19 | + "geometry of operations: D110, D121") |
| 20 | +options.register('tol', |
| 21 | + 0.01, |
| 22 | + VarParsing.VarParsing.multiplicity.singleton, |
| 23 | + VarParsing.VarParsing.varType.float, |
| 24 | + "Tolerance for checking overlaps: 0.0, 0.01, 0.1, 1.0" |
| 25 | +) |
| 26 | + |
| 27 | +### get and parse the command line arguments |
| 28 | +options.parseArguments() |
| 29 | + |
| 30 | +print(options) |
| 31 | + |
| 32 | +#################################################################### |
| 33 | +# Use the options |
| 34 | + |
| 35 | +geomName = "Run4" + options.geometry |
| 36 | +geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff" |
| 37 | +import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings |
| 38 | +GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName) |
| 39 | +baseName = "HGCalRun4" + options.geometry |
| 40 | +print("Geometry Name: ", geomName) |
| 41 | +print("Geom file Name: ", geomFile) |
| 42 | +print("Global Tag Name: ", GLOBAL_TAG) |
| 43 | +print("Era Name: ", ERA) |
| 44 | +print("Base file Name: ", baseName) |
| 45 | + |
| 46 | +process = cms.Process('G4PrintGeometry',ERA) |
| 47 | + |
| 48 | +process.load(geomFile) |
| 49 | +from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import * |
| 50 | +process = checkOverlap(process) |
| 51 | + |
| 52 | +# enable Geant4 overlap check |
| 53 | +process.g4SimHits.CheckGeometry = True |
| 54 | + |
| 55 | +# Geant4 geometry check |
| 56 | +process.g4SimHits.G4CheckOverlap.OutputBaseName = cms.string(baseName) |
| 57 | +process.g4SimHits.G4CheckOverlap.OverlapFlag = cms.bool(False) |
| 58 | +process.g4SimHits.G4CheckOverlap.Tolerance = cms.double(options.tol) |
| 59 | +process.g4SimHits.G4CheckOverlap.Resolution = cms.int32(10000) |
| 60 | +process.g4SimHits.G4CheckOverlap.Depth = cms.int32(-1) |
| 61 | +# tells if NodeName is G4Region or G4PhysicalVolume |
| 62 | +process.g4SimHits.G4CheckOverlap.RegionFlag = cms.bool(True) |
| 63 | +# list of names |
| 64 | +process.g4SimHits.G4CheckOverlap.NodeName = cms.string('HGCalRegion') |
| 65 | +# enable dump gdml file |
| 66 | +process.g4SimHits.G4CheckOverlap.gdmlFlag = cms.bool(False) |
| 67 | +# if defined a G4PhysicsVolume info is printed |
| 68 | +process.g4SimHits.G4CheckOverlap.PVname = '' |
| 69 | +# if defined a list of daughter volumes is printed |
| 70 | +process.g4SimHits.G4CheckOverlap.LVname = 'lvD121' |
| 71 | + |
| 72 | +# extra output files, created if a name is not empty |
| 73 | +process.g4SimHits.FileNameField = '' |
| 74 | +process.g4SimHits.FileNameGDML = '' |
| 75 | +process.g4SimHits.FileNameRegions = '' |
| 76 | +# |
0 commit comments