File indexing completed on 2025-01-18 03:42:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 import os
0017 import FWCore.ParameterSet.Config as cms
0018
0019
0020 from FWCore.ParameterSet.VarParsing import VarParsing
0021 datadir = os.path.join(os.environ.get('CMSSW_BASE',''),"src/HGCalCommissioning/LocalCalibration/data")
0022 options = VarParsing('standard')
0023 options.register('geometry', 'Extended2026D94', VarParsing.multiplicity.singleton, VarParsing.varType.string,
0024 info="geometry to use")
0025 options.register('fedconfig',f"{datadir}/config_feds.json",mytype=VarParsing.varType.string,
0026 info="Path to configuration (JSON format)")
0027 options.register('modconfig',f"{datadir}/config_econds.json",mytype=VarParsing.varType.string,
0028 info="Path to configuration (JSON format)")
0029 options.register('params',f"{datadir}/level0_calib_params.json",mytype=VarParsing.varType.string,
0030 info="Path to calibration parameters (JSON format)")
0031 options.register('modules',
0032
0033
0034 "HGCalCommissioning/Configuration/data/ModuleMaps/modulelocator_test_2mods.txt",
0035 mytype=VarParsing.varType.string,
0036 info="Path to module mapper. Absolute, or relative to CMSSW src directory")
0037 options.register('sicells','Geometry/HGCalMapping/data/CellMaps/WaferCellMapTraces.txt',mytype=VarParsing.varType.string,
0038 info="Path to Si cell mapper. Absolute, or relative to CMSSW src directory")
0039 options.register('sipmcells','Geometry/HGCalMapping/data/CellMaps/channels_sipmontile.hgcal.txt',mytype=VarParsing.varType.string,
0040 info="Path to SiPM-on-tile cell mapper. Absolute, or relative to CMSSW src directory")
0041 options.parseArguments()
0042 if len(options.files)==0:
0043 options.files=['file:/eos/cms/store/group/dpg_hgcal/comm_hgcal/psilva/hackhathon/23234.103_TTbar_14TeV+2026D94Aging3000/step2.root']
0044
0045
0046
0047
0048 print(f">>> Geometry: {options.geometry!r}")
0049 print(f">>> Input files: {options.files!r}")
0050 print(f">>> Module map: {options.modules!r}")
0051 print(f">>> SiCell map: {options.sicells!r}")
0052 print(f">>> SipmCell map: {options.sipmcells!r}")
0053 print(f">>> FED config: {options.fedconfig!r}")
0054 print(f">>> ECON-D config: {options.modconfig!r}")
0055 print(f">>> Calib params: {options.params!r}")
0056
0057
0058 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 as Era_Phase2
0059 process = cms.Process('HGCalRecHitESProducersTest',Era_Phase2)
0060
0061
0062 from Configuration.AlCa.GlobalTag import GlobalTag
0063 process.load("Configuration.StandardSequences.Services_cff")
0064 process.load("Configuration.StandardSequences.MagneticField_cff")
0065 process.load("Configuration.EventContent.EventContent_cff")
0066 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0067 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0068
0069
0070 process.source = cms.Source(
0071 "PoolSource",
0072 fileNames = cms.untracked.vstring(options.files),
0073 duplicateCheckMode = cms.untracked.string("noDuplicateCheck")
0074 )
0075
0076 process.maxEvents.input = 1
0077
0078
0079 process.load("FWCore.MessageService.MessageLogger_cfi")
0080 process.MessageLogger.cerr.threshold = ''
0081 process.MessageLogger.cerr.FwkReport.reportEvery = 500
0082
0083
0084 process.load(f"Configuration.Geometry.Geometry{options.geometry}Reco_cff")
0085 process.load(f"Configuration.Geometry.Geometry{options.geometry}_cff")
0086
0087 process.load('Geometry.HGCalMapping.hgCalMappingESProducer_cfi')
0088 process.hgCalMappingESProducer.si = cms.FileInPath(options.sicells)
0089 process.hgCalMappingESProducer.sipm = cms.FileInPath(options.sipmcells)
0090 process.hgCalMappingESProducer.modules = cms.FileInPath(options.modules)
0091
0092
0093
0094
0095 process.hgcalConfigESProducer = cms.ESSource(
0096 'HGCalConfigurationESProducer',
0097 fedjson=cms.string(options.fedconfig),
0098 modjson=cms.string(options.modconfig),
0099
0100
0101
0102
0103
0104
0105
0106 indexSource=cms.ESInputTag('hgCalMappingESProducer','')
0107 )
0108
0109
0110 process.load('Configuration.StandardSequences.Accelerators_cff')
0111
0112
0113 process.hgcalConfigParamESProducer = cms.ESProducer(
0114 'hgcalrechit::HGCalConfigurationESProducer@alpaka',
0115 gain=cms.int32(1),
0116
0117 indexSource=cms.ESInputTag('hgCalMappingESProducer','')
0118 )
0119 process.hgcalCalibParamESProducer = cms.ESProducer(
0120 'hgcalrechit::HGCalCalibrationESProducer@alpaka',
0121 filename=cms.string(options.params),
0122 indexSource=cms.ESInputTag('hgCalMappingESProducer',''),
0123 configSource=cms.ESInputTag(''),
0124 )
0125
0126
0127 process.testHGCalRecHitESProducers = cms.EDProducer(
0128 'HGCalRecHitESProducersTest@alpaka',
0129
0130
0131 indexSource=cms.ESInputTag('hgCalMappingESProducer', ''),
0132 configSource=cms.ESInputTag('hgcalConfigESProducer', ''),
0133 configParamSource=cms.ESInputTag('hgcalConfigParamESProducer', ''),
0134 calibParamSource=cms.ESInputTag('hgcalCalibParamESProducer', ''),
0135 )
0136 process.t = cms.Task(process.testHGCalRecHitESProducers)
0137 process.p = cms.Path(process.t)
0138
0139
0140 process.output = cms.OutputModule(
0141 'PoolOutputModule',
0142 fileName = cms.untracked.string(options.output),
0143
0144 )
0145 process.output_path = cms.EndPath(process.output)
0146