CMS 3D CMS Logo

pfClusterHBHEAlpaka_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 
5 from RecoParticleFlow.PFRecHitProducer.hcalRecHitSoAProducer_cfi import hcalRecHitSoAProducer as _hcalRecHitSoAProducer
6 from RecoParticleFlow.PFRecHitProducer.pfRecHitHCALParamsESProducer_cfi import pfRecHitHCALParamsESProducer as _pfRecHitHCALParamsESProducer
7 from RecoParticleFlow.PFRecHitProducer.pfRecHitHCALTopologyESProducer_cfi import pfRecHitHCALTopologyESProducer as _pfRecHitHCALTopologyESProducer
8 from RecoParticleFlow.PFRecHitProducer.pfRecHitSoAProducerHCAL_cfi import pfRecHitSoAProducerHCAL as _pfRecHitSoAProducerHCAL
9 from RecoParticleFlow.PFRecHitProducer.legacyPFRecHitProducer_cfi import legacyPFRecHitProducer as _legacyPFRecHitProducer
10 from RecoParticleFlow.PFClusterProducer.pfClusterParamsESProducer_cfi import pfClusterParamsESProducer as _pfClusterParamsESProducer
11 from RecoParticleFlow.PFClusterProducer.pfClusterSoAProducer_cfi import pfClusterSoAProducer as _pfClusterSoAProducer
12 from RecoParticleFlow.PFClusterProducer.legacyPFClusterProducer_cfi import legacyPFClusterProducer as _legacyPFClusterProducer
13 
14 from RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff import pfClusteringHBHEHFTask, pfClusteringHBHEHFOnlyTask, particleFlowClusterHBHE, particleFlowRecHitHBHE, particleFlowClusterHCAL, particleFlowClusterHBHEOnly, particleFlowRecHitHBHEOnly, particleFlowClusterHCALOnly
15 #Full Reco
16 _alpaka_pfClusteringHBHEHFTask = pfClusteringHBHEHFTask.copy()
17 #HCAL Only
18 _alpaka_pfClusteringHBHEHFOnlyTask = pfClusteringHBHEHFOnlyTask.copy()
19 
20 
21 pfRecHitHCALParamsRecordSource = cms.ESSource('EmptyESSource',
22  recordName = cms.string('PFRecHitHCALParamsRecord'),
23  iovIsRunNotTime = cms.bool(True),
24  firstValid = cms.vuint32(1)
25  )
26 
27 pfRecHitHCALTopologyRecordSource = cms.ESSource('EmptyESSource',
28  recordName = cms.string('PFRecHitHCALTopologyRecord'),
29  iovIsRunNotTime = cms.bool(True),
30  firstValid = cms.vuint32(1)
31  )
32 
33 pfClusterParamsRecordSource = cms.ESSource('EmptyESSource',
34  recordName = cms.string('JobConfigurationGPURecord'),
35  iovIsRunNotTime = cms.bool(True),
36  firstValid = cms.vuint32(1)
37  )
38 
39 hbheRecHitToSoA = _hcalRecHitSoAProducer.clone(
40  src = "hbhereco"
41  )
42 
43 pfRecHitHCALParamsESProducer = _pfRecHitHCALParamsESProducer.clone(
44  energyThresholdsHB = cms.vdouble( 0.1, 0.2, 0.3, 0.3 ),
45  energyThresholdsHE = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 )
46  )
47 
48 pfRecHitHCALTopologyESProducer = _pfRecHitHCALTopologyESProducer.clone()
49 pfRecHitSoAProducerHCAL = _pfRecHitSoAProducerHCAL.clone(
50  producers = cms.VPSet(
51  cms.PSet(
52  src = cms.InputTag("hbheRecHitToSoA"),
53  params = cms.ESInputTag("pfRecHitHCALParamsESProducer:"),
54  )
55  ),
56  topology = "pfRecHitHCALTopologyESProducer:",
57  synchronise = cms.untracked.bool(False)
58  )
59 
60 legacyPFRecHitProducer = _legacyPFRecHitProducer.clone(
61  src = "pfRecHitSoAProducerHCAL"
62  )
63 
64 pfClusterParamsESProducer = _pfClusterParamsESProducer.clone()
65 pfClusterSoAProducer = _pfClusterSoAProducer.clone(
66  pfRecHits = 'pfRecHitSoAProducerHCAL',
67  topology = "pfRecHitHCALTopologyESProducer:",
68  pfClusterParams = 'pfClusterParamsESProducer:',
69  synchronise = cms.bool(False)
70  )
71 
72 
73 legacyPFClusterProducer = _legacyPFClusterProducer.clone(
74  src = 'pfClusterSoAProducer',
75  pfClusterBuilder = particleFlowClusterHBHE.pfClusterBuilder,
76  recHitsSource = 'legacyPFRecHitProducer',
77  PFRecHitsLabelIn = 'pfRecHitSoAProducerHCAL'
78  )
79 
80 #Full Reco
81 _alpaka_pfClusteringHBHEHFTask.add(pfRecHitHCALParamsRecordSource)
82 _alpaka_pfClusteringHBHEHFTask.add(pfRecHitHCALTopologyRecordSource)
83 _alpaka_pfClusteringHBHEHFTask.add(pfClusterParamsRecordSource)
84 _alpaka_pfClusteringHBHEHFTask.add(hbheRecHitToSoA)
85 _alpaka_pfClusteringHBHEHFTask.add(pfRecHitHCALParamsESProducer)
86 _alpaka_pfClusteringHBHEHFTask.add(pfRecHitHCALTopologyESProducer)
87 _alpaka_pfClusteringHBHEHFTask.add(pfRecHitSoAProducerHCAL)
88 _alpaka_pfClusteringHBHEHFTask.add(legacyPFRecHitProducer)
89 _alpaka_pfClusteringHBHEHFTask.add(pfClusterParamsESProducer)
90 _alpaka_pfClusteringHBHEHFTask.add(pfClusterSoAProducer)
91 _alpaka_pfClusteringHBHEHFTask.add(legacyPFClusterProducer)
92 
93 _alpaka_pfClusteringHBHEHFTask.remove(particleFlowRecHitHBHE)
94 _alpaka_pfClusteringHBHEHFTask.remove(particleFlowClusterHBHE)
95 _alpaka_pfClusteringHBHEHFTask.remove(particleFlowClusterHCAL)
96 _alpaka_pfClusteringHBHEHFTask.add(particleFlowClusterHCAL)
97 
98 alpaka.toModify(particleFlowClusterHCAL, clustersSource = "legacyPFClusterProducer")
99 
100 alpaka.toReplaceWith(pfClusteringHBHEHFTask, _alpaka_pfClusteringHBHEHFTask)
101 
102 #HCAL Only
103 
104 from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
105 
106 hbheOnlyRecHitToSoA = _hcalRecHitSoAProducer.clone(
107  src = "hbheprereco"
108  )
109 run3_HB.toModify(hbheOnlyRecHitToSoA,
110  src = "hbhereco"
111  )
112 
113 pfRecHitSoAProducerHBHEOnly = _pfRecHitSoAProducerHCAL.clone(
114  producers = cms.VPSet(
115  cms.PSet(
116  src = cms.InputTag("hbheOnlyRecHitToSoA"),
117  params = cms.ESInputTag("pfRecHitHCALParamsESProducer:"),
118  )
119  ),
120  topology = "pfRecHitHCALTopologyESProducer:",
121  synchronise = cms.untracked.bool(False)
122  )
123 
124 legacyPFRecHitProducerHBHEOnly = _legacyPFRecHitProducer.clone(
125  src = "pfRecHitSoAProducerHBHEOnly"
126  )
127 
128 pfClusterSoAProducerHBHEOnly = _pfClusterSoAProducer.clone(
129  pfRecHits = 'pfRecHitSoAProducerHBHEOnly',
130  topology = "pfRecHitHCALTopologyESProducer:",
131  pfClusterParams = 'pfClusterParamsESProducer:',
132  synchronise = cms.bool(False)
133  )
134 
135 legacyPFClusterProducerHBHEOnly = _legacyPFClusterProducer.clone(
136  src = 'pfClusterSoAProducerHBHEOnly',
137  pfClusterBuilder = particleFlowClusterHBHE.pfClusterBuilder,
138  recHitsSource = 'legacyPFRecHitProducerHBHEOnly',
139  PFRecHitsLabelIn = 'pfRecHitSoAProducerHBHEOnly'
140  )
141 
142 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfRecHitHCALParamsRecordSource)
143 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfRecHitHCALTopologyRecordSource)
144 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfClusterParamsRecordSource)
145 _alpaka_pfClusteringHBHEHFOnlyTask.add(hbheOnlyRecHitToSoA)
146 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfRecHitHCALParamsESProducer)
147 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfRecHitHCALTopologyESProducer)
148 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfRecHitSoAProducerHBHEOnly)
149 _alpaka_pfClusteringHBHEHFOnlyTask.add(legacyPFRecHitProducerHBHEOnly)
150 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfClusterParamsESProducer)
151 _alpaka_pfClusteringHBHEHFOnlyTask.add(pfClusterSoAProducerHBHEOnly)
152 _alpaka_pfClusteringHBHEHFOnlyTask.add(legacyPFClusterProducerHBHEOnly)
153 
154 _alpaka_pfClusteringHBHEHFOnlyTask.remove(particleFlowRecHitHBHEOnly)
155 _alpaka_pfClusteringHBHEHFOnlyTask.remove(particleFlowClusterHBHEOnly)
156 _alpaka_pfClusteringHBHEHFOnlyTask.remove(particleFlowClusterHCALOnly)
157 _alpaka_pfClusteringHBHEHFOnlyTask.add(particleFlowClusterHCALOnly)
158 
159 alpaka.toModify(particleFlowClusterHCALOnly, clustersSource = "legacyPFClusterProducerHBHEOnly")
160 
161 alpaka.toReplaceWith(pfClusteringHBHEHFOnlyTask, _alpaka_pfClusteringHBHEHFOnlyTask)