From 1a5dbf422c1211b7520000c56ac72dde27628c7a Mon Sep 17 00:00:00 2001
From: ibelyaev <Ivan.Belyaev@cern.ch>
Date: Tue, 4 Jul 2017 11:51:53 +0200
Subject: [PATCH 1/2] MomentumScaling: add the possibility  to propagate other
 parameters to scaling algorithm

---
 .../python/PhysSelPython/MomentumScaling.py           | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py b/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
index b1e433dce..bf640ccbe 100755
--- a/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
+++ b/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
@@ -166,7 +166,8 @@ class MomentumScaling(_MomentumScaling) :
     def __init__( self              ,
                   RequiredSelection ,
                   Turbo   = None    ,
-                  Year    = None    ) :
+                  Year    = None    ,
+                  **kwargs          ) :  ## arguments for scaling algorithm 
         """Pseudo-selection that allows to embedd the momentum
         scaling algorithm into the overall flow
 
@@ -184,9 +185,9 @@ class MomentumScaling(_MomentumScaling) :
         >>> selection = MomentumScaling ( selection , Turbo = 'PersistReco' )
         """
         PersistReco = str(Turbo).upper() 
-        
-        kwargs      = {}
 
+        if kwargs : kwargs ['PropertiesPrint'] = True
+            
         ##
         if not Turbo           :
             
@@ -195,7 +196,7 @@ class MomentumScaling(_MomentumScaling) :
         elif 'PERSISTRECO' == PersistReco :
             
             ## i) rescale the input selection 
-            RequiredSelection = MomentumScaling ( RequiredSelection , Turbo = True , Year = Year )
+            RequiredSelection = MomentumScaling ( RequiredSelection , Turbo = True , Year = Year , **kwargs )
             ## ii) chain it with rescaling of all persist reco tracks 
             kwargs['name' ]   = 'SCALER_PERSISTRECO'
             kwargs['Input']   = 'Hlt2/TrackFitted/Long'
@@ -215,7 +216,7 @@ class MomentumScaling(_MomentumScaling) :
             else :                
                 raise AttributeError("MomentumScaling:can't deduce ``Input'' from %s" % oloc )
 
-        ## as efault configuration for Turbo use Turbo/2016
+        ## as default configuration for Turbo use Turbo/2016
         elif Turbo is True :
             
             kwargs['name' ] = 'SCALER'
-- 
GitLab


From a267bc0e0be53c82624bd072d6ab47ef64fa0784 Mon Sep 17 00:00:00 2001
From: ibelyaev <Ivan.Belyaev@cern.ch>
Date: Wed, 5 Jul 2017 08:41:38 +0200
Subject: [PATCH 2/2]  minor fix

---
 PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py b/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
index bf640ccbe..28b00f6f8 100755
--- a/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
+++ b/PhysSel/PhysSelPython/python/PhysSelPython/MomentumScaling.py
@@ -186,7 +186,8 @@ class MomentumScaling(_MomentumScaling) :
         """
         PersistReco = str(Turbo).upper() 
 
-        if kwargs : kwargs ['PropertiesPrint'] = True
+        if not kwargs.has_key('PropertiesPrint') :
+            kwargs ['PropertiesPrint'] = True
             
         ##
         if not Turbo           :
-- 
GitLab