File indexing completed on 2024-04-06 12:32:19
0001
0002
0003
0004
0005 import FWCore.ParameterSet.Config as cms
0006 from FWCore.ParameterSet.VarParsing import VarParsing
0007 import sys, re
0008
0009 from FWCore.PythonFramework.CmsRun import CmsRun
0010 from Configuration.Eras.Era_Phase2_cff import Phase2
0011
0012 process = cms.Process("PROD", Phase2)
0013
0014 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 from Validation.Geometry.plot_hgcal_utils import _LABELS2COMPS
0026
0027 _ALLOWED_LABELS = _LABELS2COMPS.keys()
0028
0029 options = VarParsing('analysis')
0030 options.register('geom',
0031 'Extended2023D86',
0032 VarParsing.multiplicity.singleton,
0033 VarParsing.varType.string,
0034 "Select the geometry to be studied"
0035 )
0036
0037 options.register('label',
0038 'HGCal',
0039 VarParsing.multiplicity.singleton,
0040 VarParsing.varType.string,
0041 "Select the label to be used to create output files. Default to HGCal. If multiple components are selected, it defaults to the join of all components, with '_' as separator."
0042 )
0043
0044 options.setDefault('inputFiles', ['file:single_neutrino_random.root'])
0045
0046 options.parseArguments()
0047
0048
0049 if options.label not in _ALLOWED_LABELS:
0050 print("\n*** Error, '%s' not registered as a valid components to monitor." % options.label)
0051 print("Allowed components:", _ALLOWED_LABELS)
0052 print()
0053 raise RuntimeError("Unknown label")
0054
0055 _components = _LABELS2COMPS[options.label]
0056
0057
0058 process.load("Configuration.Geometry.Geometry%sReco_cff" % options.geom)
0059
0060
0061
0062
0063 process.load("Configuration.StandardSequences.MagneticField_38T_cff")
0064
0065
0066
0067
0068
0069
0070
0071 process.load("SimG4Core.Application.g4SimHits_cfi")
0072
0073 process.load("IOMC.RandomEngine.IOMC_cff")
0074 process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876
0075
0076 process.source = cms.Source("PoolSource",
0077 fileNames = cms.untracked.vstring(options.inputFiles)
0078 )
0079
0080 process.maxEvents = cms.untracked.PSet(
0081 input = cms.untracked.int32(-1)
0082 )
0083
0084 process.p1 = cms.Path(process.g4SimHits)
0085 process.g4SimHits.StackingAction.TrackNeutrino = cms.bool(True)
0086 process.g4SimHits.UseMagneticField = False
0087 process.g4SimHits.Physics.type = 'SimG4Core/Physics/DummyPhysics'
0088 process.g4SimHits.Physics.DummyEMPhysics = True
0089 process.g4SimHits.Physics.CutsPerRegion = False
0090 process.g4SimHits.Watchers = cms.VPSet(cms.PSet(
0091 type = cms.string('MaterialBudgetAction'),
0092 MaterialBudgetAction = cms.PSet(
0093 HistosFile = cms.string('matbdg_%s.root' % options.label),
0094 AllStepsToTree = cms.bool(True),
0095 HistogramList = cms.string('HGCal'),
0096 SelectedVolumes = cms.vstring(_components),
0097 TreeFile = cms.string('None'),
0098
0099 StopAfterProcess = cms.string('None'),
0100
0101 TextFile = cms.string('None'),
0102
0103
0104 minZ = cms.double(-7000.),
0105 maxZ = cms.double(7000.),
0106 nintZ = cms.int32(3500),
0107
0108 rMin = cms.double(-50.),
0109 rMax = cms.double(8000.),
0110 nrbin = cms.int32(805),
0111
0112 etaMin = cms.double(-5.),
0113 etaMax = cms.double(5.),
0114 netabin = cms.int32(250),
0115
0116 phiMin = cms.double(-3.2),
0117 phiMax = cms.double(3.2),
0118 nphibin = cms.int32(180),
0119
0120 RMin = cms.double(0.),
0121 RMax = cms.double(8000.),
0122 nRbin = cms.int32(800)
0123
0124 )
0125 ))
0126
0127
0128 cmsRun = CmsRun(process)
0129 cmsRun.run()
0130
0131