From a3d74ecaca24d7980665f6746a09afd563ae2891 Mon Sep 17 00:00:00 2001
From: Sean <sean.benson@cern.ch>
Date: Wed, 25 May 2016 17:04:03 +0200
Subject: [PATCH] Make TurboConf work with 2015 Turbo++

---
 GaudiConf/python/GaudiConf/TurboConf.py | 26 +++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/GaudiConf/python/GaudiConf/TurboConf.py b/GaudiConf/python/GaudiConf/TurboConf.py
index 94e6d2c52c9..5763fa7f177 100644
--- a/GaudiConf/python/GaudiConf/TurboConf.py
+++ b/GaudiConf/python/GaudiConf/TurboConf.py
@@ -104,10 +104,36 @@ class TurboConf(LHCbConfigurableUser):
         self._register_unpackers()
         pv_source = '/Event/Turbo/Primary'
 
+        if self.getProp("DataType")=="2015":
+            # do not neet decoder interference if using 2015 data
+            from DAQSys.Decoders import DecoderDB
+            from DAQSys.DecoderClass import Decoder
+            Decoder("HltPackedDataDecoder/Hlt2PackedDataDecoder",active=False,conf=DecoderDB)
+
         if self.getProp('PersistReco'):
             packing = PersistRecoPacking()
+            
             self._register_pr_unpackers(packing)
             self._register_pr_links(packing)
             pv_source = '/Event/Turbo/PrimaryWithTracks'
+            
+            # account for name change in 2015
+            if self.getProp("DataType")=="2015":
+                unpackers = packing.unpackers()
+                for alg in unpackers:
+                    # Fix packed location
+                    origLoc = alg.InputName
+                    newLoc=origLoc.replace("Long","long")
+                    newLoc1=newLoc.replace("Downstream","down")
+                    newLoc2=newLoc1.replace("Neutral","neutral")
+                    alg.InputName=newLoc2
+                    # Point to present PVs
+                    pv_source = '/Event/Turbo/Primary'
+                    # Point to correct RichPID location
+                    origLoc_rpid = alg.OutputName
+                    newLoc_rpid = origLoc_rpid.replace("deuteron","")
+                    alg.OutputName = newLoc_rpid
+                    if origLoc_rpid!=newLoc_rpid:
+                        DataOnDemandSvc().AlgMap[alg.OutputName] = alg
 
         self._register_pv_links(pv_source)
-- 
GitLab