Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:36:03

0001 import copy
0002 import FWCore.ParameterSet.Config as cms
0003 from DQM.SiPixelHeterogeneous.siPixelPhase1MonitorRecHitsSoA_cfi import *
0004 from DQM.SiPixelHeterogeneous.siPixelPhase2MonitorRecHitsSoA_cfi import *
0005 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1MonitorRecHitsSoA_cfi import *
0006 from DQM.SiPixelHeterogeneous.siPixelPhase1MonitorTrackSoA_cfi import *
0007 from DQM.SiPixelHeterogeneous.siPixelPhase2MonitorTrackSoA_cfi import *
0008 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1MonitorTrackSoA_cfi import *
0009 from DQM.SiPixelHeterogeneous.siPixelMonitorVertexSoA_cfi import *
0010 # Alpaka Modules
0011 from Configuration.ProcessModifiers.alpaka_cff import alpaka
0012 from DQM.SiPixelHeterogeneous.siPixelPhase1MonitorRecHitsSoAAlpaka_cfi import *
0013 from DQM.SiPixelHeterogeneous.siPixelPhase2MonitorRecHitsSoAAlpaka_cfi import *
0014 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1MonitorRecHitsSoAAlpaka_cfi import *
0015 from DQM.SiPixelHeterogeneous.siPixelPhase1MonitorTrackSoAAlpaka_cfi import *
0016 from DQM.SiPixelHeterogeneous.siPixelPhase2MonitorTrackSoAAlpaka_cfi import *
0017 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1MonitorTrackSoAAlpaka_cfi import *
0018 from DQM.SiPixelHeterogeneous.siPixelMonitorVertexSoAAlpaka_cfi import *
0019 
0020 # Run-3 sequence
0021 monitorpixelSoASource = cms.Sequence(siPixelPhase1MonitorRecHitsSoA * siPixelPhase1MonitorTrackSoA * siPixelMonitorVertexSoA)
0022 # Run-3 Alpaka sequence 
0023 monitorpixelSoASourceAlpaka = cms.Sequence(siPixelPhase1MonitorRecHitsSoAAlpaka * siPixelPhase1MonitorTrackSoAAlpaka * siPixelMonitorVertexSoAAlpaka)
0024 alpaka.toReplaceWith(monitorpixelSoASource, monitorpixelSoASourceAlpaka)
0025 # Phase-2 sequence
0026 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
0027 _monitorpixelSoARecHitsSource = cms.Sequence(siPixelPhase2MonitorRecHitsSoA * siPixelPhase2MonitorTrackSoA * siPixelMonitorVertexSoA)
0028 (phase2_tracker & ~alpaka).toReplaceWith(monitorpixelSoASource, _monitorpixelSoARecHitsSource)
0029 _monitorpixelSoARecHitsSourceAlpaka = cms.Sequence(siPixelPhase2MonitorRecHitsSoAAlpaka * siPixelPhase2MonitorTrackSoAAlpaka * siPixelMonitorVertexSoAAlpaka)
0030 (phase2_tracker & alpaka).toReplaceWith(monitorpixelSoASource, _monitorpixelSoARecHitsSourceAlpaka)
0031 
0032 # HIon Phase 1 sequence
0033 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0034 
0035 _monitorpixelSoARecHitsSourceHIon = cms.Sequence(siPixelHIonPhase1MonitorRecHitsSoA * siPixelHIonPhase1MonitorTrackSoA * siPixelMonitorVertexSoA)
0036 (pp_on_AA & ~phase2_tracker).toReplaceWith(monitorpixelSoASource, _monitorpixelSoARecHitsSourceHIon)
0037 _monitorpixelSoARecHitsSourceHIonAlpaka = cms.Sequence(siPixelHIonPhase1MonitorRecHitsSoAAlpaka * siPixelHIonPhase1MonitorTrackSoAAlpaka * siPixelMonitorVertexSoAAlpaka)
0038 (pp_on_AA & ~phase2_tracker & alpaka).toReplaceWith(monitorpixelSoASource, _monitorpixelSoARecHitsSourceHIonAlpaka)
0039 
0040 #Define the sequence for GPU vs CPU validation
0041 #This should run:- individual monitor for the 2 collections + comparison module
0042 from DQM.SiPixelHeterogeneous.siPixelPhase1CompareRecHitsSoA_cfi import *
0043 from DQM.SiPixelHeterogeneous.siPixelPhase2CompareRecHitsSoA_cfi import *
0044 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1CompareRecHitsSoA_cfi import *
0045 from DQM.SiPixelHeterogeneous.siPixelPhase1CompareTrackSoA_cfi import *
0046 from DQM.SiPixelHeterogeneous.siPixelPhase2CompareTrackSoA_cfi import *
0047 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1CompareTrackSoA_cfi import *
0048 from DQM.SiPixelHeterogeneous.siPixelCompareVertexSoA_cfi import *
0049 from DQM.SiPixelHeterogeneous.siPixelPhase1RawDataErrorComparator_cfi import *
0050 from DQM.SiPixelPhase1Common.SiPixelPhase1RawData_cfi import *
0051 #Alpaka
0052 from DQM.SiPixelHeterogeneous.siPixelPhase1CompareRecHits_cfi import *
0053 from DQM.SiPixelHeterogeneous.siPixelPhase2CompareRecHits_cfi import *
0054 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1CompareRecHits_cfi import *
0055 from DQM.SiPixelHeterogeneous.siPixelPhase1CompareTracks_cfi import *
0056 from DQM.SiPixelHeterogeneous.siPixelPhase2CompareTracks_cfi import *
0057 from DQM.SiPixelHeterogeneous.siPixelHIonPhase1CompareTracks_cfi import *
0058 from DQM.SiPixelHeterogeneous.siPixelCompareVertices_cfi import *
0059 
0060 # digi errors
0061 SiPixelPhase1RawDataConfForCPU = copy.deepcopy(SiPixelPhase1RawDataConf)
0062 for pset in SiPixelPhase1RawDataConfForCPU:
0063     pset.topFolderName =  "SiPixelHeterogeneous/PixelErrorsCPU"
0064 
0065 siPixelPhase1MonitorRawDataACPU = SiPixelPhase1RawDataAnalyzer.clone(
0066     src = "siPixelDigis@cpu",
0067     histograms = SiPixelPhase1RawDataConfForCPU
0068 )
0069 
0070 SiPixelPhase1RawDataConfForGPU = copy.deepcopy(SiPixelPhase1RawDataConf)
0071 for pset in SiPixelPhase1RawDataConfForGPU:
0072     pset.topFolderName =  "SiPixelHeterogeneous/PixelErrorsGPU"
0073 
0074 siPixelPhase1MonitorRawDataAGPU = SiPixelPhase1RawDataAnalyzer.clone(
0075     src = "siPixelDigis@cuda",
0076     histograms  =SiPixelPhase1RawDataConfForGPU
0077 )
0078 
0079 ## rechits
0080 siPixelPhase1MonitorRecHitsSoACPU = siPixelPhase1MonitorRecHitsSoA.clone(
0081  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cpu",
0082  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoACPU"
0083 )
0084 
0085 siPixelPhase1MonitorRecHitsSoAGPU = siPixelPhase1MonitorRecHitsSoA.clone(
0086  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cuda",
0087  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoAGPU"
0088 )
0089 
0090 siPixelPhase2MonitorRecHitsSoACPU = siPixelPhase2MonitorRecHitsSoA.clone(
0091  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cpu",
0092  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoACPU"
0093 )
0094 
0095 siPixelPhase2MonitorRecHitsSoAGPU = siPixelPhase2MonitorRecHitsSoA.clone(
0096  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cuda",
0097  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoAGPU"
0098 )
0099 
0100 siPixelHIonPhase1MonitorRecHitsSoACPU = siPixelHIonPhase1MonitorRecHitsSoA.clone(
0101  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cpu",
0102  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoACPU"
0103 )
0104 
0105 siPixelHIonPhase1MonitorRecHitsSoAGPU = siPixelHIonPhase1MonitorRecHitsSoA.clone(
0106  pixelHitsSrc = "siPixelRecHitsPreSplittingSoA@cuda",
0107  TopFolderName = "SiPixelHeterogeneous/PixelRecHitsSoAGPU"
0108 )
0109 
0110 ## tracks
0111 siPixelPhase1MonitorTrackSoACPU = siPixelPhase1MonitorTrackSoA.clone(
0112   pixelTrackSrc = 'pixelTracksSoA@cpu',
0113   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoACPU',
0114 )
0115 
0116 siPixelPhase1MonitorTrackSoAGPU = siPixelPhase1MonitorTrackSoA.clone(
0117   pixelTrackSrc = 'pixelTracksSoA@cuda',
0118   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoAGPU',
0119 )
0120 
0121 siPixelPhase2MonitorTrackSoACPU = siPixelPhase2MonitorTrackSoA.clone(
0122   pixelTrackSrc = 'pixelTracksSoA@cpu',
0123   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoACPU',
0124 )
0125 
0126 siPixelPhase2MonitorTrackSoAGPU = siPixelPhase2MonitorTrackSoA.clone(
0127   pixelTrackSrc = 'pixelTracksSoA@cuda',
0128   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoAGPU',
0129 )
0130 
0131 siPixelHIonPhase1MonitorTrackSoACPU = siPixelHIonPhase1MonitorTrackSoA.clone(
0132   pixelTrackSrc = 'pixelTracksSoA@cpu',
0133   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoACPU',
0134 )
0135 
0136 siPixelHIonPhase1MonitorTrackSoAGPU = siPixelHIonPhase1MonitorTrackSoA.clone(
0137   pixelTrackSrc = 'pixelTracksSoA@cuda',
0138   topFolderName = 'SiPixelHeterogeneous/PixelTrackSoAGPU',
0139 )
0140 
0141 ## vertices
0142 siPixelMonitorVertexSoACPU = siPixelMonitorVertexSoA.clone(
0143   pixelVertexSrc = 'pixelVerticesSoA@cpu',
0144   topFolderName = 'SiPixelHeterogeneous/PixelVertexSoACPU',
0145 )
0146 
0147 siPixelMonitorVertexSoAGPU = siPixelMonitorVertexSoA.clone(
0148   pixelVertexSrc = 'pixelVerticesSoA@cuda',
0149   topFolderName = 'SiPixelHeterogeneous/PixelVertexSoAGPU',
0150 )
0151 
0152 ### Alpaka
0153 
0154 # digi errors
0155 SiPixelPhase1RawDataConfForSerial = copy.deepcopy(SiPixelPhase1RawDataConf)
0156 for pset in SiPixelPhase1RawDataConfForSerial:
0157     pset.topFolderName =  "SiPixelHeterogeneous/PixelErrorsCPU"
0158 
0159 siPixelPhase1MonitorRawDataASerial = SiPixelPhase1RawDataAnalyzer.clone(
0160     src = "siPixelDigiErrorsAlpakaSerial",
0161     histograms = SiPixelPhase1RawDataConfForSerial
0162 )
0163 
0164 SiPixelPhase1RawDataConfForDevice = copy.deepcopy(SiPixelPhase1RawDataConf)
0165 for pset in SiPixelPhase1RawDataConfForDevice:
0166     pset.topFolderName =  "SiPixelHeterogeneous/PixelErrorsGPU"
0167 
0168 siPixelPhase1MonitorRawDataADevice = SiPixelPhase1RawDataAnalyzer.clone(
0169     src = "siPixelDigiErrorsAlpaka",
0170     histograms = SiPixelPhase1RawDataConfForDevice
0171 )
0172 
0173 siPixelPhase1CompareDigiErrorsSoAAlpaka = siPixelPhase1RawDataErrorComparator.clone(
0174     pixelErrorSrcGPU = cms.InputTag("siPixelDigiErrorsAlpaka"),
0175     pixelErrorSrcCPU = cms.InputTag("siPixelDigiErrorsAlpakaSerial"),
0176     topFolderName = cms.string('SiPixelHeterogeneous/PixelErrorCompareGPUvsCPU')
0177 )
0178 
0179 # PixelRecHits: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
0180 siPixelRecHitsSoAMonitorSerial = siPixelPhase1MonitorRecHitsSoAAlpaka.clone(
0181     pixelHitsSrc = cms.InputTag( 'siPixelRecHitsPreSplittingAlpakaSerial' ),
0182     TopFolderName = cms.string( 'SiPixelHeterogeneous/PixelRecHitsSerial' )
0183 )
0184 
0185 # PixelRecHits: monitor of Device product (Alpaka backend: '')
0186 siPixelRecHitsSoAMonitorDevice = siPixelPhase1MonitorRecHitsSoAAlpaka.clone(
0187     pixelHitsSrc = cms.InputTag( 'siPixelRecHitsPreSplittingAlpaka' ),
0188     TopFolderName = cms.string( 'SiPixelHeterogeneous/PixelRecHitsDevice' )
0189 )
0190 
0191 # PixelTracks: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
0192 siPixelTrackSoAMonitorSerial = siPixelPhase1MonitorTrackSoAAlpaka.clone(
0193     pixelTrackSrc = cms.InputTag('pixelTracksAlpakaSerial'),
0194     topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackSerial')
0195 )
0196 
0197 # PixelTracks: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
0198 siPixelTrackSoAMonitorDevice = siPixelPhase1MonitorTrackSoAAlpaka.clone(
0199     pixelTrackSrc = cms.InputTag('pixelTracksAlpaka'),
0200     topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackDevice')
0201 )
0202 
0203 # PixelVertices: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
0204 siPixelVertexSoAMonitorSerial = siPixelMonitorVertexSoAAlpaka.clone(
0205     pixelVertexSrc = cms.InputTag("pixelVerticesAlpakaSerial"),
0206     topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexSerial')
0207 )
0208 
0209 siPixelVertexSoAMonitorDevice = siPixelMonitorVertexSoAAlpaka.clone(
0210     pixelVertexSrc = cms.InputTag("pixelVerticesAlpaka"),
0211     topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexDevice')
0212 )
0213 
0214 # Run-3 sequence
0215 monitorpixelSoACompareSource = cms.Sequence(siPixelPhase1MonitorRawDataACPU *
0216                                             siPixelPhase1MonitorRawDataAGPU *
0217                                             siPixelPhase1MonitorRecHitsSoACPU *
0218                                             siPixelPhase1MonitorRecHitsSoAGPU *
0219                                             siPixelPhase1CompareRecHitsSoA *
0220                                             siPixelPhase1MonitorTrackSoAGPU *
0221                                             siPixelPhase1MonitorTrackSoACPU *
0222                                             siPixelPhase1CompareTrackSoA *
0223                                             siPixelMonitorVertexSoACPU *
0224                                             siPixelMonitorVertexSoAGPU *
0225                                             siPixelCompareVertexSoA *
0226                                             siPixelPhase1RawDataErrorComparator)
0227 # and the Alpaka version
0228 monitorpixelSoACompareSourceAlpaka = cms.Sequence(
0229                                             siPixelPhase1MonitorRawDataASerial *
0230                                             siPixelPhase1MonitorRawDataADevice *
0231                                             siPixelPhase1CompareDigiErrorsSoAAlpaka *
0232                                             siPixelRecHitsSoAMonitorSerial *
0233                                             siPixelRecHitsSoAMonitorDevice *
0234                                             siPixelPhase1CompareRecHits *
0235                                             siPixelTrackSoAMonitorSerial *
0236                                             siPixelTrackSoAMonitorDevice *
0237                                             siPixelPhase1CompareTracks *
0238                                             siPixelVertexSoAMonitorSerial *
0239                                             siPixelVertexSoAMonitorDevice *
0240                                             siPixelCompareVertices )
0241 
0242 # Phase-2 sequence ...
0243 _monitorpixelSoACompareSource =  cms.Sequence(siPixelPhase2MonitorRecHitsSoACPU *
0244                                               siPixelPhase2MonitorRecHitsSoAGPU *
0245                                               siPixelPhase2CompareRecHitsSoA *
0246                                               siPixelPhase2MonitorTrackSoAGPU *
0247                                               siPixelPhase2MonitorTrackSoACPU *
0248                                               siPixelPhase2CompareTrackSoA *
0249                                               siPixelMonitorVertexSoACPU *
0250                                               siPixelMonitorVertexSoAGPU *
0251                                               siPixelCompareVertexSoA)
0252 
0253 # ...and the Alpaka version
0254 _monitorpixelSoACompareSourceAlpakaPhase2 = cms.Sequence(                                          
0255                                             siPixelRecHitsSoAMonitorSerial *
0256                                             siPixelRecHitsSoAMonitorDevice *
0257                                             siPixelPhase1CompareRecHits *
0258                                             siPixelTrackSoAMonitorSerial *
0259                                             siPixelTrackSoAMonitorDevice *
0260                                             siPixelPhase1CompareTracks *
0261                                             siPixelVertexSoAMonitorSerial *
0262                                             siPixelVertexSoAMonitorDevice *
0263                                             siPixelCompareVertices )
0264 
0265 # HIon sequence
0266 _monitorpixelSoACompareSourceHIonPhase1 =  cms.Sequence(siPixelHIonPhase1MonitorRecHitsSoACPU *
0267                                               siPixelHIonPhase1MonitorRecHitsSoAGPU *
0268                                               siPixelHIonPhase1CompareRecHitsSoA *
0269                                               siPixelHIonPhase1MonitorTrackSoAGPU *
0270                                               siPixelHIonPhase1MonitorTrackSoACPU *
0271                                               siPixelHIonPhase1CompareTrackSoA *
0272                                               siPixelMonitorVertexSoACPU *
0273                                               siPixelMonitorVertexSoAGPU *
0274                                               siPixelCompareVertexSoA)
0275 
0276 phase2_tracker.toReplaceWith(monitorpixelSoACompareSource,_monitorpixelSoACompareSource)
0277 phase2_tracker.toReplaceWith(monitorpixelSoACompareSourceAlpaka,_monitorpixelSoACompareSourceAlpakaPhase2)
0278 
0279 from Configuration.ProcessModifiers.gpuValidationPixel_cff import gpuValidationPixel
0280 gpuValidationPixel.toReplaceWith(monitorpixelSoASource, monitorpixelSoACompareSource)
0281 
0282 from Configuration.ProcessModifiers.alpakaValidationPixel_cff import alpakaValidationPixel
0283 (alpakaValidationPixel & ~gpuValidationPixel ).toReplaceWith(monitorpixelSoASource, monitorpixelSoACompareSourceAlpaka)
0284 
0285