From 42f3b3b662e7ad17af8a6d310330128d9799d706 Mon Sep 17 00:00:00 2001
From: Alex Pearce <alex.pearce@cern.ch>
Date: Wed, 30 Aug 2017 12:38:59 +0200
Subject: [PATCH 1/4] Update Tesla tests to account for recent changes.

The major differences are:

* Turbo processing generally requires `DaVinci().Turbo = True`;
* The packers now require the locations of packed containers that should
always be created to be explicitly specified, and emit a warning if
these are not specified.
---
 Phys/Tesla/tests/options/DV_2015_CaloCheck.py          |  1 +
 Phys/Tesla/tests/options/DV_2015_SharedContainers.py   |  1 +
 Phys/Tesla/tests/options/DaVinciCheckDiMuon.py         |  1 +
 Phys/Tesla/tests/options/DaVinciCheckDstp_PR.py        |  1 +
 Phys/Tesla/tests/options/TeslaStep.py                  |  1 -
 Phys/Tesla/tests/options/TupleStep.py                  | 10 +---------
 Phys/Tesla/tests/options/TupleStepOneLine.py           |  2 +-
 Phys/Tesla/tests/options/TupleStepStreams.py           |  1 +
 Phys/Tesla/tests/qmtest/tesla.qms/a_lumiGen.qmt        |  2 +-
 Phys/Tesla/tests/qmtest/tesla.qms/default.qmt          |  3 ++-
 Phys/Tesla/tests/qmtest/tesla.qms/default_2015.qmt     |  2 +-
 .../tests/qmtest/tesla.qms/lineChecker_failure.qmt     |  5 +++++
 12 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/Phys/Tesla/tests/options/DV_2015_CaloCheck.py b/Phys/Tesla/tests/options/DV_2015_CaloCheck.py
index ab683bea8..eed8c67e9 100644
--- a/Phys/Tesla/tests/options/DV_2015_CaloCheck.py
+++ b/Phys/Tesla/tests/options/DV_2015_CaloCheck.py
@@ -10,6 +10,7 @@ DstConf().Turbo=True
 DaVinci()
 DaVinci().EvtMax=-1
 DaVinci().DataType="2015"
+DaVinci().Turbo=True
 
 from GaudiConf import IOHelper
 IOHelper().inputFiles( ["tesla_2015_TCK.dst"] , clear=True ) 
diff --git a/Phys/Tesla/tests/options/DV_2015_SharedContainers.py b/Phys/Tesla/tests/options/DV_2015_SharedContainers.py
index bce278719..be470648d 100644
--- a/Phys/Tesla/tests/options/DV_2015_SharedContainers.py
+++ b/Phys/Tesla/tests/options/DV_2015_SharedContainers.py
@@ -10,6 +10,7 @@ DstConf().Turbo=True
 DaVinci()
 DaVinci().EvtMax=-1
 DaVinci().DataType="2015"
+DaVinci().Turbo=True
 
 from GaudiConf import IOHelper
 IOHelper().inputFiles( ["tesla_2015_TCK.dst"] , clear=True ) 
diff --git a/Phys/Tesla/tests/options/DaVinciCheckDiMuon.py b/Phys/Tesla/tests/options/DaVinciCheckDiMuon.py
index eef664a07..f82147108 100644
--- a/Phys/Tesla/tests/options/DaVinciCheckDiMuon.py
+++ b/Phys/Tesla/tests/options/DaVinciCheckDiMuon.py
@@ -8,6 +8,7 @@ DaVinci()
 DaVinci().EvtMax=-1
 DaVinci().Lumi=True
 DaVinci().DataType="2016"
+DaVinci().Turbo=True
 
 from GaudiConf import IOHelper
 IOHelper().inputFiles( ["DiMuon.dst"] , clear=True ) 
diff --git a/Phys/Tesla/tests/options/DaVinciCheckDstp_PR.py b/Phys/Tesla/tests/options/DaVinciCheckDstp_PR.py
index 4d695b416..957dc7d17 100644
--- a/Phys/Tesla/tests/options/DaVinciCheckDstp_PR.py
+++ b/Phys/Tesla/tests/options/DaVinciCheckDstp_PR.py
@@ -8,6 +8,7 @@ DaVinci()
 DaVinci().EvtMax=-1
 DaVinci().Lumi=True
 DaVinci().DataType="2016"
+DaVinci().Turbo=True
 
 from GaudiConf import IOHelper
 IOHelper().inputFiles( ["Dstp_PR.dst"] , clear=True ) 
diff --git a/Phys/Tesla/tests/options/TeslaStep.py b/Phys/Tesla/tests/options/TeslaStep.py
index 5d86e0a60..431c35d3a 100644
--- a/Phys/Tesla/tests/options/TeslaStep.py
+++ b/Phys/Tesla/tests/options/TeslaStep.py
@@ -4,7 +4,6 @@ Tesla().InputType = "RAW"
 Tesla().DataType = '2016'
 Tesla().Simulation = False
 Tesla().Mode = 'Online'
-Tesla().RawFormatVersion = 0.2
 Tesla().VertRepLoc = 'Hlt2'
 Tesla().KillInputHlt2Reps = True
 
diff --git a/Phys/Tesla/tests/options/TupleStep.py b/Phys/Tesla/tests/options/TupleStep.py
index 3287738e9..1da06b269 100644
--- a/Phys/Tesla/tests/options/TupleStep.py
+++ b/Phys/Tesla/tests/options/TupleStep.py
@@ -1,18 +1,10 @@
 from Configurables import DaVinci
 from Configurables import DecayTreeTuple
 
-from Configurables import DstConf
-DstConf().Turbo=True
-
 Tuple = DecayTreeTuple("psi")
 Tuple.Decay = "J/psi(1S) -> mu+ mu-"
 Tuple.Inputs = [ '/Event/Turbo/Hlt2DiMuonJPsiTurbo/Particles']
 
-from Configurables import DstConf, TurboConf
-DstConf().Turbo = True
-TurboConf().PersistReco = True
-from StandardParticles import StdAllNoPIDsPions
-
 # Necessary DaVinci parameters #################
 DaVinci().Simulation   = False
 DaVinci().SkipEvents = 0
@@ -24,4 +16,4 @@ DaVinci().DataType      = '2016'
 DaVinci().UserAlgorithms = [] 
 DaVinci().UserAlgorithms += [Tuple]
 DaVinci().InputType = 'MDST'
-
+DaVinci().Turbo = True
diff --git a/Phys/Tesla/tests/options/TupleStepOneLine.py b/Phys/Tesla/tests/options/TupleStepOneLine.py
index 80d825849..21d75bb84 100644
--- a/Phys/Tesla/tests/options/TupleStepOneLine.py
+++ b/Phys/Tesla/tests/options/TupleStepOneLine.py
@@ -2,4 +2,4 @@ from GaudiConf import IOHelper
 IOHelper().inputFiles(['PFN:Tesla.dst'])
 from Configurables import DaVinci
 DaVinci().TupleFile = 'TupleStepOneLine.root'
-
+DaVinci().RootInTES = '/Event/Turbo'
diff --git a/Phys/Tesla/tests/options/TupleStepStreams.py b/Phys/Tesla/tests/options/TupleStepStreams.py
index e5c272338..fab7702a6 100644
--- a/Phys/Tesla/tests/options/TupleStepStreams.py
+++ b/Phys/Tesla/tests/options/TupleStepStreams.py
@@ -2,3 +2,4 @@ from GaudiConf import IOHelper
 IOHelper().inputFiles(['PFN:DiMuon.dst'])
 from Configurables import DaVinci
 DaVinci().TupleFile = 'TupleStepStreams.root'
+DaVinci().RootInTES = '/Event/DiMuon/Turbo'
diff --git a/Phys/Tesla/tests/qmtest/tesla.qms/a_lumiGen.qmt b/Phys/Tesla/tests/qmtest/tesla.qms/a_lumiGen.qmt
index 2a3185cb1..966e3ae7b 100644
--- a/Phys/Tesla/tests/qmtest/tesla.qms/a_lumiGen.qmt
+++ b/Phys/Tesla/tests/qmtest/tesla.qms/a_lumiGen.qmt
@@ -20,7 +20,7 @@
     <text>../options/TeslaRawReprocess.py</text>
   </set></argument>
   <argument name="validator"><text>
-countErrorLines({"FATAL":0, "ERROR":1595, "WARNING" :0})
+countErrorLines({"FATAL":0, "ERROR":1595, "WARNING" :1})
   </text></argument>
 </extension>
 
diff --git a/Phys/Tesla/tests/qmtest/tesla.qms/default.qmt b/Phys/Tesla/tests/qmtest/tesla.qms/default.qmt
index c7fee8aed..cb42dd7f5 100644
--- a/Phys/Tesla/tests/qmtest/tesla.qms/default.qmt
+++ b/Phys/Tesla/tests/qmtest/tesla.qms/default.qmt
@@ -19,8 +19,9 @@
   <argument name="args"><set>
     <text>../options/default.py</text>
   </set></argument>
+  <!-- TODO: we see 161 more errors than we should -->
   <argument name="validator"><text>
-countErrorLines({"FATAL":0, "ERROR":5561, "WARNING" :161})
+countErrorLines({"FATAL":0, "ERROR":5561, "WARNING" :162})
 #findReferenceBlock("""
 #Hlt2SelReportsD...  ERROR HltSelReportsDecoder::  Did not find string key for trigger selection in storage
 #""", id = "AllowResp" )
diff --git a/Phys/Tesla/tests/qmtest/tesla.qms/default_2015.qmt b/Phys/Tesla/tests/qmtest/tesla.qms/default_2015.qmt
index 774042ecc..d94eb9f01 100644
--- a/Phys/Tesla/tests/qmtest/tesla.qms/default_2015.qmt
+++ b/Phys/Tesla/tests/qmtest/tesla.qms/default_2015.qmt
@@ -20,7 +20,7 @@
     <text>../options/TCK_2015RP.py</text>
   </set></argument>
   <argument name="validator"><text>
-countErrorLines({"FATAL":0, "ERROR":0, "WARNING" :0})
+countErrorLines({"FATAL":0, "ERROR":0, "WARNING" :1})
 </text></argument>
 </extension>
 
diff --git a/Phys/Tesla/tests/qmtest/tesla.qms/lineChecker_failure.qmt b/Phys/Tesla/tests/qmtest/tesla.qms/lineChecker_failure.qmt
index 54941792c..a7f5f1cf5 100644
--- a/Phys/Tesla/tests/qmtest/tesla.qms/lineChecker_failure.qmt
+++ b/Phys/Tesla/tests/qmtest/tesla.qms/lineChecker_failure.qmt
@@ -31,6 +31,11 @@ TeslaLineChecker    ERROR Affected run : 179348
 TeslaLineChecker    ERROR Affected TCK : 0x21361609
 TeslaLineChecker    ERROR FIX!
 TeslaLineChecker    ERROR In case you are testing, set Tesla().EnableLineChecker = False to skip this check.
+TeslaLineChecker    ERROR Maximum number of errors ( 'ErrorMax':1) reached.
+DaVinciUserSequ...  ERROR Maximum number of errors ( 'ErrorMax':1) reached.
+DaVinciAnalysisSeq  ERROR Maximum number of errors ( 'ErrorMax':1) reached.
+FilteredEventSeq    ERROR Maximum number of errors ( 'ErrorMax':1) reached.
+DaVinciEventSeq     ERROR Maximum number of errors ( 'ErrorMax':1) reached.
 EventLoopMgr      WARNING Execution of algorithm DaVinciEventSeq failed
 EventLoopMgr        ERROR Error processing event loop.
 EventLoopMgr        ERROR Terminating event processing loop due to errors
-- 
GitLab


From 07f4e043af9a94ae115e0354faa79076c2143a61 Mon Sep 17 00:00:00 2001
From: Alex Pearce <alex.pearce@cern.ch>
Date: Wed, 30 Aug 2017 14:47:00 +0200
Subject: [PATCH 2/4] Temporary fix while bug hunting.

---
 Phys/Tesla/python/Tesla/Configuration.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/Phys/Tesla/python/Tesla/Configuration.py b/Phys/Tesla/python/Tesla/Configuration.py
index f7db0c2a7..c91dfe4c8 100644
--- a/Phys/Tesla/python/Tesla/Configuration.py
+++ b/Phys/Tesla/python/Tesla/Configuration.py
@@ -1131,7 +1131,8 @@ class Tesla(LHCbConfigurableUser):
             self._configureLumi()
         else:
             DecodeRawEvent().DataOnDemand=True
-            RecombineRawEvent(Version=self.getProp('SplitRawEventInput'))
+            # RecombineRawEvent(Version=self.getProp('SplitRawEventInput'))
+            RecombineRawEvent()
             if self.getProp('Simulation')==True:
                 self._unpackMC()
                 TurboConf().setProp("PersistReco",True)
@@ -1165,11 +1166,11 @@ class Tesla(LHCbConfigurableUser):
             kill_selreports = self._configureHlt2SelReportsKill()
             self.teslaSeq.Members += [kill_selreports]
 
-        if self.getProp('SplitRawEventInput') != self.getProp('SplitRawEventOutput'):
-            raw_event_juggler = self._raw_event_juggler(
-                self.getProp('SplitRawEventInput'),
-                self.getProp('SplitRawEventOutput')
-            )
-            self.teslaSeq.Members += [raw_event_juggler]
+        # if self.getProp('SplitRawEventInput') != self.getProp('SplitRawEventOutput'):
+        #     raw_event_juggler = self._raw_event_juggler(
+        #         self.getProp('SplitRawEventInput'),
+        #         self.getProp('SplitRawEventOutput')
+        #     )
+        #     self.teslaSeq.Members += [raw_event_juggler]
 
         ApplicationMgr().TopAlg+=[self.teslaSeq]
-- 
GitLab


From ef182dd8411262a57dce86a506cce9749d49342b Mon Sep 17 00:00:00 2001
From: Alex Pearce <alex.pearce@cern.ch>
Date: Fri, 1 Sep 2017 09:12:57 +0200
Subject: [PATCH 3/4] Revert "Temporary fix while bug hunting."

This reverts commit 07f4e043af9a94ae115e0354faa79076c2143a61.
---
 Phys/Tesla/python/Tesla/Configuration.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/Phys/Tesla/python/Tesla/Configuration.py b/Phys/Tesla/python/Tesla/Configuration.py
index c91dfe4c8..f7db0c2a7 100644
--- a/Phys/Tesla/python/Tesla/Configuration.py
+++ b/Phys/Tesla/python/Tesla/Configuration.py
@@ -1131,8 +1131,7 @@ class Tesla(LHCbConfigurableUser):
             self._configureLumi()
         else:
             DecodeRawEvent().DataOnDemand=True
-            # RecombineRawEvent(Version=self.getProp('SplitRawEventInput'))
-            RecombineRawEvent()
+            RecombineRawEvent(Version=self.getProp('SplitRawEventInput'))
             if self.getProp('Simulation')==True:
                 self._unpackMC()
                 TurboConf().setProp("PersistReco",True)
@@ -1166,11 +1165,11 @@ class Tesla(LHCbConfigurableUser):
             kill_selreports = self._configureHlt2SelReportsKill()
             self.teslaSeq.Members += [kill_selreports]
 
-        # if self.getProp('SplitRawEventInput') != self.getProp('SplitRawEventOutput'):
-        #     raw_event_juggler = self._raw_event_juggler(
-        #         self.getProp('SplitRawEventInput'),
-        #         self.getProp('SplitRawEventOutput')
-        #     )
-        #     self.teslaSeq.Members += [raw_event_juggler]
+        if self.getProp('SplitRawEventInput') != self.getProp('SplitRawEventOutput'):
+            raw_event_juggler = self._raw_event_juggler(
+                self.getProp('SplitRawEventInput'),
+                self.getProp('SplitRawEventOutput')
+            )
+            self.teslaSeq.Members += [raw_event_juggler]
 
         ApplicationMgr().TopAlg+=[self.teslaSeq]
-- 
GitLab


From 03649bd737019cb8f0e61f903aae755c18b25004 Mon Sep 17 00:00:00 2001
From: Alex Pearce <alex.pearce@cern.ch>
Date: Fri, 1 Sep 2017 11:39:10 +0200
Subject: [PATCH 4/4] Define raw event formats for tests.

---
 Phys/Tesla/tests/options/TCK_2015RP.py | 2 ++
 Phys/Tesla/tests/options/TeslaStep.py  | 2 ++
 Phys/Tesla/tests/options/containers.py | 2 ++
 Phys/Tesla/tests/options/default.py    | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/Phys/Tesla/tests/options/TCK_2015RP.py b/Phys/Tesla/tests/options/TCK_2015RP.py
index 13ec2bb83..ccd527310 100644
--- a/Phys/Tesla/tests/options/TCK_2015RP.py
+++ b/Phys/Tesla/tests/options/TCK_2015RP.py
@@ -6,6 +6,8 @@ Tesla().Mode = 'Offline'
 Tesla().VertRepLoc = 'Hlt2'
 Tesla().EvtMax=1000
 Tesla().outputFile = "tesla_2015_TCK.dst"
+Tesla().SplitRawEventInput = '0.4'
+Tesla().SplitRawEventOutput = '0.4'
 
 from Gaudi.Configuration import *
 version='v10r0_0x00fa0051'
diff --git a/Phys/Tesla/tests/options/TeslaStep.py b/Phys/Tesla/tests/options/TeslaStep.py
index 431c35d3a..8f9fe22a0 100644
--- a/Phys/Tesla/tests/options/TeslaStep.py
+++ b/Phys/Tesla/tests/options/TeslaStep.py
@@ -6,6 +6,8 @@ Tesla().Simulation = False
 Tesla().Mode = 'Online'
 Tesla().VertRepLoc = 'Hlt2'
 Tesla().KillInputHlt2Reps = True
+Tesla().SplitRawEventInput = '0.4'
+Tesla().SplitRawEventOutput = '0.4'
 
 from Configurables import Tesla
 from Gaudi.Configuration import *
diff --git a/Phys/Tesla/tests/options/containers.py b/Phys/Tesla/tests/options/containers.py
index e2d157c34..9ce747453 100644
--- a/Phys/Tesla/tests/options/containers.py
+++ b/Phys/Tesla/tests/options/containers.py
@@ -30,6 +30,8 @@ Tesla().EnableLineChecker = False
 Tesla().OutputLevel = 2
 Tesla().EvtMax = -1
 Tesla().Pack = False
+Tesla().SplitRawEventInput = '0.4'
+Tesla().SplitRawEventOutput = '0.4'
 
 from PRConfig.TestFileDB import test_file_db
 input = test_file_db['Tesla_Bsphiphi_MC12wTurbo']
diff --git a/Phys/Tesla/tests/options/default.py b/Phys/Tesla/tests/options/default.py
index 6301ccb8f..dd1cc4cbf 100644
--- a/Phys/Tesla/tests/options/default.py
+++ b/Phys/Tesla/tests/options/default.py
@@ -30,6 +30,8 @@ Tesla().TriggerLines = ["Hlt2IncPhi"]
 Tesla().EnableLineChecker = False
 Tesla().OutputLevel = 4
 Tesla().EvtMax = -1
+Tesla().SplitRawEventInput = '0.4'
+Tesla().SplitRawEventOutput = '0.4'
 
 from PRConfig.TestFileDB import test_file_db
 input = test_file_db['Tesla_Bsphiphi_MC12wTurbo']
-- 
GitLab