From ce9c61eb61635e21527f42861a117268ee905a5f Mon Sep 17 00:00:00 2001
From: Alex Pearce <alex.pearce@cern.ch>
Date: Wed, 31 May 2017 10:32:03 +0200
Subject: [PATCH] Allow for 2016-style Tesla configuration on 2017 data.

---
 Phys/Tesla/python/Tesla/Configuration.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Phys/Tesla/python/Tesla/Configuration.py b/Phys/Tesla/python/Tesla/Configuration.py
index 366b5fd4c..a9803dbd5 100644
--- a/Phys/Tesla/python/Tesla/Configuration.py
+++ b/Phys/Tesla/python/Tesla/Configuration.py
@@ -105,6 +105,8 @@ class Tesla(LHCbConfigurableUser):
           , 'IgnoredLines'      : [ ]   # Regexes for lines excluded from the comparison of DecReports and input to TeslaReportsAlgo
           , 'FilterMC' : False # Save a subset of the input MC particles and vertices under `Tesla.base, mimicking a microDST writer`
           , 'ILinePersistenceSvc' : "TCKLinePersistenceSvc"   # Implementation of the ILinePersistenceSvc to use (for >= 2017 data types)
+          , 'CandidatesFromSelReports' : False  # If True and DataType >= 2017, take Turbo candidates from Hlt2SelReports rather than
+                                                # from the DstData raw bank (i.e. behave as if DataType =< 2016)
           }
     _propertyDocDct ={
             "EvtMax"		: "Maximum number of events to process, default all"
@@ -150,6 +152,8 @@ class Tesla(LHCbConfigurableUser):
             , 'IgnoredLines'      : 'Regexes for lines excluded from the comparison of DecReports and input to TeslaReportsAlgo'
             , 'FilterMC' : "Save a subset of the input MC particles and vertices under `Tesla.base`, mimicking a microDST writer"
             , 'ILinePersistenceSvc' : "Implementation of the ILinePersistenceSvc to use (for >= 2017 data types)"
+            , 'CandidatesFromSelReports' : ("If True and DataType >= 2017, take Turbo candidates from Hlt2SelReports rather than "
+                                            "from the DstData raw bank (i.e. behave as if DataType =< 2016)")
             
             }
 
@@ -977,7 +981,7 @@ class Tesla(LHCbConfigurableUser):
                 # /Event/Turbo, else it will be packed
                 TurboConf().setProp("RootInTES", "/Event")
 
-        if self.getProp('DataType') == '2017':
+        if self.getProp('DataType') == '2017' and not self.getProp('CandidatesFromSelReports'):
             # Unpack the DstData raw bank
             TurboConf().setProp("PersistReco", True)
             streaming_seq = self._configureOutputTurboSP()
-- 
GitLab