forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#181 from jbsauvan/config-defaults
Add clustering and calibration customization functions
- Loading branch information
Showing
3 changed files
with
92 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import hgcalLayersCalibrationCoefficients_cfi as layercalibparam | ||
|
||
|
||
def custom_cluster_calibration_global(process, | ||
factor=1.084 | ||
): | ||
parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters | ||
parameters_c2d.calibSF_cluster = cms.double(factor) | ||
parameters_c2d.applyLayerCalibration = cms.bool(False) | ||
return process | ||
|
||
|
||
def custom_cluster_calibration_layers(process, | ||
weights=layercalibparam.TrgLayer_weights | ||
): | ||
parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters | ||
parameters_c2d.layerWeights = weights | ||
parameters_c2d.applyLayerCalibration = cms.bool(True) | ||
return process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
|
||
def custom_2dclustering_distance(process, | ||
distance=6.,# cm | ||
seed_threshold=5.,# MipT | ||
cluster_threshold=2.# MipT | ||
): | ||
parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters | ||
parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) | ||
parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) | ||
parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) | ||
parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) | ||
parameters_c2d.dR_cluster = cms.double(distance) | ||
parameters_c2d.clusterType = cms.string('dRC2d') | ||
return process | ||
|
||
def custom_2dclustering_topological(process, | ||
seed_threshold=5.,# MipT | ||
cluster_threshold=2.# MipT | ||
): | ||
parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters | ||
parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) # MipT | ||
parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) # MipT | ||
parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) # MipT | ||
parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) # MipT | ||
parameters_c2d.clusterType = cms.string('NNC2d') | ||
return process | ||
|
||
def custom_2dclustering_constrainedtopological(process, | ||
distance=6.,# cm | ||
seed_threshold=5.,# MipT | ||
cluster_threshold=2.# MipT | ||
): | ||
parameters_c2d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C2d_parameters | ||
parameters_c2d.seeding_threshold_silicon = cms.double(seed_threshold) # MipT | ||
parameters_c2d.seeding_threshold_scintillator = cms.double(seed_threshold) # MipT | ||
parameters_c2d.clustering_threshold_silicon = cms.double(cluster_threshold) # MipT | ||
parameters_c2d.clustering_threshold_scintillator = cms.double(cluster_threshold) # MipT | ||
parameters_c2d.dR_cluster = cms.double(distance) # cm | ||
parameters_c2d.clusterType = cms.string('dRNNC2d') | ||
return process | ||
|
||
def custom_3dclustering_distance(process, | ||
distance=0.01 | ||
): | ||
parameters_c3d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C3d_parameters | ||
parameters_c3d.dR_multicluster = cms.double(distance) | ||
parameters_c3d.type_multicluster = cms.string('dRC3d') | ||
return process | ||
|
||
|
||
def custom_3dclustering_dbscan(process, | ||
distance=0.005, | ||
min_points=3 | ||
): | ||
parameters_c3d = process.hgcalTriggerPrimitiveDigiProducer.BEConfiguration.algorithms[0].C3d_parameters | ||
parameters_c3d.dist_dbscan_multicluster = cms.double(distance) | ||
parameters_c3d.minN_dbscan_multicluster = cms.uint32(min_points) | ||
parameters_c3d.type_multicluster = cms.string('DBSCAN3d') | ||
return process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters