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