PF HLT in Alpaka.
6 '''Customization to introduce Particle Flow Reconstruction in Alpaka 8 process.hltPFRecHitHCALParamsRecordSource = cms.ESSource(
'EmptyESSource',
9 recordName = cms.string(
'PFRecHitHCALParamsRecord'),
10 iovIsRunNotTime = cms.bool(
True),
11 firstValid = cms.vuint32(1)
14 process.hltPFRecHitHCALTopologyRecordSource = cms.ESSource(
'EmptyESSource',
15 recordName = cms.string(
'PFRecHitHCALTopologyRecord'),
16 iovIsRunNotTime = cms.bool(
True),
17 firstValid = cms.vuint32(1)
20 process.hltPFClusterParamsRecordSource = cms.ESSource(
'EmptyESSource',
21 recordName = cms.string(
'JobConfigurationGPURecord'),
22 iovIsRunNotTime = cms.bool(
True),
23 firstValid = cms.vuint32(1)
26 process.hltHBHERecHitToSoA = cms.EDProducer(
"HCALRecHitSoAProducer@alpaka",
27 src = cms.InputTag(
"hltHbhereco"),
28 synchronise = cms.untracked.bool(
False)
31 process.hltPFRecHitHCALTopologyESProducer = cms.ESProducer(
'PFRecHitHCALTopologyESProducer@alpaka',
32 usePFThresholdsFromDB = cms.bool(
True),
33 appendToDataLabel = cms.string(
''),
37 process.hltPFRecHitHCALParamsESProducer = cms.ESProducer(
'PFRecHitHCALParamsESProducer@alpaka',
38 energyThresholdsHB = cms.vdouble(
44 energyThresholdsHE = cms.vdouble(
53 appendToDataLabel = cms.string(
''),
56 process.hltPFRecHitSoAProducerHCAL = cms.EDProducer(
"PFRecHitSoAProducerHCAL@alpaka",
57 producers = cms.VPSet(
59 src = cms.InputTag(
"hltHBHERecHitToSoA"),
60 params = cms.ESInputTag(
"hltPFRecHitHCALParamsESProducer:"),
63 topology = cms.ESInputTag(
"hltPFRecHitHCALTopologyESProducer:"),
64 synchronise = cms.untracked.bool(
False)
67 process.hltPFRecHitSoAProducerHCALCPUSerial =
makeSerialClone(process.hltPFRecHitSoAProducerHCAL)
69 process.hltLegacyPFRecHitProducer = cms.EDProducer(
"LegacyPFRecHitProducer",
70 src = cms.InputTag(
"hltPFRecHitSoAProducerHCAL")
73 process.hltPFClusterParamsESProducer = cms.ESProducer(
"PFClusterParamsESProducer@alpaka",
74 seedFinder = cms.PSet(
75 nNeighbours = cms.int32(4),
76 thresholdsByDetector = cms.VPSet(
78 detector = cms.string(
'HCAL_BARREL1'),
79 seedingThreshold = cms.vdouble(
85 seedingThresholdPt = cms.double(0)
88 detector = cms.string(
'HCAL_ENDCAP'),
89 seedingThreshold = cms.vdouble(
98 seedingThresholdPt = cms.double(0)
102 initialClusteringStep = cms.PSet(
103 thresholdsByDetector = cms.VPSet(
105 detector = cms.string(
'HCAL_BARREL1'),
106 gatheringThreshold = cms.vdouble(
114 detector = cms.string(
'HCAL_ENDCAP'),
115 gatheringThreshold = cms.vdouble(
127 pfClusterBuilder = cms.PSet(
128 maxIterations = cms.uint32(5),
129 minFracTot = cms.double(1e-20),
130 minFractionToKeep = cms.double(1e-07),
131 excludeOtherSeeds = cms.bool(
True),
132 showerSigma = cms.double(10),
133 stoppingTolerance = cms.double(1e-08),
134 recHitEnergyNorms = cms.VPSet(
136 detector = cms.string(
'HCAL_BARREL1'),
137 recHitEnergyNorm = cms.vdouble(
145 detector = cms.string(
'HCAL_ENDCAP'),
146 recHitEnergyNorm = cms.vdouble(
157 positionCalc = cms.PSet(
158 minFractionInCalc = cms.double(1e-09),
159 minAllowedNormalization = cms.double(1e-09)
161 timeResolutionCalcBarrel = cms.PSet(
162 corrTermLowE = cms.double(0),
163 threshLowE = cms.double(6),
164 noiseTerm = cms.double(21.86),
165 constantTermLowE = cms.double(4.24),
166 noiseTermLowE = cms.double(8),
167 threshHighE = cms.double(15),
168 constantTerm = cms.double(2.82)
170 timeResolutionCalcEndcap = cms.PSet(
171 corrTermLowE = cms.double(0),
172 threshLowE = cms.double(6),
173 noiseTerm = cms.double(21.86),
174 constantTermLowE = cms.double(4.24),
175 noiseTermLowE = cms.double(8),
176 threshHighE = cms.double(15),
177 constantTerm = cms.double(2.82)
182 process.hltPFClusterSoAProducer = cms.EDProducer(
"PFClusterSoAProducer@alpaka",
183 pfRecHits = cms.InputTag(
"hltPFRecHitSoAProducerHCAL"),
184 topology = cms.ESInputTag(
"hltPFRecHitHCALTopologyESProducer:"),
185 pfClusterParams = cms.ESInputTag(
"hltPFClusterParamsESProducer:"),
186 synchronise = cms.bool(
False)
189 process.hltPFClusterSoAProducerCPUSerial =
makeSerialClone(process.hltPFClusterSoAProducer,
190 pfRecHits = cms.InputTag(
"hltPFRecHitSoAProducerHCALCPUSerial"),
194 if(
not hasattr(process,
'hltParticleFlowClusterHBHE')):
197 process.hltLegacyPFClusterProducer = cms.EDProducer(
"LegacyPFClusterProducer",
198 src = cms.InputTag(
"hltPFClusterSoAProducer"),
199 pfClusterBuilder = process.hltParticleFlowClusterHBHE.pfClusterBuilder,
200 usePFThresholdsFromDB = cms.bool(
True),
201 recHitsSource = cms.InputTag(
"hltLegacyPFRecHitProducer"),
202 PFRecHitsLabelIn = cms.InputTag(
"hltPFRecHitSoAProducerHCAL")
207 process.hltParticleFlowClusterHCAL = cms.EDProducer(
"PFMultiDepthClusterProducer",
208 clustersSource = cms.InputTag(
"hltLegacyPFClusterProducer"),
209 usePFThresholdsFromDB = cms.bool(
True),
210 energyCorrector = process.hltParticleFlowClusterHCAL.energyCorrector,
211 pfClusterBuilder = process.hltParticleFlowClusterHCAL.pfClusterBuilder,
212 positionReCalc = process.hltParticleFlowClusterHCAL.positionReCalc
216 process.HLTPFHcalRecHits = cms.Sequence(
217 process.hltHBHERecHitToSoA+
218 process.hltPFRecHitSoAProducerHCAL+
219 process.hltLegacyPFRecHitProducer
222 process.HLTPFHcalClustering = cms.Sequence(
223 process.HLTPFHcalRecHits+
224 process.hltPFClusterSoAProducer+
225 process.hltLegacyPFClusterProducer+
226 process.hltParticleFlowClusterHCAL
232 def replaceItemsInSequence(process, itemsToReplace, replacingSequence):
233 for sequence, items
in process.sequences.items():
235 containsAll =
all(items.contains(item)
for item
in itemsToReplace)
237 for item
in itemsToReplace:
239 if(item != itemsToReplace[-1]):
243 items.replace(item, replacingSequence)
246 itemsList = [process.hltParticleFlowRecHitHBHE, process.hltParticleFlowClusterHBHE,process.hltParticleFlowClusterHCAL]
247 process = replaceItemsInSequence(process, itemsList, process.HLTPFHcalClustering)
249 process.HLTPFClusterHBHECPUSerial = cms.Sequence(process.hltHBHERecHitToSoA+process.hltPFRecHitSoAProducerHCALCPUSerial+process.hltPFClusterSoAProducerCPUSerial)
252 if hasattr(process,
'hltOutputDQMGPUvsCPU'):
253 process.hltOutputDQMGPUvsCPU.outputCommands.extend([
254 'keep *_hltPFClusterSoAProducer_*_*',
255 'keep *_hltPFClusterSoAProducerCPUSerial_*_*',
259 dqmHcalRecoPathName =
None 260 for pathName
in process.paths_():
261 if pathName.startswith(
'DQM_HcalReconstruction_v'):
262 dqmHcalRecoPathName = pathName
265 if dqmHcalRecoPathName ==
None:
268 dqmHcalPath = getattr(process, dqmHcalRecoPathName)
269 dqmHcalRecoPathIndex = dqmHcalPath.index(process.hltHcalConsumerGPU) + 1
270 dqmHcalPath.insert(dqmHcalRecoPathIndex , process.HLTPFClusterHBHECPUSerial)
def makeSerialClone(module, kwargs)
def customizeHLTforAlpakaParticleFlowClustering(process)
PF HLT in Alpaka.
if(threadIdxLocalY==0 &&threadIdxLocalX==0)