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