From 5ab6876503b3f6722a3ddd370319572a2bb03963 Mon Sep 17 00:00:00 2001
From: Roel Aaij <raaij@nikhef.nl>
Date: Mon, 18 Apr 2016 19:42:38 +0200
Subject: [PATCH] Set PreloadTools = True on all derivatives of DVCommonBase.

---
 Hlt/HltConf/doc/release.notes               |  3 +++
 Hlt/HltConf/python/HltConf/Configuration.py | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/Hlt/HltConf/doc/release.notes b/Hlt/HltConf/doc/release.notes
index f1397ebdd..e9c4ca53e 100755
--- a/Hlt/HltConf/doc/release.notes
+++ b/Hlt/HltConf/doc/release.notes
@@ -4,6 +4,9 @@
 ! Purpose     : HLT Configuration
 ! -----------------------------------------------------------------------------
 
+! 2016-04-18 - Roel Aaij
+ - Set PreloadTools = True on all derivatives of DVCommonBase.
+
 ! 2016-04-18 - Rosen Matev
  - Add RecVertices to persist reco and refactor code to use PersistRecoPacking
 
diff --git a/Hlt/HltConf/python/HltConf/Configuration.py b/Hlt/HltConf/python/HltConf/Configuration.py
index d8e16a80f..b08bbab7a 100755
--- a/Hlt/HltConf/python/HltConf/Configuration.py
+++ b/Hlt/HltConf/python/HltConf/Configuration.py
@@ -508,6 +508,24 @@ class HltConf(LHCbConfigurableUser):
         from HltConf.HltMonitoring import HltMonitoringConf
         HltMonitoringConf().configureHltMonitoring(lines1, lines2)
 
+        # Set PreloadTools to True everywhere
+        def preloadTools(c):
+            defProps = c.getDefaultProperties()
+            if 'PreloadTools' in defProps:
+                if type(defProps['PreloadTools']) == bool:
+                    # DVCommonBase has a bool
+                    c.PreloadTools = True
+            for p in ['Members', 'Filter0', 'Filter1']:
+                if not hasattr(c, p):
+                    continue
+                x = getattr(c, p)
+                if list is not type(x):
+                    x = [x]
+                for i in x:
+                    preloadTools(i)
+        for l in lines1 + lines2:
+            preloadTools(l.configurable())
+                    
         if self.getProp("Verbose") : print Sequence('Hlt')
 
     def _safeSet(self, option, newVal):
-- 
GitLab