diff --git a/Phys/DaVinciTrackScaling/doc/release.notes b/Phys/DaVinciTrackScaling/doc/release.notes
index ca787c92b0e44668e614f6990beaef3107775f91..fb0c960535bb6ce4854d65e108e31d0a5ac916a1 100644
--- a/Phys/DaVinciTrackScaling/doc/release.notes
+++ b/Phys/DaVinciTrackScaling/doc/release.notes
@@ -4,6 +4,9 @@
 ! Purpose     : Track scaling and smearing
 !-----------------------------------------------------------------------------
 
+! 2017-01-11 - Vanya Belyaev
+ - prepare scripts for momenentum scaling for -2015&2016
+
 !=================== DaVinciTrackScaling v1r6 2016-02-04 =====================
 
 ! 2015-12-05 - Gerhard Raven
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-2011repro.root b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-2011repro.root
new file mode 100644
index 0000000000000000000000000000000000000000..e5f5804570bb46ffce4c267efa85dd6d3e39f35f
Binary files /dev/null and b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-2011repro.root differ
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2012.root b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2012.root
new file mode 100644
index 0000000000000000000000000000000000000000..29b3d84a9bd6ba7b0458eb24ed6def14826b55dc
Binary files /dev/null and b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2012.root differ
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2015.root b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2015.root
new file mode 100644
index 0000000000000000000000000000000000000000..dfc93c83d60a443c3b39c08d67464b46ed2ffbd0
Binary files /dev/null and b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2015.root differ
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2016.root b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2016.root
new file mode 100644
index 0000000000000000000000000000000000000000..13983fc6321c54f474ad940c9b77eb22c96c824b
Binary files /dev/null and b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/BFitResults-fine-2016.root differ
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/momentum_scale.py b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/momentum_scale.py
index 0135bcfaaceab12a5b6fa6f19dca6803d2af2ba9..72722cc65e0b015729533fd6948e15192c0cea27 100644
--- a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/momentum_scale.py
+++ b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/momentum_scale.py
@@ -1,8 +1,6 @@
 #!/usr/bin/env python
 # =============================================================================
-# $Id:$
-# =============================================================================
-# @file DaVinciTools/momentum_scale.py
+# @file momentum_scale.py
 #
 # Helper script to convert input data (histograms + offsets) to XML-format
 #
@@ -21,10 +19,6 @@
 # @date   2013-04-20
 # @see TrackScaleState
 #
-#                   $Revision:$
-# Last modification $Date:$
-#                by $Author:$
-#
 # ============================================================================
 """
 Helper script to convert input data (histograms + offsets) to XML-format
@@ -46,76 +40,24 @@ Input data are specified close to the start of the script
 __author__  = "Vanya BELYAEV Ivan.Belyaev@itep.ru"
 __date__    = "2013-04-20"
 __version__ = "$Revision:$"
-# ============================================================================
-print 100*'*'
-print __doc__
-print 100*'*'
+__all__     = (
+    'logger'           ,
+    'buildXML'         ,
+    'offsets_to_histo'
+    )
 # ============================================================================
 import ROOT 
 from   Ostap.PyRoUts import h1_axis,VE
-
-
-# =============================================================================
-## get the data 
-# =============================================================================
-#
-year      = '2k+11'
-reco      = 'Reco14'
-#
-directory = '/afs/cern.ch/user/m/mneedham/public/2011-repro-Calib/'
-filename  = 'BFitResults-2011repro.root'
-the_file = ROOT.TFile( directory + filename )
-print 100*'*'
-print 'HISTOS are read from ' , directory + filename
-print the_file.ls()
-print 100*'*'
-
-delta = 1.0e-4 
-print 'global DELTA is defined as %s ' % delta 
-
-#
-# get histograms
-# 
-idp_plus  = the_file.Get('idp-plus' )
-idp_minus = the_file.Get('idp-minus')
-
-# =============================================================================
-## CalScale.h: 
-##   if (run >= 87219  && run <=  89777 ) alpha =0.0; 
-##   else if (run >= 89333  && run <=  90256 ) alpha = 6.36699e-05  ;
-##   else if (run >= 90257  && run <=   90763  ) alpha = 7.11719e-05 ;
-##   else if (run >= 91556 && run <= 93282)  alpha = 1.53674e-05 ;
-##   else if (run >= 93398  && run <=  94386 ) alpha = 0.000144135 ; 
-##   else if (run >= 95948  && run <=  97028 ) alpha = 0.000214408  ;
-##   else if (run >= 97114  && run <=  98882 ) alpha = 3.41493e-05 ;
-##   else if (run >= 98900  && run <=  101862 ) alpha =  0.000137622;
-##   else if (run >= 101891  && run <=  102452 ) alpha = 3.73981e-05 ;
-##   else if (run >= 102499  && run <=  102907 ) alpha = 0.000169023 ;
-##   else if (run >= 103049  && run <=  103687 ) alpha =  3.20303e-05 ;
-##   else if (run >= 103954  && run <=  104414 ) alpha =  0.00017584 ;
-
-offsets = [
-    ## start   stop     offset 
-    (  87219 ,  89777 , 0.0         ) ,
-    (  89333 ,  90256 , 6.36699e-05 ) ,
-    (  90257 ,  90763 , 7.11719e-05 ) , 
-    (  91556 ,  93282 , 1.53674e-05 ) , 
-    (  93398 ,  94386 , 0.000144135 ) , 
-    (  95948 ,  97028 , 0.000214408 ) , 
-    (  97114 ,  98882 , 3.41493e-05 ) , 
-    (  98900 , 101862 , 0.000137622 ) , 
-    ( 101891 , 102452 , 3.73981e-05 ) , 
-    ( 102499 , 102907 , 0.000169023 ) ,
-    ( 103049 , 103687 , 3.20303e-05 ) , 
-    ( 103954 , 104414 , 0.00017584  ) ,
-    ]
-
+# ============================================================================
+from   Ostap.Logger  import getLogger
+logger = getLogger('MomentumScale')
+# ============================================================================
 
 # ============================================================================
 ## convert run offsets into the histogram
-# @param offset the list of run-dependes offsets: [ (start,stop,offset) ]
-# @param title (optional) the histogram title
-# @code 
+#  @param offset the list of run-dependes offsets: [ (start,stop,offset) ]
+#  @param title (optional) the histogram title
+#  @code 
 #   offsets_2011 = [
 #     ## start   stop     offset 
 #     ( 89333  , 90256  , 9.97629e-05 ) ,
@@ -129,8 +71,7 @@ offsets = [
 # @date   2013-04-20
 #
 def offsets_to_histo ( offsets , title =  '' ) :
-    """
-    Helper function to convert the offset list into histogram
+    """Helper function to convert the offset list into histogram
     
     offsets_2011 = [
     ## start   stop     offset 
@@ -150,7 +91,7 @@ def offsets_to_histo ( offsets , title =  '' ) :
         ticks.add ( i[0]     )
         ticks.add ( i[1] + 1 ) ## take care about equality 
         
-    ## create the histogram with appropriate biunings 
+    ## create the histogram with appropriate binnings 
     h = h1_axis ( list ( ticks )  , double = True , title = title )
         
     for i in offsets :
@@ -161,72 +102,72 @@ def offsets_to_histo ( offsets , title =  '' ) :
     return h 
 
 
+line1 = '<?xml version="1.0" encoding="ISO-8859-1"?>'
+line2 = '<!DOCTYPE DDDB SYSTEM "../../../DTD/structure.dtd">'
 # =============================================================================
 # Build XML-document 
 # =============================================================================
-
-## 
-line1 = '<?xml version="1.0" encoding="ISO-8859-1"?>'
-line2 = '<!DOCTYPE DDDB SYSTEM "../../../DTD/structure.dtd">'
-##
-
-## import lxml.etree
-import lxml.builder    
-
-E         = lxml.builder.ElementMaker()
-DDDB      = E.DDDB
-CONDITION = E.condition
-PARAM     = E.param
-
-xml_delta     = PARAM (
-    str ( delta ),
-    name    = 'Delta'              ,
-    type    = 'double'             ,
-    comment = 'Global delta scale         %s %s' % ( reco , year )
-    )
-
-xml_idplus    = PARAM (
-    idp_plus.toString() , 
-    name    = "IdpPlus" ,
-    type    = "Histo2D" ,
-    comment = "Calibration for IdpPlus    %s %s" % ( reco , year )
-    )
-
-xml_idpminus = PARAM (
-    idp_minus.toString () ,
-    name    = "IdpMinus" ,
-    type    = "Histo2D"  ,
-    comment = "Calibration for IdpMinus   %s %s" % ( reco , year )
-    )
-
-xml_offsets = PARAM (
-    offsets_to_histo ( offsets , 'Run-dependent offsets' ).toString() , 
-    name    = "Offsets" ,
-    type    = "Histo1D" ,
-    comment = "Run-dependent offsets     %s %s" % ( reco , year )
-    )
-
-document = DDDB(
-    CONDITION (
-    xml_delta    ,
-    xml_idplus   ,
-    xml_idpminus ,
-    xml_offsets  ,
-    ## comment = "Momentum scale            %s %s" % ( reco , year ) ,
-    name    = 'MomentumScale' 
-    ),
-    )   
-
-
-xml_name = 'MomentumScale.xml'
-xml_file = open ( xml_name ,'w')
-
-print >> xml_file,  line1+'\n'+line2+'\n\n\n'+lxml.etree.tostring( document , pretty_print=True)
-
-xml_file.close()
-print 100*'*'
-print 'XML file "%s" is generated in CWD ' % xml_name 
-print 100*'*'
+def buildXML ( reco      ,
+               year      ,
+               idp_plus  ,
+               idp_minus , 
+               offsets   ,
+               delta     ) :
+    
+    import lxml.builder    
+    
+    E         = lxml.builder.ElementMaker()
+    DDDB      = E.DDDB
+    CONDITION = E.condition
+    PARAM     = E.param
+    
+    xml_delta     = PARAM (
+        str ( delta ),
+        name    = 'Delta'              ,
+        type    = 'double'             ,
+        comment = 'Global delta scale         %s %s' % ( reco , year )
+        )
+    
+    xml_idplus    = PARAM (
+        idp_plus.toString() , 
+        name    = "IdpPlus" ,
+        type    = "Histo2D" ,
+        comment = "Calibration for IdpPlus    %s %s" % ( reco , year )
+        )
+    
+    xml_idpminus = PARAM (
+        idp_minus.toString () ,
+        name    = "IdpMinus" ,
+        type    = "Histo2D"  ,
+        comment = "Calibration for IdpMinus   %s %s" % ( reco , year )
+        )
+    
+    xml_offsets = PARAM (
+        offsets_to_histo ( offsets , 'Run-dependent offsets' ).toString() , 
+        name    = "Offsets" ,
+        type    = "Histo1D" ,
+        comment = "Run-dependent offsets     %s %s" % ( reco , year )
+        )
+    
+    document = DDDB(
+        CONDITION (
+        xml_delta    ,
+        xml_idplus   ,
+        xml_idpminus ,
+        xml_offsets  ,
+        ## comment = "Momentum scale            %s %s" % ( reco , year ) ,
+        name    = 'MomentumScale' 
+        ),
+        )   
+    
+    xml_name = 'MomentumScale.xml'
+    xml_file = open ( xml_name ,'w')
+    
+    print >> xml_file,  line1+'\n'+line2+'\n\n\n'+lxml.etree.tostring( document , pretty_print=True)
+    
+    xml_file.close()
+    logger.info ( 'XML file "%s" is generated in CWD ' % xml_name ) 
+    
 
 
 # =============================================================================
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2011.py b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2011.py
new file mode 100644
index 0000000000000000000000000000000000000000..cb69d43b8de6bd76236aff5026959ef6266c4c8e
--- /dev/null
+++ b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2011.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+# =============================================================================
+# @file scaling_2011.py
+#
+# Momentum scaling for 2011
+#
+# Input data are specified close to the start of the script:
+#
+#  - input ROOT file with historams
+#     the file should have two 2D-histograms, named as 'idp-plus' and 'idp-minus'
+#     
+#  - global delta
+#  - list of run-dependent offsets as list of triplets:  [ (start,stop,offset) ],
+#     where (start,stop) represent the run range (both edges are inclusive) 
+#
+#  As the output xml-file MomentumScale.xml is generated in cwd
+#
+# @author Matt  NEEDHAM 
+# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
+# @date   2013-04-20
+# @see TrackScaleState
+# ============================================================================
+"""Momentum sclaing for 2011
+- input ROOT file with historams
+the file should have two 2D-histograms, named as 'idp-plus' and 'idp-minus'
+
+- global delta
+- list of run-dependent offsets as list of triplets:  [ (start,stop,offset) ],
+where (start,stop) represent the run range (both edges are inclusive) 
+
+As the output xml-file MomentumScale.xml is generated in cwd
+
+"""
+# ============================================================================
+__author__  = "Vanya BELYAEV Ivan.Belyaev@itep.ru"
+__date__    = "2013-04-20"
+__version__ = "$Revision:$"
+# ============================================================================
+import ROOT, Ostap.PyRoUts  
+# ============================================================================
+from momentum_scale import buildXML, logger  
+# ============================================================================
+logger.info(100*'*')
+logger.info(__doc__)
+logger.info(100*'*')
+# ============================================================================
+
+# ============================================================================
+## the histograms 
+with ROOT.TFile( 'BFitResults-2011repro.root','READ') as the_file :
+    idp_plus  = the_file.Get('idp-plus' ).clone()
+    idp_minus = the_file.Get('idp-minus').clone() 
+    logger.info ( 'HISTOS are read from %s'  % the_file )
+
+# =============================================================================
+## global delta
+delta =  1.0e-4
+logger.info ( 'Global delta: %s' % delta) 
+
+# =============================================================================
+## CalScale.h: 
+##   if (run >= 87219  && run <=  89777 ) alpha =0.0; 
+##   else if (run >= 89333  && run <=  90256 ) alpha = 6.36699e-05  ;
+##   else if (run >= 90257  && run <=   90763  ) alpha = 7.11719e-05 ;
+##   else if (run >= 91556 && run <= 93282)  alpha = 1.53674e-05 ;
+##   else if (run >= 93398  && run <=  94386 ) alpha = 0.000144135 ; 
+##   else if (run >= 95948  && run <=  97028 ) alpha = 0.000214408  ;
+##   else if (run >= 97114  && run <=  98882 ) alpha = 3.41493e-05 ;
+##   else if (run >= 98900  && run <=  101862 ) alpha =  0.000137622;
+##   else if (run >= 101891  && run <=  102452 ) alpha = 3.73981e-05 ;
+##   else if (run >= 102499  && run <=  102907 ) alpha = 0.000169023 ;
+##   else if (run >= 103049  && run <=  103687 ) alpha =  3.20303e-05 ;
+##   else if (run >= 103954  && run <=  104414 ) alpha =  0.00017584 ;
+
+offsets = [
+    ## start   stop     offset 
+    (  87219 ,  89777 , 0.0         ) ,
+    (  89333 ,  90256 , 6.36699e-05 ) ,
+    (  90257 ,  90763 , 7.11719e-05 ) , 
+    (  91556 ,  93282 , 1.53674e-05 ) , 
+    (  93398 ,  94386 , 0.000144135 ) , 
+    (  95948 ,  97028 , 0.000214408 ) , 
+    (  97114 ,  98882 , 3.41493e-05 ) , 
+    (  98900 , 101862 , 0.000137622 ) , 
+    ( 101891 , 102452 , 3.73981e-05 ) , 
+    ( 102499 , 102907 , 0.000169023 ) ,
+    ( 103049 , 103687 , 3.20303e-05 ) , 
+    ( 103954 , 104414 , 0.00017584  ) ,
+    ]
+
+# =============================================================================
+# Build XML-document 
+# =============================================================================
+buildXML ( year      = '2k+11'    ,
+           reco      = 'Reco14'   ,
+           idp_plus  = idp_plus   ,
+           idp_minus = idp_minus  ,
+           offsets   = offsets    ,
+           delta     = delta      ) 
+  
+# =============================================================================
+# The END 
+# =============================================================================
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2015.py b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2015.py
new file mode 100644
index 0000000000000000000000000000000000000000..9168fb4c2f7aa2251ce70c94cbf34191788314bc
--- /dev/null
+++ b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2015.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# =============================================================================
+# @file scaling_2015.py
+#
+# Momentum scaling for 2015
+#
+# @author Matt  NEEDHAM 
+# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
+# @date   2016-01-11
+# ============================================================================
+"""Momentum scaling fro 2015
+
+Input data are specified close to the start of the script
+
+- input ROOT file with historams
+the file should have two 2D-histograms, named as 'idp-plus' and 'idp-minus'
+
+- global delta
+- list of run-dependent offsets as list of triplets:  [ (start,stop,offset) ],
+where (start,stop) represent the run range (both edges are inclusive) 
+
+As the output xml-file MomentumScale.xml is generated in cwd
+
+"""
+# ============================================================================
+__author__  = "Vanya BELYAEV Ivan.Belyaev@itep.ru"
+__date__    = "2016-01-11"
+__version__ = ""
+# ============================================================================
+import ROOT, Ostap.PyRoUts  
+# ============================================================================
+from momentum_scale import buildXML, logger  
+# ============================================================================
+logger.info(100*'*')
+logger.info(__doc__)
+logger.info(100*'*')
+# ============================================================================
+
+# ============================================================================
+## the histograms 
+with ROOT.TFile('BFitResults-fine-2015.root','READ') as the_file :
+    idp_plus  = the_file.Get('idp-plus' ).clone()
+    idp_minus = the_file.Get('idp-minus').clone() 
+    logger.info ( 'HISTOS are read from %s'  % the_file ) 
+
+# =============================================================================
+## global delta
+delta =  -0.165063e-3
+logger.info ( 'Global delta: %s' % delta) 
+
+## //down
+## if (run >= 162200   && run <= 163200 ) alpha = 0.0;
+## //gap
+## else if (run >= 163250  && run <= 164000 )  alpha = 0.0406160e-3 ;
+## else if (run >= 164001  && run <= 164500 )  alpha = -0.0405840e-3;
+## else if (run >= 164501  && run <= 164900 )  alpha = -0.0751180e-3;
+## else if (run >= 164901  && run <= 165200 )  alpha =  -0.0706750e-3;
+## //gap
+## else if (run >= 165201  && run <= 165400 ) alpha =  -0.0708270e-3  ;
+## else if (run >= 165401  && run <= 165600 ) alpha =  -0.0670200e-3 ;
+## // up
+## else if (run >= 166250  && run <= 166400 ) alpha = 0.0940130e-3 ;
+## else if (run >= 166401  && run <= 166550 ) alpha = 0.0539590e-3 ;
+## // gap
+## else if (run >= 166600  && run <= 166700 ) alpha = 0.0157780e-3  ;
+## else if (run >= 166700  && run <= 166800 ) alpha = 0.0421130e-3 ;
+## // gap
+## else if (run >= 166850  && run <= 167000 ) alpha =  -0.0553680e-3 ;
+## else if (run >= 167000  && run <= 167150 ) alpha =  -0.0373790e-3;
+
+## Run-dependent offsets
+offsets = [
+    ## start stop offset
+    ( 163250 , 164000 ,  0.0406160e-3 ) ,
+    ( 164001 , 164500 , -0.0405840e-3 ) , 
+    ( 164501 , 164900 , -0.0751180e-3 ) , 
+    ( 164901 , 165200 , -0.0706750e-3 ) ,
+    ##
+    ( 165201 , 165400 , -0.0708270e-3 ) , 
+    ( 165401 , 165600 , -0.0670200e-3 ) ,
+    ##
+    ( 166250 , 166400 ,  0.0940130e-3 ) , 
+    ( 166401 , 166550 ,  0.0539590e-3 ) , 
+    ## 
+    ( 166600 , 166700 ,  0.0157780e-3 ) , 
+    ( 166700 , 166800 ,  0.0421130e-3 ) , 
+    ## 
+    ( 166850 , 167000 , -0.0553680e-3 ) , 
+    ( 167000 , 167150 , -0.0373790e-3 ) 
+    ]
+
+# =============================================================================
+# Build XML-document 
+# =============================================================================
+buildXML ( year      = '2k+15'    ,
+           reco      = 'Reco16'   ,
+           idp_plus  = idp_plus   ,
+           idp_minus = idp_minus  ,
+           offsets   = offsets    ,
+           delta     = delta      ) 
+
+# ============================================================================
+# The END 
+# ============================================================================
+
diff --git a/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2016.py b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2016.py
new file mode 100644
index 0000000000000000000000000000000000000000..2a16ef4620e56ba6a95f4793683c1a2c978a0d79
--- /dev/null
+++ b/Phys/DaVinciTrackScaling/python/DaVinciTrackScaling/scaling_2016.py
@@ -0,0 +1,146 @@
+#!/usr/bin/env python
+# =============================================================================
+# @file scaling_2016.py
+#
+# Momentum scaling for 2016
+#
+# @author Matt  NEEDHAM 
+# @author Vanya BELYAEV Ivan.Belyaev@itep.ru
+# @date   2016-01-11
+# ============================================================================
+"""Momentum scaling fro 2016
+
+Input data are specified close to the start of the script
+
+- input ROOT file with historams
+the file should have two 2D-histograms, named as 'idp-plus' and 'idp-minus'
+
+- global delta
+- list of run-dependent offsets as list of triplets:  [ (start,stop,offset) ],
+where (start,stop) represent the run range (both edges are inclusive) 
+
+As the output xml-file MomentumScale.xml is generated in cwd
+
+"""
+# ============================================================================
+__author__  = "Vanya BELYAEV Ivan.Belyaev@itep.ru"
+__date__    = "2016-01-11"
+__version__ = ""
+# ============================================================================
+import ROOT, Ostap.PyRoUts  
+# ============================================================================
+from momentum_scale import buildXML, logger  
+# ============================================================================
+logger.info(100*'*')
+logger.info(__doc__)
+logger.info(100*'*')
+# ============================================================================
+
+# ============================================================================
+## the histograms 
+with ROOT.TFile('BFitResults-fine-2016.root','READ') as the_file :
+    idp_plus  = the_file.Get('idp-plus' ).clone()
+    idp_minus = the_file.Get('idp-minus').clone() 
+    logger.info ( 'HISTOS are read from %s'  % the_file ) 
+
+# =============================================================================
+## global delta
+delta =  -0.19e-3
+logger.info ( 'Global delta: %s' % delta)
+
+## //down
+## if (run >=174500   && run <= 175100 ) alpha = 0;
+## else if (run >= 175101  && run <= 175900 )  alpha =0.0302171e-3 ;
+## else if (run >= 175901  && run <= 176100 )  alpha =0.0558559e-3 ;
+## else if (run >= 176101  && run <= 176330 )  alpha = 0.0874364e-3;
+## //up
+## else if (run >= 176657 && run <= 177000) alpha = 0.130490e-3;
+## else if (run >= 177001 && run <= 177250) alpha = 0.146611e-3;
+## else if (run >= 177251 && run <= 177350) alpha =  0.166163e-3;
+## else if (run >= 177351 && run <= 177500) alpha =  0.153974e-3;
+## //
+## else if (run >= 177501 && run <= 177600) alpha =  0.239742e-3;
+## else if (run >= 177601 && run <= 177800) alpha = 0.299172e-3;
+## //
+## else if (run >= 178001 && run <= 178250) alpha = 0.238894e-3;
+## else if (run >= 178251 && run <= 178500) alpha = 0.221683e-3;
+## else if (run >= 178501 && run <= 179001) alpha = 0.232447e-3;
+## else if (run >= 179001 && run <= 179500) alpha = 0.251556e-3;
+## else if (run >= 179501 && run <= 179999) alpha = 0.246533e-3;
+## else if (run >= 180000 && run <= 180300) alpha = 0.270993e-3;
+## else if (run >= 180301 && run <= 180640) alpha = 0.255366e-3;
+## // down
+## else if (run >= 181200  && run <= 181700 )  alpha = 0.0686362e-3 ;
+## else if (run >= 181700  && run <= 182300 )  alpha =0.0945660e-3;
+## else if (run >= 182301  && run <= 182500 )  alpha =0.0683000e-3 ;
+## else if (run >= 182501  && run <= 182800 )  alpha = 0.0877048e-3;
+## else if (run >= 182801  && run <= 183000 )  alpha = 0.126342e-3;
+## else if (run >= 183001  && run <= 183200 )  alpha = 0.119248e-3;
+## //up
+## else if (run >= 183800  && run <= 184200 )  alpha =0.222877e-3 ;
+## else if (run >= 184201  && run <= 184657 )  alpha = 0.211130e-3;
+## // down
+## else if (run >= 184700  && run <= 185000 )  alpha =0.2111e-3 ;
+## else if (run >= 185000  && run <= 185100 )  alpha =0.05129e-3 ;
+## else if (run >= 185101  && run <= 185200 )  alpha = -0.00853040e-3 ;
+## else if (run >= 185201  && run <= 185300 )  alpha =0.0154273e-3 ;
+## else if (run >= 185301  && run <= 185400 )  alpha =0.0351537e-3 ;
+## else if (run >= 185401  && run <= 185600 )  alpha = 0.0677423e-3 ;
+
+
+## Run-dependent offsets
+offsets = [
+    ## start stop offset
+    ## //down
+    ( 175101 , 175900 ,  0.0302171e-3 ) , 
+    ( 175901 , 176100 ,  0.0558559e-3 ) , 
+    ( 176101 , 176330 ,  0.0874364e-3 ) , 
+    ## //up
+    ( 176657 , 177000 ,  0.130490e-3  ) , 
+    ( 177001 , 177250 ,  0.146611e-3  ) , 
+    ( 177251 , 177350 ,  0.166163e-3  ) ,
+    ( 177351 , 177500 ,  0.153974e-3  ) , 
+    ## //
+    ( 177501 , 177600 ,  0.239742e-3  ) , 
+    ( 177601 , 177800 ,  0.299172e-3  ) , 
+    ## //
+    ( 178001 , 178250 ,  0.238894e-3  ) , 
+    ( 178251 , 178500 ,  0.221683e-3  ) , 
+    ( 178501 , 179001 ,  0.232447e-3  ) ,
+    ( 179001 , 179500 ,  0.251556e-3  ) , 
+    ( 179501 , 179999 ,  0.246533e-3  ) , 
+    ( 180000 , 180300 ,  0.270993e-3  ) , 
+    ( 180301 , 180640 ,  0.255366e-3  ) , 
+    ## // down
+    ( 181200 , 181700 ,  0.0686362e-3 ) , 
+    ( 181700 , 182300 ,  0.0945660e-3 ) , 
+    ( 182301 , 182500 ,  0.0683000e-3 ) , 
+    ( 182501 , 182800 ,  0.0877048e-3 ) , 
+    ( 182801 , 183000 ,  0.126342e-3  ) , 
+    ( 183001 , 183200 ,  0.119248e-3  ) , 
+    ## //up
+    ( 183800 , 184200 ,  0.222877e-3  ) , 
+    ( 184201 , 184657 ,  0.211130e-3  ) , 
+    ## // down
+    ( 184700 , 185000 ,  0.2111e-3     ) , 
+    ( 185000 , 185100 ,  0.05129e-3    ) , 
+    ( 185101 , 185200 , -0.00853040e-3 ) ,  
+    ( 185201 , 185300 ,  0.0154273e-3  ) , 
+    ( 185301 , 185400 ,  0.0351537e-3  ) , 
+    ( 185401 , 185600 ,  0.0677423e-3  )
+    ]
+
+# =============================================================================
+# Build XML-document 
+# =============================================================================
+buildXML ( year      = '2k+16'    ,
+           reco      = 'Reco16'   ,
+           idp_plus  = idp_plus   ,
+           idp_minus = idp_minus  ,
+           offsets   = offsets    ,
+           delta     = delta      ) 
+
+# ============================================================================
+# The END 
+# ============================================================================
+
diff --git a/Phys/DecayTreeTuple/src/TupleToolPid.cpp b/Phys/DecayTreeTuple/src/TupleToolPid.cpp
index 1af69de3a7de18f485a37861e1378dff2bdd04fc..67aa6796700102921298785de2d8c98126283181 100755
--- a/Phys/DecayTreeTuple/src/TupleToolPid.cpp
+++ b/Phys/DecayTreeTuple/src/TupleToolPid.cpp
@@ -81,6 +81,24 @@ StatusCode TupleToolPid::fill( const Particle*
       // RICH
       const RichPID * richPID = proto->richPID();
       test &= tuple->column( prefix+"_hasRich", richPID != NULL );
+      // Moved some RICH information variables to default since they are useful to determine
+      // how the PID information has been obtained.
+      test &= tuple->column( prefix+"_UsedRichAerogel",
+                             richPID ? richPID->usedAerogel()  : false );
+      test &= tuple->column( prefix+"_UsedRich1Gas",
+                             richPID ? richPID->usedRich1Gas() : false );
+      test &= tuple->column( prefix+"_UsedRich2Gas",
+                             richPID ? richPID->usedRich2Gas() : false );
+      test &= tuple->column( prefix+"_RichAboveElThres",
+                             richPID ? richPID->electronHypoAboveThres() : false );
+      test &= tuple->column( prefix+"_RichAboveMuThres",
+                             richPID ? richPID->muonHypoAboveThres()     : false );
+      test &= tuple->column( prefix+"_RichAbovePiThres",
+                             richPID ? richPID->pionHypoAboveThres()     : false );
+      test &= tuple->column( prefix+"_RichAboveKaThres",
+                             richPID ? richPID->kaonHypoAboveThres()     : false );
+      test &= tuple->column( prefix+"_RichAbovePrThres",
+                             richPID ? richPID->protonHypoAboveThres()   : false );
 
       // CALO
       test &= tuple->column( prefix+"_hasCalo", !proto->calo().empty() );
@@ -90,22 +108,6 @@ StatusCode TupleToolPid::fill( const Particle*
       {
 
         // RICH variables
-        test &= tuple->column( prefix+"_UsedRichAerogel",
-                               richPID ? richPID->usedAerogel()  : false );
-        test &= tuple->column( prefix+"_UsedRich1Gas",
-                               richPID ? richPID->usedRich1Gas() : false );
-        test &= tuple->column( prefix+"_UsedRich2Gas",
-                               richPID ? richPID->usedRich2Gas() : false );
-        test &= tuple->column( prefix+"_RichAboveElThres",
-                               richPID ? richPID->electronHypoAboveThres() : false );
-        test &= tuple->column( prefix+"_RichAboveMuThres",
-                               richPID ? richPID->muonHypoAboveThres()     : false );
-        test &= tuple->column( prefix+"_RichAbovePiThres",
-                               richPID ? richPID->pionHypoAboveThres()     : false );
-        test &= tuple->column( prefix+"_RichAboveKaThres",
-                               richPID ? richPID->kaonHypoAboveThres()     : false );
-        test &= tuple->column( prefix+"_RichAbovePrThres",
-                               richPID ? richPID->protonHypoAboveThres()   : false );
         test &= tuple->column( prefix+"_RichDLLe",  
                                proto->info(LHCb::ProtoParticle::RichDLLe,-1000) );
         test &= tuple->column( prefix+"_RichDLLmu",