Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:26

0001 # Auto generated configuration file
0002 # using:
0003 # Revision: 1.19
0004 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
0005 # with command line options: reHLT --processName reHLT -s HLT:@relval2021 --conditions auto:phase1_2021_realistic --datatier GEN-SIM-DIGI-RAW -n 5 --eventcontent FEVTDEBUGHLT --geometry DB:Extended --era Run3 --customise=HLTrigger/Configuration/customizeHLTforPatatrack.customizeHLTforPatatrack --filein /store/relval/CMSSW_12_3_0_pre5/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/123X_mcRun3_2021_realistic_v6-v1/10000/2639d8f2-aaa6-4a78-b7c2-9100a6717e6c.root
0006 import FWCore.ParameterSet.Config as cms
0007 
0008 from Configuration.Eras.Era_Run3_cff import Run3
0009 
0010 process = cms.Process('rereHLT',Run3)
0011 
0012 _thresholdsHB = cms.vdouble(0.8, 0.8, 0.8, 0.8)
0013 _thresholdsHE = cms.vdouble(0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
0014 _thresholdsHBphase1 = cms.vdouble(0.1, 0.2, 0.3, 0.3)
0015 _thresholdsHEphase1 = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
0016 _seedingThresholdsHB = cms.vdouble(1.0, 1.0, 1.0, 1.0)
0017 _seedingThresholdsHE = cms.vdouble(1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1)
0018 _seedingThresholdsHBphase1 = cms.vdouble(0.125, 0.25, 0.35, 0.35)
0019 _seedingThresholdsHEphase1 = cms.vdouble(0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275)
0020 #updated HB RecHit threshold for 2023
0021 _thresholdsHBphase1_2023 = cms.vdouble(0.4, 0.3, 0.3, 0.3)
0022 #updated HB seeding threshold for 2023
0023 _seedingThresholdsHBphase1_2023 = cms.vdouble(0.6, 0.5, 0.5, 0.5)
0024 
0025 # import of standard configurations
0026 process.load('Configuration.StandardSequences.Services_cff')
0027 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0028 process.load('FWCore.MessageService.MessageLogger_cfi')
0029 process.load('Configuration.EventContent.EventContent_cff')
0030 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0031 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0032 process.load('Configuration.StandardSequences.MagneticField_cff')
0033 process.load('HLTrigger.Configuration.HLT_GRun_cff')
0034 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0035 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0036 
0037 process.load('Configuration.StandardSequences.Accelerators_cff')
0038 process.load('HeterogeneousCore.AlpakaCore.ProcessAcceleratorAlpaka_cfi')
0039 
0040 process.maxEvents = cms.untracked.PSet(
0041     #input = cms.untracked.int32(1),
0042     #input = cms.untracked.int32(100),
0043     input = cms.untracked.int32(1000),
0044     output = cms.optional.untracked.allowed(cms.int32,cms.PSet)
0045 )
0046 
0047 # Input source
0048 # Need to use a file that contains HCAL/ECAL hits. Verify using:
0049 # root root://eoscms.cern.ch//eos/cms/store/relval/CMSSW_13_0_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_130X_mcRun3_2022_realistic_v2_HS-v4/2590000/0088b51b-0cda-40f2-95fc-590f446624ee.root -e 'Events->Print()' -q | grep -E "hltHbhereco|hltEcalRecHit"
0050 process.source = cms.Source("PoolSource",
0051     #fileNames = cms.untracked.vstring('/store/relval/CMSSW_13_0_0/RelValTTbar_14TeV/GEN-SIM-DIGI-RAW/PU_130X_mcRun3_2022_realistic_v2_HS-v4/2590000/0088b51b-0cda-40f2-95fc-590f446624ee.root'),
0052     fileNames = cms.untracked.vstring('/store/relval/CMSSW_13_0_8/RelValQCD_FlatPt_15_3000HS_14/GEN-SIM-DIGI-RAW/130X_mcRun3_2022_realistic_v3_2022-v1/2580000/0e63ba30-251b-4034-93ca-4d400aaa399e.root'),
0053     secondaryFileNames = cms.untracked.vstring(),
0054     #skipEvents = cms.untracked.uint32(999)
0055 )
0056 
0057 process.options = cms.untracked.PSet(
0058     IgnoreCompletely = cms.untracked.vstring(),
0059     Rethrow = cms.untracked.vstring(),
0060     allowUnscheduled = cms.obsolete.untracked.bool,
0061     canDeleteEarly = cms.untracked.vstring(),
0062     deleteNonConsumedUnscheduledModules = cms.untracked.bool(True),
0063     dumpOptions = cms.untracked.bool(False),
0064     emptyRunLumiMode = cms.obsolete.untracked.string,
0065     eventSetup = cms.untracked.PSet(
0066         forceNumberOfConcurrentIOVs = cms.untracked.PSet(
0067             allowAnyLabel_=cms.required.untracked.uint32
0068         ),
0069         numberOfConcurrentIOVs = cms.untracked.uint32(0)
0070     ),
0071     fileMode = cms.untracked.string('FULLMERGE'),
0072     forceEventSetupCacheClearOnNewRun = cms.untracked.bool(False),
0073     makeTriggerResults = cms.obsolete.untracked.bool,
0074     numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(0),
0075     numberOfConcurrentRuns = cms.untracked.uint32(1),
0076     numberOfStreams = cms.untracked.uint32(0),
0077     numberOfThreads = cms.untracked.uint32(1),
0078     printDependencies = cms.untracked.bool(False),
0079     sizeOfStackForThreadsInKB = cms.optional.untracked.uint32,
0080     throwIfIllegalParameter = cms.untracked.bool(True),
0081     wantSummary = cms.untracked.bool(False)
0082 )
0083 
0084 # Production Info
0085 process.configurationMetadata = cms.untracked.PSet(
0086     annotation = cms.untracked.string('reHLT nevts:5'),
0087     name = cms.untracked.string('Applications'),
0088     version = cms.untracked.string('$Revision: 1.19 $')
0089 )
0090 
0091 # Output definition
0092 process.FEVTDEBUGHLToutput = cms.OutputModule("PoolOutputModule",
0093     dataset = cms.untracked.PSet(
0094         dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'),
0095         filterName = cms.untracked.string('')
0096     ),
0097     fileName = cms.untracked.string('reHLT_HLT.root'),
0098     outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands,
0099     splitLevel = cms.untracked.int32(0)
0100 )
0101 
0102 # Other statements
0103 from HLTrigger.Configuration.CustomConfigs import ProcessName
0104 process = ProcessName(process)
0105 
0106 from Configuration.AlCa.GlobalTag import GlobalTag
0107 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '')
0108 
0109 # Path and EndPath definitions
0110 process.endjob_step = cms.EndPath(process.endOfProcess)
0111 process.FEVTDEBUGHLToutput_step = cms.EndPath(process.FEVTDEBUGHLToutput)
0112 
0113 # Schedule definition
0114 # process.schedule imported from cff in HLTrigger.Configuration
0115 process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step])
0116 from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask
0117 associatePatAlgosToolsTask(process)
0118 
0119 # customisation of the process
0120 from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
0121 process = customizeHLTforMC(process)
0122 
0123 # Add early deletion of temporary data products to reduce peak memory need
0124 from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete
0125 process = customiseEarlyDelete(process)
0126 
0127 process.load( "HLTrigger.Timer.FastTimerService_cfi" )
0128 if 'MessageLogger' in process.__dict__:
0129     process.MessageLogger.TriggerSummaryProducerAOD = cms.untracked.PSet()
0130     process.MessageLogger.L1GtTrigReport = cms.untracked.PSet()
0131     process.MessageLogger.L1TGlobalSummary = cms.untracked.PSet()
0132     process.MessageLogger.HLTrigReport = cms.untracked.PSet()
0133     process.MessageLogger.FastReport = cms.untracked.PSet()
0134     process.MessageLogger.ThroughputService = cms.untracked.PSet()
0135     process.MessageLogger.cerr.FastReport = cms.untracked.PSet( limit = cms.untracked.int32( 10000000 ) )
0136 
0137 
0138 #####################################
0139 ##   Read command-line arguments   ##
0140 #####################################
0141 import sys
0142 import argparse
0143 parser = argparse.ArgumentParser(prog=f"{sys.argv[0]} {sys.argv[1]} --", description='Test and validation of PFRecHitProducer with Alpaka')
0144 parser.add_argument('-c', '--cal', type=str, default='HCAL',
0145                     help='Calorimeter type. Possible options: HCAL, ECAL. Default: HCAL')
0146 parser.add_argument('-b', '--backend', type=str, default='auto',
0147                     help='Alpaka backend. Possible options: CPU, GPU, auto. Default: auto')
0148 parser.add_argument('-s', '--synchronise', action='store_true', default=False,
0149                     help='Put synchronisation point at the end of Alpaka modules (for benchmarking performance)')
0150 parser.add_argument('-t', '--threads', type=int, default=8,
0151                     help='Number of threads. Default: 8')
0152 parser.add_argument('-d', '--debug', type=int, default=0, const=1, nargs="?",
0153                     help='Dump PFRecHits for first event (n>0) or first error (n<0). This applies to the n-th validation (1: Legacy vs Alpaka, 2: Legacy vs Legacy-from-Alpaka, 3: Alpaka vs Legacy-from-Alpaka). Default: 0')
0154 args = parser.parse_args()
0155 
0156 if(args.debug and args.threads != 1):
0157     args.threads = 1
0158     print("Number of threads set to 1 for debugging")
0159 
0160 assert args.cal.lower() in ["hcal", "ecal", "h", "e"], "Invalid calorimeter type"
0161 hcal = args.cal.lower() in ["hcal", "h"]
0162 CAL = "HCAL" if hcal else "ECAL"
0163 
0164 alpaka_backends = {
0165     "cpu": "alpaka_serial_sync::%s",  # Execute on CPU
0166     "gpu": "alpaka_cuda_async::%s",   # Execute using CUDA
0167     "cuda": "alpaka_cuda_async::%s",  # Execute using CUDA
0168     "auto": "%s@alpaka"               # Let framework choose
0169 }
0170 assert args.backend.lower() in alpaka_backends, "Invalid backend"
0171 alpaka_backend_str = alpaka_backends[args.backend.lower()]
0172 
0173 
0174 
0175 ########################################
0176 ##    Legacy HBHE PFRecHit producer   ##
0177 ########################################
0178 process.hltParticleFlowRecHitHBHE = cms.EDProducer("PFRecHitProducer",
0179     navigator = cms.PSet(
0180         hcalEnums = cms.vint32(1, 2),
0181         name = cms.string('PFRecHitHCALDenseIdNavigator')
0182     ),
0183     producers = cms.VPSet(cms.PSet(
0184         name = cms.string('PFHBHERecHitCreator'),
0185         qualityTests = cms.VPSet(
0186             cms.PSet(
0187                 usePFThresholdsFromDB = cms.bool(True),
0188                 cuts = cms.VPSet(
0189                     cms.PSet(
0190                         depth = cms.vint32(1, 2, 3, 4),
0191                         detectorEnum = cms.int32(1),
0192                         threshold = cms.vdouble(0.4, 0.3, 0.3, 0.3)
0193                     ),
0194                     cms.PSet(
0195                         depth = cms.vint32(1, 2, 3, 4, 5, 6, 7),
0196                         detectorEnum = cms.int32(2),
0197                         threshold = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
0198                     )
0199                 ),
0200                 name = cms.string('PFRecHitQTestHCALThresholdVsDepth')
0201             ),
0202             cms.PSet(
0203                 cleaningThresholds = cms.vdouble(0.0),
0204                 flags = cms.vstring('Standard'),
0205                 maxSeverities = cms.vint32(11),
0206                 name = cms.string('PFRecHitQTestHCALChannel')
0207             )
0208         ),
0209         src = cms.InputTag("hltHbherecoLegacy")
0210     ))
0211 )
0212 
0213 
0214 #####################################
0215 ##    Legacy PFRecHit producer     ##
0216 #####################################
0217 if hcal:
0218     process.hltParticleFlowRecHit = cms.EDProducer("PFRecHitProducer",
0219         navigator = cms.PSet(
0220             hcalEnums = cms.vint32(1, 2),
0221             name = cms.string('PFRecHitHCALDenseIdNavigator')
0222         ),
0223         producers = cms.VPSet(cms.PSet(
0224             name = cms.string('PFHBHERecHitCreator'),
0225             qualityTests = cms.VPSet(
0226                 cms.PSet(
0227                     usePFThresholdsFromDB = cms.bool(True),
0228                     cuts = cms.VPSet(
0229                         cms.PSet(
0230                             depth = cms.vint32(1, 2, 3, 4),
0231                             detectorEnum = cms.int32(1),
0232                             threshold = cms.vdouble(0.4, 0.3, 0.3, 0.3)
0233                         ),
0234                         cms.PSet(
0235                             depth = cms.vint32(1, 2, 3, 4, 5, 6, 7),
0236                             detectorEnum = cms.int32(2),
0237                             threshold = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
0238                         )
0239                     ),
0240                     name = cms.string('PFRecHitQTestHCALThresholdVsDepth')
0241                 ),
0242                 cms.PSet(
0243                     cleaningThresholds = cms.vdouble(0.0),
0244                     flags = cms.vstring('Standard'),
0245                     maxSeverities = cms.vint32(11),
0246                     name = cms.string('PFRecHitQTestHCALChannel')
0247                 )
0248             ),
0249             src = cms.InputTag("hltHbherecoLegacy")
0250         ))
0251     )
0252 else:  # ecal
0253     qualityTestsECAL = cms.VPSet(
0254         cms.PSet(
0255             name = cms.string("PFRecHitQTestDBThreshold"),
0256             applySelectionsToAllCrystals=cms.bool(True),
0257         ),
0258         cms.PSet(
0259             name = cms.string("PFRecHitQTestECAL"),
0260             cleaningThreshold = cms.double(2.0),
0261             timingCleaning = cms.bool(True),
0262             topologicalCleaning = cms.bool(True),
0263             skipTTRecoveredHits = cms.bool(True)
0264         )
0265     )
0266     process.hltParticleFlowRecHit = cms.EDProducer("PFRecHitProducer",
0267         navigator = cms.PSet(
0268             name = cms.string("PFRecHitECALNavigator"),
0269             barrel = cms.PSet( ),
0270             endcap = cms.PSet( )
0271         ),
0272         producers = cms.VPSet(
0273             cms.PSet(
0274                 name = cms.string("PFEBRecHitCreator"),
0275                 src  = cms.InputTag("hltEcalRecHit","EcalRecHitsEB"),
0276                 srFlags = cms.InputTag(""),
0277                 qualityTests = qualityTestsECAL
0278             ),
0279             cms.PSet(
0280                 name = cms.string("PFEERecHitCreator"),
0281                 src  = cms.InputTag("hltEcalRecHit","EcalRecHitsEE"),
0282                 srFlags = cms.InputTag(""),
0283                 qualityTests = qualityTestsECAL
0284             )
0285         )
0286     )
0287 
0288 
0289 #####################################
0290 ##    Alpaka PFRecHit producer     ##
0291 #####################################
0292 # Convert legacy CaloRecHits to CaloRecHitSoA
0293 if hcal:
0294     process.hltParticleFlowRecHitToSoA = cms.EDProducer(alpaka_backend_str % "HCALRecHitSoAProducer",
0295         src = cms.InputTag("hltHbherecoLegacy"),
0296         synchronise = cms.untracked.bool(args.synchronise)
0297     )
0298 else:  # ecal
0299     process.hltParticleFlowRecHitEBToSoA = cms.EDProducer(alpaka_backend_str % "ECALRecHitSoAProducer",
0300         src = cms.InputTag("hltEcalRecHit","EcalRecHitsEB"),
0301         synchronise = cms.untracked.bool(args.synchronise)
0302     )
0303     process.hltParticleFlowRecHitEEToSoA = cms.EDProducer(alpaka_backend_str % "ECALRecHitSoAProducer",
0304         src = cms.InputTag("hltEcalRecHit","EcalRecHitsEE"),
0305         synchronise = cms.untracked.bool(args.synchronise)
0306     )
0307 
0308 # Construct topology and cut parameter information
0309 process.pfRecHitTopologyRecordSource = cms.ESSource('EmptyESSource',
0310     recordName = cms.string(f'PFRecHit{CAL}TopologyRecord'),
0311     iovIsRunNotTime = cms.bool(True),
0312     firstValid = cms.vuint32(1)
0313 )
0314 process.pfRecHitParamsRecordSource = cms.ESSource('EmptyESSource',
0315     recordName = cms.string(f'PFRecHit{CAL}ParamsRecord'),
0316     iovIsRunNotTime = cms.bool(True),
0317     firstValid = cms.vuint32(1)
0318 )
0319 process.hltParticleFlowRecHitTopologyESProducer = cms.ESProducer(alpaka_backend_str % f"PFRecHit{CAL}TopologyESProducer",
0320         usePFThresholdsFromDB = cms.bool(True))
0321 if hcal:
0322     process.hltParticleFlowRecHitParamsESProducer = cms.ESProducer(alpaka_backend_str % "PFRecHitHCALParamsESProducer",
0323         energyThresholdsHB = cms.vdouble( 0.4, 0.3, 0.3, 0.3 ),
0324         energyThresholdsHE = cms.vdouble( 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 )
0325     )
0326 else:  # ecal
0327     process.hltParticleFlowRecHitParamsESProducer = cms.ESProducer(alpaka_backend_str % "PFRecHitECALParamsESProducer")
0328 
0329 # Construct PFRecHitSoA
0330 if hcal:
0331     process.hltParticleFlowPFRecHitAlpaka = cms.EDProducer(alpaka_backend_str % "PFRecHitSoAProducerHCAL",
0332         producers = cms.VPSet(
0333             cms.PSet(
0334                 src = cms.InputTag("hltParticleFlowRecHitToSoA"),
0335                 params = cms.ESInputTag("hltParticleFlowRecHitParamsESProducer:"),
0336             )
0337         ),
0338         topology = cms.ESInputTag("hltParticleFlowRecHitTopologyESProducer:"),
0339         synchronise = cms.untracked.bool(args.synchronise)
0340     )
0341 else:  # ecal
0342     process.hltParticleFlowPFRecHitAlpaka = cms.EDProducer(alpaka_backend_str % "PFRecHitSoAProducerECAL",
0343         producers = cms.VPSet(
0344             cms.PSet(
0345                 src = cms.InputTag("hltParticleFlowRecHitEBToSoA"),
0346                 params = cms.ESInputTag("hltParticleFlowRecHitParamsESProducer:")
0347             ),
0348             cms.PSet(
0349                 src = cms.InputTag("hltParticleFlowRecHitEEToSoA"),
0350                 params = cms.ESInputTag("hltParticleFlowRecHitParamsESProducer:")
0351             )
0352         ),
0353         topology = cms.ESInputTag("hltParticleFlowRecHitTopologyESProducer:"),
0354         synchronise = cms.bool(args.synchronise)
0355     )
0356 
0357 # Convert Alpaka PFRecHits to legacy format (for validation)
0358 process.hltParticleFlowAlpakaToLegacyPFRecHits = cms.EDProducer("LegacyPFRecHitProducer",
0359     src = cms.InputTag("hltParticleFlowPFRecHitAlpaka")
0360 )
0361 
0362 
0363 #####################################
0364 ##       PFRecHit validation       ##
0365 #####################################
0366 # Validate legacy format from legacy module vs SoA format from Alpaka module
0367 # This is the main Alpaka vs legacy test
0368 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0369 process.hltParticleFlowPFRecHitComparison = DQMEDAnalyzer("PFRecHitProducerTest",
0370     #caloRecHits = cms.untracked.InputTag("hltParticleFlowRecHitToSoA"),
0371     pfRecHitsSource1 = cms.untracked.InputTag("hltParticleFlowRecHit"),
0372     pfRecHitsSource2 = cms.untracked.InputTag("hltParticleFlowPFRecHitAlpaka"),
0373     pfRecHitsType1 = cms.untracked.string("legacy"),
0374     pfRecHitsType2 = cms.untracked.string("alpaka"),
0375     title = cms.untracked.string("Legacy vs Alpaka"),
0376     dumpFirstEvent = cms.untracked.bool(args.debug == 1),
0377     dumpFirstError = cms.untracked.bool(args.debug == -1),
0378     strictCompare = cms.untracked.bool(True)
0379 )
0380 
0381 # Validate legacy format from legacy module vs legacy format from Alpaka module
0382 process.hltParticleFlowAlpakaToLegacyPFRecHitsComparison1 = DQMEDAnalyzer("PFRecHitProducerTest",
0383     pfRecHitsSource1 = cms.untracked.InputTag("hltParticleFlowRecHitHBHE"),
0384     pfRecHitsSource2 = cms.untracked.InputTag("hltParticleFlowAlpakaToLegacyPFRecHits"),
0385     pfRecHitsType1 = cms.untracked.string("legacy"),
0386     pfRecHitsType2 = cms.untracked.string("legacy"),
0387     title = cms.untracked.string("Legacy vs Legacy-from-Alpaka"),
0388     dumpFirstEvent = cms.untracked.bool(args.debug == 2),
0389     dumpFirstError = cms.untracked.bool(args.debug == -2),
0390     strictCompare = cms.untracked.bool(True)
0391 )
0392 
0393 # Validate SoA format from Alpaka module vs legacy format from Alpaka module
0394 # This tests the SoA-to-legacy conversion module
0395 process.hltParticleFlowAlpakaToLegacyPFRecHitsComparison2 = DQMEDAnalyzer("PFRecHitProducerTest",
0396     pfRecHitsSource1 = cms.untracked.InputTag("hltParticleFlowPFRecHitAlpaka"),
0397     pfRecHitsSource2 = cms.untracked.InputTag("hltParticleFlowAlpakaToLegacyPFRecHits"),
0398     pfRecHitsType1 = cms.untracked.string("alpaka"),
0399     pfRecHitsType2 = cms.untracked.string("legacy"),
0400     title = cms.untracked.string("Alpaka vs Legacy-from-Alpaka"),
0401     dumpFirstEvent = cms.untracked.bool(args.debug == 3),
0402     dumpFirstError = cms.untracked.bool(args.debug == -3),
0403     strictCompare = cms.untracked.bool(True)
0404 )
0405 
0406 #Move Onto Clustering
0407 
0408 process.pfClusterParamsAlpakaESRcdSource = cms.ESSource('EmptyESSource',
0409     recordName = cms.string('JobConfigurationGPURecord'),
0410     iovIsRunNotTime = cms.bool(True),
0411     firstValid = cms.vuint32(1)
0412 )
0413 
0414 from RecoParticleFlow.PFClusterProducer.pfClusterParamsESProducer_cfi import pfClusterParamsESProducer as _pfClusterParamsESProducer
0415 
0416 process.hltParticleFlowClusterParamsESProducer = _pfClusterParamsESProducer.clone()
0417 process.hltParticleFlowClusterParamsESProducer.pfClusterBuilder.maxIterations = 5
0418 
0419 for idx, x in enumerate(process.hltParticleFlowClusterParamsESProducer.initialClusteringStep.thresholdsByDetector):
0420     for idy, y in enumerate(process.hltParticleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector):
0421         if x.detector == y.detector:
0422             x.gatheringThreshold = y.gatheringThreshold
0423 for idx, x in enumerate(process.hltParticleFlowClusterParamsESProducer.pfClusterBuilder.recHitEnergyNorms):
0424     for idy, y in enumerate(process.hltParticleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms):
0425         if x.detector == y.detector:
0426             x.recHitEnergyNorm = y.recHitEnergyNorm
0427 for idx, x in enumerate(process.hltParticleFlowClusterParamsESProducer.seedFinder.thresholdsByDetector):
0428     for idy, y in enumerate(process.hltParticleFlowClusterHBHE.seedFinder.thresholdsByDetector):
0429         if x.detector == y.detector:
0430             x.seedingThreshold = y.seedingThreshold
0431 
0432 process.hltParticleFlowPFClusterAlpaka = cms.EDProducer(alpaka_backend_str % "PFClusterSoAProducer",
0433                                                         pfClusterParams = cms.ESInputTag("hltParticleFlowClusterParamsESProducer:"),
0434                                                         topology = cms.ESInputTag("hltParticleFlowRecHitTopologyESProducer:"),
0435                                                         synchronise = cms.bool(args.synchronise))
0436 process.hltParticleFlowPFClusterAlpaka.pfRecHits = cms.InputTag("hltParticleFlowPFRecHitAlpaka")
0437 
0438 # Create legacy PFClusters
0439 
0440 process.hltParticleFlowAlpakaToLegacyPFClusters = cms.EDProducer("LegacyPFClusterProducer",
0441                                                                  src = cms.InputTag("hltParticleFlowPFClusterAlpaka"),
0442                                                                  pfClusterParams = cms.ESInputTag("hltParticleFlowClusterParamsESProducer:"),
0443                                                                  pfClusterBuilder = process.hltParticleFlowClusterHBHE.pfClusterBuilder,
0444                                                                  usePFThresholdsFromDB = cms.bool(True),
0445                                                                  recHitsSource = cms.InputTag("hltParticleFlowAlpakaToLegacyPFRecHits"))
0446 process.hltParticleFlowAlpakaToLegacyPFClusters.PFRecHitsLabelIn = cms.InputTag("hltParticleFlowPFRecHitAlpaka")
0447 
0448 process.hltParticleFlowClusterHBHE.pfClusterBuilder.maxIterations = 5
0449 process.hltParticleFlowClusterHBHE.usePFThresholdsFromDB = cms.bool(True)
0450 
0451 # Additional customization
0452 process.FEVTDEBUGHLToutput.outputCommands = cms.untracked.vstring('drop  *_*_*_*')
0453 process.FEVTDEBUGHLToutput.outputCommands.append('keep *_hltParticleFlowRecHitToSoA_*_*')
0454 process.FEVTDEBUGHLToutput.outputCommands.append('keep *_hltParticleFlowPFRecHitAlpaka_*_*')
0455 process.FEVTDEBUGHLToutput.outputCommands.append('keep *_hltParticleFlowAlpakaToLegacyPFClusters_*_*')
0456 process.FEVTDEBUGHLToutput.outputCommands.append('keep *_hltParticleFlowClusterHBHE_*_*')
0457 
0458 # Path/sequence definitions
0459 path = process.hltHcalDigis
0460 path += process.hltHbherecoLegacy
0461 path += process.hltParticleFlowRecHit               # Construct PFRecHits on CPU
0462 if hcal:
0463     path += process.hltParticleFlowRecHitToSoA     # Convert legacy calorimeter hits to SoA (HCAL barrel+endcap)
0464 else:  # ecal
0465     path += process.hltParticleFlowRecHitEBToSoA   # Convert legacy calorimeter hits to SoA (ECAL barrel)
0466     path += process.hltParticleFlowRecHitEEToSoA   # Convert legacy calorimeter hits to SoA (ECAL endcap)
0467 path += process.hltParticleFlowPFRecHitAlpaka      # Construct PFRecHits SoA
0468 path += process.hltParticleFlowRecHitHBHE               # Construct Legacy PFRecHits
0469 path += process.hltParticleFlowClusterHBHE
0470 path += process.hltParticleFlowPFRecHitComparison  # Validate Alpaka vs CPU
0471 path += process.hltParticleFlowAlpakaToLegacyPFRecHits             # Convert Alpaka PFRecHits SoA to legacy format
0472 path += process.hltParticleFlowAlpakaToLegacyPFRecHitsComparison1  # Validate legacy-format-from-alpaka vs regular legacy format
0473 path += process.hltParticleFlowAlpakaToLegacyPFRecHitsComparison2  # Validate Alpaka format vs legacy-format-from-alpaka
0474 
0475 path += process.hltParticleFlowPFClusterAlpaka
0476 path += process.hltParticleFlowAlpakaToLegacyPFClusters
0477 
0478 process.PFClusterAlpakaValidationTask = cms.EndPath(path)
0479 process.schedule = cms.Schedule(process.PFClusterAlpakaValidationTask)
0480 process.schedule.extend([process.endjob_step,process.FEVTDEBUGHLToutput_step])
0481 process.options.numberOfThreads = cms.untracked.uint32(args.threads)
0482 
0483 # Save DQM output
0484 process.DQMoutput = cms.OutputModule("DQMRootOutputModule",
0485     dataset = cms.untracked.PSet(
0486         dataTier = cms.untracked.string('DQMIO'),
0487         filterName = cms.untracked.string('')
0488     ),
0489     fileName = cms.untracked.string('file:DQMIO.root'),
0490     outputCommands = process.DQMEventContent.outputCommands,
0491     splitLevel = cms.untracked.int32(0)
0492 )
0493 process.DQMTask = cms.EndPath(process.DQMoutput)
0494 process.schedule.append(process.DQMTask)