Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-14 22:43:10

0001 from __future__ import absolute_import
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 from L1Trigger.L1THGCal.l1tHGCalTriggerGeometryESProducer_cfi import *
0005 
0006 import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
0007 import RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi as recoparam
0008 import RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi as recocalibparam 
0009 from . import hgcalLayersCalibrationCoefficients_cfi as layercalibparam
0010 
0011 
0012 feCfg_si = digiparam.hgceeDigitizer.digiCfg.feCfg
0013 feCfg_sc = digiparam.hgchebackDigitizer.digiCfg.feCfg
0014 
0015 # trigger cell LSB before compression is the LSB of the ADC
0016 triggerCellLsbBeforeCompression_si = float(feCfg_si.adcSaturation_fC.value())/(2**float(feCfg_si.adcNbits.value()))
0017 triggerCellLsbBeforeCompression_sc = float(feCfg_sc.adcSaturation_fC.value())/(2**float(feCfg_sc.adcNbits.value()))
0018 
0019 # Linearization parameters for silicon
0020 linearization_params_si = cms.PSet(
0021         linLSB = cms.double(triggerCellLsbBeforeCompression_si),
0022         adcsaturation = feCfg_si.adcSaturation_fC,
0023         tdcnBits = feCfg_si.tdcNbits,
0024         tdcOnset = feCfg_si.tdcOnset_fC,
0025         adcnBits = feCfg_si.adcNbits,
0026         tdcsaturation = feCfg_si.tdcSaturation_fC,
0027         linnBits = cms.uint32(17),
0028          oot_coefficients = cms.vdouble(0., 0.), # OOT PU subtraction coeffs for samples (bx-2, bx-1). (0,0) = no OOT PU subtraction
0029         )
0030 
0031 # Linearization parameters for scintillator
0032 linearization_params_sc = cms.PSet(
0033         linLSB = cms.double(triggerCellLsbBeforeCompression_sc),
0034         adcsaturation = feCfg_sc.adcSaturation_fC,
0035         tdcnBits = feCfg_sc.tdcNbits,
0036         tdcOnset = feCfg_sc.tdcOnset_fC,
0037         adcnBits = feCfg_sc.adcNbits,
0038         tdcsaturation = feCfg_sc.tdcSaturation_fC,
0039         linnBits = cms.uint32(17),
0040          oot_coefficients = cms.vdouble(0., 0.), # OOT PU subtraction coeffs for samples (bx-2, bx-1). (0,0) = no OOT PU subtraction
0041         )
0042 
0043 summation_params = cms.PSet(
0044         siliconCellLSB_fC =  cms.double(triggerCellLsbBeforeCompression_si),
0045         scintillatorCellLSB_MIP = cms.double(triggerCellLsbBeforeCompression_sc),
0046         noiseSilicon = cms.PSet(),
0047         noiseScintillator = cms.PSet(),
0048         # cell thresholds before TC sums
0049         # Cut at 3sigma of the noise
0050         noiseThreshold = cms.double(3), # in units of sigmas of the noise
0051         )
0052 
0053 # Compression parameters for low density modules
0054 compression_params_ldm = cms.PSet(
0055         exponentBits = cms.uint32(4),
0056         mantissaBits = cms.uint32(3),
0057         truncationBits = cms.uint32(1),
0058         rounding = cms.bool(True),
0059         )
0060 # Compression parameters for high density modules
0061 compression_params_hdm = cms.PSet(
0062         exponentBits = cms.uint32(4),
0063         mantissaBits = cms.uint32(3),
0064         truncationBits = cms.uint32(3),
0065         rounding = cms.bool(True),
0066         )
0067 
0068 # Reco calibration parameters
0069 fCperMIPee = recoparam.HGCalUncalibRecHit.HGCEEConfig.fCPerMIP
0070 fCperMIPhe = recoparam.HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP
0071 fCperMIPnose = recoparam.HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP
0072 layerWeights = layercalibparam.TrgLayer_dEdX_weights
0073 layerWeightsNose = recocalibparam.dEdX.weightsNose
0074 thicknessCorrectionSi = recocalibparam.HGCalRecHit.thicknessCorrection
0075 thicknessCorrectionSc = recocalibparam.HGCalRecHit.sciThicknessCorrection
0076 thicknessCorrectionNose = recocalibparam.HGCalRecHit.thicknessNoseCorrection
0077 
0078 NTHICKNESS = 3
0079 calibration_params_ee = cms.PSet(
0080         lsb = cms.double(triggerCellLsbBeforeCompression_si),
0081         fCperMIP = fCperMIPee,
0082         dEdXweights = layerWeights,
0083         thicknessCorrection = cms.vdouble(thicknessCorrectionSi[0:NTHICKNESS]),
0084         chargeCollectionEfficiency = cms.PSet(),
0085         )
0086 
0087 calibration_params_hesi = cms.PSet(
0088         lsb = cms.double(triggerCellLsbBeforeCompression_si),
0089         fCperMIP = fCperMIPhe,
0090         dEdXweights = layerWeights,
0091         thicknessCorrection = cms.vdouble(thicknessCorrectionSi[NTHICKNESS:2*NTHICKNESS]),
0092         chargeCollectionEfficiency = cms.PSet(),
0093         )
0094 
0095 calibration_params_hesc = cms.PSet(
0096         lsb = cms.double(triggerCellLsbBeforeCompression_sc),
0097         fCperMIP = cms.vdouble(1.),
0098         dEdXweights = layerWeights,
0099         thicknessCorrection = cms.vdouble(thicknessCorrectionSc.value()),
0100         chargeCollectionEfficiency = cms.PSet(values=cms.vdouble(1.)),
0101         )
0102 
0103 calibration_params_nose = cms.PSet(
0104         lsb = cms.double(triggerCellLsbBeforeCompression_si),
0105         fCperMIP = fCperMIPnose,
0106         dEdXweights = layerWeightsNose,
0107         thicknessCorrection = thicknessCorrectionNose,
0108         chargeCollectionEfficiency = cms.PSet(),
0109         )
0110 
0111 vfe_proc = cms.PSet( ProcessorName = cms.string('HGCalVFEProcessorSums'),
0112                      linearizationCfg_si = linearization_params_si,
0113                      linearizationCfg_sc = linearization_params_sc,
0114                      summationCfg = summation_params,
0115                      compressionCfg_ldm = compression_params_ldm,
0116                      compressionCfg_hdm = compression_params_hdm,
0117                      calibrationCfg_ee = calibration_params_ee,
0118                      calibrationCfg_hesi = calibration_params_hesi,
0119                      calibrationCfg_hesc = calibration_params_hesc,
0120                      calibrationCfg_nose = calibration_params_nose,
0121                      )
0122 
0123 # isolate these refs in case they aren't available in some other WF
0124 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0125 phase2_hgcal.toModify(summation_params,
0126     noiseSilicon = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_fC")),
0127     noiseScintillator = cms.PSet(refToPSet_ = cms.string("HGCAL_noise_heback")),
0128 )
0129 
0130 phase2_hgcal.toModify(calibration_params_ee,
0131     chargeCollectionEfficiency = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
0132 )
0133 phase2_hgcal.toModify(calibration_params_hesi,
0134     chargeCollectionEfficiency = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
0135 )
0136 phase2_hgcal.toModify(calibration_params_nose,
0137     chargeCollectionEfficiency = cms.PSet(refToPSet_ = cms.string("HGCAL_chargeCollectionEfficiencies")),
0138 )
0139 
0140 
0141 
0142 l1tHGCalVFEProducer = cms.EDProducer(
0143         "HGCalVFEProducer",
0144         eeDigis = cms.InputTag('simHGCalUnsuppressedDigis:EE'),
0145         fhDigis = cms.InputTag('simHGCalUnsuppressedDigis:HEfront'),
0146         bhDigis = cms.InputTag('simHGCalUnsuppressedDigis:HEback'),
0147         ProcessorParameters = vfe_proc.clone()
0148        )
0149 
0150 l1tHFnoseVFEProducer = cms.EDProducer(
0151         "HFNoseVFEProducer",
0152         noseDigis = cms.InputTag('simHFNoseUnsuppressedDigis:HFNose'),
0153         ProcessorParameters = vfe_proc.clone()
0154        )
0155 
0156 
0157