Skip to content
Snippets Groups Projects

MomentumScaling: add the possibility to propagate other parameters to scaling algorithm

Closed Vanya Belyaev requested to merge vanya-momentum-scaling-v1 into master
1 unresolved thread
@@ -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,10 @@ class MomentumScaling(_MomentumScaling) :
>>> selection = MomentumScaling ( selection , Turbo = 'PersistReco' )
"""
PersistReco = str(Turbo).upper()
kwargs = {}
if not kwargs.has_key('PropertiesPrint') :
kwargs ['PropertiesPrint'] = True
##
if not Turbo :
@@ -195,7 +197,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 +217,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'
Loading