From 2ecb298d05f8a55cd751b56b1e81970dbd6c64ff Mon Sep 17 00:00:00 2001
From: Julie Kirk <Julie.Kirk@cern.ch>
Date: Wed, 16 Dec 2020 12:10:31 +0100
Subject: [PATCH] TrigInDetValidation: Add "release" parameter for ART tests

---
 .../python/TrigInDetNewArtSteps.py            | 35 +++++++++++--------
 .../share/TrigInDetValidation_NewBase.py      |  3 +-
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetNewArtSteps.py b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetNewArtSteps.py
index f36db2004b1..9be14b5c66a 100644
--- a/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetNewArtSteps.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/python/TrigInDetNewArtSteps.py
@@ -35,6 +35,7 @@ class TrigInDetReco(ExecStep):
         self.slices = []
         self.preexec_trig = ' '
         self.postinclude_trig = postinclude_file
+        self.release = 'latest'
         self.preexec_reco =  ';'.join([
             'from RecExConfig.RecFlags import rec',
             'rec.doForwardDet=False',
@@ -60,21 +61,8 @@ class TrigInDetReco(ExecStep):
         self.postexec_trig = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.RDO_TRIG=100000000000']"
 
 
-        # get the cuttent atlas base release, and the previous base release
-        import os
-        DVERSION=os.getenv('Athena_VERSION')
-        if ( DVERSION is None ) :
-            AVERSION = "22.0.20"
-        else :
-            BASE=DVERSION[:5]
-            SUB=int(DVERSION[5:])
-            SUB -= 1
-            AVERSION=BASE+str(SUB)
-
-        print( "remapping athena base release version: ", DVERSION, " -> ", AVERSION )
-
         self.postexec_reco = "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.ESD=100000000000']"
-        self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG" --asetup "RAWtoESD:Athena,'+AVERSION+'" "ESDtoAOD:Athena,'+AVERSION+'" '
+        self.args = '--outputAODFile=AOD.pool.root --steering="doRDO_TRIG"'
 
 
     def configure(self, test):
@@ -114,6 +102,25 @@ class TrigInDetReco(ExecStep):
         chains += ']'
         self.preexec_trig = 'doEmptyMenu=True;'+flags+'selectChains='+chains
 
+        if (self.release == 'current'):
+            print( "Using current release for offline Reco steps  " )
+        else:
+            # get the current atlas base release, and the previous base release
+            import os
+            DVERSION=os.getenv('Athena_VERSION')
+            if (self.release == 'latest'):
+                if ( DVERSION is None ) :
+                    AVERSION = "22.0.20"
+                else:
+                    BASE=DVERSION[:5]
+                    SUB=int(DVERSION[5:])
+                    SUB -= 1
+                    AVERSION=BASE+str(SUB)
+            else:
+                AVERSION = self.release
+            self.args += ' --asetup "RAWtoESD:Athena,'+AVERSION+'" "ESDtoAOD:Athena,'+AVERSION+'" '
+            print( "remapping athena base release version for offline Reco steps: ", DVERSION, " -> ", AVERSION )
+
 
         self.args += ' --preExec "RDOtoRDOTrigger:{:s};" "all:{:s};" "RAWtoESD:{:s};" "ESDtoAOD:{:s};"'.format(
             self.preexec_trig, self.preexec_all, self.preexec_reco, self.preexec_aod)
diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_NewBase.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_NewBase.py
index afbbee8fe15..7315cccd423 100755
--- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_NewBase.py
+++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_NewBase.py
@@ -73,7 +73,8 @@ rdo2aod.slices            = Slices
 rdo2aod.threads           = Threads
 rdo2aod.concurrent_events = Slots 
 rdo2aod.config_only       = testconfig
-
+if 'Release' in dir():
+    rdo2aod.release           = Release
 
 
 if "Args" not in locals() : 
-- 
GitLab