neighbour_weights=neighbour_weights_1stOrder,
    seed_position=cms.string("TCWeighted"),  #BinCentre, TCWeighted
    seeding_space=cms.string("RPhi"),  # RPhi, XY
    seed_smoothing_ecal=seed_smoothing_ecal,
    seed_smoothing_hcal=seed_smoothing_hcal,
)

histoMax_C3d_clustering_params = cms.PSet(
    dR_multicluster=cms.double(0.03),
    dR_multicluster_byLayer_coefficientA=cms.vdouble(),
    dR_multicluster_byLayer_coefficientB=cms.vdouble(),
    shape_threshold=cms.double(1.),
    shape_distance=cms.double(0.015),
    minPt_multicluster=cms.double(0.5),  # minimum pt of the multicluster (GeV)
    cluster_association=cms.string("NearestNeighbour"),
    EGIdentification=egamma_identification_histomax.clone(),
)

# V9 samples have a different definition of the dEdx calibrations. To account for it
# we rescale the thresholds of the clustering seeds
# (see https://indico.cern.ch/event/806845/contributions/3359859/attachments/1815187/2966402/19-03-20_EGPerf_HGCBE.pdf
# for more details)
phase2_hgcalV10.toModify(
    histoMax_C3d_seeding_params,
    threshold_histo_multicluster=7.5,  # MipT
)

histoMaxVariableDR_C3d_params = histoMax_C3d_clustering_params.clone(
    dR_multicluster=cms.double(0.),
    dR_multicluster_byLayer_coefficientA=cms.vdouble(dr_layerbylayer),
    dR_multicluster_byLayer_coefficientB=cms.vdouble([0] * (MAX_LAYERS + 1)))
                             dist_dbscan_multicluster=cms.double(0.005),
                             minN_dbscan_multicluster=cms.uint32(3),
                             EGIdentification=egamma_identification_drnn_dbscan.clone())


histoMax_C3d_params = cms.PSet(type_multicluster=cms.string('HistoMaxC3d'),
                               dR_multicluster=cms.double(0.03),
                               dR_multicluster_byLayer_coefficientA=cms.vdouble(),
                               dR_multicluster_byLayer_coefficientB=cms.vdouble(),
                               minPt_multicluster=cms.double(0.5),  # minimum pt of the multicluster (GeV)
                               nBins_R_histo_multicluster=cms.uint32(36),
                               nBins_Phi_histo_multicluster=cms.uint32(216),
                               binSumsHisto=binSums,
                               threshold_histo_multicluster=cms.double(10.),
                               cluster_association=cms.string("NearestNeighbour"),
                               EGIdentification=egamma_identification_histomax.clone(),
                               neighbour_weights=neighbour_weights_1stOrder
                               )
# V9 samples have a different defintiion of the dEdx calibrations. To account for it
# we reascale the thresholds of the clustering seeds
# (see https://indico.cern.ch/event/806845/contributions/3359859/attachments/1815187/2966402/19-03-20_EGPerf_HGCBE.pdf
# for more details)
phase2_hgcalV9.toModify(histoMax_C3d_params,
                        threshold_histo_multicluster=7.5,  # MipT
                        )


histoMaxVariableDR_C3d_params = histoMax_C3d_params.clone(
        dR_multicluster = cms.double(0.),
        dR_multicluster_byLayer_coefficientA = cms.vdouble(dr_layerbylayer),
        dR_multicluster_byLayer_coefficientB = cms.vdouble([0]*(MAX_LAYERS+1))