From 31a76f28a44b7d096c44fe3c75cedf51c15f795a Mon Sep 17 00:00:00 2001
From: mmusich <marco.musich@cern.ch>
Date: Fri, 18 Aug 2023 08:43:35 +0200
Subject: [PATCH 1/2] put back 140.6 in the relval matrix (RAW' emulation
 workflow starting from 2022 data)

---
 .../python/relval_standard.py                 |  3 ++-
 .../python/relval_steps.py                    | 26 +++++++++++++++++--
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/Configuration/PyReleaseValidation/python/relval_standard.py b/Configuration/PyReleaseValidation/python/relval_standard.py
index 5d1d659ad8df9..bf41c572ea342 100644
--- a/Configuration/PyReleaseValidation/python/relval_standard.py
+++ b/Configuration/PyReleaseValidation/python/relval_standard.py
@@ -132,7 +132,8 @@
 workflows[140.5611] = ['RunHI2018reMINIAOD',['RunHI2018AOD','REMINIAODHID18','HARVESTHI18MINIAOD']]
 workflows[140.57] = ['RunHI2018Reduced',['RunHI2018Reduced','RECOHID18','HARVESTDHI18']]
 workflows[140.58] = ['',['RunHI2018','RAWPRIMEHI18','RECOHID18APPROXCLUSTERS','HARVESTDHI18']]
-workflows[140.61] = ['',['RunHI2022FullFormat','RECOHID22','HARVESTDHI22']]
+workflows[140.60] = ['',['RunHI2022','RAWPRIMEHI22','RECOHID22APPROXCLUSTERS','HARVESTDHI22']]
+workflows[140.61] = ['',['RunHI2022','RECOHID22','HARVESTDHI22']]
 
 ### run2 2015B 50ns ###
 workflows[134.701] = ['',['RunHLTPhy2015B','HLTDR2_50ns','RECODR2_50nsreHLT_HIPM','HARVESTDR2']]
diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py
index 76737e377aaba..563e17e3ff3f6 100644
--- a/Configuration/PyReleaseValidation/python/relval_steps.py
+++ b/Configuration/PyReleaseValidation/python/relval_steps.py
@@ -114,8 +114,7 @@
 steps['RunHI2018AOD']={'INPUT':InputInfo(dataSet='/HIHardProbes/HIRun2018A-04Apr2019-v1/AOD',label='hi2018aod',events=10000,location='STD',ls=Run2018HI)}
 
 Run2022HI={362321: [[112,112]]}
-steps['RunHI2022']={'INPUT':InputInfo(dataSet='/HITestRawPrime0/HIRun2022A-v1/RAW',label='hi2022',events=10000,location='STD',ls=Run2022HI)}
-steps['RunHI2022FullFormat']={'INPUT':InputInfo(dataSet='/HITestRaw0/HIRun2022A-v1/RAW',label='hi2022',events=10000,location='STD',ls=Run2022HI)}
+steps['RunHI2022']={'INPUT':InputInfo(dataSet='/HITestRaw0/HIRun2022A-v1/RAW',label='hi2022',events=10000,location='STD',ls=Run2022HI)}
 
 Run2012A=[191226]
 Run2012ASk=Run2012A+[]
@@ -2157,6 +2156,18 @@ def lhegensim2018ml(fragment,howMuch):
                         '--process':'REHLT'
 }
 
+steps['RAWPRIMEHI22']={ '--scenario':'pp',
+                        '--conditions':'auto:run3_data_prompt',
+                        '-s':'REPACK:DigiToApproxClusterRaw',
+                        '--datatier':'GEN-SIM-DIGI-RAW-HLTDEBUG',
+                        '--era':'Run3_pp_on_PbPb_approxSiStripClusters',
+                        '--eventcontent':'REPACKRAW',
+                        '-n':'10',
+                        '--customise_commands':'\"process.rawPrimeDataRepacker.src=\'rawDataRepacker\'\"',
+                        '--repacked':'',
+                        '--process':'REHLT'
+}
+
 steps['RAWPRIMESIMHI18']={ '--scenario':'pp',
                            '--conditions':'auto:phase1_2022_realistic_hi',
                            '-s':'REPACK:DigiToApproxClusterRaw',
@@ -2192,6 +2203,17 @@ def lhegensim2018ml(fragment,howMuch):
                           '-n':'100'
 }
 
+
+steps['RECOHID22APPROXCLUSTERS']=merge([{ '--scenario':'pp',
+                                          '--conditions':'auto:run3_data_prompt',
+                                          '-s':'RAW2DIGI,L1Reco,RECO,DQM:@commonFakeHLT+@standardDQMFakeHLT',
+                                          '--datatier':'AOD,DQMIO',
+                                          '--eventcontent':'AOD,DQM',
+                                          '--era':'Run3_pp_on_PbPb_approxSiStripClusters',
+                                          '--repacked':'',
+                                          '-n':'100'
+                                      },steps['RECOHID15']])
+
 steps['RECOHID22']=merge([{ '--scenario':'pp',
                             '--conditions':'auto:run3_data_prompt',
                             '-s':'RAW2DIGI,L1Reco,RECO,DQM:@commonFakeHLT+@standardDQMFakeHLT',

From f421b8129031407fd2f27b9079c8b0750ea77be2 Mon Sep 17 00:00:00 2001
From: mmusich <marco.musich@cern.ch>
Date: Fri, 18 Aug 2023 09:23:06 +0200
Subject: [PATCH 2/2] supply onlineBeamSpot for DigiToRaw_Repack in Run3 setup

---
 .../StandardSequences/python/DigiToRaw_Repack_cff.py         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Configuration/StandardSequences/python/DigiToRaw_Repack_cff.py b/Configuration/StandardSequences/python/DigiToRaw_Repack_cff.py
index a712ecaf6fc06..12d6c75978d38 100644
--- a/Configuration/StandardSequences/python/DigiToRaw_Repack_cff.py
+++ b/Configuration/StandardSequences/python/DigiToRaw_Repack_cff.py
@@ -84,5 +84,10 @@
    scalersInputTag = cms.InputTag( "rawDataRepacker" )
 )
 
+import RecoVertex.BeamSpotProducer.onlineBeamSpotESProducer_cfi as _mod
+BeamSpotESProducer = _mod.onlineBeamSpotESProducer.clone(
+    timeThreshold = 999999 # to allow using old runs in tests
+)
+
 DigiToApproxClusterRawTask = cms.Task(hltSiStripRawToDigi,siStripZeroSuppressionHLT,hltScalersRawToDigi,hltBeamSpotProducer,siStripClustersHLT,hltSiStripClusters2ApproxClusters,rawPrimeDataRepacker)
 DigiToApproxClusterRaw = cms.Sequence(DigiToApproxClusterRawTask)