CMS 3D CMS Logo

iterativeTICL_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
5 from RecoHGCal.TICL.MIPStep_cff import *
7 from RecoHGCal.TICL.TrkStep_cff import *
8 from RecoHGCal.TICL.EMStep_cff import *
9 from RecoHGCal.TICL.HADStep_cff import *
10 from RecoHGCal.TICL.CLUE3DEM_cff import *
11 from RecoHGCal.TICL.CLUE3DHAD_cff import *
13 
14 from RecoHGCal.TICL.ticlLayerTileProducer_cfi import ticlLayerTileProducer
15 from RecoHGCal.TICL.pfTICLProducer_cfi import pfTICLProducer as _pfTICLProducer
16 from RecoHGCal.TICL.trackstersMergeProducer_cfi import trackstersMergeProducer as _trackstersMergeProducer
18 
19 from RecoHGCal.TICL.tracksterLinksProducer_cfi import tracksterLinksProducer as _tracksterLinksProducer
21 from RecoHGCal.TICL.ticlCandidateProducer_cfi import ticlCandidateProducer as _ticlCandidateProducer
22 
23 from RecoHGCal.TICL.mtdSoAProducer_cfi import mtdSoAProducer as _mtdSoAProducer
24 
25 from Configuration.ProcessModifiers.ticl_v5_cff import ticl_v5
26 from Configuration.ProcessModifiers.ticl_superclustering_dnn_cff import ticl_superclustering_dnn
27 from Configuration.ProcessModifiers.ticl_superclustering_mustache_pf_cff import ticl_superclustering_mustache_pf
28 from Configuration.ProcessModifiers.ticl_superclustering_mustache_ticl_cff import ticl_superclustering_mustache_ticl
29 
30 ticlLayerTileTask = cms.Task(ticlLayerTileProducer)
31 
32 ticlTrackstersMerge = _trackstersMergeProducer.clone()
33 ticlTracksterLinks = _tracksterLinksProducer.clone(
34  tracksters_collections = cms.VInputTag(
35  'ticlTrackstersCLUE3DHigh',
36  'ticlTrackstersRecovery'
37  ),
38  regressionAndPid = cms.bool(True),
39  inferenceAlgo = cms.string('TracksterInferenceByDNN'),
40  pluginInferenceAlgoTracksterInferenceByDNN = cms.PSet(
41  algo_verbosity = cms.int32(0),
42  doPID = cms.int32(1),
43  doRegression = cms.int32(1),
44  inputNames = cms.vstring('input'),
45  output_en = cms.vstring('enreg_output'),
46  output_id = cms.vstring('pid_output'),
47  eid_min_cluster_energy = cms.double(1),
48  eid_n_clusters = cms.int32(10),
49  eid_n_layers = cms.int32(50),
50  onnxEnergyModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/energy_v0.onnx'),
51  onnxPIDModelPath = cms.FileInPath('RecoHGCal/TICL/data/ticlv5/onnx_models/linking/id_v0.onnx'),
52  type = cms.string('TracksterInferenceByDNN')
53  )
54 )
55 
56 ticlCandidate = _ticlCandidateProducer.clone()
57 mtdSoA = _mtdSoAProducer.clone()
58 
59 pfTICL = _pfTICLProducer.clone()
60 ticl_v5.toModify(pfTICL, ticlCandidateSrc = cms.InputTag('ticlCandidate'), isTICLv5 = cms.bool(True), useTimingAverage=True)
61 
62 ticlPFTask = cms.Task(pfTICL)
63 
64 ticlIterationsTask = cms.Task(
65  ticlCLUE3DHighStepTask
66 )
67 
68 ticl_v5.toModify(ticlIterationsTask , func=lambda x : x.add(ticlRecoveryStepTask))
69 ''' For future separate iterations
70 ,ticlCLUE3DEMStepTask,
71 ,ticlCLUE3DHADStepTask
72  '''
73 
74 ''' For future separate iterations
75 ticl_v5.toReplaceWith(ticlIterationsTask, ticlIterationsTask.copyAndExclude([ticlCLUE3DHighStepTask]))
76 '''
77 
78 from Configuration.ProcessModifiers.fastJetTICL_cff import fastJetTICL
79 fastJetTICL.toModify(ticlIterationsTask, func=lambda x : x.add(ticlFastJetStepTask))
80 
81 ticlIterLabels = ["ticlTrackstersCLUE3DHigh", "ticlTrackstersMerge"]
82 ticlIterLabels_v5 = ["ticlTrackstersCLUE3DHigh", "ticlTracksterLinks", "ticlCandidate"]
83 
84 ''' For future separate iterations
85 "CLUE3DEM", "CLUE3DHAD",
86 '''
87 
88 ticlTracksterMergeTask = cms.Task(ticlTrackstersMerge)
89 ticlTracksterLinksTask = cms.Task(ticlTracksterLinks, ticlSuperclusteringTask)
90 
91 
92 mergeTICLTask = cms.Task(ticlLayerTileTask
93  ,ticlIterationsTask
94  ,ticlTracksterMergeTask
95 )
96 
97 ticl_v5.toReplaceWith(mergeTICLTask, mergeTICLTask.copyAndExclude([ticlTracksterMergeTask]))
98 ticl_v5.toModify(mergeTICLTask, func=lambda x : x.add(ticlTracksterLinksTask))
99 
100 
101 mtdSoATask = cms.Task(mtdSoA)
102 ticlCandidateTask = cms.Task(ticlCandidate)
103 
104 
105 if ticl_v5._isChosen():
106  ticlIterLabels = ticlIterLabels_v5.copy()
107  if ticl_superclustering_mustache_ticl._isChosen():
108  ticlIterLabels.append("ticlTracksterLinksSuperclusteringMustache")
109  if ticl_superclustering_dnn._isChosen():
110  ticlIterLabels.append("ticlTracksterLinksSuperclusteringDNN")
111 
112 
113 associatorsInstances = []
114 
115 for labelts in ticlIterLabels:
116  for labelsts in ['ticlSimTracksters', 'ticlSimTrackstersfromCPs']:
117  associatorsInstances.append(labelts+'To'+labelsts)
118  associatorsInstances.append(labelsts+'To'+labelts)
119 
120 iterTICLTask = cms.Task(mergeTICLTask,
121  ticlPFTask)
122 
123 ticl_v5.toModify(iterTICLTask, func=lambda x : x.add(mtdSoATask, ticlCandidateTask))
124 
125 
126 ticlLayerTileHFNose = ticlLayerTileProducer.clone(
127  detector = 'HFNose'
128 )
129 
130 ticlLayerTileHFNoseTask = cms.Task(ticlLayerTileHFNose)
131 
132 iterHFNoseTICLTask = cms.Task(ticlLayerTileHFNoseTask
133  ,ticlHFNoseTrkEMStepTask
134  ,ticlHFNoseEMStepTask
135  ,ticlHFNoseTrkStepTask
136  ,ticlHFNoseHADStepTask
137  ,ticlHFNoseMIPStepTask
138 )