Skip to content

Commit

Permalink
Fix layers-related configurations for V16 era
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsauvan committed Dec 21, 2023
1 parent 304c1f6 commit 17fb616
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 65 deletions.
36 changes: 25 additions & 11 deletions L1Trigger/L1THGCal/python/hgcalLayersCalibrationCoefficients_cfi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Modifier_phase2_hgcalV16_cff import phase2_hgcalV16

from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import dEdX, dEdX_v16
from . import l1tHGCalTriggerGeometryESProducer_cfi as geomparam

AllLayer_weights = cms.vdouble(0.0,
0.0158115,
0.0286877,
Expand Down Expand Up @@ -110,16 +115,25 @@
0.328053
)

from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import dEdX

EE_LAYERS = 28
TrgLayer_dEdX_weights = cms.vdouble()
for lid, lw in enumerate(dEdX.weights):
if lid > (EE_LAYERS+1):
TrgLayer_dEdX_weights.append(lw)
else:
# Only half the layers are read in the EE at L1T
if (lid % 2) == 1:
TrgLayer_dEdX_weights.append(lw+dEdX.weights[lid-1])

def trigger_dedx_weights(ecal_layers, reco_weights):
weights = []
for lid, lw in enumerate(reco_weights):
if lid > (ecal_layers+1):
weights.append(lw)
else:
TrgLayer_dEdX_weights.append(0)
# Only half the layers are read in the EE at L1T
if (lid % 2) == 1:
weights.append(lw+reco_weights[lid-1])
else:
weights.append(0)
return weights

triggerWeights = cms.PSet(
weights = cms.vdouble(trigger_dedx_weights(geomparam.CEE_LAYERS, dEdX.weights))
)

phase2_hgcalV16.toModify(triggerWeights,
weights = cms.vdouble(trigger_dedx_weights(geomparam.CEE_LAYERS_V16, dEdX_v16.weights))
)
45 changes: 16 additions & 29 deletions L1Trigger/L1THGCal/python/l1tHGCalConcentratorProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@
adcSaturationBH_MIP = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcSaturation_fC
adcNbitsBH = digiparam.hgchebackDigitizer.digiCfg.feCfg.adcNbits

EE_DR_GROUP = 7
FH_DR_GROUP = 6
BH_DR_GROUP = 12
# MAX_LAYERS should be equal to kNHGCalLayersMax_ defined in interface/HGCalCoarseTriggerCellMapping.h
# MAX_LAYERS can be larger than the actual number of layers
# CTC / STC sizes vectors should have a length of 4*MAX_LAYERS, 4 = 3 different silicon thicknesses + scintillator portion
MAX_LAYERS = 52

STC_SIZE_CUSTOM_PERLAYER_100 = ([4] + # no layer 0
[4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + [4]*EE_DR_GROUP + # EM
[4]*FH_DR_GROUP + [4]*FH_DR_GROUP + # FH
[4]*BH_DR_GROUP) # BH
STC_SIZE_CUSTOM_PERLAYER_200 = ([16] + # no layer 0
[16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + [16]*EE_DR_GROUP + # EM
[16]*FH_DR_GROUP + [16]*FH_DR_GROUP + # FH
[16]*BH_DR_GROUP) # BH
STC_SIZE_CUSTOM_PERLAYER_300 = STC_SIZE_CUSTOM_PERLAYER_200
STC_SIZE_CUSTOM_PERLAYER_SCIN = STC_SIZE_CUSTOM_PERLAYER_200


CTC_SIZE = ( [2]*(MAX_LAYERS+1)*4)
STC_SIZE = ( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*3 )

CTC_2_SIZES = cms.vuint32( [2]*(MAX_LAYERS+1)*4 )
STC_4_AND_16_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*3 )
STC_4_AND_8_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3 )

threshold_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
Method = cms.vstring(['thresholdSelect']*3),
Expand All @@ -33,7 +20,7 @@
coarsenTriggerCells = cms.vuint32(0,0,0),
fixedDataSizePerHGCROC = cms.bool(False),
allTrigCellsInTrigSums = cms.bool(True),
ctcSize = cms.vuint32(CTC_SIZE),
ctcSize = CTC_2_SIZES,
)

# Column is Nlinks, Row is NWafers
Expand Down Expand Up @@ -90,14 +77,14 @@
superTCCalibration_hesi = vfe_proc.calibrationCfg_hesi.clone(),
superTCCalibration_hesc = vfe_proc.calibrationCfg_hesc.clone(),
superTCCalibration_nose = vfe_proc.calibrationCfg_nose.clone(),
ctcSize = cms.vuint32(CTC_SIZE),
ctcSize = CTC_2_SIZES,
)

supertc_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
Method = cms.vstring(['superTriggerCellSelect']*3),
type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
stcSize = cms.vuint32(STC_SIZE),
ctcSize = cms.vuint32(CTC_SIZE),
stcSize = STC_4_AND_16_SIZES,
ctcSize = CTC_2_SIZES,
fixedDataSizePerHGCROC = cms.bool(False),
allTrigCellsInTrigSums = cms.bool(False),
coarsenTriggerCells = cms.vuint32(0,0,0),
Expand All @@ -118,8 +105,8 @@
fixedDataSizePerHGCROC = cms.bool(False),
allTrigCellsInTrigSums = cms.bool(False),
type_energy_division = cms.string('superTriggerCell'),# superTriggerCell,oneBitFraction,equalShare
stcSize = cms.vuint32(STC_SIZE),
ctcSize = cms.vuint32(CTC_SIZE),
stcSize = STC_4_AND_16_SIZES,
ctcSize = CTC_2_SIZES,
superTCCompression = superTCCompression_proc.clone(),
coarseTCCompression = coarseTCCompression_proc.clone(),
superTCCalibration_ee = vfe_proc.calibrationCfg_ee.clone(),
Expand All @@ -132,8 +119,8 @@
coarsetc_onebitfraction_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
Method = cms.vstring(['superTriggerCellSelect']*3),
type_energy_division = cms.string('oneBitFraction'),
stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
ctcSize = cms.vuint32(CTC_SIZE),
stcSize = STC_4_AND_8_SIZES,
ctcSize = CTC_2_SIZES,
fixedDataSizePerHGCROC = cms.bool(True),
allTrigCellsInTrigSums = cms.bool(False),
coarsenTriggerCells = cms.vuint32(0,0,0),
Expand All @@ -152,8 +139,8 @@
coarsetc_equalshare_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
Method = cms.vstring(['superTriggerCellSelect']*3),
type_energy_division = cms.string('equalShare'),
stcSize = cms.vuint32([4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3),
ctcSize = cms.vuint32(CTC_SIZE),
stcSize = STC_4_AND_8_SIZES,
ctcSize = CTC_2_SIZES,
fixedDataSizePerHGCROC = cms.bool(True),
allTrigCellsInTrigSums = cms.bool(False),
coarsenTriggerCells = cms.vuint32(0,0,0),
Expand Down
32 changes: 15 additions & 17 deletions L1Trigger/L1THGCal/python/l1tHGCalTriggerGeometryESProducer_cfi.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import FWCore.ParameterSet.Config as cms

disconnectedTriggerLayers = [
2,
4,
6,
8,
10,
12,
14,
16,
18,
20,
22,
24,
26,
28
]
from Configuration.Eras.Modifier_phase2_hgcalV16_cff import phase2_hgcalV16

CEE_LAYERS = 28
TOTAL_LAYERS = 50

CEE_LAYERS_V16 = 26
TOTAL_LAYERS_V16 = 47

def disconnected_layers(ecal_layers):
return [l for l in range(1,ecal_layers+1) if l%2==0]


geometry = cms.PSet( TriggerGeometryName = cms.string('HGCalTriggerGeometryV9Imp2'),
Expand All @@ -25,9 +19,13 @@
ScintillatorModuleSize = cms.uint32(6),
ScintillatorLinksPerModule = cms.uint32(2),
DisconnectedModules = cms.vuint32(0),
DisconnectedLayers = cms.vuint32(disconnectedTriggerLayers)
DisconnectedLayers = cms.vuint32(disconnected_layers(CEE_LAYERS))
)

phase2_hgcalV16.toModify(geometry,
DisconnectedLayers = cms.vuint32(disconnected_layers(CEE_LAYERS_V16))
)

l1tHGCalTriggerGeometryESProducer = cms.ESProducer(
'HGCalTriggerGeometryESProducer',
TriggerGeometry = geometry
Expand Down
9 changes: 3 additions & 6 deletions L1Trigger/L1THGCal/python/l1tHGCalVFEProducer_cfi.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import absolute_import
import FWCore.ParameterSet.Config as cms

from L1Trigger.L1THGCal.l1tHGCalTriggerGeometryESProducer_cfi import *

import SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi as digiparam
import RecoLocalCalo.HGCalRecProducers.HGCalUncalibRecHit_cfi as recoparam
import RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi as recocalibparam
Expand Down Expand Up @@ -69,7 +67,6 @@
fCperMIPee = recoparam.HGCalUncalibRecHit.HGCEEConfig.fCPerMIP
fCperMIPhe = recoparam.HGCalUncalibRecHit.HGCHEFConfig.fCPerMIP
fCperMIPnose = recoparam.HGCalUncalibRecHit.HGCHFNoseConfig.fCPerMIP
layerWeights = layercalibparam.TrgLayer_dEdX_weights
layerWeightsNose = recocalibparam.dEdX.weightsNose
thicknessCorrectionSi = recocalibparam.HGCalRecHit.thicknessCorrection
thicknessCorrectionSc = recocalibparam.HGCalRecHit.sciThicknessCorrection
Expand All @@ -79,23 +76,23 @@
calibration_params_ee = cms.PSet(
lsb = cms.double(triggerCellLsbBeforeCompression_si),
fCperMIP = fCperMIPee,
dEdXweights = layerWeights,
dEdXweights = layercalibparam.triggerWeights.weights,
thicknessCorrection = cms.vdouble(thicknessCorrectionSi[0:NTHICKNESS]),
chargeCollectionEfficiency = cms.PSet(),
)

calibration_params_hesi = cms.PSet(
lsb = cms.double(triggerCellLsbBeforeCompression_si),
fCperMIP = fCperMIPhe,
dEdXweights = layerWeights,
dEdXweights = layercalibparam.triggerWeights.weights,
thicknessCorrection = cms.vdouble(thicknessCorrectionSi[NTHICKNESS:2*NTHICKNESS]),
chargeCollectionEfficiency = cms.PSet(),
)

calibration_params_hesc = cms.PSet(
lsb = cms.double(triggerCellLsbBeforeCompression_sc),
fCperMIP = cms.vdouble(1.),
dEdXweights = layerWeights,
dEdXweights = layercalibparam.triggerWeights.weights,
thicknessCorrection = cms.vdouble(thicknessCorrectionSc.value()),
chargeCollectionEfficiency = cms.PSet(values=cms.vdouble(1.)),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

fcPerMip = recoparam.HGCalUncalibRecHit.HGCEEConfig.fCPerMIP
keV2fC = digiparam.hgceeDigitizer.digiCfg.keV2fC
layerWeights = layercalibparam.TrgLayer_dEdX_weights
thicknessCorrections = recocalibparam.HGCalRecHit.thicknessCorrection

ntuple_event = cms.PSet(
Expand Down Expand Up @@ -65,7 +64,7 @@
FillTruthMap = cms.bool(False),
fcPerMip = fcPerMip,
keV2fC = keV2fC,
layerWeights = layerWeights,
layerWeights = layercalibparam.triggerWeights.weights,
thicknessCorrections = thicknessCorrections,
FilterCellsInMulticlusters = cms.bool(False)
)
Expand Down

0 comments on commit 17fb616

Please sign in to comment.