diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
index dd484b54b2a0e53092a15a5cb029bbc36a5dd26c..d88ab5523e4bb6eb4bdc36ccb225ffa24840d940 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/CommonPars.h
@@ -10,7 +10,7 @@
 /*                     Without re-extrapolation fitter can make */
 /*			2 steps, so total shift is doubled      */
 /*								*/
-/*  NTrkM        -  Maximal amount of tracks from old version 	*/
+/*  vkalNTrkM    -  Maximal amount of tracks from old version 	*/
 /*		    of fitter. Should disappear finally    	*/
 /*								*/
 /*  vkalMagCnvCst - conversion constant for field in Tesla and	*/ 
@@ -19,10 +19,13 @@
 #ifndef _TrkVKalVrtCore_CommonPars_H
 #define _TrkVKalVrtCore_CommonPars_H
 
-#define NTrkM 300
+#define vkalNTrkM 300
 #define vkalMagCnvCst 0.29979246
 #define vkalInternalStepLimit   20.
 #define vkalAllowedPtChange      3.
 #define vkalShiftToTrigExtrapolation      20.
+#define vkalMaxNMassCnst 8
+
+#define ARR_2D(name,N,i,j) (name)[(i)*(N) + (j)]
 
 #endif
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
index b0a7198647cfa67d52a80feccb898fc0d9301ba3..399217e80719bec26e4231a529df69177fc32404 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Derivt.h
@@ -13,14 +13,6 @@
 
 namespace Trk {
   
-  struct DerivT{
-    long int ncnst, ndummy;
-    double aa[8];
-    double f0t[3*NTrkM*8];	/* was [3][300][8] */
-    double h0t[24];	        /* was [3][8] */
-  };
-
-
 
 // Base class for any constraint
 // Contains derivatines needed for application
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
index 71ba886053cb8103738e869437bbc157bc11b154..8ca1bd9c9757902af1c26ba3dbf033a0b9ad87c7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForCFT.h
@@ -20,13 +20,12 @@ namespace Trk {
     int usePassNear;
     int usePlaneCnst;
 
-// Summary charge at vertex
-    long int icht;
 //
 // For several(up to 8) mass constraints
     int nmcnst;
-    double wm[NTrkM];
-    double wmfit[8], localbmag;
+    double wm[vkalNTrkM];
+    double wmfit[vkalMaxNMassCnst];
+    double localbmag;
 // Since 20/09/2009 - Vertex in plane constraint 
     double Ap,Bp,Cp,Dp;
 
@@ -40,23 +39,29 @@ namespace Trk {
     double vrt[3], covvrt[6], wgtvrt[6];
 //
 // temporary vertex in global ref.frame
-    double vrtstp[3];        
-    long int irob;
+    double vrtstp[3];
+    int irob;
     double RobustScale;
-    double robres[NTrkM];
-    short int indtrkmc[NTrkM*8];	/* was [300][8] */
-    short int IterationNumber;
+    double robres[vkalNTrkM];
+    int indtrkmc[vkalMaxNMassCnst][vkalNTrkM];
+    int IterationNumber;
     double IterationPrecision;
  
     ForCFT(){
       nmcnst=0;
       useMassCnst=0; usePhiCnst=0; useThetaCnst=0; usePointingCnst=0; usePlaneCnst=0;
-      useAprioriVrt=0; usePassNear=0; icht=0; Ap=Bp=Dp=Cp=0.;
-      IterationNumber = 100; IterationPrecision=1.e-3; RobustScale = 1.; irob=0;
-      localbmag=2.0;   // Safety: standard magnetic field in ID 
+      useAprioriVrt=0; usePassNear=0; Ap=Bp=Dp=Cp=0.;
+      IterationNumber = 100; IterationPrecision=1.e-3;
+      RobustScale = 1.; irob=0;
+      for (int ic=0; ic<vkalMaxNMassCnst; ++ic) wmfit[ic] = -10000.;
+      for (int it=0; it<vkalNTrkM; ++it) {
+         wm[it] = 139.57018;
+         for(int ic=0; ic<vkalMaxNMassCnst; ic++) indtrkmc[ic][it]=0;
+      }
+      localbmag=1.997;   // Safety: standard magnetic field in ID 
     };
-    ~ForCFT(){};
-  };
+    ~ForCFT() {};
+  };
 
 }
 #endif
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForVrtClose.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForVrtClose.h
index bd01dbf336fb647bcf80c22e98e59d1d24288f2b..f713f52e8b4f3eaf1981e0b0954894446e5852dd 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForVrtClose.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/ForVrtClose.h
@@ -28,7 +28,7 @@ namespace Trk {
 			      // not touched during PostFit
     double ywgt[3], rv0[2];
     double cvder[12];	              /* was [2][6] */
-    double dcv[6*(NTrkM*3+3)];	      /* was [6][903] */
+    double dcv[6*(vkalNTrkM*3+3)];    /* was [6][903] */
 
     ForVrtClose(){
       Charge=0;  vrt[0]=vrt[1]=vrt[2]=0.;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h
index 97be1e391745240830d779235c16041918671c11..89c1aabb4171e1de50139e19f2aa3a6975d85f84 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/Propagator.h
@@ -1,20 +1,33 @@
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
-
+/* General track propagation implementation                */
+/* If external propagator is provided as                   */
+/* either an object inherited from the basePropagator class*/
+/* or a function addrPropagator - the vkalPropagator class */
+/* will use it, otherwise the vkalPropagor uses simple     */
+/* propagatiob in constant magnetic field.                 */
+/* 							   */
+/*  Thread-safe implementation				   */
+/*---------------------------------------------------------*/
 #ifndef _TrkVKalVrtCore_Propagator_H
 #define _TrkVKalVrtCore_Propagator_H
-//#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+
 
 namespace Trk {
 
-/*    Class for track propagation to any point       */
-/*---------------------------------------------------*/
+#define vkalUseRKMPropagator  0
+
+class VKalVrtControl;
 
   typedef void (*addrPropagator)(long int ,long int, double*, double*, double*, double*, double*, double* );
 
   class VKTrack;
+  class VKalVrtControlBase;
 
+//
+// Base class for concrete implementation of propagator (e.g. Athena one) to be called by vkalPropagator
+//
   class basePropagator {
   public:
      basePropagator();
@@ -30,6 +43,11 @@ namespace Trk {
 //
    };
 
+//
+// Main propagator in VKalVrtCore package. 
+// Depending on VKalVrtControlBase object it either calls external propagator
+// or uses default implementations
+//
   class vkalPropagator {
   public:
      vkalPropagator();
@@ -38,18 +56,12 @@ namespace Trk {
 
      void Propagate(long int TrkID, long int Charge, 
                     double *ParOld, double *CovOld, double *RefStart, 
-                    double *RefEnd, double *ParNew, double *CovNew) const;
+                    double *RefEnd, double *ParNew, double *CovNew,
+                    const VKalVrtControlBase* FitControl = 0) const;
      bool checkTarget(double *RefEnd) const;
      void Propagate(VKTrack *trk, double *RefStart, 
-                    double *RefEnd, double *ParNew, double *CovNew) const;
-     void setPropagator(addrPropagator ); 
-     void setPropagator(basePropagator*); 
-     void setTypeProp(int); 
-  
-   private:
-     int m_typePropagator;
-     addrPropagator   m_functionProp; 
-     basePropagator*  m_objectProp;
+                    double *RefEnd, double *ParNew, double *CovNew,
+                    const VKalVrtControlBase* FitControl = 0) const;
    };
 
 }
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
index 9678cfddfb725fd932ac6b33bf00ddeaa347bb94..cffaa69d5d6d73116c9efaad4e355fd413b39fed 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCore.h
@@ -4,171 +4,67 @@
 
 #ifndef _TrkVKalVrtCore_VKalVrtCore_H
 #define _TrkVKalVrtCore_VKalVrtCore_H
-#include "ForVrtClose.h"
+
+#include "TrkVKalVrtCore/CommonPars.h"
+#include "TrkVKalVrtCore/VKalVrtBMag.h"
+#include "TrkVKalVrtCore/Propagator.h"
+#include "TrkVKalVrtCore/ForCFT.h"
 #include <vector>
-#include <iostream>
+#include <memory>
 
 namespace Trk {
-
-  
-   class VKConstraintBase;
-   class VKVertex;
-
-  struct CascadeEvent 
-  {
-    int cascadeNV;
-    int nearPrmVertex;
-    double *fullCovMatrix;
-    double SCALE;
-    double accuracyConstraint;
-    std::vector< VKVertex *> cascadeVertexList; 
-    std::vector<int> matrixPnt;
-    CascadeEvent(){cascadeNV = 0; nearPrmVertex=0; fullCovMatrix=0; SCALE=1.; accuracyConstraint=1.e-4;};
-    ~CascadeEvent(){if(fullCovMatrix)delete[] fullCovMatrix;};
-  };
-
 //
-//   Main container for all track related information in vertex fit
+//   Main class to control TrkVKalVrtCore package
+//  If references to external Propagator/Mag.Field are present - the package uses them,
+//  otherwise default internal fixed_field/simple_propagator are used. 
 //--------------------------------------------------------------------
-   class VKTrack
-   {
-    public:
-       VKTrack(long int, double[], double[], VKVertex *, double);
-      ~VKTrack();
-//       VKTrack(const VKTrack & src);  //copy
-       friend std::ostream& operator<<( std::ostream& out, const VKTrack& track );
 
+   class VKalVrtControlBase
+   {
      public:
-       long int Id;      //track ID number
-       int Charge;       //track charge
-
-               // Fitted track perameters at vertex VKVErtex->fitV
-       double fitP[3];
-       double Chi2;
-
-               // Track perameters at vertex VKVErtex->cnstV for constraint calculations
-        double cnstP[3];
-
-               // ALL is estimated at VKVErtex->iniV posision - start position of the fit
-       double iniP[3];     //perigee parameters assuming that track passes through iniXYZ 
-
-               // ALL is estimated at VKVErtex->refIterV posision - iteration reference position 
-       double Perig[5];         //perigee parameters prepared for vertex estimation
-       double WgtM[15];         //symmetric weight matrix prepared for vertex estimation
-       double WgtM_save[15];    //copy of weight matrix for speed optimisation
-
-               // All for robustification
-       double rmnd[5];     //remnants with respect to fitted vertex position
-       double e[5];        //eigenvalues of weight matrix
-       double v[5][5];     //corresponding eigenvectors of weight matrix
-
-               // ALL is estimated at VKVErtex->refXYZ posision - reference position for vertex fit
-       double refPerig[5];  //perigee parameters
-       double refCovar[15]; //symmetric covariance matrix 
+       VKalVrtControlBase(const baseMagFld*, const addrMagHandler, const basePropagator*, const addrPropagator);
+       VKalVrtControlBase(const VKalVrtControlBase & src);              //copy
+      ~VKalVrtControlBase();
+
+       const baseMagFld*      m_objMagFld;
+       const addrMagHandler   m_funcMagFld;
+       const basePropagator*  m_objProp;
+       const addrPropagator   m_funcProp; 
+   };
 
+   class VKalVrtControl : public VKalVrtControlBase
+   {
      public:
-       double getMass() const  {return m_mass;}
-       void   setMass(double M){ m_mass=M;}
-       double a0()    const    { return Perig[0];}
-       double z()     const    { return Perig[1];}
-       double theta() const    { return Perig[2];}
-       double phi()   const    { return Perig[3];}
-       double invR()  const    { return Perig[4];}
-       double r_a0()    const  { return refPerig[0];}
-       double r_z()     const  { return refPerig[1];}
-       double r_theta() const  { return refPerig[2];}
-       double r_phi()   const  { return refPerig[3];}
-       double r_invR()  const  { return refPerig[4];}
+       VKalVrtControl(const VKalVrtControlBase &);
+       VKalVrtControl(const VKalVrtControl & src);              //copy
+      ~VKalVrtControl();
 
      public:
-       void setCurrent  ( double[], double[]); // set iteration (current) track parameters 
-       void setReference( double[], double[]); // set reference track parameters 
-       void restoreCurrentWgt();               // restore track WGT from saved copy 
-
-     private:
-
-       VKVertex* m_originVertex;
-       double m_mass;      //track mass
-
-   };
-  
 
-   class TWRK       // collection of temporary arrays for 
-   {   
-    public:
-      TWRK();
-     ~TWRK();
+       void setIterationNum(int Iter);
+       void setIterationPrec(double Prec);
+       void setRobustScale(double Scale);
+       void setRobustness(int Rob);
+       void setMassCnstData(int Ntrk, double Mass);
+       void setMassCnstData(int Ntrk, std::vector<int> Index, double Mass);
+
+       void setUseMassCnst();
+       void setUsePhiCnst();
+       void setUsePlaneCnst(double a, double b, double c, double d);
+       void setUseThetaCnst();
+       void setUseAprioriVrt();
+       void setUsePointingCnst(int );
+       void setUsePassNear(int);
 
      public:
-       double   tt[3];    // U_i vector (see Billoir...)
-       double   wb[9];
-       double   wc[6]; 
-       double  wci[6];
-       double wbci[9];
-       double drdp[2][3]; // for "pass near" constraint
-       double parf0[3];   // parameter shifts during iteration
-       double part[3];    // temporary array for fostfit optimization
-   };
-
-
-
-   class VKVertex
-   {   
-    public:
-      VKVertex();
-     ~VKVertex();
-      VKVertex(const VKVertex & src);              //copy
-      VKVertex& operator= (const VKVertex & src);  //assign
-
-     public:        // Relative coordinates with respect to refIterV[]
-       double Chi2;         // vertex Chi2
-       double fitV[3];      //fitted vertex position on given iteration step
-       double fitVcov[6];   //symmetric covariance matrix of fitted vertex
-       double iniV[3];      //starting point for the fit.
-       double cnstV[3];     //position for constraint values calculation. May be different from fitV or iniV
-
-     public:        //Global coordinates
-       double refIterV[3];  //initial point for iteration step and target for preparatory
-                            //track extrapolation. At this point Perig[] and WgtM[] for each track are defined.
-       double refV[3];      //reference point for given vertex. At this point refPerig[] and refCovar[]
-                            //for each track are defined
-
-       int useApriorVertex;   //for a priory vertex position knowledge usage
-       double apriorV[3];     //global coordinates (the same as refV and refIterV)
-       double apriorVWGT[6];  //weight matrix of a priori vertex   
-
-
-       bool passNearVertex;       // needed for "passing near vertex" constraint
-       bool passWithTrkCov;       //  Vertex, CovVertex, Charge and derivatives 
-       double fitMom[3];          //   are in ForVrtClose structure
-       double fitCovXYZMom[21];   //  Mom and CovMom are here because they are used also for other purposes
-       ForVrtClose FVC;
-
-
-       double T[3];           // save T(see Billoir) vector for futher use
-       double wa[6];          // save WA matrix for futher use
-       double dxyz0[3];       // unconstrained shift of vertex on current iteration. Needed for PostFit
-      
-       std::vector<VKTrack* > TrackList;
-       std::vector<TWRK* >    tmpArr;
-       std::vector<VKConstraintBase *> ConstraintList;
-
-
-       void setRefV(double []);
-       void setCnstV(double []);
-       void setRefIterV(double []);
-       void setIniV(double []);
-       void setFitV(double []);
-
-
-       VKVertex * nextCascadeVrt;
-       std::vector<VKVertex*> includedVrt;  // these vertices are NOT owned by given object.
-       double savedVrtMomCov[21]; // saved covariance WITHOUT pointing constraint
-				  // for correct cascade error definition 
-   };
-
-
 
+       double * m_fullCovariance;   // On vertex fit exit contains full covariance matrix 
+                                    // (x,y,z,px_0,py_0,pz_0,....,px_n,py_n,pz_n)
+                                    // in symmetric form
+       ForCFT m_forcft;
+       double m_vrtMassTot;
+       double m_vrtMassError;
+  };
 
 } // end of namespace bracket
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h
new file mode 100755
index 0000000000000000000000000000000000000000..e698189c3a857ccdf1a4345d48eb5f12647ac277
--- /dev/null
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/TrkVKalVrtCoreBase.h
@@ -0,0 +1,191 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef _TrkVKalVrtCoreBase_VKalVrtCore_H
+#define _TrkVKalVrtCoreBase_VKalVrtCore_H
+
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/ForVrtClose.h"
+#include "TrkVKalVrtCore/ForCFT.h"
+#include "TrkVKalVrtCore/CommonPars.h"
+#include <vector>
+#include <iostream>
+
+namespace Trk {
+
+  
+   class VKConstraintBase;
+   class VKVertex;
+
+  struct CascadeEvent 
+  {
+    int cascadeNV;
+    int nearPrmVertex;
+    double *fullCovMatrix;
+    double SCALE;
+    double accuracyConstraint;
+    std::vector< VKVertex *> cascadeVertexList; 
+    std::vector<int> matrixPnt;
+    CascadeEvent(){cascadeNV = 0; nearPrmVertex=0; fullCovMatrix=0; SCALE=1.; accuracyConstraint=1.e-4;};
+    ~CascadeEvent(){if(fullCovMatrix)delete[] fullCovMatrix;};
+  };
+
+//
+//   Main container for all track related information in vertex fit
+//--------------------------------------------------------------------
+   class VKTrack
+   {
+    public:
+       VKTrack(long int, double[], double[], VKVertex *, double);
+      ~VKTrack();
+//       VKTrack(const VKTrack & src);  //copy
+       friend std::ostream& operator<<( std::ostream& out, const VKTrack& track );
+
+     public:
+       long int Id;      //track ID number
+       int Charge;       //track charge
+
+               // Fitted track perameters at vertex VKVErtex->fitV
+       double fitP[3];
+       double Chi2;
+
+               // Track perameters at vertex VKVErtex->cnstV for constraint calculations
+       double cnstP[3];
+
+               // ALL is estimated at VKVErtex->iniV posision - start position of the fit
+       double iniP[3];     //perigee parameters assuming that track passes through iniXYZ 
+
+               // ALL is estimated at VKVErtex->refIterV posision - iteration reference position 
+       double Perig[5];         //perigee parameters prepared for vertex estimation
+       double WgtM[15];         //symmetric weight matrix prepared for vertex estimation
+       double WgtM_save[15];    //copy of weight matrix for speed optimisation
+
+               // All for robustification
+       double rmnd[5];     //remnants with respect to fitted vertex position
+       double e[5];        //eigenvalues of weight matrix
+       double v[5][5];     //corresponding eigenvectors of weight matrix
+
+               // ALL is estimated at VKVErtex->refXYZ posision - reference position for vertex fit
+       double refPerig[5];  //perigee parameters
+       double refCovar[15]; //symmetric covariance matrix 
+
+     public:
+       double getMass() const  {return m_mass;}
+       void   setMass(double M){ m_mass=M;}
+       double a0()    const    { return Perig[0];}
+       double z()     const    { return Perig[1];}
+       double theta() const    { return Perig[2];}
+       double phi()   const    { return Perig[3];}
+       double invR()  const    { return Perig[4];}
+       double r_a0()    const  { return refPerig[0];}
+       double r_z()     const  { return refPerig[1];}
+       double r_theta() const  { return refPerig[2];}
+       double r_phi()   const  { return refPerig[3];}
+       double r_invR()  const  { return refPerig[4];}
+
+     public:
+       void setCurrent  ( double[], double[]); // set iteration (current) track parameters 
+       void setReference( double[], double[]); // set reference track parameters 
+       void restoreCurrentWgt();               // restore track WGT from saved copy 
+
+     private:
+
+       VKVertex* m_originVertex;
+       double m_mass;      //track mass
+
+   };
+  
+
+   class TWRK       // collection of temporary arrays for 
+   {   
+    public:
+      TWRK();
+     ~TWRK();
+
+     public:
+       double   tt[3];    // U_i vector (see Billoir...)
+       double   wb[9];
+       double   wc[6]; 
+       double  wci[6];
+       double wbci[9];
+       double drdp[2][3]; // for "pass near" constraint
+       double parf0[3];   // parameter shifts during iteration
+       double part[3];    // temporary array for fostfit optimization
+   };
+
+
+
+   class VKVertex
+   {   
+    public:
+      VKVertex(const VKalVrtControl &);
+      VKVertex();
+     ~VKVertex();
+      VKVertex(const VKVertex & src);              //copy
+      VKVertex& operator= (const VKVertex & src);  //assign
+
+     public:        // Object with defining information for VKalVrtCore library.
+                    // Each vertex has a copy of VKalVrtControl object what allows
+                    // to fit it independently with individual set of constraints.
+                    // See Cascade code. 
+       std::unique_ptr<VKalVrtControl>  m_fitterControl;
+
+     public:        // Relative coordinates with respect to refIterV[]
+       double Chi2;         // vertex Chi2
+       double fitV[3];      //fitted vertex position on given iteration step
+       double fitVcov[6];   //symmetric covariance matrix of fitted vertex
+       double iniV[3];      //starting point for the fit.
+       double cnstV[3];     //position for constraint values calculation. May be different from fitV or iniV
+
+     public:        //Global coordinates
+       double refIterV[3];  //initial point for iteration step and target for preparatory
+                            //track extrapolation. At this point Perig[] and WgtM[] for each track are defined.
+       double refV[3];      //reference point for given vertex. At this point refPerig[] and refCovar[]
+                            //for each track are defined
+
+       int useApriorVertex;   //for a priory vertex position knowledge usage
+       double apriorV[3];     //global coordinates (the same as refV and refIterV)
+       double apriorVWGT[6];  //weight matrix of a priori vertex   
+
+
+       bool passNearVertex;       // needed for "passing near vertex" constraint
+       bool passWithTrkCov;       //  Vertex, CovVertex, Charge and derivatives 
+       double fitMom[3];          //   are in ForVrtClose structure
+       double fitCovXYZMom[21];   //  Mom and CovMom are here because they are used also for other purposes
+       ForVrtClose FVC;
+
+
+       double T[3];           // save T(see Billoir) vector for futher use
+       double wa[6];          // save WA matrix for futher use
+       double dxyz0[3];       // unconstrained shift of vertex on current iteration. Needed for PostFit
+      
+       std::vector<VKTrack* > TrackList;
+       std::vector<TWRK* >    tmpArr;
+       std::vector<VKConstraintBase *> ConstraintList;
+
+
+       void setRefV(double []);
+       void setCnstV(double []);
+       void setRefIterV(double []);
+       void setIniV(double []);
+       void setFitV(double []);
+
+
+       VKVertex * nextCascadeVrt;
+       std::vector<VKVertex*> includedVrt;  // these vertices are NOT owned by given object.
+       double savedVrtMomCov[21]; // saved covariance WITHOUT pointing constraint
+				  // for correct cascade error definition 
+     public: 
+
+       int existFullCov;
+       double ader[(3*vkalNTrkM+3)*(3*vkalNTrkM+3)];  // was [903][903]
+
+   };
+
+
+
+
+} // end of namespace bracket
+
+#endif
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/VKalVrtBMag.h b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/VKalVrtBMag.h
index 8ccce7f28f443237d53425fa5efb6e3eb66a9e2b..d1f01818d9d309443381dbc0c848833d6e187f3a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/VKalVrtBMag.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/TrkVKalVrtCore/VKalVrtBMag.h
@@ -1,62 +1,59 @@
 /*
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
+*/
+/* General magnetic field in any point access              */
+/* If external magnetic field handler is provided as       */
+/* either an object inherited from the baseMagFld class    */
+/* or a function addrMagHandler - the vkalMagFld class     */
+/* will use it, otherwise the vkalMagFld returns           */
+/* the constant magnetic field.                            */
+/* 							   */
+/*  Thread-safe implementation				   */
+/*---------------------------------------------------------*/
 #ifndef _TrkVKalVrtCore_VKalVrtBMag_H
 #define _TrkVKalVrtCore_VKalVrtBMag_H
+
+
 namespace Trk {
-
-/* Structure for keeping magnetic field in the fitting point.          */
-/* This field is used for mass, momentum and constraints calculation   */
-/* in the package.                                                     */
-/*  The field here is set BEFORE starting of propagation of all tracks */
-/*  to the estimated vertex position on each iteration of the fit      */
-/*     Used for error matrix calculation AFTER fit also!!!             */
-/***********************************************************************/
-
-  struct VKalVrtBMag{
-    double bmag, bmagx, bmagy, bmagz;
-  };
-
-
-
-
-/* Now general magnetic field in any point definition*/
-/*     Changeable at any moment!!!                   */
-/*---------------------------------------------------*/
+
+  class VKalVrtControlBase;
 
   typedef void (*addrMagHandler)(double,double,double, double& ,double& , double& );
-
+
+//
+//  Base class for concrete megnetic field implementations (e.g. Athena tool) to be called by vkalMagFld
+//
   class baseMagFld {
   public:
      baseMagFld();
      virtual ~baseMagFld();
-     virtual void getMagFld(const double,const double,const double,double&,double&,double&)=0;
+     virtual void getMagFld(const double,const double,const double,double&,double&,double&) const =0;
   };
 
-
+//
+// Main magnetic field implememtation in VKalVrtCore package.
+// Depending on VKalVrtControlBase it either calls external magnetic field
+// or uses default fixed magnetic field.
+//
   class vkalMagFld {
   public:
      vkalMagFld();
     ~vkalMagFld();
 
-     void getMagFld(const double,const double,const double,double&,double&,double&);
-     void setMagHandler(addrMagHandler);
-     void setMagHandler(baseMagFld*);
-     double getCnvCst();
+     void getMagFld(const double,const double,const double,double&,double&,double&, const VKalVrtControlBase*)  const;
+     double getMagFld(const double xyz[3], const VKalVrtControlBase* FitControl)  const;
+     double getCnvCst() const;
   
    private:
-     double m_cnstBMAG;
-     addrMagHandler m_functionHandler;
-     double m_vkalCnvMagFld;
-     baseMagFld*    m_objectHandler;   
+     const double m_cnstBMAG;
+     const double m_vkalCnvMagFld;
+     const double m_mm;
      double m_saveXpos;
      double m_saveYpos;
      double m_saveZpos;
      double m_saveBX;
      double m_saveBY;
      double m_saveBZ;
-     double m_mm;
    };
 
 }
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
index 48226eae2d91b8e2566c18c2f5e03149ca017082..17ddd89a87abaade9f445bbc4af7dce7f79096f1 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFit.cxx
@@ -4,28 +4,24 @@
 
 #include <math.h>
 #include <iostream>
-#include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/Derivt.h"
+#include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/Propagator.h"
-#include "TrkVKalVrtCore/WorkArray.h"
-#include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
+#include "TrkVKalVrtCore/Derivt.h"
 
 namespace Trk {
 
 
-DerivT          derivt_;
-ForCFT          forcft_;
-VKalVrtBMag     vkalvrtbmag;
+//These two objects either use pointers to external handlers
+//provided on input or returns constant magentic field and
+//propagation in it.
+// No writable data members ==> thread-safe
+//=========================================================
 vkalMagFld      myMagFld;
 vkalPropagator  myPropagator;
-WorkArray       workarray_;
-
 
-#define forcft_1 forcft_
-#define derivt_1 derivt_
-#define workarray_1 workarray_
 
 #define min(a,b) ((a) <= (b) ? (a) : (b))
 #define max(a,b) ((a) >= (b) ? (a) : (b))
@@ -93,7 +89,7 @@ extern double cfSmallEigenvalue( double*, long int );
 /*                         -3     no fit at all                               */
 /*                         -4     noninvertible vert.error matrix for IFLAG=6 */
 /*                         -5     Divergence of iterations                    */
-/* Author: V.Kostioukhine ( 1996 )                                            */
+/* Author: V.Kostyukhin ( 1996 )                                            */
 /*----------------------------------------------------------------------------*/
 
 
@@ -103,50 +99,30 @@ extern double cfSmallEigenvalue( double*, long int );
 
 
 
-
-
-
 VKVertex createVertex(long int NTRK, long int *ich, double *xyz0, double *par0,
-	              double *inp_Trk5, double *inp_CovTrk5)
+	              double *inp_Trk5, double *inp_CovTrk5, VKalVrtControl * currFitControl)
 {
     long int  tk;
 
-    VKVertex MainVRT; 
+    VKVertex MainVRT(*currFitControl);           
+    ForCFT & vrtForCFT=currFitControl->m_forcft;
 
     double xyz[3]={0.,0.,0.};              // Perigee point
-
-//Old with  ref. point moved to initial vertex position
-//    double base_err[15],base_par[15];
-//    MainVRT.setRefV(xyz0);      //ref point
-//    MainVRT.setRefIterV(xyz0);  //iteration ref. point
-//    for (tk=0; tk<NTRK ; tk++) {
-//       //printT(&inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , "Input track:");
-//       myPropagator.Propagate( tk, ich[tk], &inp_Trk5[tk*5],   &inp_CovTrk5[tk*15],  xyz,
-//                                      xyz0,  base_par,          base_err );
-//       MainVRT.TrackList.push_back(new VKTrack(tk, base_par, base_err, &MainVRT, forcft_.wm[tk]));
-//       MainVRT.tmpArr.push_back(new TWRK());
-//       MainVRT.TrackList[tk]->Charge = ich[tk];           // Charge coinsides with sign of curvature
-//    }
-//std::cout<<" New="<< (*(MainVRT.TrackList[0])) <<'\n';
 //
 //VK 13.01.2009 New strategy with ref.point left at initial position
     MainVRT.setRefV(xyz);      //ref point
     MainVRT.setRefIterV(xyz0);  //iteration ref. point
     for (tk=0; tk<NTRK ; tk++) {
-//       printT(&inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , "Input track:");
-       MainVRT.TrackList.push_back(new VKTrack(tk, &inp_Trk5[tk*5], &inp_CovTrk5[tk*15], &MainVRT, forcft_.wm[tk]));
+//     printT(&inp_Trk5[tk*5], &inp_CovTrk5[tk*15] , "Input track:");
+       MainVRT.TrackList.push_back(new VKTrack(tk, &inp_Trk5[tk*5], &inp_CovTrk5[tk*15], &MainVRT, vrtForCFT.wm[tk]));
        MainVRT.tmpArr.push_back(new TWRK());
        MainVRT.TrackList[tk]->Charge = ich[tk];           // Charge coinsides with sign of curvature
     }
 
-    forcft_1.icht=0;  for (tk=0; tk<NTRK; ++tk)forcft_1.icht += ich[tk];  // summary charge
-    MainVRT.FVC.Charge = forcft_1.icht;
-    cfdcopy(forcft_1.vrt,    MainVRT.FVC.vrt ,    3);
-    cfdcopy(forcft_1.covvrt, MainVRT.FVC.covvrt , 6);
+    MainVRT.FVC.Charge = 0; for (tk=0; tk<NTRK; ++tk)MainVRT.FVC.Charge += ich[tk];  // summary charge
+    cfdcopy(vrtForCFT.vrt,    MainVRT.FVC.vrt ,    3);
+    cfdcopy(vrtForCFT.covvrt, MainVRT.FVC.covvrt , 6);
 
-//    std::cout<<" CNST="<<forcft_1.useMassCnst<<", "  <<forcft_1.usePointingCnst<<", "
-//                       <<forcft_1.usePhiCnst<<", "   <<forcft_1.useThetaCnst<<", "
-//	  	       <<forcft_1.useAprioriVrt<<", "<<'\n';
 /* --------------------------------------------------------*/
 /*           Initial value                                 */
 /* --------------------------------------------------------*/
@@ -163,11 +139,11 @@ VKVertex createVertex(long int NTRK, long int *ich, double *xyz0, double *par0,
 }
 
 
+extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase* = 0);
+extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, const VKalVrtControl * =0);
+extern void cfmasserr(VKVertex* , int*, double, double*, double*);
 
-
-
-
-long int fitVertex(VKVertex * vk, long int iflag) 
+int fitVertex(VKVertex * vk) 
 {
     long int  i, jerr, tk, it=0;
 
@@ -176,70 +152,67 @@ long int fitVertex(VKVertex * vk, long int iflag)
     double aermd[30],tmpd[30];  // temporary array
     double tmpPer[5],tmpCov[15], tmpWgt[15];
     double VrtMomCov[21],PartMom[4];
-    double vBx,vBy,vBz;
     double cnstRemnants=0., iniCnstRem=0.;
 
     const double ConstraintAccuracy=1.e-4;
 
-    extern long int  vtcfit( VKVertex * vk);
-    extern void applyConstraints(VKVertex * vk);
-    extern int afterFit(VKVertex *, double *, double *, double *, double *);
-    extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *);
-    extern void robtest(VKVertex * , long int );
+    extern int  vtcfit( VKVertex * vk);
     extern void cfsetdiag(long int , double *, double );
     extern int cfInv5(double *cov, double *wgt );
     extern void cfTrkCovarCorr(double *cov);
+    extern void applyConstraints(VKVertex * vk);
+    extern void robtest(VKVertex * , long int );
 
 //
 //    New datastructure
 
     long int IERR = 0;
                                 /* Type of the constraint for the fit */
-    derivt_1.ndummy = iflag;    // Obsolete setting. Just for safety.
     long int NTRK = vk->TrackList.size();
+    ForCFT & vrtForCFT=vk->m_fitterControl->m_forcft;
     vk->passNearVertex=false;  //explicit setting - not to use
     vk->passWithTrkCov=false;  //explicit setting - not to use
-    if ( forcft_1.usePassNear    )  vk->passNearVertex=true;
-    if ( forcft_1.usePassNear==2 )  vk->passWithTrkCov=true;
+    if ( vrtForCFT.usePassNear    )  vk->passNearVertex=true;
+    if ( vrtForCFT.usePassNear==2 )  vk->passWithTrkCov=true;
     double zeroV[3]={0.,0.,0.};
     VKTrack * trk=0;
 
     chi2min = 1e15;
     chi2df = 0.;
 
-    if( forcft_1.nmcnst && forcft_1.useMassCnst )  {       //mass constraints are present
+    if( vrtForCFT.nmcnst && vrtForCFT.useMassCnst )  {       //mass constraints are present
       std::vector<int> index;
       for( int ic=0; ic<8; ic++){
-        if(forcft_.wmfit[ic]>0){    // new mass constraint
+        if(vrtForCFT.wmfit[ic]>0){    // new mass constraint
            index.clear();
-           for(tk=0; tk<NTRK; tk++){ if( forcft_.indtrkmc[ic*NTrkM + tk] )index.push_back(tk);}
-           vk->ConstraintList.push_back(new VKMassConstraint( NTRK, forcft_.wmfit[ic], index, vk));
+           for(tk=0; tk<NTRK; tk++){ if( vrtForCFT.indtrkmc[ic*vkalNTrkM + tk] )index.push_back(tk);}
+           vk->ConstraintList.push_back(new VKMassConstraint( NTRK, vrtForCFT.wmfit[ic], index, vk));
         }
       }
       //VKMassConstraint *ctmp=dynamic_cast<VKMassConstraint*>( vk->ConstraintList[0]); std::cout<<(*ctmp)<<'\n';
     }
-    if( forcft_1.usePointingCnst==1 ){  //3Dpointing
-      vk->ConstraintList.push_back(new VKPointConstraint( NTRK, forcft_.vrt, vk));
+    if( vrtForCFT.usePointingCnst==1 ){  //3Dpointing
+      vk->ConstraintList.push_back(new VKPointConstraint( NTRK, vrtForCFT.vrt, vk));
       //VKPointConstraint *ptmp=dynamic_cast<VKPointConstraint*>( vk->ConstraintList[1]); std::cout<<(*ptmp)<<'\n';
     }
-    if( forcft_1.usePointingCnst==2 ){  //Z pointing
-      VKPointConstraint *temp = new VKPointConstraint( NTRK, forcft_.vrt, vk);
+    if( vrtForCFT.usePointingCnst==2 ){  //Z pointing
+      VKPointConstraint *temp = new VKPointConstraint( NTRK, vrtForCFT.vrt, vk);
       temp->onlyZ=true;
       vk->ConstraintList.push_back(temp);
       //VKPointConstraint *ptmp=dynamic_cast<VKPointConstraint*>( vk->ConstraintList[1]); std::cout<<(*ptmp)<<'\n';
     }
-    if ( forcft_1.useAprioriVrt ) {
-        cfdcopy(forcft_.covvrt, tmpd,   6);
+    if ( vrtForCFT.useAprioriVrt ) {
+        cfdcopy(vrtForCFT.covvrt, tmpd,   6);
 	IERR=cfdinv(tmpd, aermd, -3); if (IERR) {  IERR = -4; return IERR; }
         vk->useApriorVertex = 1;
-        cfdcopy(forcft_.vrt, vk->apriorV,   3);
+        cfdcopy(vrtForCFT.vrt, vk->apriorV,   3);
         cfdcopy(      aermd, vk->apriorVWGT,6);
     }
-    if ( forcft_1.usePhiCnst )  vk->ConstraintList.push_back(new VKPhiConstraint( NTRK, vk));
-    if ( forcft_1.useThetaCnst )vk->ConstraintList.push_back(new VKThetaConstraint( NTRK, vk));
-    if ( forcft_1.usePlaneCnst ){
-      if( forcft_1.Ap+forcft_1.Bp+forcft_1.Cp != 0.){
-        vk->ConstraintList.push_back(new VKPlaneConstraint( NTRK, forcft_1.Ap, forcft_1.Bp, forcft_1.Cp, forcft_1.Dp, vk));
+    if ( vrtForCFT.usePhiCnst )  vk->ConstraintList.push_back(new VKPhiConstraint( NTRK, vk));
+    if ( vrtForCFT.useThetaCnst )vk->ConstraintList.push_back(new VKThetaConstraint( NTRK, vk));
+    if ( vrtForCFT.usePlaneCnst ){
+      if( vrtForCFT.Ap+vrtForCFT.Bp+vrtForCFT.Cp != 0.){
+        vk->ConstraintList.push_back(new VKPlaneConstraint( NTRK, vrtForCFT.Ap, vrtForCFT.Bp, vrtForCFT.Cp, vrtForCFT.Dp, vk));
       }
     }
 //
@@ -259,9 +232,9 @@ long int fitVertex(VKVertex * vk, long int iflag)
 /* ------------------------------------------------------------*/
      bool extrapolationDone=false;
      bool forcedExtrapolation=false;  //To force explicit extrapolation
-     std::vector< Vect3DF > savedExtrapVertices(forcft_1.IterationNumber);
+     std::vector< Vect3DF > savedExtrapVertices(vrtForCFT.IterationNumber);
      double cnstRemnantsPrev=1.e20, Chi2Prev=0.; int countBadStep=0; // For consecutive bad steps
-     for (it = 1; it <= forcft_1.IterationNumber; ++it) {
+     for (it = 1; it <= vrtForCFT.IterationNumber; ++it) {
         vShift = sqrt( (vk->refIterV[0]-dxyzst[0])*(vk->refIterV[0]-dxyzst[0])
 	              +(vk->refIterV[1]-dxyzst[1])*(vk->refIterV[1]-dxyzst[1])
 	              +(vk->refIterV[2]-dxyzst[2])*(vk->refIterV[2]-dxyzst[2]) );
@@ -269,7 +242,10 @@ long int fitVertex(VKVertex * vk, long int iflag)
        savedExtrapVertices[it-1].Y=dxyzst[1];
        savedExtrapVertices[it-1].Z=dxyzst[2];
        if(it==1){
-         if(!myPropagator.checkTarget(dxyzst)) { IERR=-10; return IERR; }       // First guess is definitely outside working volume
+	 bool insideGoodVolume=false;
+         if(vk->m_fitterControl && vk->m_fitterControl->m_objProp) { insideGoodVolume = vk->m_fitterControl->m_objProp->checkTarget(dxyzst);}
+         else                                                      { insideGoodVolume = myPropagator.checkTarget(dxyzst); }
+         if(!insideGoodVolume) { IERR=-10; return IERR; }       // First guess is definitely outside working volume
        }
 /* ---------------------------------------------------------------- */
 /*  Propagate parameters and errors at point dXYZST                 */
@@ -281,7 +257,8 @@ long int fitVertex(VKVertex * vk, long int iflag)
           forcedExtrapolation=false;
           double oldX=0., oldY=0., oldZ=0.;
           if(it>=2){ oldX=savedExtrapVertices[it-2].X; oldY=savedExtrapVertices[it-2].Y; oldZ=savedExtrapVertices[it-2].Z;}
-          while( !myPropagator.checkTarget(dxyzst) ){      //check extrapolation and limit step if needed
+	  bool insideGoodVolume=false;
+          while( !insideGoodVolume ){      //check extrapolation and limit step if needed
              dxyzst[0]=(savedExtrapVertices[it-1].X + oldX)/2.;
              dxyzst[1]=(savedExtrapVertices[it-1].Y + oldY)/2.;
              dxyzst[2]=(savedExtrapVertices[it-1].Z + oldZ)/2.;
@@ -292,18 +269,20 @@ long int fitVertex(VKVertex * vk, long int iflag)
              double ddy=savedExtrapVertices[it-1].Y - oldY;
              double ddz=savedExtrapVertices[it-1].Z - oldZ;
              if( sqrt(ddx*ddx+ddy*ddy+ddz*ddz)<5.) { IERR=-11; return IERR; }       // Impossible to extrapolate
+             if(vk->m_fitterControl && vk->m_fitterControl->m_objProp) { insideGoodVolume = vk->m_fitterControl->m_objProp->checkTarget(dxyzst);}
+             else                                                      { insideGoodVolume = myPropagator.checkTarget(dxyzst); }
           }
 	  double targV[3]={dxyzst[0],dxyzst[1],dxyzst[2]};
 	  for (tk = 0; tk < NTRK; ++tk) {
-            myPropagator.Propagate(vk->TrackList[tk], vk->refV,  targV, tmpPer, tmpCov);
+            myPropagator.Propagate(vk->TrackList[tk], vk->refV,  targV, tmpPer, tmpCov, (vk->m_fitterControl).get());
             cfTrkCovarCorr(tmpCov);
             double eig5=cfSmallEigenvalue(tmpCov,5 );
  	    if(eig5<1.e-15 ){ 
                 tmpCov[0]+=1.e-15; tmpCov[2]+=1.e-15; tmpCov[5]+=1.e-15;  tmpCov[9]+=1.e-15;  tmpCov[14]+=1.e-15; 
 	    }else if(tmpCov[0]>1.e9) {  //Bad propagation with material. Try without it.
-               myPropagator.Propagate(-999, vk->TrackList[tk]->Charge,
-                                       vk->TrackList[tk]->refPerig,vk->TrackList[tk]->refCovar,
-	             	               vk->refV,  targV, tmpPer, tmpCov);
+               myPropagator.Propagate(-999, vk->TrackList[tk]->Charge, vk->TrackList[tk]->refPerig,vk->TrackList[tk]->refCovar,
+	              	                vk->refV,  targV, tmpPer, tmpCov, (vk->m_fitterControl).get()); 
+
 	       if(cfSmallEigenvalue(tmpCov,5 )<1.e-15){    //Final protection
  	           tmpCov[1]=0.;tmpCov[3]=0.;tmpCov[6]=0.;tmpCov[10]=0.;
 		                tmpCov[4]=0.;tmpCov[7]=0.;tmpCov[11]=0.;
@@ -321,13 +300,10 @@ long int fitVertex(VKVertex * vk, long int iflag)
 //VK	    if ( vShift > 200. ) vk->TrackList[tk]->setReference( tmpPer, tmpCov ); //Change reference for big shift
           }
 //VK          if ( vShift > 200. )vk->setRefV(dxyzst);  // Change reference vertex for big shift
-//std::cout<< (*(vk->TrackList[0])) <<'\n';
 //
 /* Magnetic field in fitting point setting */
           vk->setRefIterV(dxyzst);
-          myMagFld.getMagFld(vk->refIterV[0],vk->refIterV[1],vk->refIterV[2],vBx,vBy,vBz);
-	  forcft_1.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-	  vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
+          vrtForCFT.localbmag = myMagFld.getMagFld(vk->refIterV,(vk->m_fitterControl).get());
           vk->setIniV(zeroV);vk->setCnstV(zeroV);    // initial guess with respect to refIterV[]. 0 after extrap.
         }else{
           vk->setIniV( vk->fitV ); vk->setCnstV( vk->fitV );  // use previous fitV[] as start position
@@ -342,8 +318,8 @@ long int fitVertex(VKVertex * vk, long int iflag)
 	    trk = vk->TrackList[tk]; protectCurvatureSign( trk->refPerig[4], trk->fitP[2] , trk->WgtM);
         }
 /*--------------------------------  Now the fit itself -----------------*/
-	if (forcft_1.irob != 0) {robtest(vk, 0);}  // ROBUSTIFICATION new data structure
-	if (forcft_1.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
+	if (vrtForCFT.irob != 0) {robtest(vk, 0);}  // ROBUSTIFICATION new data structure
+	if (vrtForCFT.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
         for( tk=0; tk<NTRK; tk++){
 	  trk = vk->TrackList[tk]; 
 	  trk->iniP[0]=trk->cnstP[0]=trk->fitP[0];   //use fitted track parameters as initial guess
@@ -379,22 +355,19 @@ long int fitVertex(VKVertex * vk, long int iflag)
 	chi22s = chi21s * 1.01 + 10.; //for safety 
 	if ( vShift < 10.*vkalShiftToTrigExtrapolation) {              // REASONABLE DISPLACEMENT - RECALCULATE
 /* ROBUSTIFICATION */
-	  if (forcft_1.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
+	  if (vrtForCFT.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
 //Reset mag.field
           for( i=0; i<3; i++) dparst[i]=vk->refIterV[i]+vk->fitV[i]; // fitted vertex at global frame
-          myMagFld.getMagFld(dparst[0],dparst[1],dparst[2],vBx,vBy,vBz);
-	  forcft_1.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-	  vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
-
+          vrtForCFT.localbmag=myMagFld.getMagFld(dparst,(vk->m_fitterControl).get());
 	  if ( vk->passNearVertex ) {
-            jerr = afterFit(vk, workarray_1.ader, vk->FVC.dcv, PartMom, VrtMomCov);
+            jerr = afterFit(vk, vk->ader, vk->FVC.dcv, PartMom, VrtMomCov, (vk->m_fitterControl).get());
 	    cfdcopy( PartMom, &dparst[3], 3);  //vertex part of it is filled above
             cfdcopy(VrtMomCov,vk->FVC.dcovf,21);  //Used in chi2 caclulation later...
 	    cfdcopy(  PartMom, vk->fitMom, 3);          //save Momentum
             cfdcopy(VrtMomCov, vk->fitCovXYZMom, 21);   //save XYZMom covariance
 	    vpderiv(vk->passWithTrkCov, vk->FVC.Charge, dparst, VrtMomCov, 
 	                       vk->FVC.vrt, vk->FVC.covvrt, 
-		               vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0);
+		               vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0, (vk->m_fitterControl).get());
 	  }
 
           for( tk=0; tk<NTRK; tk++){
@@ -425,11 +398,11 @@ long int fitVertex(VKVertex * vk, long int iflag)
 /*  Test of convergence */
 	chi2df = fabs(chi21s - chi22s);
   /*---------------------Normal convergence--------------------*/
-        double PrecLimit = min(chi22s*1.e-4, forcft_1.IterationPrecision);
+        double PrecLimit = min(chi22s*1.e-4, vrtForCFT.IterationPrecision);
 	//std::cout<<"Convergence="<< chi2df <<"<"<<PrecLimit<<" cnst="<<cnstRemnants<<"<"<<ConstraintAccuracy<<'\n';
 	if ((chi2df < PrecLimit) && (vShift < 0.001) && it>1 && (cnstRemnants<ConstraintAccuracy)){
 	   double dstFromExtrapPnt=sqrt(vk->fitV[0]*vk->fitV[0] + vk->fitV[1]*vk->fitV[1]+ vk->fitV[2]*vk->fitV[2]);
-	   if( dstFromExtrapPnt>vkalShiftToTrigExtrapolation/2. && it < forcft_1.IterationNumber-15){
+	   if( dstFromExtrapPnt>vkalShiftToTrigExtrapolation/2. && it < vrtForCFT.IterationNumber-15){
 	     forcedExtrapolation=true;
 	     continue;          // Make another extrapolation exactly to found vertex position
            }
@@ -443,7 +416,7 @@ long int fitVertex(VKVertex * vk, long int iflag)
 
 // Track near vertex constraint recalculation for next fit
 	if ( vk->passNearVertex ) {
-            jerr = afterFit(vk, workarray_1.ader, vk->FVC.dcv, PartMom, VrtMomCov);
+            jerr = afterFit(vk, vk->ader, vk->FVC.dcv, PartMom, VrtMomCov, (vk->m_fitterControl).get());
             for( i=0; i<3; i++) dparst[i] = vk->refIterV[i]+vk->fitV[i]; // fitted vertex at global frame
             cfdcopy( PartMom, &dparst[3], 3);
             cfdcopy(VrtMomCov,vk->FVC.dcovf,21);  //Used in chi2 caclulation later...
@@ -451,7 +424,7 @@ long int fitVertex(VKVertex * vk, long int iflag)
             cfdcopy(VrtMomCov, vk->fitCovXYZMom, 21);   //save XYZMom covariance
 	    vpderiv(vk->passWithTrkCov, vk->FVC.Charge, dparst, VrtMomCov, 
 	                       vk->FVC.vrt, vk->FVC.covvrt, 
-		               vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0);
+		               vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0, (vk->m_fitterControl).get());
 	}
 //
 // Check constraints status
@@ -487,34 +460,27 @@ long int fitVertex(VKVertex * vk, long int iflag)
 }
 
 
-     int CFit(long int iflag, long int ifCovV0, long int NTRK, 
+     int CFit(VKalVrtControl &FitCONTROL, long int ifCovV0, long int NTRK, 
 	      long int *ich, double *xyz0, double *par0,
 	      double *inp_Trk5, double *inp_CovTrk5, 
 	      double *xyzfit, double *parfs, double *ptot,
               double *covf, double *chi2, double *chi2tr)
 {
-    long int IERR,tk;
+    int IERR,tk;
     double dptot[5], VrtMomCov[21];
 
-    extern int afterFit(VKVertex *, double *, double *, double *, double *);
-
     ptot[0]=0.; ptot[0]=0.; ptot[0]=0.;     
     cfdcopy(xyz0,xyzfit,3);
 
-    vkalDynamicArrays tmpArrays(NTRK+1);       // dynamic arrays creation for VTCFIT
-    workarray_1.myWorkArrays = & tmpArrays;
 //
 //   Create vertex
 //
-    VKVertex MainVRT = createVertex(NTRK, ich, xyz0, par0,inp_Trk5, inp_CovTrk5);
+    VKVertex MainVRT = createVertex(NTRK, ich, xyz0, par0, inp_Trk5, inp_CovTrk5, &FitCONTROL);
 //
 //  Fit vertex
 //
-    IERR = fitVertex( &MainVRT, iflag); 
-    if(IERR){
-       workarray_1.myWorkArrays = 0;    //Safety for VTCFIT.  tmpArrays object is removed automatically.
-       return IERR;
-    }
+    IERR = fitVertex( &MainVRT); 
+    if(IERR)   return IERR;
 //
 //  if successful - save results
 //
@@ -530,30 +496,33 @@ long int fitVertex(VKVertex * vk, long int iflag)
 //  If required - get full covariance matrix
 //
     if(ifCovV0){
-      double vBx,vBy,vBz;
-      myMagFld.getMagFld(xyzfit[0],xyzfit[1],xyzfit[2],vBx,vBy,vBz);
-      forcft_1.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-      vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
-      IERR = afterFit(&MainVRT, workarray_1.ader, MainVRT.FVC.dcv, dptot, VrtMomCov);
+      MainVRT.m_fitterControl->m_forcft.localbmag = myMagFld.getMagFld(xyzfit,(MainVRT.m_fitterControl).get());
+      IERR = afterFit(&MainVRT, MainVRT.ader, MainVRT.FVC.dcv, dptot, VrtMomCov, (MainVRT.m_fitterControl).get());
       if (IERR) return -2;   /* NONINVERTIBLE COV.MATRIX */
+      if(MainVRT.existFullCov){
+        if(FitCONTROL.m_fullCovariance) delete[] FitCONTROL.m_fullCovariance;
+        FitCONTROL.m_fullCovariance=new double( (3*NTRK+3)*(3*NTRK+3+1)/2 );
+        int out=0;
+        for(int ti=0; ti<3+3*NTRK; ti++){
+          for(int tj=ti; tj<3+3*NTRK; tj++){
+            FitCONTROL.m_fullCovariance[out] = ARR_2D(MainVRT.ader, 3*vkalNTrkM+3, ti, tj);
+            out++;
+        } }
+        int activeTrk[vkalNTrkM]={1};
+        cfmasserr(&MainVRT, activeTrk,MainVRT.m_fitterControl->m_forcft.localbmag, 
+                      &FitCONTROL.m_vrtMassTot, &FitCONTROL.m_vrtMassError);
+      }
       cfdcopy( VrtMomCov,  covf, 21);  //XvYvZvPxPyPz covariance
       cfdcopy( dptot,      ptot,  3);  //summary mom
+      cfdcopy( MainVRT.m_fitterControl->m_forcft.robres, FitCONTROL.m_forcft.robres, NTRK); //Track weights from robust fit
+      
 //std::cout<<" newcov="<<VrtMomCov[0]<<", "<<VrtMomCov[2]<<", "<<VrtMomCov[4]<<", "
 //                     <<VrtMomCov[9]<<", "<<VrtMomCov[14]<<", "<<VrtMomCov[13]<<'\n';
     }
 
-    workarray_1.myWorkArrays = 0;    //Safety for VTCFIT.  tmpArrays object is removed automatically.
     return 0;
 
 }
 
 
-void getWeights(long int ntrk, double *trkWeight)
-{  
-  if( ntrk > NTrkM) ntrk=NTrkM;
-  for( int i=0; i<ntrk; i++ ) trkWeight[i]=forcft_1.robres[i];
-  return;
-}
-
-
 } /* End of VKalVrtCore namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
index 996dd0090e597c2f76c4c7d0efc984cf73fbf728..61df9c0df28f027afd4f2f09d7bf1aca0f8dee8d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascade.cxx
@@ -6,29 +6,24 @@
 #include <iostream>
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/Propagator.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
-#include "TrkVKalVrtCore/WorkArray.h"
 #include "TrkVKalVrtCore/Derivt.h"
+#include "TrkVKalVrtCore/Propagator.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 
 namespace Trk {
 
 extern vkalPropagator  myPropagator;
-extern WorkArray       workarray_;
-extern DerivT          derivt_;
-extern ForCFT          forcft_;
-extern VKalVrtBMag     vkalvrtbmag;
 extern vkalMagFld      myMagFld;
 extern CascadeEvent    cascadeEvent_;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
 extern double cfSmallEigenvalue( double*, long int );
-extern long int  vtcfit( VKVertex * vk);
-extern void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, double *paro, double *covo);
-extern int afterFit(VKVertex *, double *, double *, double *, double *);
-extern int afterFitWithIniPar(VKVertex *vk, double *, double *, double *, double *);
+extern int  vtcfit( VKVertex * vk);
+extern void  combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *paro, double *covo);
+extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase * =0 );
+extern int afterFitWithIniPar(VKVertex *vk, double *, double *, double *, double *, const VKalVrtControlBase * =0 );
 extern void applyConstraints(VKVertex * vk);
 extern void FullMTXfill(VKVertex * , double * );
 extern  int FullMCNSTfill(VKVertex * , double * , double * );
@@ -42,8 +37,8 @@ extern int getCascadeNPar(int Type=0);
 extern VKTrack * getCombinedVTrack(VKVertex *);
 extern void cleanCascade();
 extern void cfdcopy(double *source, double *target, int);
-extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *);
-extern std::vector<double> getFitParticleMom( VKTrack *);
+extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *, const VKalVrtControl * =0);
+extern std::vector<double> getFitParticleMom( VKTrack *, double);
 
 extern void setFittedMatrices(double * , long int , std::vector<int> &, std::vector< std::vector<double> > & );
 extern std::vector<double> transformCovar(int , double **, std::vector<double> );
@@ -64,14 +59,14 @@ int setVTrackMass(VKVertex * vk)
    VectMOM totP;
 
    if(!vk->nextCascadeVrt)return 0;               // nonpointing vertex
-   myMagFld.getMagFld(vk->refIterV[0] + vk->fitV[0],
-                      vk->refIterV[1] + vk->fitV[1],
-                      vk->refIterV[2] + vk->fitV[2], vBx, vBy, vBz);
-  		      vkalvrtbmag.bmag  = vBz; //correct field in vertex
+
+   myMagFld.getMagFld(vk->refIterV[0]+vk->fitV[0], vk->refIterV[1]+vk->fitV[1], vk->refIterV[2]+vk->fitV[2],
+                                        vBx,vBy,vBz,(vk->m_fitterControl).get());
+
    NTRK = vk->TrackList.size();                   // Number of tracks at vertex
    totP.Px=0.;totP.Py=0.;totP.Pz=0.;totP.E=0.;
    for(it=0; it<NTRK; it++){
-       std::vector<double> pp = getFitParticleMom( vk->TrackList[it] );
+       std::vector<double> pp = getFitParticleMom( vk->TrackList[it], vBz );
        totP.Px += pp[0];     
        totP.Py += pp[1];     
        totP.Pz += pp[2];     
@@ -131,10 +126,9 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //
 //  Fit itself. First get magnetic field at iteration reference point
 //
-   double vBx,vBy,vBz;
-   myMagFld.getMagFld(vk->refIterV[0],vk->refIterV[1],vk->refIterV[2],vBx,vBy,vBz);
-   forcft_.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-   vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
+   vk->m_fitterControl->m_forcft.localbmag=myMagFld.getMagFld(vk->refIterV,(vk->m_fitterControl).get());
+
+
 //
 //-------- Check if pointing constraint exists
 //
@@ -147,15 +141,13 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //-------- Then fit
 //
    applyConstraints(vk);                                         //apply all constraints in vertex 
-   long int IERR = vtcfit( vk );
+   int IERR = vtcfit( vk );
    if(IERR) return IERR;
 //
 //fit vertex once more with resolved constraints to prevent oscillations
 //   if(Pointing){ 
 //      double targVrt[3]={vk->refIterV[0] + vk->fitV[0],vk->refIterV[1] + vk->fitV[1],vk->refIterV[2] + vk->fitV[2]};
-//      myMagFld.getMagFld(targVrt[0],targVrt[1],targVrt[2],vBx,vBy,vBz);
-//      forcft_.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-//      vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
+//      vk->m_fitterControl->m_forcft.localbmag=myMagFld.getMagFld(vk->targVrt,(vk->m_fitterControl).get());
 //      vk->setRefIterV(targVrt);
 //      vk->iniV[0]=vk->fitV[0]=vk->cnstV[0]=vk->iniV[1]=vk->fitV[1]=vk->cnstV[1]=vk->iniV[2]=vk->fitV[2]=vk->cnstV[2]=0.;
 //      for(int it=0; it<(int)vk->TrackList.size(); it++){
@@ -165,14 +157,14 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //         trk->cnstP[2] = trk->iniP[2] = trk->fitP[2];
 //      }      
 //      applyConstraints(vk);                                         //apply all constraints in vertex 
-//      long int IERR = vtcfit( vk );
+//      int IERR = vtcfit( vk );
 //      if(IERR) return IERR;
 //   }
 //
 //    Fill fitted combined track in next vertex (if needed)
 //
    if(vk->nextCascadeVrt){
-      FullMTXfill(vk, workarray_.ader);
+      FullMTXfill(vk, vk->ader);
       VKTrack * target_trk = getCombinedVTrack(vk);  // get address of combined track
       if( target_trk == 0 ) return -12;
 
@@ -182,13 +174,13 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
       double dptot[4],VrtMomCov[21];      
       double parV0[5],covParV0[15],tmpCov[15],fittedVrt[3];      
       if(Pointing){
-         IERR = afterFitWithIniPar( vk, workarray_.ader, vk->FVC.dcv, dptot, VrtMomCov);
+         IERR = afterFitWithIniPar( vk, vk->ader, vk->FVC.dcv, dptot, VrtMomCov, (vk->m_fitterControl).get());
          fittedVrt[0]=vk->refIterV[0]+vk->iniV[0];
          fittedVrt[1]=vk->refIterV[1]+vk->iniV[1];
          fittedVrt[2]=vk->refIterV[2]+vk->iniV[2];
       }
       else{
-         IERR = afterFit( vk, workarray_.ader, vk->FVC.dcv, dptot, VrtMomCov);
+         IERR = afterFit( vk, vk->ader, vk->FVC.dcv, dptot, VrtMomCov, (vk->m_fitterControl).get());
          fittedVrt[0]=vk->refIterV[0]+vk->fitV[0];
          fittedVrt[1]=vk->refIterV[1]+vk->fitV[1];
          fittedVrt[2]=vk->refIterV[2]+vk->fitV[2];
@@ -216,11 +208,12 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
       }
 //
 //  Particle creation and propagation      
-      combinedTrack( Charge, fittedVrt, dptot, VrtMomCov, parV0, covParV0);
+      double localField=myMagFld.getMagFld(fittedVrt,(vk->m_fitterControl).get());
+      combinedTrack( Charge, dptot, VrtMomCov, localField, parV0, covParV0);
       covParV0[0]=fabs(covParV0[0]); covParV0[2]=fabs(covParV0[2]); covParV0[5]=fabs(covParV0[5]);
       covParV0[9]=fabs(covParV0[9]); covParV0[14]=fabs(covParV0[14]);  //VK protection against numerical problems
       myPropagator.Propagate(-999, Charge, parV0, covParV0, fittedVrt, 
-                vk->nextCascadeVrt->refIterV, target_trk->Perig, tmpCov);
+                vk->nextCascadeVrt->refIterV, target_trk->Perig, tmpCov, (vk->m_fitterControl).get());
 //    IERR=cfInv5(tmpCov, target_trk->WgtM);  if (IERR) IERR=cfdinv(tmpCov, target_trk->WgtM, 5);
 //      target_trk->iniP[0]=target_trk->cnstP[0]=target_trk->fitP[0]=target_trk->Perig[2];   //initial guess
 //      target_trk->iniP[1]=target_trk->cnstP[1]=target_trk->fitP[1]=target_trk->Perig[3];
@@ -251,7 +244,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 //
    if( vk->passNearVertex || vk==cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]){
       double dptot[4],VrtMomCov[21];      
-      IERR = afterFit( vk, workarray_.ader, vk->FVC.dcv, dptot, VrtMomCov);
+      IERR = afterFit( vk, vk->ader, vk->FVC.dcv, dptot, VrtMomCov, (vk->m_fitterControl).get());
       if (IERR) return -13;                        /* NONINVERTIBLE COV.MATRIX */
       cfdcopy(    dptot, vk->fitMom, 3);          //save Momentum
       cfdcopy(VrtMomCov, vk->fitCovXYZMom, 21);   //save XYZMom covariance
@@ -276,8 +269,6 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
      countTrk += cascadeEvent_.cascadeVertexList[iv]->TrackList.size();
   }
-  vkalDynamicArrays tmpArrays(countTrk);     // dynamic arrays creation for VTCFIT
-  workarray_.myWorkArrays = &tmpArrays;      // They are automatically removed on exit 
 //============================================================================================
 //
 // First without pointing to get initial estimations and resolve mass constraints
@@ -305,7 +296,7 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 	                    vk->fitMom[0], vk->fitMom[1], vk->fitMom[2] };
           vk->FVC.Charge=getVertexCharge(vk);     
 	  vpderiv(true, vk->FVC.Charge, dparst, vk->fitCovXYZMom, vk->FVC.vrt, vk->FVC.covvrt, 
-	                      vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0);
+	                      vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0, (vk->m_fitterControl).get());
        }
        IERR = fitVertexCascade( vk, 0);     if(IERR)return IERR;   //fit 
        IERR = setVTrackMass(vk);            if(IERR)return IERR;   //mass of combined particle
@@ -373,24 +364,24 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 	                    vk->fitMom[0], vk->fitMom[1], vk->fitMom[2] };
           vk->FVC.Charge=getVertexCharge(vk);
 	  vpderiv(vk->passWithTrkCov, vk->FVC.Charge, dparst, vk->fitCovXYZMom, 
-	     vk->FVC.vrt, vk->FVC.covvrt, vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0);
+	     vk->FVC.vrt, vk->FVC.covvrt, vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0, (vk->m_fitterControl).get());
        }
-       if (forcft_.irob != 0) {robtest(vk, 0);}  // ROBUSTIFICATION new data structure
-       if (forcft_.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
+       if (vk->m_fitterControl->m_forcft.irob != 0) {robtest(vk, 0);}  // ROBUSTIFICATION new data structure
+       if (vk->m_fitterControl->m_forcft.irob != 0) {robtest(vk, 1);}  // ROBUSTIFICATION new data structure
        IERR = fitVertexCascade( vk, 1 );   if(IERR) break;              //with passNear for last vertex in cascade if needed
        IERR = setVTrackMass(vk);           if(IERR) break;               //mass of combined particle
 //
 //Get full constraint matrix and left side for vertex
        cascadeEvent_.matrixPnt[iv]=NStart;
-       NParCur = FullMCNSTfill( vk, workarray_.ader, tmpLSide);
+       NParCur = FullMCNSTfill( vk, vk->ader, tmpLSide);
 //
 //Move them to cascade full matrix and left side
-       copyFullMtx( workarray_.ader, NParCur, NParCur, fullMatrix, NStart, fullNPar); 
+       copyFullMtx( vk->ader, NParCur, NParCur, fullMatrix, NStart, fullNPar); 
 //
 //Copy error matrix for left side vector (measured part T,U1,..,Un - see Billoir)
 //  to correct place in iniCovMatrix matrix. Only at last step and without constraint part!!! CHECK IT!!!
        if(Iter==NFitIterationMax || fullSTOP || badStepCount>=badStepCountMax) 
-       copyFullMtx( workarray_.ader, 3+3*vk->TrackList.size(), NParCur, iniCovMatrix, NStart, fullNPar); 
+       copyFullMtx( vk->ader, 3+3*vk->TrackList.size(), NParCur, iniCovMatrix, NStart, fullNPar); 
 //
 // Fill left part of the system
        for(i=0; i<NParCur; i++) fullLSide[i+NStart] = tmpLSide[i];
@@ -517,7 +508,6 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
   //if(tmpc1)std::cout<<(*tmpc1)<<'\n';
 
   delete[] fullMatrix; delete[] fullLSide; delete[] tmpLSide; delete[] iniCovMatrix;
-  workarray_.myWorkArrays = 0;    //Safety for VTCFIT.  tmpArrays object is removed automatically.
 //-------------------------------- Check constraints status
   cnstRemnants=cascadeCnstRemnants();
 //std::cout<<"fullcnst="<<cnstRemnants<<" lim="<<cnstRemnants/minCnstRemnants<<'\n';
@@ -532,21 +522,22 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
  int processCascadePV( double *primVrt, double *primVrtCov )
 {
     double aermd[6],tmpd[6];  // temporary arrays
-    forcft_.vrt[0] = primVrt[0];
-    forcft_.vrt[1] = primVrt[1];
-    forcft_.vrt[2] = primVrt[2];
-    forcft_.covvrt[0] = primVrtCov[0];
-    forcft_.covvrt[1] = primVrtCov[1];
-    forcft_.covvrt[2] = primVrtCov[2];
-    forcft_.covvrt[3] = primVrtCov[3];
-    forcft_.covvrt[4] = primVrtCov[4];
-    forcft_.covvrt[5] = primVrtCov[5];
     VKVertex * vk = cascadeEvent_.cascadeVertexList[cascadeEvent_.cascadeNV-1]; //Main vertex
 
+    vk->m_fitterControl->m_forcft.vrt[0] = primVrt[0];
+    vk->m_fitterControl->m_forcft.vrt[1] = primVrt[1];
+    vk->m_fitterControl->m_forcft.vrt[2] = primVrt[2];
+    vk->m_fitterControl->m_forcft.covvrt[0] = primVrtCov[0];
+    vk->m_fitterControl->m_forcft.covvrt[1] = primVrtCov[1];
+    vk->m_fitterControl->m_forcft.covvrt[2] = primVrtCov[2];
+    vk->m_fitterControl->m_forcft.covvrt[3] = primVrtCov[3];
+    vk->m_fitterControl->m_forcft.covvrt[4] = primVrtCov[4];
+    vk->m_fitterControl->m_forcft.covvrt[5] = primVrtCov[5];
+
     vk->useApriorVertex = 1;
-    cfdcopy(forcft_.covvrt, tmpd,   6);
+    cfdcopy(vk->m_fitterControl->m_forcft.covvrt, tmpd,   6);
     int IERR=cfdinv(tmpd, aermd, -3); if (IERR) {  IERR = -4; return IERR; }
-    cfdcopy(forcft_.vrt, vk->apriorV,   3);
+    cfdcopy(vk->m_fitterControl->m_forcft.vrt, vk->apriorV,   3);
     cfdcopy(      aermd, vk->apriorVWGT,6);
 
     return processCascade();
@@ -609,7 +600,10 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
 	           +(vk->refV[1]-targetVertex[1])*(vk->refV[1]-targetVertex[1])
                    +(vk->refV[2]-targetVertex[2])*(vk->refV[2]-targetVertex[2]) );
 //std::cout<<"target="<<targetVertex[0]<<", "<<targetVertex[1]<<", "<<targetVertex[2]<<" vsht="<<vShift<<'\n';
-     if(!myPropagator.checkTarget(targetVertex)) { return -16; }       //Vertex is definitely outside working volume
+     bool insideGoodVolume=false;
+     if(vk->m_fitterControl && vk->m_fitterControl->m_objProp) { insideGoodVolume = vk->m_fitterControl->m_objProp->checkTarget(targetVertex);}
+     else                                                      { insideGoodVolume = myPropagator.checkTarget(targetVertex); }
+     if(!insideGoodVolume) { return -16; }       //Vertex is definitely outside working volume
      for(it=0; it<NTRK; it++){
        trk=vk->TrackList[it];
        if(trk->Id < 0){                // pseudo-track from cascade vertex
@@ -618,11 +612,11 @@ int fitVertexCascade( VKVertex * vk, int Pointing)
           trk->fitP[2] =trk->iniP[2]+ Step*(trk->fitP[2]-trk->iniP[2]);
           continue;
        }
-       myPropagator.Propagate(trk, vk->refV,  targetVertex, tmpPer, tmpCov);
+       myPropagator.Propagate(trk, vk->refV,  targetVertex, tmpPer, tmpCov, (vk->m_fitterControl).get());
  //Check!!!And protection if needed.
        double eig5=cfSmallEigenvalue(tmpCov,5 );
        if(eig5<1.e-15 || tmpCov[0]>1.e7) {  //Bad propagation with material. Try without it.
-          myPropagator.Propagate(-999, trk->Charge,trk->refPerig,trk->refCovar, vk->refV, targetVertex, tmpPer, tmpCov);
+          myPropagator.Propagate(-999, trk->Charge,trk->refPerig,trk->refCovar, vk->refV, targetVertex, tmpPer, tmpCov, (vk->m_fitterControl).get());
 	  if(cfSmallEigenvalue(tmpCov,5 )<1.e-15){    //Final protection
 	        tmpCov[1]=0.;tmpCov[3]=0.;tmpCov[6]=0.;tmpCov[10]=0.;
 		             tmpCov[4]=0.;tmpCov[7]=0.;tmpCov[11]=0.;
@@ -750,7 +744,6 @@ void getFittedCascade( std::vector< Vect3DF > & cVertices,
      vrtPos.Y=vk->refIterV[1] + vk->fitV[1];
      vrtPos.Z=vk->refIterV[2] + vk->fitV[2];
      cVertices.push_back(vrtPos);
-     myMagFld.getMagFld(vrtPos.X,vrtPos.Y,vrtPos.Z,vBx,vBy,vBz); vkalvrtbmag.bmag  = vBz; //correct field in vertex
      NTRK = vk->TrackList.size();            // Number of tracks at vertex
      momCollector.clear();
      int DIM=3*(NTRK+1);
@@ -760,8 +753,10 @@ void getFittedCascade( std::vector< Vect3DF > & cVertices,
      DPhys[pntPhys+0][cascadeEvent_.matrixPnt[iv]+0]=1.;
      DPhys[pntPhys+1][cascadeEvent_.matrixPnt[iv]+1]=1.;
      DPhys[pntPhys+2][cascadeEvent_.matrixPnt[iv]+2]=1.;
+     myMagFld.getMagFld(vk->refIterV[0]+vk->fitV[0], vk->refIterV[1]+vk->fitV[1], vk->refIterV[2]+vk->fitV[2],
+                                                      vBx,vBy,vBz,(vk->m_fitterControl).get());
      for(it=0; it<NTRK; it++){
-       std::vector<double> pp = getFitParticleMom( vk->TrackList[it] );
+       std::vector<double> pp = getFitParticleMom( vk->TrackList[it], vBz );
        prtMom.Px=pp[0]; prtMom.Py=pp[1]; prtMom.Pz=pp[2]; prtMom.E=pp[3]; 
        momCollector.push_back( prtMom );
        if(vk->TrackList[it]->Id >= 0) particleChi2.push_back( vk->TrackList[it]->Chi2 ); //Only real tracks
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
index 04f67ceb42726945add8c6408807307258b19dfa..5c4b7a0e220cf42bf65f27bae2ba86f49e1e9977 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CFitCascadeScale.cxx
@@ -10,28 +10,22 @@
 #include <math.h>
 #include <iostream>
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
-#include "TrkVKalVrtCore/ForCFT.h"
 #include "TrkVKalVrtCore/Propagator.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
-#include "TrkVKalVrtCore/WorkArray.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Derivt.h"
 
 
 namespace Trk {
 
 extern vkalPropagator  myPropagator;
-extern WorkArray       workarray_;
-extern DerivT          derivt_;
-extern ForCFT          forcft_;
-extern VKalVrtBMag     vkalvrtbmag;
 extern vkalMagFld      myMagFld;
 extern CascadeEvent    cascadeEvent_;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
-extern long int  vtcfit( VKVertex * vk);
-extern void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, double *paro, double *covo);
-extern int afterFit(VKVertex *, double *, double *, double *, double *);
+extern int  vtcfit( VKVertex * vk);
+extern void  combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *paro, double *covo);
+extern int afterFit(VKVertex *, double *, double *, double *, double *, const VKalVrtControlBase* = 0);
 extern void applyConstraints(VKVertex * vk);
 extern void FullMTXfill(VKVertex * , double * );
 extern  int FullMCNSTfill(VKVertex * , double * , double * );
@@ -40,9 +34,7 @@ extern int getCascadeNPar(int Type=0);
 extern VKTrack * getCombinedVTrack(VKVertex *);
 extern void cleanCascade();
 extern void cfdcopy(double *source, double *target, int);
-extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *);
-extern std::vector<double> getFitParticleMom( VKTrack *);
-
+extern void vpderiv(bool, long int , double *, double *, double *, double *, double *, double *, double *,const VKalVrtControl * =0);
 extern std::vector<double> transformCovar(int , double **, std::vector<double> );
 extern double cfVrtDstSig( VKVertex * , bool );
 extern long int getVertexCharge( VKVertex *);
@@ -77,29 +69,28 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
 //  Fit itself. First get magnetic field at iteration reference point
 //
    distToVertex = 0.;
-   double vBx,vBy,vBz;
-   myMagFld.getMagFld(vk->refIterV[0],vk->refIterV[1],vk->refIterV[2],vBx,vBy,vBz);
-   forcft_.localbmag = vBz; vkalvrtbmag.bmag  = vBz;
-   vkalvrtbmag.bmagz = vBz; vkalvrtbmag.bmagy = vBy; vkalvrtbmag.bmagx = vBx;
+   vk->m_fitterControl->m_forcft.localbmag=myMagFld.getMagFld(vk->refIterV,(vk->m_fitterControl).get());
+
+
 //
 //-------- Then fit
 //
    applyConstraints(vk);                                         //apply all constraints in vertex 
-   long int IERR = vtcfit( vk );
+   int IERR = vtcfit( vk );
    if(IERR) return IERR;
 //
 //
 //    Fill fitted combined track in next vertex (if needed)
 //
    double dptot[4],VrtMomCov[21];      
-   IERR = afterFit( vk, workarray_.ader, vk->FVC.dcv, dptot, VrtMomCov);
+   IERR = afterFit( vk, vk->ader, vk->FVC.dcv, dptot, VrtMomCov, (vk->m_fitterControl).get());
    if (IERR) return -13;                        /* NONINVERTIBLE COV.MATRIX */
    cfdcopy(    dptot, vk->fitMom, 3);          //save Momentum
    cfdcopy(VrtMomCov, vk->fitCovXYZMom, 21);   //save XYZMom covariance
    vk->FVC.Charge=getVertexCharge(vk);     
 //
    if(vk->nextCascadeVrt){
-      FullMTXfill(vk, workarray_.ader);
+      FullMTXfill(vk, vk->ader);
       VKTrack * target_trk = getCombinedVTrack(vk);  // get address of combined track
       if( target_trk == 0 ) return -12;
 
@@ -112,11 +103,12 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
       fittedVrt[2]=vk->refIterV[2]+vk->fitV[2];
 //
 //  Particle creation and propagation      
-      combinedTrack( Charge, fittedVrt, dptot, VrtMomCov, parV0, covParV0);
+      double localField=myMagFld.getMagFld(fittedVrt,(vk->m_fitterControl).get());
+      combinedTrack( Charge, dptot, VrtMomCov, localField, parV0, covParV0);
       covParV0[0]=fabs(covParV0[0]); covParV0[2]=fabs(covParV0[2]); covParV0[5]=fabs(covParV0[5]);
       covParV0[9]=fabs(covParV0[9]); covParV0[14]=fabs(covParV0[14]);  //VK protection against numerical problems
       myPropagator.Propagate(-999, Charge, parV0, covParV0, fittedVrt, 
-                vk->nextCascadeVrt->refIterV, target_trk->Perig, tmpCov);
+                vk->nextCascadeVrt->refIterV, target_trk->Perig, tmpCov, (vk->m_fitterControl).get());
 //std::cout<<"testR,Z="<<target_trk->Perig[0]<<", "<<target_trk->Perig[1]<<'\n';
       distToVertex = sqrt(target_trk->Perig[0]*target_trk->Perig[0]+target_trk->Perig[1]*target_trk->Perig[1]);
       cfdcopy(target_trk->Perig,target_trk->Perig,5);
@@ -156,8 +148,6 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
      countTrk += cascadeEvent_.cascadeVertexList[iv]->TrackList.size();
   }
-  vkalDynamicArrays tmpArrays(countTrk);     // dynamic arrays creation for VTCFIT
-  workarray_.myWorkArrays = &tmpArrays;      // They are automatically removed on exit 
   cascadeEvent_.SCALE=1.;                    // Safety
 //============================================================================================
 //
@@ -201,7 +191,7 @@ int fitVertexCascadeScale( VKVertex * vk, double & distToVertex )
           double dparst[6]={vk->refIterV[0]+vk->iniV[0], vk->refIterV[1]+vk->iniV[1], vk->refIterV[2]+vk->iniV[2],
 	                    vk->fitMom[0], vk->fitMom[1], vk->fitMom[2] };
 	  vpderiv(vk->passWithTrkCov, vk->FVC.Charge, dparst, vk->fitCovXYZMom, vk->FVC.vrt, vk->FVC.covvrt, 
-	                                             vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0);
+	                                             vk->FVC.cvder, vk->FVC.ywgt, vk->FVC.rv0, (vk->m_fitterControl).get());
         }
         IERR = fitVertexCascadeScale( vk, iv_dstToVrt);    if(IERR)return IERR;   //fit 
         IERR = setVTrackMass(vk);                          if(IERR)return IERR;   //mass of combined particle
@@ -244,11 +234,10 @@ std::cout<<"================================================="<<sum_dstToVrt<<'\
   double * tmpLSide   = new double[fullNPar];
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
     cascadeEvent_.matrixPnt[iv]=NStart;
-    NStart  += FullMCNSTfill( vk, workarray_.ader, tmpLSide);
+    NStart  += FullMCNSTfill( vk, vk->ader, tmpLSide);
   }
   delete[] tmpLSide; 
 
-  workarray_.myWorkArrays = 0;    //Safety for VTCFIT.  tmpArrays object is removed automatically.
   return 0;
 }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
index d4a43e14ad4cf21b35ad93b0cc444d5484a4303d..9cf1542bf0289c7209b7908cb75aa9358e9e7b7d 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeDefinition.cxx
@@ -4,21 +4,14 @@
 
 #include <math.h>
 #include <iostream>
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
-#include "TrkVKalVrtCore/Derivt.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
-#include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/WorkArray.h"
+#include "TrkVKalVrtCore/Derivt.h"
 
 namespace Trk {
 
-
 CascadeEvent cascadeEvent_;
 extern vkalMagFld      myMagFld;
-extern VKalVrtBMag     vkalvrtbmag;
-extern WorkArray       workarray_;
-extern DerivT          derivt_;
-extern ForCFT          forcft_;
 
 extern int cfdinv(double *, double *, long int );
 extern int cfInv5(double *cov, double *wgt );
@@ -71,7 +64,7 @@ void addCascadeEntry( VKVertex * vk, std::vector<int> index)
 //  vertexDefinition[iv][it]   - list of real track to vertex associacion
 //  cascadeDefinition[iv][ipv] - for given vertex IV the list of previous vertices pointing to it.
 // 
-int makeCascade(long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
+int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
                    std::vector< std::vector<int> > vertexDefinition,
                    std::vector< std::vector<int> > cascadeDefinition,
 		   double definedCnstAccuracy=1.e-4)
@@ -94,7 +87,7 @@ int makeCascade(long int NTRK, long int *ich, double *wm, double *inp_Trk5, doub
     int vEstimDone=0, nTrkTot=0;
 
     for(iv=0; iv<NV; iv++){ 
-      VRT = new VKVertex(); 
+      VRT = new VKVertex(FitCONTROL); 
       VRT->setRefV(xyz);                               //ref point
       VRT->setRefIterV(xyz);                           //iteration ref. point
       VRT->setIniV(xyz); VRT->setCnstV(xyz);           // initial guess. 0 of course.
@@ -122,7 +115,7 @@ int makeCascade(long int NTRK, long int *ich, double *wm, double *inp_Trk5, doub
       }
       if(NTv>1){   //First estimation of vertex position if vertex has more than 2 tracks
         vEstimDone=1;
-        myMagFld.getMagFld(VRT->refIterV[0],VRT->refIterV[1],VRT->refIterV[2],vBx,vBy,vBz);
+        myMagFld.getMagFld(VRT->refIterV[0],VRT->refIterV[1],VRT->refIterV[2],vBx,vBy,vBz,(VRT->m_fitterControl).get());
         double aVrt[3]={0.,0.,0.};
         for(int i=0; i<NTv-1;i++) for(int j=i+1; j<NTv; j++){
            vkvFastV(&arr[i*5],&arr[j*5],xyz,vBz,out);
@@ -186,10 +179,6 @@ int initCascadeEngine()
   for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
      countTrk += cascadeEvent_.cascadeVertexList[iv]->TrackList.size();
   }
-  vkalDynamicArrays tmpArrays(countTrk);       // dynamic arrays creation for VTCFIT
-  workarray_.myWorkArrays = &tmpArrays;        // They are automatically removed on exit 
-  forcft_.nmcnst = 0;
-  derivt_.ndummy = 0;
 //---------------------Some check-----------
 //  VKMassConstraint * tmpc0=0; VKMassConstraint * tmpc1=0;
 //  if(cascadeEvent_.cascadeVertexList[0]->ConstraintList.size()>0){
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
index 37b4a10d780b8759eb60e64a4fb9e79d47483225..67bde048886bb2a251c8cc9906924d1c2d097cb9 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/CascadeUtils.cxx
@@ -4,7 +4,7 @@
 
 #include <math.h>
 #include <iostream>
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Derivt.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 
@@ -13,10 +13,9 @@ namespace Trk {
 extern CascadeEvent    cascadeEvent_;
 
 extern vkalMagFld      myMagFld;
-extern VKalVrtBMag  vkalvrtbmag;
 
-extern std::vector<double> getFitParticleMom( VKTrack *);
-extern std::vector<double> getIniParticleMom( VKTrack *);
+extern std::vector<double> getIniParticleMom( VKTrack *, VKTrack *);
+extern std::vector<double> getIniParticleMom( VKTrack *, double );
 
 //  Add to system matrix the derivatives due to pseudotrack constraints
 //
@@ -32,7 +31,7 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide)
    std::vector<double> vMagFld; double vBx,vBy,vBz;
    for( iv=0; iv<cascadeEvent_.cascadeNV; iv++){
       vk = cascadeEvent_.cascadeVertexList[iv];
-      myMagFld.getMagFld( vk->refIterV[0]+vk->iniV[0], vk->refIterV[1]+vk->iniV[1], vk->refIterV[2]+vk->iniV[2],vBx,vBy,vBz);
+      myMagFld.getMagFld(vk->refIterV[0]+vk->iniV[0], vk->refIterV[1]+vk->iniV[1], vk->refIterV[2]+vk->iniV[2],vBx,vBy,vBz,(vk->m_fitterControl).get());
       vMagFld.push_back(vBz);  // fill mag.fields for all vertices
    }
 //
@@ -60,21 +59,19 @@ int fixPseudoTrackPt(long int NPar, double * fullMtx, double * LSide)
 //
 // Momentum of pseudo track in next vertex
         for(int ivt=0; ivt<NPar; ivt++)DerivC[ivt]=DerivP[ivt]=DerivT[ivt]=0.;
-        vkalvrtbmag.bmag=vMagFld[ivnext];
         DerivC[posCombTrk+2]=-1.;
         DerivT[posCombTrk+0]=-1.;
         DerivP[posCombTrk+1]=-1.;
-        std::vector<double> ppsum = getIniParticleMom( vk->nextCascadeVrt->TrackList[indCombTrk] ); // INI for pseudo
-	double csum=vk->nextCascadeVrt->TrackList[indCombTrk]->iniP[2];                             // INI for pseudo
+        std::vector<double> ppsum = getIniParticleMom( vk->nextCascadeVrt->TrackList[indCombTrk], vMagFld[ivnext] ); // INI for pseudo
+	double csum=vk->nextCascadeVrt->TrackList[indCombTrk]->iniP[2];                                              // INI for pseudo
         double ptsum=sqrt(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1]);
         double sinth2sum=(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1])/(ppsum[0]*ppsum[0] + ppsum[1]*ppsum[1] + ppsum[2]*ppsum[2]);
         
 //
 // Momenta+Derivatives of tracks in vertex itself
-        vkalvrtbmag.bmag=vMagFld[iv];
 	double tpx,tpy; tpx=tpy=0;
         for(it=0; it<(int)vk->TrackList.size(); it++){
-          std::vector<double> pp =    getIniParticleMom( vk->TrackList[it] );
+          std::vector<double> pp =    getIniParticleMom( vk->TrackList[it], vMagFld[iv]);
 	  double curv=vk->TrackList[it]->iniP[2];
           double pt=sqrt(pp[0]*pp[0] + pp[1]*pp[1]);
           double cth=pp[2]/pt;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
index 329f3ea469cef36fdccdfb877461f9a188094b1e..80a21ea989d3476620ae365915e4f5a28ede3ba3 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc1.cxx
@@ -5,7 +5,7 @@
 #include <math.h> 
 #include "TrkVKalVrtCore/Derivt.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include <iostream>
 
 namespace Trk {
@@ -17,7 +17,7 @@ namespace Trk {
 //      cnstV and cnstP values are used!!!
 //-----------------------------------------------
 
-extern std::vector<double> getCnstParticleMom( VKTrack * );
+extern std::vector<double> getCnstParticleMom( VKTrack *, VKVertex * );
 
 void  calcMassConstraint( VKMassConstraint * cnst )
 {
@@ -32,7 +32,7 @@ void  calcMassConstraint( VKMassConstraint * cnst )
     for( itc=0; itc<usedNTRK; itc++){
       it = cnst->usedParticles[itc];
       trk = vk->TrackList.at(it);
-      pp[itc]=getCnstParticleMom( trk );
+      pp[itc]=getCnstParticleMom( trk , vk);
       ptot[0] += pp[itc][0];    
       ptot[1] += pp[itc][1];    
       ptot[2] += pp[itc][2];    
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
index 9944d5711a0890e3cc9f3c3dbee05548b8b8efdc..a52e75cd0d39008cf95f845eb453f1ff46bf2fa6 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Derclc2.cxx
@@ -6,40 +6,41 @@
 #include "TrkVKalVrtCore/Derivt.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
-
-
-
 //
 //   Pointing constraint calculation in new data model.
 //
 //      cnstV and cnstP values are used!!!
 //-----------------------------------------------
- extern void cfnewp(long int*, double*, double*, double*, double*, double*);
- extern std::vector<double> getCnstParticleMom( VKTrack * );
-
+extern void cfnewp(long int*, double*, double*, double*, double*, double*);
+extern std::vector<double> getCnstParticleMom( VKTrack *, double );
+extern vkalMagFld      myMagFld;
 
 void  calcPointConstraint( VKPointConstraint * cnst )
 {
+    VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
+    VKVertex * vk=cnst->getOriginVertex();
 //
 //  Magnetic field in fitted vertex position
-    double magConst =vkalvrtbmag.bmag  * vkalMagCnvCst;
+    double cnstPos[3];
+    cnstPos[0]=vk->refIterV[0]+vk->cnstV[0];
+    cnstPos[1]=vk->refIterV[1]+vk->cnstV[1];
+    cnstPos[2]=vk->refIterV[2]+vk->cnstV[2];
+    double localField = myMagFld.getMagFld(cnstPos,(vk->m_fitterControl).get());
+    double magConst = localField * vkalMagCnvCst;
 //
 //
     int it,Charge=0;
     double ptot[4]={0.,0.,0.,0.};  
-    VKConstraintBase * base_cnst = (VKConstraintBase*) cnst;
-    VKVertex * vk=cnst->getOriginVertex();
     int NTRK = vk->TrackList.size();
     VKTrack * trk;
     std::vector< std::vector<double> > pp(NTRK);
     for( it=0; it<NTRK; it++){
       trk = vk->TrackList[it];
-      pp[it]=getCnstParticleMom( trk );
+      pp[it]=getCnstParticleMom( trk, localField );
       ptot[0] += pp[it][0];    
       ptot[1] += pp[it][1];    
       ptot[2] += pp[it][2];    
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
index c817f5ba6e97408404fa159ac477e84b6a1adb13..22037527e66d91222b67682a1fbb4b1c3148b8f7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DerclcAng.cxx
@@ -4,7 +4,7 @@
 
 #include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/Derivt.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include <iostream>
 #include <math.h>
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DummyMag.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DummyMag.cxx
index 9ceffc22e6d6fcb2764758d7b3e72d097a499694..0593327f3c1511cfdb3210822a0756a2a974e857 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DummyMag.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/DummyMag.cxx
@@ -5,38 +5,31 @@
 //  Create object vkalMagFld which containg magnetic field.
 //  It accepts external handlers with magnetic field ( function or object)
 //  and takes data from them. If they are absent - default constants 
-//  ATLAS magnetic field (2.084 tesla) is used
+//  ATLAS magnetic field (1.996 tesla) is used
 //
 //   Single object myMagFld of vkalMagFld type is created in CFit.cxx
-//
-//   A structure vkalvrtbmag of type VKalVrtBMag is also created in CFit.cxx
-//  Purpose is keep magnetic field at point of linearisation of vertex fit.
-//  It stays constant during one iteration and after fit convergence
-//   (contrary to myMagFld which changes during any propagation)
 //-------------------------------------------------------------------------
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/CommonPars.h"
 #include <iostream>
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
-
-vkalMagFld::vkalMagFld() {
-   m_cnstBMAG=1.996;                    /* Const mag. field in Tesla */
-   m_functionHandler=0;
-   m_objectHandler=0;
+vkalMagFld::vkalMagFld():
+   m_cnstBMAG(1.997),                  /* Const mag. field in Tesla */
+   m_vkalCnvMagFld(vkalMagCnvCst),     /* Conversion constant is defined in CommonPars.h */
+   m_mm(1.)
+{
 
 //   vkalCnvMagFld = 0.0029979246;   /* For GeV and cm and Tesla*/
-   m_vkalCnvMagFld = 0.29979246;       /* For MeV and mm and Tesla*/
-
-   vkalvrtbmag.bmag=1.996;            /* Initial mag. mield in Tesla */
+//   m_vkalCnvMagFld = 0.29979246;   /* For MeV and mm and Tesla*/
    m_saveXpos=-10000000000.;
    m_saveYpos=-20000000000.;
    m_saveZpos=-30000000000.;
    m_saveBX=0.;
    m_saveBY=0.;
    m_saveBZ=0.;
-   m_mm=1.;
 }
 
 vkalMagFld::~vkalMagFld() {}
@@ -45,35 +38,39 @@ vkalMagFld::~vkalMagFld() {}
 baseMagFld::baseMagFld() {}
 baseMagFld::~baseMagFld() {}
 
-void vkalMagFld::setMagHandler(addrMagHandler addr) {
-   m_functionHandler=addr;
-   m_objectHandler=0;
-}
-
-void vkalMagFld::setMagHandler(baseMagFld* addr) {
-   m_objectHandler=addr;
-   m_functionHandler=0;
-}
-
-
 void vkalMagFld::getMagFld(const double X,const double Y,const double Z,
-                           double& bx, double& by, double& bz)
+                           double& bx, double& by, double& bz, const VKalVrtControlBase* FitControl=0 ) const
 {
-     if ( m_functionHandler == 0 && m_objectHandler==0 ){
-        bx=0.;
-        by=0.;
+     bx=by=0.;
+     if ( FitControl==0  || (FitControl->m_funcMagFld == 0 && FitControl->m_objMagFld==0) ){
         bz=m_cnstBMAG;
+        return;
      }
-     if ( m_functionHandler != 0){
-        m_functionHandler(X,Y,Z,bx,by,bz);
-     }else if ( m_objectHandler   != 0) {
-        m_objectHandler->getMagFld(X,Y,Z,bx,by,bz);
+     if ( FitControl->m_funcMagFld ){
+        FitControl->m_funcMagFld(X,Y,Z,bx,by,bz);
+     }else if ( FitControl->m_objMagFld ) {
+        FitControl->m_objMagFld->getMagFld(X,Y,Z,bx,by,bz);
      }
 //   std::cout<<" Mag.field"<<bx<<", "<<by<<", "<<bz<<" Shift="<<Shift<<
 //                   " obj="<<m_objectHandler<<" func="<<m_functionHandler<<'\n';
 }
 
-double vkalMagFld::getCnvCst() {
+double vkalMagFld::getMagFld(const double xyz[3], const VKalVrtControlBase* FitControl=0 ) const
+{
+     double bx=0., by=0., bz=0.;
+     if (  FitControl==0  || (FitControl->m_funcMagFld == 0 && FitControl->m_objMagFld==0) ){
+       bz=m_cnstBMAG;
+       return bz;
+     }
+     if ( FitControl->m_funcMagFld ){
+        FitControl->m_funcMagFld(xyz[0],xyz[1],xyz[2],bx,by,bz);
+     }else if ( FitControl->m_objMagFld ) {
+        FitControl->m_objMagFld->getMagFld(xyz[0],xyz[1],xyz[2],bx,by,bz);
+     }
+     return bz;
+}
+
+double vkalMagFld::getCnvCst() const {
    return this->m_vkalCnvMagFld;
 }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/FullMtx.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/FullMtx.cxx
index d20c22d1f1704592ca51d07709b11d3541aa95e3..28a690b05a465c89f28c87ace3b7d93a18bf3da7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/FullMtx.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/FullMtx.cxx
@@ -3,7 +3,7 @@
 */
 
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Derivt.h"
 
 namespace Trk {
@@ -14,7 +14,7 @@ namespace Trk {
 /* Author: V.Kostyukhin                                */
 /* --------------------------------------------------- */
 
-#define ader_ref(a_1,a_2) ader[(a_2)*(NTrkM*3+3) + a_1]
+#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + a_1]
 
 void FullMTXfill(VKVertex * vk, double * ader)
 {
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
index 6ee9132fbaf66885f0bf09df23cf1db9616ece16..63daf452669e84bc6e58daba16387b54f96568c0 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/PrCFit.cxx
@@ -9,9 +9,7 @@
 
 namespace Trk {
 
-extern ForCFT      forcft_;
-
-#define forcft_1 forcft_
+ForCFT      forcft_1;
 
 /*------------------------------------------------------------------------------*/
 /* Package for vertex fit with constraints 					*/
@@ -48,7 +46,6 @@ void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double
     long int i__1;
     double   summ;
 
-#define indtrkmc_ref(a_1,a_2) forcft_1.indtrkmc[(a_2)*NTrkM + (a_1) - (NTrkM+1)]
 
 /*------------------------------------------------------------------------------*/
 /*        SETTING OF INITIAL PARAMETERS FOR C-FIT 				*/
@@ -83,7 +80,7 @@ void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double
     forcft_1.nmcnst = 0;
     for (int i=0; i<8; ++i) forcft_1.wmfit[i] = -10000.;
     summ = 0.;
-    i__1 = (*ntrk)<NTrkM ? (*ntrk): NTrkM;
+    i__1 = (*ntrk)<vkalNTrkM ? (*ntrk): vkalNTrkM;
     for (int i=0; i<i__1; ++i) {
 	forcft_1.wm[i] =  fabs(wm[i]);
 	summ += wm[i];
@@ -91,9 +88,9 @@ void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double
     if ((*wmfit) > summ) {
 /*  Set general mass constraint based on ALL tracks */
 	forcft_1.nmcnst = 1;
-	for (int i = 1; i <= NTrkM; ++i) {
-	    indtrkmc_ref(i, forcft_1.nmcnst) = 0;
-	    if (i <= (*ntrk)) {indtrkmc_ref(i, 1) = 1;}
+	for (int i = 0; i < vkalNTrkM; ++i) {
+	    forcft_1.indtrkmc[0][i] = 0;
+	    if (i < (*ntrk)) {forcft_1.indtrkmc[0][i] = 1;}
 	}
 	forcft_1.wmfit[0] = (*wmfit);
     }
@@ -110,7 +107,7 @@ void prcfit( long int *ntrk, double  *wm, double  *wmfit, double  *bmag, double
     forcft_1.irob = 0;
     forcft_1.IterationNumber    = 50;
     forcft_1.IterationPrecision = 1.e-3;
-    for (int i = 0; i < NTrkM; ++i) forcft_1.robres[i]=1.; //Safety
+    for (int i = 0; i < vkalNTrkM; ++i) forcft_1.robres[i]=1.; //Safety
 //
 // Reset all constraints
 //
@@ -172,16 +169,15 @@ void setmasscnst_(long int *ncnsttrk, long int *indextrk, double  *wmcnst)
 
     ++forcft_1.nmcnst;
     if (forcft_1.nmcnst > 8) return ;
-    for (int i = 1; i <= NTrkM; ++i) {
-	indtrkmc_ref(i, forcft_1.nmcnst) = 0;
+    for (int i = 0; i < vkalNTrkM; ++i) {
+	forcft_1.indtrkmc[forcft_1.nmcnst-1][i] = 0;
     }
-    for (int i = 1; i <= (*ncnsttrk);  ++i) {
-	if (indextrk[i] > 0 && indextrk[i] <= NTrkM) {
-	    indtrkmc_ref(indextrk[i], forcft_1.nmcnst) = 1;
+    for (int i = 0; i < (*ncnsttrk);  ++i) {
+	if (indextrk[i] > 0 && indextrk[i] < vkalNTrkM) {
+	    forcft_1.indtrkmc[forcft_1.nmcnst-1][indextrk[i]] = 1;
 	}
     }
     forcft_1.wmfit[forcft_1.nmcnst - 1] = (*wmcnst);
  }
-#undef indtrkmc_ref
 
 } /* End of namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
index f75f27dc9b07b5bb1afd5de8708ba7d0ece5067e..5936b4c6f0f686f11948e5fff728e2c56a429824 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Propagate.cxx
@@ -8,7 +8,7 @@
 //  Single myPropagator object of vkalPropagator type is created in CFit.cxx
 //------------------------------------------------------------------------
 // Header include
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Propagator.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include <math.h>
@@ -22,7 +22,7 @@ extern vkalMagFld      myMagFld;
 
 extern void cfnewp(long int*, double*, double*, double*, double*, double*);
 extern void cferpr(long int*, double*, double*, double*, double*, double*);
-extern void cfnewpm (double*, double*, double*, double*, double*, double*);
+extern void cfnewpm (double*, double*, double*, double*, double*, double*, const VKalVrtControlBase * =0);
 
 //------------------------------------------------------------------------
 //  Old propagator functions:
@@ -51,7 +51,7 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
 //
    void PropagateSTD(long int, long int Charge, 
                      double *ParOld, double *CovOld, double *RefStart,
-                     double *RefEnd, double *ParNew, double *CovNew) 
+                     double *RefEnd, double *ParNew, double *CovNew, const VKalVrtControlBase * CONTROL) 
    {
       double Way,closePoint[3],Goal[3];
       Goal[0]=RefEnd[0]-RefStart[0];
@@ -61,8 +61,8 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
       if(CovOld != 0) cferpr( &Charge, ParOld, &Goal[0], &Way, CovOld, CovNew);
       if(Charge==0){                      // Correction for different magnetic field values in Ini and End
         double vBx,vBy,vBz,vBzn;
-        myMagFld.getMagFld(RefStart[0],RefStart[1],RefStart[2],vBx,vBy,vBz);
-        myMagFld.getMagFld(RefEnd[0],RefEnd[1],RefEnd[2],vBx,vBy,vBzn);
+        myMagFld.getMagFld(RefStart[0],RefStart[1],RefStart[2],vBx,vBy,vBz,CONTROL);
+        myMagFld.getMagFld(RefEnd[0],RefEnd[1],RefEnd[2],vBx,vBy,vBzn,CONTROL);
         double Corr = vBzn/vBz;
         ParNew[4]  *= Corr;
         if(CovOld != 0){
@@ -80,7 +80,7 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
 //   Runge-Kutta propagator in nonuniform field
 //
    void PropagateRKM(long int Charge, double *ParOld, double *CovOld, double *RefStart, 
-                                      double *RefEnd, double *ParNew, double *CovNew)
+                                      double *RefEnd, double *ParNew, double *CovNew, const VKalVrtControlBase * CONTROL)
    {
       double Way;
       double closePoint[3],Goal[3];
@@ -93,7 +93,7 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
 // double Save[5];  if(Way > 100){for (int ii=0; ii<5;ii++) Save[ii]=ParNew[ii];}
 // double Save[4];  if(Way > 10.){for (int ii=0; ii<3;ii++) Save[ii]=closePoint[ii];Save[3]=ParNew[0];}
  
-      if ( Charge != 0) cfnewpm( ParOld, RefStart, RefEnd, &Way, ParNew, closePoint);
+      if ( Charge != 0) cfnewpm( ParOld, RefStart, RefEnd, &Way, ParNew, closePoint, CONTROL);
 
 //if(Way > 10){
 //  if(fabs(ParNew[3]- Save[3])>0.5 ) std::cout<<" ERROR ="<<ParNew[3]<<", "<<Save[3]<<",Way="<<Way<<'\n';
@@ -113,8 +113,8 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
 //}
       if(Charge==0){                      // Correction for different magnetic field values in Ini and End
         double vBx,vBy,vBz,vBzn;
-        myMagFld.getMagFld(RefStart[0],RefStart[1],RefStart[2],vBx,vBy,vBz);
-        myMagFld.getMagFld(RefEnd[0],RefEnd[1],RefEnd[2],vBx,vBy,vBzn);
+        myMagFld.getMagFld(RefStart[0],RefStart[1],RefStart[2],vBx,vBy,vBz,CONTROL);
+        myMagFld.getMagFld(RefEnd[0],RefEnd[1],RefEnd[2],vBx,vBy,vBzn,CONTROL);
         double Corr = vBzn/vBz;
         ParNew[4]  *= Corr;
         if(CovOld != 0){
@@ -130,108 +130,96 @@ extern void cfnewpm (double*, double*, double*, double*, double*, double*);
 //----------------------------------------------------------------------------------------
 //                         Propagator object 
 //
-   vkalPropagator::vkalPropagator() 
-   {
-      m_functionProp  = Trk::PropagateSTD;
-      m_typePropagator = 0;
-      m_objectProp = 0;
-   }
+   vkalPropagator::vkalPropagator(){}
    vkalPropagator::~vkalPropagator() {}
 
    basePropagator::basePropagator() {}
    basePropagator::~basePropagator() {}
 
-   void vkalPropagator::setTypeProp(int Type){
-     m_typePropagator = Type;
-     if(m_typePropagator < 0) m_typePropagator=0;
-     if(m_typePropagator > 3) m_typePropagator=0;
-   }
-
-   void vkalPropagator::setPropagator(addrPropagator newProp) 
-   {
-      m_functionProp = newProp;
-      m_objectProp = 0;
-      m_typePropagator = 2;
-   }
-   
-   void vkalPropagator::setPropagator(basePropagator* newProp) 
-   {
-      m_functionProp = 0;
-      m_objectProp = newProp;
-      m_typePropagator = 3;
-   }
 
-   bool vkalPropagator::checkTarget(double *RefNew) const 
+   bool vkalPropagator::checkTarget(double *) const 
    {
-      if ( m_typePropagator == 0 ) return  true;
-      if ( m_typePropagator == 1 ) return  true;
-      if ( m_typePropagator == 2 ) return  true;     
-      if ( m_typePropagator == 3 ) return m_objectProp->checkTarget(RefNew);
+      //if ( m_typePropagator == 3 ) return m_objectProp->checkTarget(RefNew);
       return  true;
    }
  
-   void vkalPropagator::Propagate(long int TrkID, long int Charge, 
-                                  double *ParOld, double *CovOld, double *RefOld, 
-                                  double *RefNew, double *ParNew, double *CovNew) const
+   void vkalPropagator::Propagate(long int TrkID, long int Charge, double *ParOld, double *CovOld, double *RefOld, 
+                                  double *RefNew, double *ParNew, double *CovNew, const VKalVrtControlBase * FitControl) const
    {
-//std::cout<<" VKal PROP="<<typePropagator<<", "<<Charge<<'\n';
      if( RefOld[0]==RefNew[0] && RefOld[1]==RefNew[1] && RefOld[2]==RefNew[2]){
        for (int i=0; i<5;  i++) ParNew[i]=ParOld[i];
        if(CovOld != 0) { for (int i=0; i<15; i++) CovNew[i]=CovOld[i];}
        return;
      }
-     if ( m_typePropagator == 0 ) Trk::PropagateSTD( TrkID, Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);
-     if ( m_typePropagator == 1 ) Trk::PropagateRKM( Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);
-     if ( m_typePropagator == 2 ) m_functionProp( TrkID, Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);     
-     if ( m_typePropagator == 3 ) {
+//
+//-- Propagation itself
+//
+     if( FitControl==0 || (FitControl->m_objProp==0 && FitControl->m_funcProp==0) ){   // No external propagators, use internal ones
+       if(vkalUseRKMPropagator){ Trk::PropagateRKM( Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew, FitControl); }
+       else                    { Trk::PropagateSTD( TrkID,Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew, FitControl); }
+       return;
+     }
+
+     if (FitControl->m_objProp){
 	if( Charge == 0 ) {
-	  Trk::PropagateSTD( TrkID,Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);
+	  Trk::PropagateSTD( TrkID,Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew, FitControl);
 	}else{
-//std::cout<<"Propagation dist="<<RefOld[0]<<" - "<<RefNew[0]<<'\n';
-//Trk::PropagateRKM( Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);// Test
-//std::cout<<" RKM ="<<ParNew[0]<<", "<<ParNew[1]<<", "<<ParNew[2]<<", "<<ParNew[3]<<", "<<ParNew[4]<<'\n';
-//std::cout<<" ATLrefn="<<RefNew[0]<<", "<<RefNew[1]<<", "<<RefNew[2]<<'\n';
-          m_objectProp->Propagate( TrkID, Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);     
-//std::cout<<" ATLpar ="<<ParNew[0]<<", "<<ParNew[1]<<", "<<ParNew[2]<<", "<<ParNew[3]<<", "<<ParNew[4]<<'\n';
-                   // Protection against propagation fail
+          FitControl->m_objProp->Propagate( TrkID, Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);     
 	  if( ParNew[0]==0. && ParNew[1]==0. && ParNew[2]==0. && ParNew[3]==0. && ParNew[4]==0.){
-            Trk::PropagateRKM( Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);
+            Trk::PropagateRKM( Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew, FitControl);
 	  }
-        }
+       }
+       return;
      }
-//std::cout<<" refn="<<RefNew[0]<<", "<<RefNew[1]<<", "<<RefNew[2]<<", "<<typePropagator <<'\n';
-//std::cout<<" refo="<<RefOld[0]<<", "<<RefOld[1]<<", "<<RefOld[2]<<'\n';
-//std::cout<<" prob="<<ParOld[0]<<", "<<ParOld[1]<<", "<<ParOld[2]<<", "<<ParOld[3]<<", "<<ParOld[4]<<'\n';
-//std::cout<<" prop="<<ParNew[0]<<", "<<ParNew[1]<<", "<<ParNew[2]<<", "<<ParNew[3]<<", "<<ParNew[4]<<'\n';
+     //-------------------
+     if (FitControl->m_funcProp){
+       FitControl->m_funcProp( TrkID, Charge, ParOld, CovOld, RefOld, RefNew, ParNew, CovNew);     
+       return;
+     }
+     //-------------------
      return;
    }
 
-   void vkalPropagator::Propagate( VKTrack * trk, double *RefOld, double *RefNew,
-                                   double *ParNew, double *CovNew) const
+
+   void vkalPropagator::Propagate( VKTrack * trk, double *RefOld, double *RefNew, double *ParNew, double *CovNew,
+                      const VKalVrtControlBase * FitControl) const
    {
      if( RefOld[0]==RefNew[0] && RefOld[1]==RefNew[1] && RefOld[2]==RefNew[2]){
        for (int i=0; i<5;  i++) ParNew[i]=trk->refPerig[i];
        for (int i=0; i<15; i++) CovNew[i]=trk->refCovar[i];
        return;
      }
-     long int TrkID = trk->Id; long int Charge = trk->Charge;
-     if ( m_typePropagator == 0 ) Trk::PropagateSTD( TrkID, Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);
-     if ( m_typePropagator == 1 ) Trk::PropagateRKM(        Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);
-     if ( m_typePropagator == 2 ) m_functionProp(      TrkID, Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);     
-     if ( m_typePropagator == 3 ) {
+     long int TrkID = trk->Id;
+     long int Charge = trk->Charge;
+//
+//-- Propagation itself
+//
+     if( FitControl==0 || (FitControl->m_objProp==0 && FitControl->m_funcProp==0) ){   // No external propagators, use internal ones
+       if(vkalUseRKMPropagator){ Trk::PropagateRKM(       Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew, FitControl); }
+       else                    { Trk::PropagateSTD( TrkID,Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew, FitControl); }
+       return;
+     }
+
+     if (FitControl->m_objProp){
 	if( Charge == 0 ) {
-	  Trk::PropagateSTD( TrkID,Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);
+	  Trk::PropagateSTD( TrkID,Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew, FitControl);
 	}else{
-          m_objectProp->Propagate( TrkID, Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);     
+          FitControl->m_objProp->Propagate( TrkID, Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);     
 	  if( ParNew[0]==0. && ParNew[1]==0. && ParNew[2]==0. && ParNew[3]==0. && ParNew[4]==0.){
-            Trk::PropagateRKM( Charge,trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);
+            Trk::PropagateRKM( Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew, FitControl);
 	  }
-        }
-     }
+       }
 //std::cout<<" refn="<<RefNew[0]<<", "<<RefNew[1]<<", "<<RefNew[2]<<", "<<typePropagator <<'\n';
 //std::cout<<" refo="<<RefOld[0]<<", "<<RefOld[1]<<", "<<RefOld[2]<<'\n';
 //std::cout<<" prob="<<trk->refPerig[0]<<", "<<trk->refPerig[1]<<", "<<trk->refPerig[2]<<", "<<trk->refPerig[3]<<", "<<trk->refPerig[4]<<'\n';
 //std::cout<<" prop="<<ParNew[0]<<", "<<ParNew[1]<<", "<<ParNew[2]<<", "<<ParNew[3]<<", "<<ParNew[4]<<'\n';
+       return;
+     }
+     //-------------------
+     if (FitControl->m_funcProp){
+       FitControl->m_funcProp( TrkID, Charge, trk->refPerig, trk->refCovar, RefOld, RefNew, ParNew, CovNew);     
+       return;
+     }
      return;
    }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
index 66bd5937fd5abe2471663fbe0feee91c41530034..720d99b71fcf23ce8ada130d785e9742ee17f468 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/RobTest.cxx
@@ -3,16 +3,12 @@
 */
 
 #include <math.h>
-#include "TrkVKalVrtCore/WorkArray.h"
-#include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include <iostream>
 #include <vector>
 
 namespace Trk {
 
-extern WorkArray workarray_;
-extern ForCFT forcft_;
 
 //extern void digx(double*, double*, double*, long int , long int );
  
@@ -40,8 +36,8 @@ void robtest(VKVertex * vk, long int ifl)
 
     int NTRK = vk->TrackList.size();
 
-    long int irob = forcft_.irob;
-    double    Scl = forcft_.RobustScale;  //Tuning constant
+    long int irob = vk->m_fitterControl->m_forcft.irob;
+    double    Scl = vk->m_fitterControl->m_forcft.RobustScale;  //Tuning constant
     double    C;                          // Breakdown constant
 
     if ( ifl == 0) {                               /* FILLING OF EIGENVALUES AND VECTORS */
@@ -119,8 +115,8 @@ void robtest(VKVertex * vk, long int ifl)
 		kk++;
 	    }
 	}
-	forcft_.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4];
-	if(forcft_.robres[it]>1.)forcft_.robres[it]=1.;
+	vk->m_fitterControl->m_forcft.robres[it] = roba[0] * roba[1] * roba[2] * roba[3] * roba[4];
+	if(vk->m_fitterControl->m_forcft.robres[it]>1.)vk->m_fitterControl->m_forcft.robres[it]=1.;
     }
 //std::cout<<" Fin="<<vk->TrackList[0]->WgtM[0]<<", "<<vk->TrackList[0]->WgtM[1]<<", "<<vk->TrackList[0]->WgtM[2]
 //            <<", "<<vk->TrackList[0]->WgtM[3]<<", "<<vk->TrackList[0]->WgtM[4]<<", "<<vk->TrackList[0]->WgtM[5]
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
index ec05c539ee5c4bb373f58f3bdf439d916d9aa2a9..d6d07c0429ca4ec6db28f3981d3b10b8bf54983a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/TrkVKalVrtCoreBase.cxx
@@ -2,14 +2,42 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#include <math.h> 
+#include <math.h>
+#include <algorithm>
 #include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Derivt.h"
-#include <iostream>
 
 namespace Trk {
 
+  VKalVrtControlBase::VKalVrtControlBase(const baseMagFld* baseFld,   const addrMagHandler addrFld, 
+                                     const basePropagator* baseP, const addrPropagator addrP): 
+       m_objMagFld(baseFld),
+       m_funcMagFld(addrFld),
+       m_objProp(baseP), 
+       m_funcProp(addrP){}
+
+  VKalVrtControlBase::~VKalVrtControlBase(){}
+
+  VKalVrtControlBase::VKalVrtControlBase(const VKalVrtControlBase & src ): 
+       m_objMagFld(src.m_objMagFld),
+       m_funcMagFld(src.m_funcMagFld),
+       m_objProp(src.m_objProp), 
+       m_funcProp(src.m_funcProp){}
+
+  VKalVrtControl::VKalVrtControl(const VKalVrtControlBase & base): VKalVrtControlBase(base) { 
+    m_fullCovariance=0;
+    m_vrtMassTot=-1.;
+    m_vrtMassError=-1.;
+  }
+  VKalVrtControl::VKalVrtControl(const VKalVrtControl & src) : VKalVrtControlBase(src) { 
+    m_fullCovariance=0; 
+    m_forcft=src.m_forcft;
+    m_vrtMassTot=src.m_vrtMassTot;
+    m_vrtMassError=src.m_vrtMassError;
+  }
+  VKalVrtControl::~VKalVrtControl()  { if(m_fullCovariance) delete[] m_fullCovariance; }
 
 
   VKTrack::VKTrack(long int iniId, double Perigee[], double Covariance[], VKVertex * vk, double m):
@@ -72,7 +100,11 @@ namespace Trk {
 
 
 
-  VKVertex::VKVertex(){ 
+  VKVertex::VKVertex(const VKalVrtControl & FitControl): VKVertex() 
+  {    m_fitterControl = std::unique_ptr<VKalVrtControl>(new VKalVrtControl(FitControl));  }
+
+  VKVertex::VKVertex()
+  { 
      useApriorVertex=0;  //no apriori vertex position used
      passNearVertex=false;   //no "pass near" constraint used
      passWithTrkCov=false;   //no trk covariance for this constraint
@@ -84,7 +116,10 @@ namespace Trk {
      fitCovXYZMom[0]=savedVrtMomCov[0]=100.; fitCovXYZMom[2] =savedVrtMomCov[2] =100.; fitCovXYZMom[5] =savedVrtMomCov[5] =100.;
      fitCovXYZMom[9]=savedVrtMomCov[9]=100.; fitCovXYZMom[14]=savedVrtMomCov[14]=100.; fitCovXYZMom[20]=savedVrtMomCov[20]=100.;
      Chi2=0.;
+     existFullCov=0;
+     std::fill(ader,ader+(3*vkalNTrkM+3)*(3*vkalNTrkM+3),0);
   }
+
   VKVertex::~VKVertex()
   {  
        for( int i=0; i<(int)TrackList.size(); i++) delete TrackList[i];
@@ -100,6 +135,7 @@ namespace Trk {
 
 
   VKVertex::VKVertex(const VKVertex & src):        //copy constructor
+  m_fitterControl(new VKalVrtControl(*src.m_fitterControl)),
   Chi2(src.Chi2),                         // vertex Chi2
   useApriorVertex(src.useApriorVertex),   //for a priory vertex position knowledge usage
   passNearVertex(src.passNearVertex),     // needed for "passing near vertex" constraint
@@ -123,6 +159,8 @@ namespace Trk {
        fitCovXYZMom[i]=src.fitCovXYZMom[i];
     }
     nextCascadeVrt = 0;
+    existFullCov = src.existFullCov;
+    std::copy(src.ader,src.ader+(3*vkalNTrkM+3)*(3*vkalNTrkM+3),ader);
     //----- Creation of track copies
     for( int i=0; i<(int)src.TrackList.size(); i++) TrackList.push_back( new VKTrack(*(src.TrackList[i])) );
   }
@@ -130,6 +168,8 @@ namespace Trk {
   VKVertex& VKVertex::operator= (const VKVertex & src)        //Assignment operator
   {
     if (this!=&src){
+      m_fitterControl.reset();
+      m_fitterControl=std::unique_ptr<VKalVrtControl>(new VKalVrtControl(*(src.m_fitterControl)));
       Chi2=src.Chi2;                         // vertex Chi2
       useApriorVertex=src.useApriorVertex;    //for a priory vertex position knowledge usage
       passNearVertex=src.passNearVertex;      // needed for "passing near vertex" constraint
@@ -152,6 +192,8 @@ namespace Trk {
         fitCovXYZMom[i]=src.fitCovXYZMom[i];
       }
       nextCascadeVrt = 0;
+      existFullCov = src.existFullCov;
+      std::copy(src.ader,src.ader+(3*vkalNTrkM+3)*(3*vkalNTrkM+3),ader);
     //----- Creation of track copies
       TrackList.clear();
       tmpArr.clear();
@@ -165,5 +207,63 @@ namespace Trk {
   TWRK::TWRK(){}
   TWRK::~TWRK(){}
 
+  void VKalVrtControl::setIterationNum(int Iter)
+  {
+    if (Iter<3)   Iter=3;
+    if (Iter>100) Iter=100;
+    m_forcft.IterationNumber    = Iter;
+  }
+
+  void VKalVrtControl::setIterationPrec(double Prec)
+  {
+    if (Prec<1.e-5)   Prec=1.e-5;
+    if (Prec>1.e-1)   Prec=1.e-1;
+    m_forcft.IterationPrecision = Prec;
+  }
+
+  void VKalVrtControl::setRobustScale(double Scale)
+  {
+    if (Scale<0.01)   Scale=0.01;
+    if (Scale>100.)   Scale=100.;
+    m_forcft.RobustScale = Scale;
+  }
+
+  void VKalVrtControl::setRobustness(int Rob)
+  {
+    if (Rob<0)   Rob=0;
+    if (Rob>7)   Rob=7;
+    m_forcft.irob = Rob;
+  }
+  void VKalVrtControl::setMassCnstData(int Ntrk, double Mass){     // Define global mass constraint. It must be first
+    double sumM(0.);
+    for(int it=0; it<Ntrk; it++) sumM +=   m_forcft.wm[it];                        //sum of particle masses
+    if(sumM<Mass) {
+      m_forcft.wmfit[0]=Mass;
+      for(int it=0; it<Ntrk; it++) m_forcft.indtrkmc[0][it]=1;                     //Set participating particles
+      m_forcft.nmcnst=1;
+    }
+    m_forcft.useMassCnst = 1;
+  }
+  void VKalVrtControl::setMassCnstData(int Ntrk, std::vector<int> Index, double Mass){
+    double sumM(0.);
+    for(int it=0; it<Ntrk; it++) sumM +=   m_forcft.wm[Index[it]];                 //sum of particle masses
+    if(sumM<Mass) {
+      m_forcft.wmfit[0]=Mass;
+      for(int it=0; it<Ntrk; it++) m_forcft.indtrkmc[m_forcft.nmcnst][Index[it]]=1;  //Set participating particles
+      m_forcft.nmcnst++;
+    }
+    m_forcft.useMassCnst = 1;
+  }
+
+  void VKalVrtControl::setUsePhiCnst()   { m_forcft.usePhiCnst = 1;}
+  void VKalVrtControl::setUsePlaneCnst(double a, double b, double c, double d)   { 
+    if(a+b+c+d == 0.){  m_forcft.usePlaneCnst = 0;
+    }else{              m_forcft.usePlaneCnst = 1; }
+    m_forcft.Ap = a; m_forcft.Bp = b; m_forcft.Cp = c; m_forcft.Dp = d;
+  }
+  void VKalVrtControl::setUseThetaCnst() { m_forcft.useThetaCnst = 1;}
+  void VKalVrtControl::setUseAprioriVrt(){ m_forcft.useAprioriVrt = 1;}
+  void VKalVrtControl::setUsePointingCnst(int iType = 1 ) { m_forcft.usePointingCnst = iType<2 ? 1 : 2 ;}
+  void VKalVrtControl::setUsePassNear(int iType = 1 ) { m_forcft.usePassNear = iType<2 ? 1 : 2 ;}
 
 } /* End of namespace */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx
index bb17bf9b5721ff062eae7ce7abeeefa51f37a30e..fcd346ff305fc1c2629b327f9ce579d4b10c2b26 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/Utilities.cxx
@@ -5,7 +5,7 @@
 #include <math.h>
 #include <algorithm>
 #include <iostream>
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 namespace Trk {
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
index 39b819fe2c3773f87220a98f42c7248b23b00a30..4ead07e704f3ba771f5f521b15bd547afcbc8ce5 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VKgrkuta.cxx
@@ -3,14 +3,16 @@
 */
 
 #include <math.h>
-#include "TrkVKalVrtCore/VKalVrtBMag.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/VKalVrtBMag.h"
+#include "TrkVKalVrtCore/CommonPars.h"
 #include <iostream>
 
 namespace Trk {
 
 extern vkalMagFld  myMagFld;
 
-void vkgrkuta_(double *charge, double *step, double *vect, double *vout)
+void vkgrkuta_(double *charge, double *step, double *vect, double *vout, const VKalVrtControlBase* CONTROL)
 {
     double equiv_2[3], equiv_5[3];
     long int iter, ncut, j;
@@ -59,8 +61,7 @@ void vkgrkuta_(double *charge, double *step, double *vect, double *vout)
     iter = 0;
     ncut = 0;
     for (j = 1; j <= 7; ++j) {vout[j] = vect[j];}
-//    pinv = (*charge) * 2.9979251e-4 / vect[7];    // Old definition
-    pinv = (*charge) * 2.9979251e-2 / vect[7];      // New for MM, MEV/C and KGAUSS 
+    pinv = (*charge) * 2.9979251e-2 / vect[7];      // New for MM, MEV/C and KGAUSS
     tl = 0.;
     hst = *step;
 
@@ -70,12 +71,10 @@ L20:
     rest = *step - tl;
     if (fabs(hst) > fabs(rest)) hst = rest;
 /* *****      CALL GUFLD(VOUT,F) */
-//VK    vkmagfld_(&vout[1], &vout[2], &vout[3], &fx, &fy, &fz);
-    myMagFld.getMagFld( vout[1], vout[2], vout[3], fx, fy, fz);
-    f[0] = fx*10.;
+    myMagFld.getMagFld( vout[1], vout[2], vout[3], fx, fy, fz, CONTROL);
+    f[0] = fx*10.;   //VK Convert returned field in Tesla into kGauss for old code
     f[1] = fy*10.;
     f[2] = fz*10.;
-//std::cout <<" Now in grkuta="<<fx<<", "<<fy<<", "<<fz<<'\n';
 
 /*  Start of integration */
 
@@ -109,9 +108,8 @@ L20:
     
     
 /* *****      CALL GUFLD(XYZT,F) */
-//VK    vkmagfld_(xyzt, &xyzt[1], &xyzt[2], &fx, &fy, &fz);
-    myMagFld.getMagFld( xyzt[0], xyzt[1], xyzt[2], fx, fy, fz);
-    f[0] = fx*10.;
+    myMagFld.getMagFld( xyzt[0], xyzt[1], xyzt[2], fx, fy, fz, CONTROL);
+    f[0] = fx*10.;   //VK Convert returned field in Tesla into kGauss for old code
     f[1] = fy*10.;
     f[2] = fz*10.;
     at = a + secxs[0];
@@ -140,9 +138,8 @@ L20:
     est = fabs(dxt) + fabs(dyt) + fabs(dzt);
     if (est > fabs(hst) * 2.)          goto L30;
 /* *****      CALL GUFLD(XYZT,F) */
-//VK    vkmagfld_(xyzt, &xyzt[1], &xyzt[2], &fx, &fy, &fz);
-    myMagFld.getMagFld( xyzt[0], xyzt[1], xyzt[2], fx, fy, fz);
-    f[0] = fx*10.;
+    myMagFld.getMagFld( xyzt[0], xyzt[1], xyzt[2], fx, fy, fz, CONTROL);
+    f[0] = fx*10.; //VK Convert returned field in Tesla into kGauss for old code
     f[1] = fy*10.;
     f[2] = fz*10.;
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
index bff9f1ee3637a4a15c8adfc89c58f6056479a534..05da926087f07f9b198761f3918a14617cfa77f9 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFit.cxx
@@ -5,23 +5,12 @@
 #include <math.h>
 #include <iostream>
 #include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/Derivt.h"
-#include "TrkVKalVrtCore/WorkArray.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 namespace Trk {
 
 
-extern WorkArray workarray_;
-extern ForCFT forcft_;
-extern DerivT derivt_;
-
-
-#define workarray_1 workarray_
-#define forcft_1 forcft_
-#define derivt_1 derivt_
-
 /* ************************************************************************/
 /*                                                                        */
 /* ************************************************************************/
@@ -79,8 +68,7 @@ extern DerivT derivt_;
 
 
 
-      long int vtcfit( VKVertex * vk)
-{
+    int vtcfit( VKVertex * vk) {
     
 
     double chi2i, dxyz[3], xyzt[3], eigv[8];
@@ -116,7 +104,7 @@ extern DerivT derivt_;
 
 
 
-#define ader_ref(a_1,a_2) workarray_1.ader[(a_2)*(NTrkM*3+3) + (a_1) - (NTrkM*3+4)]
+#define ader_ref(a_1,a_2) vk->ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)]
 #define cvder_ref(a_1,a_2) vk->FVC.cvder[(a_2)*2 + (a_1) - 3]
 #define dcv_ref(a_1,a_2) vk->FVC.dcv[(a_2)*6 + (a_1) - 7]
 
@@ -160,21 +148,20 @@ extern DerivT derivt_;
 /* ---------------------------------------------------------------------- */
 
     long int IERR = 0;
-    long int NTRK = vk->TrackList.size();
+    int NTRK = vk->TrackList.size();
     double xyz[3]={vk->iniV[0],vk->iniV[1],vk->iniV[2]};
     double twb[9];
     double twci[6];
     double twbci[9];
     double xyzf[3];
 
-    if ( NTRK > NTrkM ) return 1;
+    if ( NTRK > vkalNTrkM ) return 1;
 
-// Dynamic arrays are created already in CFit
-    double *dphi 	= workarray_1.myWorkArrays->get_dphi();
-    double *deps	= workarray_1.myWorkArrays->get_deps();
-    double *drho  	= workarray_1.myWorkArrays->get_drho();
-    double *dtet 	= workarray_1.myWorkArrays->get_dtet();
-    double *dzp 	= workarray_1.myWorkArrays->get_dzp();
+    double *dphi   = new double[NTRK];
+    double *deps   = new double[NTRK];
+    double *drho   = new double[NTRK];
+    double *dtet   = new double[NTRK];
+    double *dzp    = new double[NTRK];
 
     double phip,zp,eps;
 
@@ -560,7 +547,7 @@ extern DerivT derivt_;
 	vk->wa[3] += vyv[2][0];
 	vk->wa[4] += vyv[2][1];
 	vk->wa[5] += vyv[2][2];
-	FullMTXfill(vk, workarray_1.ader);
+	FullMTXfill(vk, vk->ader);
 	if ( vk->passNearVertex ) {
 	  for (it = 1; it <= NTRK; ++it) {
 	    drdpy[0][0] = vk->tmpArr[it-1]->drdp[0][0] * vk->FVC.ywgt[0] + vk->tmpArr[it-1]->drdp[1][0] * vk->FVC.ywgt[1];
@@ -599,11 +586,11 @@ extern DerivT derivt_;
 	  }
 //----------------------------------------------------------------------------------
 	long int NParam = NTRK*3 + 3;
-	dsinv(&NParam, workarray_1.ader, NTrkM*3+3, &IERR);
+	dsinv(&NParam, vk->ader, vkalNTrkM*3+3, &IERR);
 	if ( IERR != 0) {
         std::cout << " Bad problem in CFIT inversion ierr="<<IERR<<", "<<eigv[2]<<'\n'; return IERR;
 	} else {
-            double *fortst = new double[NTrkM*3+3];
+            double *fortst = new double[vkalNTrkM*3+3];
 	    for (j = 0; j < 3; ++j) {
 		fortst[j] = stv[j];
 		for (ii=0; ii<NTRK; ++ii) { fortst[ii*3 +3 +j] = vk->tmpArr[ii]->tt[j];}
@@ -637,7 +624,7 @@ extern DerivT derivt_;
         //std::cout<< "NVertex Full="<<vk->fitV[0]<<", "<<vk->fitV[1]<<", "<<vk->fitV[2]<<'\n';
         //std::cout<< "NVertex Full shft="<<dxyz[0]<<", "<<dxyz[1]<<", "<<dxyz[2]<<'\n';
         //double *tmpA=new double[3+3*NTRK+20];
-        //IERR = FullMCNSTfill( vk, workarray_.ader, tmpA);
+        //IERR = FullMCNSTfill( vk, vk->ader, tmpA);
         //delete[] tmpA;
     }
 /* ------------------------------------------------------------ */
@@ -681,7 +668,7 @@ extern DerivT derivt_;
     //                                               <<vk->TrackList[it]->fitP[1] - vk->TrackList[it]->iniP[1]<<", "
     //                                               <<vk->TrackList[it]->fitP[2] - vk->TrackList[it]->iniP[2]<<'\n';
     //tmpA=new double[3+3*NTRK+20];
-    //IERR = FullMCNSTfill( vk, workarray_.ader, tmpA);
+    //IERR = FullMCNSTfill( vk, vk->ader, tmpA);
     //delete[] tmpA;
    }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
index c52c691e5ff643834608965a7bad2810d8f43457..38ea0e448540ea1eac4c2ebaa56333fc174cc70b 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitC.cxx
@@ -4,24 +4,14 @@
 
 #include <math.h>
 #include "TrkVKalVrtCore/ForCFT.h"
-#include "TrkVKalVrtCore/Derivt.h"
-#include "TrkVKalVrtCore/WorkArray.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
+#include "TrkVKalVrtCore/Derivt.h"
 #include <iostream>
 
 namespace Trk {
 
 
-extern ForCFT forcft_;
-extern WorkArray workarray_;
-extern DerivT derivt_;
-
-
-#define forcft_1 forcft_
-#define derivt_1 derivt_
-#define workarray_1 workarray_
-
     //extern void digx(double *, double *, double *, long int , long int );
     extern void dsinv(long int *, double *, long int , long int *);
     extern void scaleg(double *, double *, long int  ,long int );
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
index 19bc8713c81638dd3b7a55558bb27a4dd909c19f..4a25f3f1dcfa95b2f007e7d6a87127ba54e7a1d0 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtCFitE.cxx
@@ -3,84 +3,20 @@
 */
 
 #include <math.h>
-#include "TrkVKalVrtCore/Derivt.h"
-#include "TrkVKalVrtCore/WorkArray.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
+#include "TrkVKalVrtCore/Derivt.h"
 #include <iostream>
 
 namespace Trk {
 
-
-extern WorkArray workarray_;
-extern DerivT derivt_;
-
-
-#define derivt_1 derivt_
-#define workarray_1 workarray_
-
-
-#define ader_ref(a_1,a_2) workarray_1.ader[(a_2)*(NTrkM*3+3) + (a_1) - (NTrkM*3+4)]
-
-
-/* -------------------------------------------------------------- */
-/*  RETURN FULL ERROR MATRIX AFTER THE FIT                        */
-/*  ERRMTX SHOULD HAVE AT LEAST (3*NTRK+3)*(3*NTRK+4)/2. ELEMENTS */
-
-
-int fiterm(long int NTRK, double  *errmtx)
-{
-    int ii=0, i, j;
-    int lim = (NTRK+1)*3;
-    if(workarray_.existFullCov){
-      for (j = 1; j <= lim; ++j) {          /* COLUMN */
-	 for (i = 1; i <= j; ++i) {        /* ROW */
-	    errmtx[ii] = ader_ref(i, j);
-	    ++ii;
-	 }
-      }
-      return 0;
-    }else{
-      return -1;
-    }
-}
-
-
-/* ------------------------------------------------------- */
-/*  RETURN ERROR OF ANY VARIABLE AFTER THE FIT */
-
-void cferrany_(long int *ntrk, double  *deriv, double  *covar)
-{
-    (*covar) = 0.;
-
-    if (deriv==0) return;
-    --deriv;
-
-    int lim, ic, jc;
-
-    lim = ((*ntrk) + 1) * 3;
-    for (ic = 1; ic <= lim; ++ic) {
-	for (jc = 1; jc <= lim; ++jc) {
-	    (*covar) += deriv[ic] * ader_ref(ic, jc) * deriv[jc];
-	}
-    }
-} 
-
-#undef ader_ref
-
-
-
-
-
-
-
 /* ---------------------------------------------------------- */
 /* Entry for error matrix calculation after successful fit    */
 /* Error matrix has a form V(X,Y,Z,PX,PY,PZ)                  */
 /* ADER - full covariance matrix after fit in form            */
 /*        (x,y,z,track1(1:3),track2(1:3),......)              */
 
-#define ader_ref(a_1,a_2) ader[(a_2)*(NTrkM*3+3) + (a_1) - (NTrkM*3+4)]
+#define ader_ref(a_1,a_2) ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)]
 #define verr_ref(a_1,a_2) verr[(a_2)*6 + (a_1) - 7]
 #define dcv_ref(a_1,a_2)  dcv[(a_2)*6 + (a_1) - 7]
 
@@ -182,10 +118,10 @@ int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double *verr)
 //}
 //-------------------------------------------------------------------------
 /* weight matrix ready.Invert */
-        double * Scale=new double[NVar]; scaleg(ader, Scale, NVar, NTrkM*3+3);                  // Balance matrix
+        double * Scale=new double[NVar]; scaleg(ader, Scale, NVar, vkalNTrkM*3+3);              // Balance matrix
         double **ta = new double*[NVar+1]; for(i=0; i<NVar+1; i++) ta[i] = new double[NVar+1];  // Make a copy 
  	for (i=1; i<=NVar; ++i) for (j = i; j<=NVar; ++j) ta[i][j] = ta[j][i] = ader_ref(i,j);  // for failure treatment
-	dsinv(&NVar, ader, NTrkM*3+3, &IERR);
+	dsinv(&NVar, ader, vkalNTrkM*3+3, &IERR);
 	if ( IERR != 0) {
           double **tv = new double*[NVar+1]; for(i=0; i<NVar+1; i++) tv[i] = new double[NVar+1];
           double **tr = new double*[NVar+1]; for(i=0; i<NVar+1; i++) tr[i] = new double[NVar+1];
@@ -389,7 +325,7 @@ int getFullVrtCov(VKVertex * vk, double *ader, double *dcv, double *verr)
 	}
     }
 //for(int ii=1; ii<=6; ii++)std::cout<<verr_ref(ii,ii)<<", "; std::cout<<" final m NEW"<<'\n';        
-    workarray_.existFullCov = 1;
+    vk->existFullCov = 1;
     return 0;
 } 
 #undef dcv_ref
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
index 6ca0a2b6579fbd7e0ef7829eb21724416ee40f37..e01adf8e63d2c504e9a0630a67d5e56212993df8 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/VtDeriv.cxx
@@ -3,20 +3,21 @@
 */
 
 #include <math.h>
+#include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/Propagator.h"
-#include "TrkVKalVrtCore/CommonPars.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 #include <iostream>
 
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
 extern vkalPropagator  myPropagator;
+extern vkalMagFld      myMagFld;
 
 
 void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, double *vrtref, double *covvrtref, 
-      double *drdpar, double *dwgt, double *rv0)
+      double *drdpar, double *dwgt, double *rv0, const VKalVrtControl * FitCONTROL)
 {
     /* Initialized data */
 
@@ -27,8 +28,8 @@ void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, dou
     /* Local variables */
     double pari[6], covd[15], dcov[3], rvec[50]; /* was [2][6*4+1] */
     double  paro[5];
-    long int jerr, j, ij, ip, ipp, id=0;
-    double dwgt0[3]={0.,0.,0.}, constB;
+    int jerr, j, ij, ip, ipp, id=0;
+    double dwgt0[3]={0.,0.,0.};
     //double deriv[6], dchi2[4*6+1];                     //VK for debugging
     double cs, pp, sn, pt, rho;
     double covdtr[15], ctg, par[5], cnv[36];	/* was [6][6] */
@@ -67,8 +68,7 @@ void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, dou
     /* Function Body */
 /* --------------------- */
     jerr = 0;
-//VK    constB = *localbmag * .0029979246;
-    constB =vkalvrtbmag.bmag  * vkalMagCnvCst;
+    double constB =FitCONTROL->m_forcft.localbmag * vkalMagCnvCst ;
     
     for (ip = 0; ip <= 4*6; ++ip) {    // Number of points * Number of parameters
 /* --  Input parameters */
@@ -146,8 +146,9 @@ void vpderiv(bool UseTrackErr, long int Charge, double *pari0, double *covi, dou
 	tdasatVK(cnv, &covi[0], covd, 5, 6);
 
 /* -- Translation to New Reference Point */
+        myPropagator.Propagate(-999, Charge, par, covd, pari, vrtref, paro, covdtr, FitCONTROL);
+
 
-        myPropagator.Propagate(-999, Charge, par, covd, pari, vrtref, paro, covdtr);
 
 /* -- Now impact significance */
 /*  X=paro(1)*sn, Y=-paro(1)*cs */
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
index aa6aaaa80ba9ca552e1da14bf05e6660cb67228d..a24d7e07d5ae4d95cfe54dee53f3f9daefa7f189 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/XYZtrp.cxx
@@ -3,29 +3,26 @@
 */
 
 #include <math.h>
+#include "TrkVKalVrtCore/CommonPars.h"
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/Propagator.h"
 #include <iostream>
 
 namespace Trk {
 
-extern VKalVrtBMag     vkalvrtbmag;
-extern vkalMagFld      myMagFld;
 extern vkalPropagator  myPropagator;
 extern void tdasatVK(double *, double *, double *, long int, long int);
 
 #define cnv_ref(a_1,a_2) cnv[(a_2)*6 + (a_1) - 7]
 
-void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double *paro, double *errt)
+void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double BMAG, double *paro, double *errt)
 {
-
-    double const__, cs, pp, sn, pt;
-    double covd[15], rho;
-    double ctg, par[5], cnv[36];	/* was [6][6] */
- 
+    double covd[15],par[5], cnv[36];	/* was [6][6] */ 
 /* ---------------------------------------------------------- */
 /*       Subroutine for convertion                            */
-/*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
+/*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
+/* Now it's used in VKalVrtFitter only                        */
+/*                                                            */
 /*       Input:                                               */
 /*                 ICH      -  charge of track ( +1,0,-1 )    */
 /*                 VRT0(3)  -  Vertex of particle             */
@@ -41,17 +38,15 @@ void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double *par
 /* Author: V.Kostyukhin                                       */
 /* ---------------------------------------------------------- */
 
-    double fx,fy,fz;
-    myMagFld.getMagFld( vrt0[0], vrt0[1], vrt0[2], fx, fy, fz);
-    const__ = fz * myMagFld.getCnvCst();
-
-    pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
-    pp = pt*pt + pv0[2]*pv0[2];                   // p**2
-    cs  = pv0[0] / pt;
-    sn  = pv0[1] / pt;
-    ctg = pv0[2] / pt;
-    rho = (*ich) * const__ / pt;
-    if ((*ich) == 0)rho = const__ / pt;
+    double constBF =BMAG * vkalMagCnvCst; 
+
+    double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
+    double pp = pt*pt + pv0[2]*pv0[2];                   // p**2
+    double cs  = pv0[0] / pt;
+    double sn  = pv0[1] / pt;
+    double ctg = pv0[2] / pt;
+    double rho = (*ich) * constBF / pt;
+    if ((*ich) == 0)rho = constBF / pt;
 /* --  Output parameters */
     par[0] = 0.;                    /*            (-Yv*cos + Xv*sin) */
     par[1] = 0.;                    /*  Zv - cotth*(Xv*cos + Yv*sin) */
@@ -60,7 +55,7 @@ void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double *par
     if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5;
     par[3] = atan2(pv0[1], pv0[0]);
     par[4] = rho;
-    if ((*ich) == 0)par[4] = const__ / pt;
+    if ((*ich) == 0)par[4] = constBF / pt;
 //---
     double dTheta_dPx =  pv0[0]*pv0[2]/(pt*pp);   //dTheta/dPx
     double dTheta_dPy =  pv0[1]*pv0[2]/(pt*pp);   //dTheta/dPy
@@ -112,22 +107,22 @@ void  xyztrp(long int *ich, double *vrt0, double *pv0, double *covi, double *par
 
 /* -- Translation to (0,0,0) (BackPropagation) --*/
     double Ref0[3]={0.,0.,0.};
-    myPropagator.Propagate(-999, (*ich), par, covd, vrt0, Ref0, paro, errt);
+    myPropagator.Propagate(-999, (*ich), par, covd, vrt0, Ref0, paro, errt, 0);
 
 } 
 
 
-void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, double *par, double *covo)
+void  combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *par, double *covo)
 {
 
-    double const__, cs, pp, sn, pt, rho;
-    double ctg, cnv[36];	/* was [6][6] */
- /* ---------------------------------------------------------- */
-/*       Subroutine for convertion                            */
+    double cnv[36];	/* was [6][6] */
+/* ---------------------------------------------------------- */
+/*       Subroutine for convertion for VKalvrtCore            */
+/* Correct magnetic field BMAG at conversion point            */
+/*  is provided externally.                                   */
 /*           (X,Y,Z,PX,PY,PZ) --> (eps,z,theta,phi,1/r)       */
 /*       Input:                                               */
 /*                 ICH      -  charge of track ( +1,0,-1 )    */
-/*                 VRT0(3)  -  Vertex of particle             */
 /*                  PV0(3)  -  Momentum of particle           */
 /*                 COVI(21) -  simmetric covariance matrix    */
 /*       Output:                                              */
@@ -138,17 +133,15 @@ void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, doubl
 /* Author: V.Kostyukhin                                       */
 /* ---------------------------------------------------------- */
 
-    double fx,fy,fz;
-    myMagFld.getMagFld( vrt0[0], vrt0[1], vrt0[2], fx, fy, fz);
-    const__ = fz * myMagFld.getCnvCst();
-
-    pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
-    pp = pt*pt + pv0[2]*pv0[2];
-    cs  = pv0[0] / pt;
-    sn  = pv0[1] / pt;
-    ctg = pv0[2] / pt;
-    rho = ICH * const__ / pt;
-    if ( ICH==0 )rho = const__ / pt;
+    double constBF =BMAG * vkalMagCnvCst;
+
+    double pt = sqrt(pv0[0]*pv0[0] + pv0[1]*pv0[1]);
+    double pp = pt*pt + pv0[2]*pv0[2];
+    double cs  = pv0[0] / pt;
+    double sn  = pv0[1] / pt;
+    double ctg = pv0[2] / pt;
+    double rho = ICH * constBF / pt;
+    if ( ICH==0 )rho = constBF / pt;
 /* --  Output parameters */
     par[0] = 0.;                    /*            (-Yv*cos + Xv*sin) */
     par[1] = 0.;                    /*  Zv - cotth*(Xv*cos + Yv*sin) */
@@ -157,7 +150,7 @@ void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, doubl
     if(par[2]>M_PI-1.e-5) par[2]=M_PI-1.e-5;
     par[3] = atan2(pv0[1], pv0[0]);
     par[4] = rho;
-    if ( ICH==0 )par[4] = const__ / pt;
+    if ( ICH==0 )par[4] = constBF / pt;
 //
     double dTheta_dPx =  pv0[0]*pv0[2]/(pt*pp);   //dTheta/dPx
     double dTheta_dPy =  pv0[1]*pv0[2]/(pt*pp);   //dTheta/dPy
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
index 449c0c56ce24ae57353b2b24809859081cb3c35c..3c7d8fa58232c712eef71a916c87d2e3cce179ff 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfImp.cxx
@@ -3,6 +3,7 @@
 */
 
 #include <math.h>
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 #include "TrkVKalVrtCore/Propagator.h"
 #include <iostream>
 
@@ -17,14 +18,11 @@ extern int cfdinv(double *, double *, long int);
 
  void   cfimp(long int TrkID, long int ich, long int IFL, double *par, 
 	double *err, double *vrt, double *vcov, double *rimp, 
-	double *rcov, double *sign )
+	double *rcov, double *sign , const VKalVrtControlBase * FitCONTROL )
 {
     double dcov[3], errd[15], paro[5];
     double dwgt[3], errn[15];
-    long int jerr, i__, j, ij;
-
-
-    double cs, sn;
+    int jerr, i__, j, ij;
 
     double cnv[6]	/* was [2][3] */;
 /* --------------------------------------------------------- */
@@ -57,7 +55,8 @@ extern int cfdinv(double *, double *, long int);
 
 
     double Ref0[3]={0.,0.,0.};  //base reference point for standard perigee
-    myPropagator.Propagate( TrkID, ich, par, errd, Ref0, vrt, paro, errn);
+
+    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
 
 //std::cout <<" CFImp new par R,Z="<<paro[0]<<", "<<paro[1]<<'\n';
 /* ---------- */
@@ -67,8 +66,8 @@ extern int cfdinv(double *, double *, long int);
     rimp[3] = paro[3];
     rimp[4] = paro[4];
 /*  X=paro(1)*sn, Y=-paro(1)*cs */
-    sn = sin(paro[3]);
-    cs = cos(paro[3]);
+    double sn = sin(paro[3]);
+    double cs = cos(paro[3]);
 /* -- New error version */
     cnv[0] = -sn;
     cnv[2] = cs;
@@ -111,7 +110,7 @@ extern int cfdinv(double *, double *, long int);
 
  void   cfimpc(long int TrkID, long int ich, long int IFL, double *par, 
 	double *err, double *vrt, double *vcov, double *rimp, 
-	double *rcov, double *sign )
+	double *rcov, double *sign, const VKalVrtControlBase * FitCONTROL )
 {
     double dcov[3], errd[15], paro[5];
     double dwgt[3], errn[15], cnv[6];	/* was [2][3] */
@@ -129,7 +128,7 @@ extern int cfdinv(double *, double *, long int);
     for (int ii = 0; ii < 15; ++ii) {errd[ii] = err[ii];}
 
     double Ref0[3]={0.,0.,0.};  //base reference point for standard perigee
-    myPropagator.Propagate( TrkID, ich, par, errd, Ref0, vrt, paro, errn);
+    myPropagator.Propagate(TrkID, ich, par, errd, Ref0, vrt, paro, errn, FitCONTROL);
 
     double tmpVrt[3]={0.,0.,0.}; double ClosestPnt[3];
     cfClstPnt( paro, tmpVrt, ClosestPnt);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMassErr.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMassErr.cxx
index bb6ef050c2a5bba009d076d851a6bc77bf0aed4d..1d9d01f69ad9ec553c20795bca4a3705c180002a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMassErr.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMassErr.cxx
@@ -3,21 +3,102 @@
 */
 
 #include <math.h>
-#include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
-extern void cferrany_(long int *, double *, double*);
 
+void cfmasserr(VKVertex * vk, int *list, double BMAG, double *MASS, double *sigM)
+{
+  int NTRK=vk->TrackList.size();
+  double * deriv = new double(3*NTRK+3);
+  double ptot[4]={0.};
+  std::vector< std::array<double,6> > pmom(NTRK);
+  double dm2dpx, dm2dpy, dm2dpz, ee, pt, px, py, pz, cth;
+
+  double constBF = BMAG * vkalMagCnvCst ;
+
+  for(int it=0; it<NTRK; it++){
+    if (list[it]) {
+       pmom[it][4] = pt = constBF / fabs(vk->TrackList[it]->fitP[2]);
+       pmom[it][5] = cth = 1. /tan(vk->TrackList[it]->fitP[0]);
+       pmom[it][0] = px = pt * cos(vk->TrackList[it]->fitP[1]);
+       pmom[it][1] = py = pt * sin(vk->TrackList[it]->fitP[1]);
+       pmom[it][2] = pz = pt * cth;
+       double mmm=vk->TrackList[it]->getMass();
+       pmom[it][3] = sqrt(px*px + py*py + pz*pz + mmm*mmm);
+       ptot[0] += px;
+       ptot[1] += py;
+       ptot[2] += pz;
+       ptot[3] += pmom[it][3];   
+    }
+  }
+
+  for(int it = 0; it < NTRK; ++it) {
+    if (list[it]) {
+       pt = pmom[it][4];
+       cth= pmom[it][5];
+       px = pmom[it][0];
+       py = pmom[it][1];
+       pz = pmom[it][2];
+       ee = pmom[it][3]; 
+       dm2dpx = (ptot[3] / ee * px - ptot[0]) * 2.;
+       dm2dpy = (ptot[3] / ee * py - ptot[1]) * 2.;
+       dm2dpz = (ptot[3] / ee * pz - ptot[2]) * 2.;
+       deriv[it*3 + 0] = dm2dpz * ((-pt) * (cth * cth + 1.));                                /* d(M2)/d(Theta) */
+       deriv[it*3 + 1] =  -dm2dpx * py + dm2dpy * px;                                        /* d(M2)/d(Phi)   */
+       deriv[it*3 + 2] = (-dm2dpx * px - dm2dpy*py - dm2dpz*pz)/vk->TrackList[it]->fitP[2];  /* d(M2)/d(Rho)   */
+    } else {
+       deriv[it*3 + 0] = deriv[it*3 + 1] = deriv[it*3 + 2] = 0.;
+    }
+  }
+//----
+  double covM2=0;
+  for(int i=0; i<NTRK*3; i++){
+     for(int j=0; j<NTRK*3; j++){
+       covM2 += deriv[i] * ARR_2D(vk->ader, vkalNTrkM*3+3, i+3, j+3) *deriv[j];
+     }
+  }
+//----
+  (*MASS) = (ptot[3]-ptot[2])*(ptot[3]+ptot[2])-ptot[1]*ptot[1]-ptot[0]*ptot[0];
+  if((*MASS)<1.e-10)  (*MASS) = 1.e-10;
+  (*MASS)   = sqrt(*MASS);
+  (*sigM) = sqrt(covM2) / 2. / (*MASS);
+  delete[] deriv;
+  return;
+}
 
-void cfmasserr_(long int *ntrk, long int *list, double *parfs,
-        double *ams, double *deriv, double *dm, double *sigm)
+
+//#define ader_ref(a_1,a_2) workarray_.ader[(a_2)*(vkalNTrkM*3+3) + (a_1) - (vkalNTrkM*3+4)]
+/* -------------------------------------------------------------- */
+/*  RETURN FULL ERROR MATRIX AFTER THE FIT                        */
+/*  ERRMTX SHOULD HAVE AT LEAST (3*NTRK+3)*(3*NTRK+4)/2. ELEMENTS */
+/* ------------------------------------------------------- */
+/*  RETURN ERROR OF ANY VARIABLE AFTER THE FIT */
+/*void cferrany_(long int *ntrk, double  *deriv, double  *covar)
+{
+    (*covar) = 0.;
+    if (deriv==0) return;
+    --deriv;
+    int lim, ic, jc;
+    lim = ((*ntrk) + 1) * 3;
+    for (ic = 1; ic <= lim; ++ic) {
+	for (jc = 1; jc <= lim; ++jc) {
+	    (*covar) += deriv[ic] * ader_ref(ic, jc) * deriv[jc];
+	}
+    }
+} 
+#undef ader_ref
+*/
+
+
+void cfmasserrold_(long int *ntrk, long int *list, double *parfs,
+        double *ams, double *deriv, double BMAG, double *dm, double *sigm)
 {
-    long int  i__;
+    int  i__;
     double ptot[4];
-    double const__, dm2dpx, dm2dpy, dm2dpz, ee, pt, px, py, pz, covarm2, cth;
+    double constB, dm2dpx, dm2dpy, dm2dpz, ee, pt, px, py, pz, cth;
 
     --deriv;
     --ams;
@@ -30,15 +111,14 @@ void cfmasserr_(long int *ntrk, long int *list, double *parfs,
     ptot[2] = 0.;
     ptot[3] = 0.;
 
-//VK    const__ = *locbmag * .0029979246;
-    const__ = vkalvrtbmag.bmag * vkalMagCnvCst ;
+    constB = BMAG * vkalMagCnvCst ;
 
     int i3;
     for (i__ = 1; i__ <= (*ntrk); ++i__) {
 	if (list[i__] == 1) {
 	    i3 = i__ * 3;
 	    pt = fabs(parfs[i3 + 3]);
-	    pt = const__ / pt;
+	    pt = constB / pt;
 	    cth = 1. /tan(parfs[i3 + 1]);
 	    px = pt * cos(parfs[i3 + 2]);
 	    py = pt * sin(parfs[i3 + 2]);
@@ -55,7 +135,7 @@ void cfmasserr_(long int *ntrk, long int *list, double *parfs,
 	i3 = i__ * 3;
 	if (list[i__] == 1) {
 	    pt = fabs(parfs[i3+3]);
-	    pt = const__ / pt;
+	    pt = constB / pt;
 	    cth = 1. / tan(parfs[i3+1]);
 	    px  = pt * cos(parfs[i3+2]);
 	    py  = pt * sin(parfs[i3+2]);
@@ -65,8 +145,8 @@ void cfmasserr_(long int *ntrk, long int *list, double *parfs,
 	    dm2dpy = (ptot[3] / ee * py - ptot[1]) * 2.;
 	    dm2dpz = (ptot[3] / ee * pz - ptot[2]) * 2.;
 	    deriv[i3 + 1] = dm2dpz * ((-pt) * (cth * cth + 1.));                    /* d(M2)/d(Theta) */
-	    deriv[i3 + 2] =  -dm2dpx * py + dm2dpy * px;                          /* d(M2)/d(Phi)   */
-	    deriv[i3 + 3] = (-dm2dpx * px - dm2dpy*py - dm2dpz*pz)/ parfs[i3+3];
+	    deriv[i3 + 2] =  -dm2dpx * py + dm2dpy * px;                            /* d(M2)/d(Phi)   */
+	    deriv[i3 + 3] = (-dm2dpx * px - dm2dpy*py - dm2dpz*pz)/ parfs[i3+3];    /* d(M2)/d(Rho) */
 /* cc Std derivatives-------------------------------------------*/
 /*          DCV(6,I*3+1)=-PT*(1+CTH**2)           ! dPz/d(theta)*/
 /*          DCV(4,I*3+2)=-PY                      ! dPx/d(phi)  */
@@ -84,12 +164,15 @@ void cfmasserr_(long int *ntrk, long int *list, double *parfs,
     deriv[1] = 0.;
     deriv[2] = 0.;
     deriv[3] = 0.;
-    cferrany_(ntrk, &deriv[1], &covarm2);
+    double covarm2=ptot[3]; //To avoid compiler warning
+    //cferrany_(ntrk, &deriv[1], &covarm2);
     (*dm) = (ptot[3]-ptot[2])*(ptot[3]+ptot[2])-ptot[1]*ptot[1]-ptot[0]*ptot[0];
     if((*dm)<1.e-6)  (*dm) = 1.e-6;
     (*dm)   = sqrt(*dm);
     (*sigm) = sqrt(covarm2) / 2. / (*dm);
 } 
 
+
+
 } /* End of namespace */
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
index fff1d7905574ac0831ca07db317759a88e354dd5..83a62ae5f6d30b513b76506c18cc966cc90c958a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfMomentum.cxx
@@ -4,19 +4,19 @@
 
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include <math.h>
 #include <iostream>
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
+extern vkalMagFld      myMagFld;
 
 void vkPerigeeToP( double *perig3, double *pp, double BMAG)
 {
-    double const__ =BMAG  * vkalMagCnvCst;
+    double constB =BMAG  * vkalMagCnvCst;
     double phiv = perig3[1];
-    double pt   = const__ / fabs(perig3[2]);
+    double pt   = constB / fabs(perig3[2]);
     pp[0] = pt * cos(phiv);
     pp[1] = pt * sin(phiv);
     pp[2] = pt / tan(perig3[0]);
@@ -24,10 +24,14 @@ void vkPerigeeToP( double *perig3, double *pp, double BMAG)
 
 
 
-std::vector<double> getFitParticleMom( VKTrack * trk)
+std::vector<double> getFitParticleMom( VKTrack * trk, VKVertex *vk)
 {
     std::vector<double> p(4);
-    double magConst =vkalvrtbmag.bmag  * vkalMagCnvCst;
+    double fieldPos[3];
+    fieldPos[0]=vk->refIterV[0]+vk->fitV[0];
+    fieldPos[1]=vk->refIterV[1]+vk->fitV[1];
+    fieldPos[2]=vk->refIterV[2]+vk->fitV[2];
+    double magConst =myMagFld.getMagFld(fieldPos,(vk->m_fitterControl).get())  * myMagFld.getCnvCst();
 
     double cth = 1. / tan( trk->fitP[0]);
     double phi      = trk->fitP[1];
@@ -39,10 +43,41 @@ std::vector<double> getFitParticleMom( VKTrack * trk)
     p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
     return p;
 }
-std::vector<double> getIniParticleMom( VKTrack * trk)
+std::vector<double> getFitParticleMom( VKTrack * trk, double BMAG)
 {
     std::vector<double> p(4);
-    double magConst =vkalvrtbmag.bmag  * vkalMagCnvCst;
+    double magConst =BMAG  * vkalMagCnvCst;
+
+    double cth = 1. / tan( trk->fitP[0]);
+    double phi      = trk->fitP[1];
+    double pt       = magConst/ fabs( trk->fitP[2] );
+    double m   = trk->getMass();
+    p[0] = pt * cos(phi);
+    p[1] = pt * sin(phi);
+    p[2] = pt * cth;
+    p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
+    return p;
+}
+
+std::vector<double> getIniParticleMom( VKTrack * trk, VKVertex *vk)
+{
+    std::vector<double> p(4);
+    double magConst = myMagFld.getMagFld(vk->refIterV,(vk->m_fitterControl).get())  * myMagFld.getCnvCst();
+
+    double cth = 1. / tan( trk->iniP[0]);
+    double phi      =      trk->iniP[1];
+    double pt       = magConst/ fabs( trk->iniP[2] );
+    double m   = trk->getMass();
+    p[0] = pt * cos(phi);
+    p[1] = pt * sin(phi);
+    p[2] = pt * cth;
+    p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
+    return p;
+}
+std::vector<double> getIniParticleMom( VKTrack * trk, double BMAG)
+{
+    std::vector<double> p(4);
+    double magConst =BMAG  * vkalMagCnvCst;
 
     double cth = 1. / tan( trk->iniP[0]);
     double phi      =      trk->iniP[1];
@@ -54,10 +89,31 @@ std::vector<double> getIniParticleMom( VKTrack * trk)
     p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
     return p;
 }
-std::vector<double> getCnstParticleMom( VKTrack * trk)
+
+
+std::vector<double> getCnstParticleMom( VKTrack * trk, VKVertex *vk )
+{
+    std::vector<double> p(4);
+    double cnstPos[3];
+    cnstPos[0]=vk->refIterV[0]+vk->cnstV[0];
+    cnstPos[1]=vk->refIterV[1]+vk->cnstV[1];
+    cnstPos[2]=vk->refIterV[2]+vk->cnstV[2];
+    double magConst = myMagFld.getMagFld(cnstPos,(vk->m_fitterControl).get())  * myMagFld.getCnvCst();
+
+    double cth = 1. / tan( trk->cnstP[0]);
+    double phi      =      trk->cnstP[1];
+    double pt       = magConst/ fabs( trk->cnstP[2] );
+    double m   = trk->getMass();
+    p[0] = pt * cos(phi);
+    p[1] = pt * sin(phi);
+    p[2] = pt * cth;
+    p[3] = sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2] + m*m );
+    return p;
+}
+std::vector<double> getCnstParticleMom( VKTrack * trk, double BMAG )
 {
     std::vector<double> p(4);
-    double magConst =vkalvrtbmag.bmag  * vkalMagCnvCst;
+    double magConst =BMAG  * vkalMagCnvCst;
 
     double cth = 1. / tan( trk->cnstP[0]);
     double phi      =      trk->cnstP[1];
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
index 5c5a1e68545c5d631d32b56391f274947cee4030..0b53a3c9992817d689950d6649bd82bf12866e90 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfNewPm.cxx
@@ -9,21 +9,19 @@
 
 namespace Trk {
 
-extern vkalPropagator  myPropagator;
-extern VKalVrtBMag vkalvrtbmag;
 extern vkalMagFld  myMagFld;
 
 
 extern double d_sign(double, double);
 extern void cfnewp(long int *, double *, double *, double *, double *, double *);
-extern void vkgrkuta_(double *, double *, double *, double *);
+extern void vkgrkuta_(double *, double *, double *, double *, const VKalVrtControlBase* =0 );
 
 
-void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, double *parn, double *closePoint)
+void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, double *parn, double *closePoint, const VKalVrtControlBase * CONTROL)
 {
     double d__1, d__2,dist_left;
     double vect[7], stmg, vout[7], dpar0[5];
-    double p, perig[3], dstep, constB, xyzst[3], charge, fx, fy, fz, pt, px, py, pz;
+    double perig[3], dstep, xyzst[3], charge;
     double posold, poscur, totway, dp;
     double dX, dY, dZ;
     long int ich;
@@ -51,14 +49,13 @@ void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, doubl
     vect[1] = -cos(par[4]) * par[1]   +xyzStart[1];
     vect[2] = par[2]                  +xyzStart[2];
 
-    myMagFld.getMagFld( vect[0],vect[1],vect[2],fx,fy,fz);
-    constB = fz * myMagFld.getCnvCst();
+    double constB = myMagFld.getMagFld(vect,CONTROL) * myMagFld.getCnvCst();
 
-    pt = constB / fabs(par[5]);
-    px = pt * cos(par[4]);
-    py = pt * sin(par[4]);
-    pz = pt / tan(par[3]);
-    p = sqrt(pt * pt + pz * pz);
+    double pt = constB / fabs(par[5]);
+    double px = pt * cos(par[4]);
+    double py = pt * sin(par[4]);
+    double pz = pt / tan(par[3]);
+    double p = sqrt(pt * pt + pz * pz);
 
     vect[3] = px / p;
     vect[4] = py / p;
@@ -75,7 +72,7 @@ void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, doubl
 	poscur = d__1 < d__2 ? d__1 : d__2;
 	poscur = d_sign(poscur, totway);
 	dstep = poscur - posold;
-	vkgrkuta_(&charge, &dstep, vect, vout);
+	vkgrkuta_(&charge, &dstep, vect, vout, CONTROL);
 	vect[0] = vout[0];
 	vect[1] = vout[1];
 	vect[2] = vout[2];
@@ -92,10 +89,8 @@ void cfnewpm(double *par, double *xyzStart, double *xyzEnd, double *ustep, doubl
 
 /* --- Now we are in the new point. Calculate track parameters */
 /*   at new point with new mag.field */
-
-    myMagFld.getMagFld( xyzEnd[0],xyzEnd[1],xyzEnd[2],fx,fy,fz);
-    //myMagFld.getMagFld( vect[0], vect[1], vect[2], fx, fy, fz);
-    constB = fz * myMagFld.getCnvCst();
+
+    constB = myMagFld.getMagFld(xyzEnd,CONTROL) * myMagFld.getCnvCst() ;
 
     dpar0[0] = 0.;
     dpar0[1] = 0.;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
index 593ff0bfd69b2217aad2397515f8ef7171678492..76bb7d6dd77ae9bed294ba4653f4e689ea5f3e73 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfTotCov.cxx
@@ -5,19 +5,14 @@
 // Calculates COVF(21) - symmetric 6x6 covariance matrix
 // for combined (X,Y,Z,Px,Py,Pz) vector after vertex fit 
 //
-//  vkalvrtbmag.bmag is set during last iteration at 
-//  vertex point
 //-----------------------------------------------------
 #include <math.h>
 #include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
-
-
 //
 //  Function calculates complete error matrix ADER and derivatives 
 //   of fitted track parameters with respect to initial ones.
@@ -27,8 +22,9 @@ extern VKalVrtBMag vkalvrtbmag;
 //--------------------------------------------------------------
 extern int getFullVrtCov(VKVertex *, double *, double *, double *);
 extern void cfsetdiag(long int , double *, double );
+extern vkalMagFld      myMagFld;
 
-int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * VrtMomCov )
+int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * VrtMomCov, const VKalVrtControlBase* CONTROL )
 {
     int i,j;
     double px,py,pz,pt,invR,cth;
@@ -43,13 +39,13 @@ int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * V
     ptot[0] = 0.;
     ptot[1] = 0.;
     ptot[2] = 0.;
-    double constB =vkalvrtbmag.bmag * vkalMagCnvCst ;
+    double constBF = myMagFld.getMagFld(vk->refV,CONTROL) * myMagFld.getCnvCst() ;
 
     for (i = 1; i <= NTRK; ++i) {
         VKTrack *trk=vk->TrackList[i-1];
         invR = trk->fitP[2];
 	cth = 1. / tan(trk->fitP[0]);
-	pt = constB / fabs(invR);
+	pt = constBF / fabs(invR);
 	px = pt * cos(trk->fitP[1]);
 	py = pt * sin(trk->fitP[1]);
 	pz = pt * cth;
@@ -81,7 +77,7 @@ int afterFit(VKVertex *vk, double *ader, double * dcv, double * ptot, double * V
 //  Complete error matrix is recalculated here via getFullVrtCov,
 //            so CPU CONSUMING!!!
 //--------------------------------------------------------------------------------------------------
-int afterFitWithIniPar(VKVertex *vk, double *ader, double * dcv, double * ptot, double * VrtMomCov )
+int afterFitWithIniPar(VKVertex *vk, double *ader, double * dcv, double * ptot, double * VrtMomCov, const VKalVrtControlBase* CONTROL  )
 {
     int i,j;
     double px,py,pz,pt,invR,cth;
@@ -97,13 +93,13 @@ int afterFitWithIniPar(VKVertex *vk, double *ader, double * dcv, double * ptot,
     ptot[0] = 0.;
     ptot[1] = 0.;
     ptot[2] = 0.;
-    double constB =vkalvrtbmag.bmag * vkalMagCnvCst ;
+    double constBF = myMagFld.getMagFld(vk->refV,CONTROL) * myMagFld.getCnvCst() ;
 
     for (i = 1; i <= NTRK; ++i) {
         VKTrack *trk=vk->TrackList[i-1];
         invR = trk->iniP[2];
 	cth = 1. / tan(trk->iniP[0]);
-	pt = constB / fabs(invR);
+	pt = constBF / fabs(invR);
 	px = pt * cos(trk->iniP[1]);
 	py = pt * sin(trk->iniP[1]);
 	pz = pt * cth;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
index f62c75105551205ca47b8ce319e62c2c729097c0..8f9f196c35e0d9b4ec174793d5df67573df638b7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/cfVrtDst.cxx
@@ -3,17 +3,15 @@
 */
 
 #include <math.h>
-#include "TrkVKalVrtCore/VKalVrtBMag.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include "TrkVKalVrtCore/Propagator.h"
 #include <iostream>
 
 namespace Trk {
 
-extern VKalVrtBMag vkalvrtbmag;
 extern vkalPropagator  myPropagator;
-
+extern vkalMagFld      myMagFld;
 
 // Function calculates distance between summary track after fit and vertex for constraint
 // Flag UseTrkErr tells if SummaryTrack errors+VertexErrors are used or only VertexErrors
@@ -36,10 +34,8 @@ double cfVrtDstSig( VKVertex * vk, bool UseTrkErr)
     double parV0[5], covParV0[15];
     double Signif;
 
-
-    extern void cfimp(long int, long int, long int, double *, double *, double *,double *, double *, double *, double *);
-    extern void  combinedTrack(long int ICH, double *vrt0, double *pv0, double *covi, double *paro, double *covo);
-    extern std::vector<double> getCnstParticleMom( VKTrack * );
+    extern void combinedTrack(long int ICH, double *pv0, double *covi, double BMAG, double *paro, double *covo);
+    extern std::vector<double> getCnstParticleMom( VKTrack * , VKVertex *);
     extern int cfdinv(double *, double *, long int); 
  /* ------------------------------------------------------------------- */
 
@@ -47,7 +43,7 @@ double cfVrtDstSig( VKVertex * vk, bool UseTrkErr)
     int NTRK = vk->TrackList.size();
     std::vector<double> pp;
     for ( it=0; it<NTRK; it++) {
-        pp=getCnstParticleMom( vk->TrackList[it] );
+        pp=getCnstParticleMom( vk->TrackList[it], vk );
 	ptot[0] += pp[0];
 	ptot[1] += pp[1];
 	ptot[2] += pp[2];
@@ -57,8 +53,9 @@ double cfVrtDstSig( VKVertex * vk, bool UseTrkErr)
 			 vk->refIterV[2] + vk->cnstV[2]};
     long int Charge = 0; for ( it=0; it<NTRK; it++) Charge += vk->TrackList[it]->Charge; 
 //std::cout<<" cfVrtDst ntrk="<<NTRK<<" chg="<<Charge<<'\n';
+    double localField=myMagFld.getMagFld(fittedVrt,(vk->m_fitterControl).get());
     if ( UseTrkErr){
-      combinedTrack( Charge, fittedVrt, ptot, vk->fitCovXYZMom, parV0, covParV0);
+      combinedTrack( Charge, ptot, vk->fitCovXYZMom, localField, parV0, covParV0);
     }else{
       double DummyErr[21] = { 1.e-20,
                                   0., 1.e-20,
@@ -66,14 +63,14 @@ double cfVrtDstSig( VKVertex * vk, bool UseTrkErr)
 				  0.,     0.,     0., 1.e-18,
 				  0.,     0.,     0.,     0., 1.e-18,
 				  0.,     0.,     0.,     0.,     0., 1.e-18};
-      combinedTrack( Charge, fittedVrt, ptot, DummyErr, parV0, covParV0);
+      combinedTrack( Charge, ptot, DummyErr, localField, parV0, covParV0);
     }
 //
 // Propagation to constraint vertex
 //
     double nPar[5],nCov[15];
     long int TrkID = -999;   // Abstract track propagation
-    myPropagator.Propagate( TrkID, Charge, parV0, covParV0, fittedVrt, vk->FVC.vrt, nPar, nCov);
+    myPropagator.Propagate( TrkID, Charge, parV0, covParV0, fittedVrt, vk->FVC.vrt, nPar, nCov, (vk->m_fitterControl).get());
 //
 //
     double cnv[2][3];
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
index 2d52248e844447d5f8dc21a04c7c17415dd94eaf..212efe42d4c80ab97294d63d9c9d6e487cfe4bf8 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtCore/src/stCnst.cxx
@@ -5,9 +5,10 @@
 //    Management of constraints 
 //
 //----------------------------------------------------
+#include "TrkVKalVrtCore/ForCFT.h"
 #include "TrkVKalVrtCore/Derivt.h"
 #include "TrkVKalVrtCore/CommonPars.h"
-#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCoreBase.h"
 #include <iostream>
 
 namespace Trk {
@@ -17,8 +18,7 @@ extern void  calcMassConstraint( VKMassConstraint * );
 extern void  calcPhiConstraint( VKPhiConstraint * );
 extern void  calcThetaConstraint( VKThetaConstraint * );
 extern void  calcPointConstraint( VKPointConstraint * );
-extern void  calcPlaneConstraint( VKPlaneConstraint * );
-
+extern void  calcPlaneConstraint( VKPlaneConstraint * );
 
 
 void applyConstraints(VKVertex * vk)
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h
index 33c7a25f3b2730a7c215b9d88e0fd5b5fbaf47ec..e23b51bc45cf4de372038f41eee48ea01caa15da 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/ITrkVKalVrtFitter.h
@@ -97,7 +97,7 @@ namespace Trk{
       virtual StatusCode VKalGetTrkWeights(std::vector<double>& Weights) =0;
       virtual StatusCode VKalGetTrkCov(long int, long int, std::vector<double>& CovMtx) =0;
       virtual StatusCode VKalGetFullCov(long int, std::vector<double>& CovMtx, int =0) =0;
-      virtual StatusCode VKalGetMassError(std::vector<int> ListOfTracks, double& Mass, double& MassError) =0;
+      virtual StatusCode VKalGetMassError(double& Mass, double& MassError) =0;
       virtual int VKalGetNDOF() =0;
 
       virtual void setApproximateVertex(double,double,double)=0;
@@ -106,7 +106,6 @@ namespace Trk{
       virtual void setRobustness(int)=0;
       virtual void setRobustScale(double)=0;
       virtual void setCascadeCnstPrec(double)=0;
-      virtual void setCnstType(int)=0;
       virtual void setMomCovCalc(int)=0;
       virtual void setIterations(int, double)=0;
       virtual void setVertexForConstraint(const xAOD::Vertex &)=0;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
index 836c0609e41729c6c7a569c9595684af8780280b..6687890af6bd33b9117a7c3130a044836115a495 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/TrkVKalVrtFitter.h
@@ -33,6 +33,8 @@ class IMagFieldAthenaSvc;
 
 namespace Trk{
 
+  class VKalVrtControl;
+
   static const int NTrMaxVFit=300;
   typedef std::vector<double> dvect;
   class VKalAtlasMagFld;
@@ -201,8 +203,7 @@ namespace Trk{
         StatusCode VKalGetTrkCov(long int, long int,dvect& CovMtx);
         StatusCode VKalGetFullCov(long int, dvect& CovMtx, int =0);
 
-        StatusCode VKalGetMassError( std::vector<int> ListOfTracks , 
-                                   double& Mass, double& MassError);
+        StatusCode VKalGetMassError(double& Mass, double& MassError);
         int VKalGetNDOF();
 //        VxCandidate * makeVxCandidate( int ,
 //                const Amg::Vector3D& , const std::vector<double> & , 
@@ -218,7 +219,6 @@ namespace Trk{
         void setRobustness(int);
         void setRobustScale(double);
         void setCascadeCnstPrec(double);
-        void setCnstType(int);
         void setIterations(int, double);
         void setVertexForConstraint(const xAOD::Vertex & );
         void setVertexForConstraint(double,double,double);
@@ -237,9 +237,6 @@ namespace Trk{
       double VKalGetImpact(const Track*,const Amg::Vector3D& Vertex, const long int Charge,
                          std::vector<double>& Impact, std::vector<double>& ImpactError);
 
-       Amg::RotationMatrix3D getMagFldRotation(double bx,double by,double bz, double vX,double vY,double vZ);
-       void rotateBack(double vi[],double pi[], double covi[], double vo[],double po[], double covo[]);
-       Amg::Vector3D rotateBack(double px, double py, double pz);
 
 //
 // ATLAS related code
@@ -257,8 +254,7 @@ namespace Trk{
       SimpleProperty<int>    m_Robustness;
       SimpleProperty<double> m_RobustScale;
       SimpleProperty<double> m_cascadeCnstPrecision;
-      SimpleProperty<int>    m_Constraint;
-      SimpleProperty<double> m_MassForConstraint;
+      SimpleProperty<double> m_massForConstraint;
       SimpleProperty<int>    m_IterationNumber;
       SimpleProperty<double> m_IterationPrecision;
       SimpleProperty<double> m_IDsizeR;
@@ -289,12 +285,11 @@ namespace Trk{
       bool m_useZPointingCnst;
       bool m_usePassNear;
       bool m_usePassWithTrkErr;
-      bool m_useMagFieldRotation;
       void initCnstList();
 
       std::vector<double>    m_ApproximateVertex;
-      std::vector<double>    m_PartMassCnst;
-      std::vector< std::vector<int> >    m_PartMassCnstTrk;
+      std::vector<double>    m_partMassCnst;
+      std::vector< std::vector<int> >    m_partMassCnstTrk;
       std::vector<int>       m_PosTrack0Charge;
 
 
@@ -334,11 +329,6 @@ namespace Trk{
                           /* =0 - no fit. All "after fit" routines fail*/
 			  /* >1 - good fit. "After fit" routines work*/
 
-      int m_PropagatorType; /* type of propagator used for fit. VKalVrtCore definition */
-                            /* =0 - constant field propagator from VKalVrtCore         */
-			    /* =1 - Runge-Kutta propagator from VKalVrtCore            */
-			    /* =3 - external propagator accessed via VKalExtPropagator */
-
       double m_BMAG;       /* const magnetic field  if needed */
       double m_CNVMAG;     /* Conversion constant */
       long int m_ifcovv0;
@@ -361,9 +351,13 @@ namespace Trk{
 
 
       VKalAtlasMagFld*       m_fitField;
-      VKalAtlasMagFld*       m_fitRotatedField;
       VKalExtPropagator*     m_fitPropagator;
       const IExtrapolator*   m_InDetExtrapolator;     //!< Pointer to Extrapolator AlgTool
+//
+//
+//
+      VKalVrtControl * m_vkalFitControl;
+
     
 //
 //  Origin of global reference frame.
@@ -384,9 +378,8 @@ namespace Trk{
         Amg::MatrixX * GiveFullMatrix(int NTrk, std::vector<double>&);
         bool convertAmg5SymMtx(const AmgSymMatrix(5)*, double[] );
 
-        void  VKalTransform( double MAG,
-        double A0V,double ZV,double PhiV,double ThetaV,double  PInv, double[],
-        long int & Charge, double[], double[]);
+        void  VKalTransform( double MAG,double A0V,double ZV,double PhiV,double ThetaV,double  PInv, double[],
+                                    long int & Charge, double[], double[]);
 
   
         StatusCode          CvtTrkTrack(const std::vector<const Track*>& list,              long int& ntrk);
@@ -396,9 +389,8 @@ namespace Trk{
         StatusCode   CvtTrackParameters(const std::vector<const TrackParameters*>& InpTrk,  long int& ntrk);
         StatusCode CvtNeutralParameters(const std::vector<const NeutralParameters*>& InpTrk,long int& ntrk);
 
-        void VKalVrtSetOptions(long int NInputTracks);
-        void    VKalToTrkTrack( double, double  , double  , double ,
-                                double& , double& , double& );
+        void VKalVrtConfigureFitterCore(int NTRK);
+        void VKalToTrkTrack( double, double  , double  , double , double& , double& , double& );
 
         long int VKalVrtFit3( long int ntrk, Amg::Vector3D& Vertex, TLorentzVector&   Momentum,
 	                   long int& Charge, dvect& ErrorMatrix, dvect& Chi2PerTrk, 
@@ -428,10 +420,6 @@ namespace Trk{
 	  int TrkID;
           const TrackParameters* TrkPnt;
 	  double prtMass;
-						   // Needed for rotation to mag.field frame
-	  bool rotateToField;                      //   Point is in GLOBAL Atlas frame
-          Amg::RotationMatrix3D trkRotation;                 // Proposal:  Track[0] is reference for all tracks
-          Amg::Vector3D         trkRotationVertex;           //            in vertex???
           Amg::Vector3D         trkSavedLocalVertex;         // Local VKalVrtCore vertex
        };
        std::vector < TrkMatControl > m_trkControl;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VKalVrtAtlas.h b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VKalVrtAtlas.h
index f5a0768273d42e8dcab9cc1ac6cdbbda7e4f9852..82633f9d36b020f0e201a09d14b818606bf903f6 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VKalVrtAtlas.h
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/TrkVKalVrtFitter/VKalVrtAtlas.h
@@ -28,21 +28,18 @@ namespace Trk{
 
        VKalAtlasMagFld();
       ~VKalAtlasMagFld();
-       void getMagFld(const double,const double,const double,double&,double&,double&);
-       void setAtlasMag(MagField::IMagFieldSvc *);
-       void setAtlasMag(const double );
+       void getMagFld(const double,const double,const double,double&,double&,double&)const;
+       void setAtlasField(MagField::IMagFieldSvc *);
+       void setAtlasField(const double );
        void setAtlasMagRefFrame( double, double, double );
 
     private:
     
        MagField::IMagFieldSvc*  m_VKalAthenaField;
-       double m_FIXED_ATLAS_FIELD;
-       const double m_mm;
+       double m_FIXED_ATLAS_FIELD=1.997;
+       const double m_mm=1.;
        double m_magFrameX, m_magFrameY, m_magFrameZ ;
-       double m_saveXpos, m_saveYpos, m_saveZpos;
-       double m_saveBX, m_saveBY, m_saveBZ;   
        Amg::Vector3D m_Point;
-       
 
    };
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtParametersBase.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtParametersBase.cxx
index 0e9adb4ad4e460eb18507b227ff6b8a0e0a8f6d6..490a8cde50bd0ffe5982190134f1693221b6a1b2 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtParametersBase.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtParametersBase.cxx
@@ -15,14 +15,10 @@
 // Other stuff
 //----
 #include  "TrkParameters/TrackParameters.h"
-#include  "TrkSurfaces/StraightLineSurface.h"
-//----
 #include <iostream> 
 
 namespace Trk {
 
- extern vkalPropagator  myPropagator;
-
 //--------------------------------------------------------------------
 //  Extract TrackParameters
 //
@@ -35,7 +31,6 @@ namespace Trk {
     AmgVector(5) VectPerig; VectPerig<<0.,0.,0.,0.,0.;
     Amg::Vector3D perGlobalPos,perGlobalVrt;
     const Trk::Perigee* mPer=0;
-    const Trk::AtaStraightLine* Line=0; 
     double CovVertTrk[15]; std::fill(CovVertTrk,CovVertTrk+15,0.);
     double tmp_refFrameX=0, tmp_refFrameY=0, tmp_refFrameZ=0;
     double fx,fy,fz,BMAG_FIXED;
@@ -48,7 +43,7 @@ namespace Trk {
      m_refFrameX=m_refFrameY=m_refFrameZ=0.;
      m_fitField->setAtlasMagRefFrame( 0., 0., 0.);
 
-     if( m_InDetExtrapolator == 0 && m_PropagatorType != 3 ){
+     if( m_InDetExtrapolator == 0 ){
        //log << MSG::WARNING  << "No InDet extrapolator given. Can't use TrackParameters!!!" << endmsg;
        if(msgLvl(MSG::WARNING))msg()<< "No InDet extrapolator given. Can't use TrackParameters!!!" << endmsg;
        return StatusCode::FAILURE;        
@@ -67,8 +62,6 @@ namespace Trk {
        tmp_refFrameZ += perGlobalPos.z() ;
        TrkMatControl tmpMat;                                    // Here we create structure to control material effects
        tmpMat.trkRefGlobPos=Amg::Vector3D(perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z());
-       tmpMat.rotateToField=false; if(m_useMagFieldRotation)tmpMat.rotateToField=true;
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
        if(m_firstMeasuredPoint){ tmpMat.extrapolationType=0;}   //First measured point strategy
        else{                     tmpMat.extrapolationType=1;}   //Any measured point strategy
        tmpMat.TrkPnt=(*i_pbase);
@@ -86,8 +79,6 @@ namespace Trk {
     m_refGVertex = Amg::Vector3D(tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ);
 //
     m_fitField->getMagFld( tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ, fx,fy,fz);  //Rotation parameters in case of rotation use   
-    Amg::RotationMatrix3D magFldRot=getMagFldRotation(fx,fy,fz, tmp_refFrameX, tmp_refFrameY, 0.);
-    StraightLineSurface lineTarget(new Amg::Transform3D( magFldRot.inverse() , Amg::Vector3D(tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ) ));
 //
 //  Common reference frame is ready. Start extraction of parameters for fit.
 //  TracksParameters are extrapolated to common point and converted to Perigee
@@ -97,7 +88,6 @@ namespace Trk {
     counter=0;
     for (i_pbase = InpTrk.begin(); i_pbase != InpTrk.end(); ++i_pbase) {
        const TrackParameters* trkparO = (*i_pbase);
-     if(!m_useMagFieldRotation){
        if( trkparO ){
          const Trk::TrackParameters* trkparN = m_fitPropagator->myExtrapWithMatUpdate( ntrk, trkparO, &m_refGVertex );
          if(trkparN == 0) return StatusCode::FAILURE;
@@ -116,28 +106,6 @@ namespace Trk {
        m_fitField->getMagFld(  perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z(),  // Magnetic field
                                fx, fy, BMAG_FIXED);                                 // at perigee point
        if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
-     }else{                   // For rotation case only!!!
-       if( trkparO ){
-         const Trk::TrackParameters* trkparN = m_fitPropagator->myExtrapToLine((long int)counter, trkparO, &m_refGVertex, lineTarget);
-         if(trkparN == 0) return StatusCode::FAILURE;
-         Line = dynamic_cast<const Trk::AtaStraightLine*>(trkparN); 
-         if( Line == 0) {   delete trkparN;  return StatusCode::FAILURE; }
-         VectPerig    =  Line->parameters(); 
-         perGlobalPos =  Line->position();    //Global position of perigee point
-         Amg::Vector3D perMomentum(Line->momentum().x(),Line->momentum().y(),Line->momentum().z());
-         Amg::Vector3D rotatedMomentum=magFldRot*perMomentum;
-//         VectPerig[2] += atan2(rotatedMomentum.y(),rotatedMomentum.x());  //VK wrong 27.09.10
-         VectPerig[2] = atan2(rotatedMomentum.y(),rotatedMomentum.x());
-         VectPerig[3] = atan2(rotatedMomentum.perp(),rotatedMomentum.z());
-         if( !convertAmg5SymMtx(Line->covariance(), CovVertTrk) ) return StatusCode::FAILURE; //VK no good covariance matrix!
-         delete trkparN;
-         BMAG_FIXED=sqrt(fx*fx+fy*fy+fz*fz);
-         m_fitRotatedField->setAtlasMag(BMAG_FIXED);  //set fixed ROTATED field in corresponding VKal oblect
-       }else{  return StatusCode::FAILURE;   }
-       m_trkControl[counter].trkRotation=magFldRot;
-       m_trkControl[counter].trkRotationVertex=   Amg::Vector3D( m_refGVertex.x(), m_refGVertex.y(), m_refGVertex.z());
-       m_trkControl[counter].trkSavedLocalVertex= Amg::Vector3D(0.,0.,0.);
-     }
        counter++;
 //std::cout<<"TESTVK="<<'\n'; std::cout.precision(16); for(int ik=0; ik<15; ik++)std::cout<<CovVertTrk[ik]<<'\n';
        VKalTransform( BMAG_FIXED, (double)VectPerig[0], (double)VectPerig[1],
@@ -183,7 +151,7 @@ namespace Trk {
     m_refFrameX=m_refFrameY=m_refFrameZ=0.;
     m_fitField->setAtlasMagRefFrame( 0., 0., 0.);
 
-    if( m_InDetExtrapolator == 0 && m_PropagatorType != 3 ){
+    if( m_InDetExtrapolator == 0 ){
        //log << MSG::WARNING  << "No InDet extrapolator given. Can't use TrackParameters!!!" << endmsg;
        if(msgLvl(MSG::WARNING))msg()<< "No InDet extrapolator given. Can't use TrackParameters!!!" << endmsg;
        return StatusCode::FAILURE;        
@@ -202,8 +170,6 @@ namespace Trk {
        tmp_refFrameZ += perGlobalPos.z() ;
        TrkMatControl tmpMat;                                    // Here we create structure to control material effects
        tmpMat.trkRefGlobPos=Amg::Vector3D(perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z()); // on track extrapolation
-       tmpMat.rotateToField=false;
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
        tmpMat.extrapolationType=0;   //First measured point strategy
        tmpMat.TrkPnt=NULL;           //No reference point for neutral track for the moment  !!!
        tmpMat.prtMass = 139.5702;
@@ -219,8 +185,6 @@ namespace Trk {
     m_refGVertex = Amg::Vector3D(tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ);
 //
     m_fitField->getMagFld( tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ, fx,fy,fz);  //Rotation parameters in case of rotation use   
-    Amg::RotationMatrix3D magFldRot=getMagFldRotation(fx,fy,fz, tmp_refFrameX, tmp_refFrameY, 0.);
-    StraightLineSurface lineTarget(new Amg::Transform3D( magFldRot.inverse() , Amg::Vector3D(tmp_refFrameX, tmp_refFrameY, tmp_refFrameZ) ));
 //
 //  Common reference frame is ready. Start extraction of parameters for fit.
 //  TracksParameters are extrapolated to common point and converted to Perigee
@@ -229,7 +193,6 @@ namespace Trk {
 //
     counter=0;
     for (i_pbase = InpTrk.begin(); i_pbase != InpTrk.end(); ++i_pbase) {
-      if(!m_useMagFieldRotation){
          const Trk::NeutralParameters* neuparO = (*i_pbase);
          if(neuparO == 0) return StatusCode::FAILURE;
          const Trk::NeutralParameters* neuparN = m_fitPropagator->myExtrapNeutral( neuparO, &m_refGVertex );
@@ -245,9 +208,6 @@ namespace Trk {
          m_fitField->getMagFld(  perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z(),  // Magnetic field
                                fx, fy, BMAG_FIXED);                                 // at perigee point
          if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
-       }else{                   // For rotation case only!!!
-         return StatusCode::FAILURE; 
-       }
        counter++;
 
 //std::cout<<" BaseEMtx="<<CovMtx.fast(1,1)<<", "<<CovMtx.fast(2,2)<<", "<<CovMtx.fast(3,3)<<", "
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
index 43dc820ac8b8eb2f59f306a5dde038c31b5f5cda..c2563ca265986cb3d6c0dde9d2d101f99aab7cd7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrackParticle.cxx
@@ -9,6 +9,7 @@
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 #include "TrkVKalVrtFitter/VKalVrtAtlas.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 //-------------------------------------------------
 // Other stuff
 //----
@@ -19,7 +20,7 @@
 
 namespace Trk {
 
-    extern vkalPropagator  myPropagator;
+ extern vkalPropagator  myPropagator;
 
 //--------------------------------------------------------------------
 //  Extract xAOD::TrackParticles
@@ -58,8 +59,6 @@ namespace Trk {
        tmp_refFrameZ += perGlobalPos.z() ;	// magnetic field
        TrkMatControl tmpMat;
        tmpMat.trkRefGlobPos=Amg::Vector3D( perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z());
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
-       tmpMat.rotateToField=false; if(m_useMagFieldRotation)tmpMat.rotateToField=true;
        tmpMat.extrapolationType=2;                   // Perigee point strategy
        tmpMat.TrkPnt=mPer; 
        tmpMat.prtMass = 139.5702;
@@ -95,7 +94,7 @@ namespace Trk {
                                                                   fx, fy, BMAG_FIXED);      // at the track perigee point
        if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
 //
-//--- Get rid of beamline rotation and move ref. frame to the track common point m_refGVertex
+//--- Move ref. frame to the track common point m_refGVertex
 //    Small beamline inclination doesn't change track covariance matrix 
        AmgSymMatrix(5) * tmpCov = new AmgSymMatrix(5)(*(mPer->covariance()));
        const Perigee * tmpPer=surfGRefPoint.createTrackParameters(mPer->position(),mPer->momentum(),mPer->charge(),tmpCov);
@@ -166,8 +165,6 @@ namespace Trk {
        tmp_refFrameZ += perGlobalPos.z() ;	// magnetic field
        TrkMatControl tmpMat;
        tmpMat.trkRefGlobPos=Amg::Vector3D( perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z());
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
-       tmpMat.rotateToField=false; if(m_useMagFieldRotation)tmpMat.rotateToField=true;
        tmpMat.extrapolationType=2;                   // Perigee point strategy
        tmpMat.TrkPnt=NULL;           //No reference point for neutral particle for the moment
        tmpMat.prtMass = 139.5702;
@@ -198,12 +195,12 @@ namespace Trk {
        if( mPer==0 ) continue; // No perigee!!!
        perGlobalPos =  mPer->position();    //Global position of perigee point
        if( !convertAmg5SymMtx(mPer->covariance(), CovVertTrk) ) return StatusCode::FAILURE; //VK no good covariance matrix!;
-       m_fitField->getMagFld( perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z(),           // Magnetic field
+       m_fitField->getMagFld( perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z(),         // Magnetic field
                                                                   fx, fy, BMAG_FIXED);      // at track perigee point
        if(fabs(BMAG_FIXED) < 0.01) BMAG_FIXED=0.01;
 
 //
-//--- Get rid of beamline rotation and move ref. frame to the track common point m_refGVertex
+//--- Move ref. frame to the track common point m_refGVertex
 //    Small beamline inclination doesn't change track covariance matrix 
 //
        AmgSymMatrix(5) * tmpCov = new AmgSymMatrix(5)(*(mPer->covariance()));
@@ -273,8 +270,6 @@ namespace Trk {
        tmp_refFrameZ += perGlobalPos.z() ;	// magnetic field
        TrkMatControl tmpMat;
        tmpMat.trkRefGlobPos=Amg::Vector3D( perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z());
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
-       tmpMat.rotateToField=false; if(m_useMagFieldRotation)tmpMat.rotateToField=true;
        tmpMat.extrapolationType=2;                   // Perigee point strategy
        tmpMat.TrkPnt=mPer;
        tmpMat.prtMass = 139.5702;
@@ -332,9 +327,7 @@ namespace Trk {
 	  for(int i=0; i<5; i++) pari[i]=m_apar[ntrk][i];
 	  for(int i=0; i<15;i++) covi[i]=m_awgt[ntrk][i];
           long int Charge = m_ich[ntrk];  
-//VK 17.06/2008 Wrong!!! m_fitPropagator is defined only when InDet extrapolator is provided!!!
-          //m_fitPropagator->Propagate(ntrk,Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0]);
-          myPropagator.Propagate(ntrk, Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0]);
+          myPropagator.Propagate(ntrk, Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0],m_vkalFitControl);
        }
 
        ntrk++; if(ntrk>=NTrMaxVFit) return StatusCode::FAILURE;
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
index cf93dd38595a1f2a88520c00968da963343b6cda..0e52d9ec0e53eeb543afa9f9a4b818c689bbc07a 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/CvtTrkTrack.cxx
@@ -9,6 +9,7 @@
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 #include "TrkVKalVrtFitter/VKalVrtAtlas.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 //-------------------------------------------------
 // Other stuff
 //----
@@ -69,8 +70,6 @@ namespace Trk{
        tmp_refFrameZ += perGlobalPos.z() ;	// magnetic field
        TrkMatControl tmpMat;
        tmpMat.trkRefGlobPos=Amg::Vector3D(perGlobalPos.x(), perGlobalPos.y(), perGlobalPos.z());
-       tmpMat.rotateToField=false; if(m_useMagFieldRotation)tmpMat.rotateToField=true;
-       tmpMat.trkRotation = Amg::RotationMatrix3D::Identity();
        tmpMat.extrapolationType=2;                   // Perigee point strategy
        tmpMat.TrkPnt=mPer;
        tmpMat.prtMass = 139.5702;
@@ -116,9 +115,7 @@ namespace Trk{
 	  for(int i=0; i<5; i++) pari[i]=m_apar[ntrk][i];
 	  for(int i=0; i<15;i++) covi[i]=m_awgt[ntrk][i];
           long int Charge = (long int) mPer->charge();  
-//VK 17.06/2008 Wrong!!! m_fitPropagator is defined only when InDet extrapolator is provided!!!
-          //m_fitPropagator->Propagate(ntrk,Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0]);
-          myPropagator.Propagate(ntrk,Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0]);
+          myPropagator.Propagate(ntrk,Charge, pari, covi, vrtini, vrtend,&m_apar[ntrk][0],&m_awgt[ntrk][0],m_vkalFitControl);
        }
 
 //
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
index 4f51122235f9a914bd6991c80210c06288f477a8..7a976e41bdef7bfdeb067440be921f80a16bc5d7 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/SetFitOptions.cxx
@@ -4,6 +4,7 @@
 
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 //-------------------------------------------------
 #include<iostream>
 
@@ -13,7 +14,8 @@
 //	       const long int& irob);           
 //  void setmasscnst_(const long int& NCnstTrk,const long int& IndexTrk,const double& WMCNST);
 //}
-namespace Trk {
+
+/*namespace Trk {
 extern void prcfit(long int *,double *,double* ,
                     double* , double* , double*);           
 extern void setmasscnst_(long int* , long int* , double* );
@@ -27,18 +29,73 @@ extern void vksetUseThetaCnst();
 extern void vksetUseAprioriVrt();
 extern void vksetUsePointingCnst(int iType = 1 );
 extern void vksetUsePassNear(int iType = 1 );
-}
+}*/
 
 namespace Trk{
 //
-// Option setting for VKalVrt core
+// Option setting for VKalVrt core via m_vkalFitControl object
 //
-  void TrkVKalVrtFitter::VKalVrtSetOptions(long int ntrk)
+
+  void TrkVKalVrtFitter::VKalVrtConfigureFitterCore(int NTRK)
+  {
+    m_FitStatus = 0;     // Drop all previous fit results
+
+    //Set input particle masses
+    for(int it=0; it<NTRK; it++){
+      if( it<(int)m_MassInputParticles.size() ) { m_vkalFitControl->m_forcft.wm[it]  = (double)(m_MassInputParticles[it]); }
+      else { m_vkalFitControl->m_forcft.wm[it]=(double)(139.5702); }
+    }
+    // Set reference vertex for different pointing constraints
+    if(m_VertexForConstraint.size() >= 3){
+      m_vkalFitControl->m_forcft.vrt[0]    =m_VertexForConstraint[0] - m_refFrameX;
+      m_vkalFitControl->m_forcft.vrt[1]    =m_VertexForConstraint[1] - m_refFrameY;
+      m_vkalFitControl->m_forcft.vrt[2]    =m_VertexForConstraint[2] - m_refFrameZ;
+    }else {for( int i=0; i<3; i++)  m_vkalFitControl->m_forcft.vrt[i] = 0.; }
+    // Set covariance matrix for reference vertex
+    if(m_CovVrtForConstraint.size() >= 6){
+           for( int i=0; i<6; i++) { m_vkalFitControl->m_forcft.covvrt[i] = (double)(m_CovVrtForConstraint[i]); }
+    }else{ for( int i=0; i<6; i++) { m_vkalFitControl->m_forcft.covvrt[i] = 0.; } }
+
+    // Configure neutral particles if required
+    if(m_TrackCharge.size() > 0){
+      for(int i=0; i<(int)m_TrackCharge.size(); i++){ 
+	 int iref=m_TrackCharge[i];   if( iref < 0  || iref > NTRK-1)    continue;
+	 m_ich[iref]=0;
+	 if(m_apar[iref][4]<0){ m_apar[iref][4] =-m_apar[iref][4];      // Charge=0 is always equal to Charge=+1
+	                        m_awgt[iref][10]=-m_awgt[iref][10];
+	                        m_awgt[iref][11]=-m_awgt[iref][11];
+	                        m_awgt[iref][12]=-m_awgt[iref][12];
+	                        m_awgt[iref][13]=-m_awgt[iref][13]; }
+      }
+    }
+    // Add global mass constraint if present
+    if(m_massForConstraint >= 0.) m_vkalFitControl->setMassCnstData(NTRK,m_massForConstraint);
+    // Add partial mass constraints if present
+    if(m_partMassCnst.size() > 0) {
+      for(int ic=0; ic<(int)m_partMassCnst.size(); ic++){ m_vkalFitControl->setMassCnstData(NTRK, m_partMassCnstTrk[ic],m_partMassCnst[ic]);}
+    }
+    // Set general configuration parameters
+    m_vkalFitControl->setRobustness(m_Robustness);
+    m_vkalFitControl->setRobustScale(m_RobustScale);
+    m_vkalFitControl->setUsePlaneCnst(0.,0.,0.,0.);
+    if(m_IterationPrecision>0.) m_vkalFitControl->setIterationPrec(m_IterationPrecision);
+    if(m_IterationNumber)  m_vkalFitControl->setIterationNum(m_IterationNumber);
+    if(m_useAprioriVertex) m_vkalFitControl->setUseAprioriVrt();
+    if(m_useThetaCnst)     m_vkalFitControl->setUseThetaCnst();
+    if(m_usePhiCnst)       m_vkalFitControl->setUsePhiCnst();
+    if(m_usePointingCnst)  m_vkalFitControl->setUsePointingCnst(1);
+    if(m_useZPointingCnst) m_vkalFitControl->setUsePointingCnst(2);
+    if(m_usePassNear)      m_vkalFitControl->setUsePassNear(1);
+    if(m_usePassWithTrkErr)m_vkalFitControl->setUsePassNear(2);
+    return;
+  }  
+
+/*  void TrkVKalVrtFitter::VKalVrtSetOptions(long int ntrk)
   { 
 
     m_FitStatus = 0;     // Drop all previous fit results
 
-    double MFit    = (double) (m_MassForConstraint);
+    double MFit    = (double) (m_massForConstraint);
     long int Rob  = (long int) m_Robustness;
     for(int i=0; i<6; i++){m_CovVrtCst[i] = 0.;}
     for(int i=0; i<3; i++){m_VrtCst[i]    = 0;}
@@ -107,7 +164,7 @@ namespace Trk{
   void TrkVKalVrtFitter::initCnstList()
   {
 //--- Mass constraint is restored here
-    if( m_MassForConstraint>0. || m_PartMassCnst.size()>0 ) vksetUseMassCnst();
+    if( m_massForConstraint>0. || m_PartMassCnst.size()>0 ) vksetUseMassCnst();
     if( m_useAprioriVertex ) vksetUseAprioriVrt();
     if( m_useThetaCnst )     vksetUseThetaCnst();
     if( m_usePhiCnst   )     vksetUsePhiCnst();
@@ -116,8 +173,49 @@ namespace Trk{
     if( m_usePassNear)       vksetUsePassNear(1);
     if( m_usePassWithTrkErr) vksetUsePassNear(2);
   }
+*/ 
+//Old logics. Left here for reference to compare with previous releases of VKalVrt
+//
+/*  void TrkVKalVrtFitter::setCnstType(int TYPE)
+  { if(TYPE>0)msg(MSG::DEBUG)<< "ConstraintType is changed at execution stage "<<m_iflag<<"=>"<<TYPE<< endmsg;
+    m_iflag = TYPE;
+    if(m_iflag<0)m_iflag=0;
+    if(m_iflag>14)m_iflag=0;
+    if( m_iflag == 2)  m_usePointingCnst   = true;    
+    if( m_iflag == 3)  m_useZPointingCnst  = true;    
+    if( m_iflag == 4)  m_usePointingCnst   = true;    
+    if( m_iflag == 5)  m_useZPointingCnst  = true;    
+    if( m_iflag == 6)  m_useAprioriVertex  = true;    
+    if( m_iflag == 7)  m_usePassWithTrkErr = true;    
+    if( m_iflag == 8)  m_usePassWithTrkErr = true;    
+    if( m_iflag == 9)  m_usePassNear       = true;    
+    if( m_iflag == 10) m_usePassNear       = true;    
+    if( m_iflag == 11) m_usePhiCnst = true;    
+    if( m_iflag == 12) { m_usePhiCnst = true; m_useThetaCnst = true;}
+    if( m_iflag == 13) { m_usePhiCnst = true; m_usePassNear  = true;}
+    if( m_iflag == 14) { m_usePhiCnst = true; m_useThetaCnst = true; m_usePassNear  = true;}
+  }
+  int  TrkVKalVrtFitter::getCnstDOF(){
+     if(m_iflag==1)return   1;
+     if(m_iflag==2)return   2;
+     if(m_iflag==3)return   1;
+     if(m_iflag==4)return   3;
+     if(m_iflag==5)return   2;
+     if(m_iflag==6)return   3;
+     if(m_iflag==7 || m_iflag==9 ) return   2;
+     if(m_iflag==8 || m_iflag==10) return   3;
+     if(m_iflag==11)return  1;
+     if(m_iflag==12)return  2;
+     if(m_iflag==13)return  3;
+     if(m_iflag==14)return  4;
+     return 0;
+  }
 
-
+*/
+//
+// Define finctions for on-the-fly fitter configuration 
+//
+//
   void TrkVKalVrtFitter::setApproximateVertex(double X,double Y,double Z)
   {  m_ApproximateVertex.clear(); m_ApproximateVertex.reserve(3);
      m_ApproximateVertex.push_back(X);
@@ -138,33 +236,13 @@ namespace Trk{
     if(m_RobustScale<0.01) m_RobustScale=1.;
     if(m_RobustScale>100.) m_RobustScale=1.;
   }
- 
-  void TrkVKalVrtFitter::setCnstType(int TYPE)
-  { if(TYPE>0)msg(MSG::DEBUG)<< "ConstraintType is changed at execution stage "<<m_iflag<<"=>"<<TYPE<< endmsg;
-    m_iflag = TYPE;
-    if(m_iflag<0)m_iflag=0;
-    if(m_iflag>14)m_iflag=0;
-    if( m_iflag == 2)  m_usePointingCnst   = true;    
-    if( m_iflag == 3)  m_useZPointingCnst  = true;    
-    if( m_iflag == 4)  m_usePointingCnst   = true;    
-    if( m_iflag == 5)  m_useZPointingCnst  = true;    
-    if( m_iflag == 6)  m_useAprioriVertex  = true;    
-    if( m_iflag == 7)  m_usePassWithTrkErr = true;    
-    if( m_iflag == 8)  m_usePassWithTrkErr = true;    
-    if( m_iflag == 9)  m_usePassNear       = true;    
-    if( m_iflag == 10) m_usePassNear       = true;    
-    if( m_iflag == 11) m_usePhiCnst = true;    
-    if( m_iflag == 12) { m_usePhiCnst = true; m_useThetaCnst = true;}
-    if( m_iflag == 13) { m_usePhiCnst = true; m_usePassNear  = true;}
-    if( m_iflag == 14) { m_usePhiCnst = true; m_useThetaCnst = true; m_usePassNear  = true;}
-  }
 
   void TrkVKalVrtFitter::setMassForConstraint(double MASS)
-  { m_MassForConstraint = MASS;}
+  { m_massForConstraint = MASS;}
 
   void TrkVKalVrtFitter::setMassForConstraint(double MASS, std::vector<int> TrkIndex)
-  { m_PartMassCnst.push_back(MASS);
-    m_PartMassCnstTrk.push_back(TrkIndex);
+  { m_partMassCnst.push_back(MASS);
+    m_partMassCnstTrk.push_back(TrkIndex);
   }
 
   void TrkVKalVrtFitter::setMomCovCalc(int TYPE)
@@ -222,26 +300,22 @@ namespace Trk{
     for(int i=0; i<(int)mass.size(); i++) m_MassInputParticles.push_back(fabs(mass[i]));
   }
 
-  void TrkVKalVrtFitter::setZeroCharge(int Track)
-  { m_TrackCharge.push_back(Track);
-  }
+  void TrkVKalVrtFitter::setZeroCharge(int Track) { m_TrackCharge.push_back(Track);}
 
 
   void TrkVKalVrtFitter::setDefault()
   {
-//   std::cout<<" In"<<'\n';
    setApproximateVertex(0.,0.,0.);
    setRobustness(0);
    setCascadeCnstPrec(1.e-4);
-   setMassForConstraint(0.);
+   setMassForConstraint(-1.);
    setVertexForConstraint(0.,0.,0.);
    setCovVrtForConstraint(1.e6,0.,1.e6,0.,0.,1.e6);
    m_MassInputParticles.clear();
-   setCnstType(0);
    setMomCovCalc(0);
    m_TrackCharge.clear();
-   m_PartMassCnst.clear();
-   m_PartMassCnstTrk.clear();
+   m_partMassCnst.clear();
+   m_partMassCnstTrk.clear();
    m_IterationNumber = 0;
    m_IterationPrecision = 0.;
    m_useAprioriVertex = false;
@@ -253,19 +327,4 @@ namespace Trk{
    m_usePassWithTrkErr = false;
   }
 
-  int  TrkVKalVrtFitter::getCnstDOF(){
-     if(m_iflag==1)return   1;
-     if(m_iflag==2)return   2;
-     if(m_iflag==3)return   1;
-     if(m_iflag==4)return   3;
-     if(m_iflag==5)return   2;
-     if(m_iflag==6)return   3;
-     if(m_iflag==7 || m_iflag==9 ) return   2;
-     if(m_iflag==8 || m_iflag==10) return   3;
-     if(m_iflag==11)return  1;
-     if(m_iflag==12)return  2;
-     if(m_iflag==13)return  3;
-     if(m_iflag==14)return  4;
-     return 0;
-  }
 } //end of namespace
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
index 0a4595b299d9f1d42630f7095541a8928bdc6b7c..b2187e805c03190e929ec355b54bbeb15f0eda13 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkCascadeFitter.cxx
@@ -14,9 +14,7 @@
 #include<iostream>
 
 namespace Trk {
-    extern vkalMagFld      myMagFld;
-    extern vkalPropagator  myPropagator;
-    extern int makeCascade(long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
+    extern int makeCascade(const VKalVrtControl & FitCONTROL, long int NTRK, long int *ich, double *wm, double *inp_Trk5, double *inp_CovTrk5,
                    std::vector< std::vector<int> > vertexDefinition,
                    std::vector< std::vector<int> > cascadeDefinition,
 		   double definedCnstAccuracy=1.e-4);
@@ -35,9 +33,6 @@ namespace Trk {
     extern int setCascadeMassConstraint(long int IV, std::vector<int> &, std::vector<int> &, double Mass);
 
 
- extern vkalMagFld      myMagFld;
- extern vkalPropagator  myPropagator;
-
 
    /** Interface for  cascade fit*/
 //-----------------------------------------------------------------------------------------
@@ -320,12 +315,6 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
     std::vector<double>  particleChi2;
 //
     if(!m_isFieldInitialized)setInitializedField();    //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
     long int ntrk=0;
     StatusCode sc; sc.setChecked();
@@ -350,13 +339,13 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
     }
     if(sc.isFailure())return 0;
 
-    VKalVrtSetOptions( ntrk );
+    VKalVrtConfigureFitterCore(ntrk);
 
     makeSimpleCascade(m_vertexDefinition, m_cascadeDefinition);
 
     double * partMass=new double[ntrk];
     for(int i=0; i<ntrk; i++) partMass[i]  = m_partMassForCascade[i];
-    int IERR = makeCascade( ntrk, m_ich, partMass, &m_apar[0][0], &m_awgt[0][0],
+    int IERR = makeCascade(*m_vkalFitControl, ntrk, m_ich, partMass, &m_apar[0][0], &m_awgt[0][0],
                             m_vertexDefinition,
                             m_cascadeDefinition,
 			    m_cascadeCnstPrecision);  delete[] partMass; if(IERR){ cleanCascade(); return 0;}
@@ -452,7 +441,7 @@ VxCascadeInfo * TrkVKalVrtFitter::fitCascade(const Vertex* primVrt, bool FirstDe
        cleanCascade();
        partMass=new double[ntrk];
        for(int i=0; i<ntrk; i++) partMass[i]  = m_partMassForCascade[i];
-       int IERR = makeCascade( ntrk, m_ich, partMass, &m_apar[0][0], &m_awgt[0][0],
+       int IERR = makeCascade(*m_vkalFitControl, ntrk, m_ich, partMass, &m_apar[0][0], &m_awgt[0][0],
                                new_vertexDefinition,
                                new_cascadeDefinition);        delete[] partMass;  if(IERR){ cleanCascade(); return 0;}
 //------Set up mass constraints
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
index 22a2b035ed7919631b7d836063fbe0997e23095c..960aa0f509a2d70f9cba0f542bea6b14354233e0 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/TrkVKalVrtFitter.cxx
@@ -5,6 +5,7 @@
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 #include "TrkVKalVrtFitter/VKalVrtAtlas.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 #include "TrkTrack/LinkToTrack.h"
 #include "TrkTrack/Track.h"
 #include "xAODTracking/TrackParticleContainer.h"
@@ -20,7 +21,6 @@
 
 namespace Trk {
     extern vkalMagFld      myMagFld;
-    extern vkalPropagator  myPropagator;
 }
 namespace Trk{
 
@@ -33,8 +33,7 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
     m_Robustness(0),
     m_RobustScale(1.),
     m_cascadeCnstPrecision(1.e-4),
-    m_Constraint(0),
-    m_MassForConstraint(0.),
+    m_massForConstraint(-1.),
     m_IterationNumber(0),
     m_IterationPrecision(0),
     m_IDsizeR(1150.),
@@ -53,7 +52,6 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
     m_useZPointingCnst(false),
     m_usePassNear(false),
     m_usePassWithTrkErr(false),
-    m_useMagFieldRotation(false),
     m_Charge(0),
     m_Chi2(0.),
     m_cascadeSize(0),
@@ -84,21 +82,20 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
     declareProperty("Robustness",   m_Robustness);
     declareProperty("RobustScale",  m_RobustScale);
     declareProperty("CascadeCnstPrecision", m_cascadeCnstPrecision);
-    declareProperty("Constraint",           m_Constraint);
-    declareProperty("MassForConstraint",    m_MassForConstraint);
+    declareProperty("MassForConstraint",    m_massForConstraint);
     declareProperty("IterationNumber",      m_IterationNumber);
     declareProperty("IterationPrecision",   m_IterationPrecision);
     declareProperty("IDsizeR",              m_IDsizeR);
     declareProperty("IDsizeZ",              m_IDsizeZ);
     declareProperty("VertexForConstraint",  m_c_VertexForConstraint);
     declareProperty("CovVrtForConstraint",  m_c_CovVrtForConstraint);
-    declareProperty("InputParticleMasses",  m_c_MassInputParticles);
-    declareProperty("ZeroChgTracks",        m_c_TrackCharge);
+    declareProperty("InputParticleMasses",  m_c_MassInputParticles, "List of masses of input particles (pions assumed if this list is absent)" );
+    declareProperty("ZeroChgTracks",        m_c_TrackCharge, "Numbers of neutral tracks in input set (numbering from zero)");
     declareProperty("Extrapolator",         m_extPropagator);
     declareProperty("AtlasMagFieldSvc",     m_magFieldAthenaSvc);
     declareProperty("FirstMeasuredPoint",   m_firstMeasuredPoint);
     declareProperty("FirstMeasuredPointLimit",   m_firstMeasuredPointLimit);
-    declareProperty("MakeExtendedVertex",   m_makeExtendedVertex);
+    declareProperty("MakeExtendedVertex",   m_makeExtendedVertex, "VKalVrt returns VxCandidate with full covariance matrix");
 //
     declareProperty("useAprioriVertexCnst",   m_useAprioriVertex);
     declareProperty("useThetaCnst",           m_useThetaCnst);
@@ -107,7 +104,6 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
     declareProperty("useZPointingCnst",       m_useZPointingCnst);
     declareProperty("usePassNearCnst",        m_usePassNear);
     declareProperty("usePassWithTrkErrCnst",  m_usePassWithTrkErr);
-    declareProperty("useMagFieldRotation",    m_useMagFieldRotation);
 // 
     m_iflag=0;
     m_ifcovv0=0;
@@ -117,7 +113,7 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
     m_refFrameZ = 0.;
     m_globalFirstHit = 0;
     m_planeCnstNDOF = 0;
-    VKalVrtSetOptions( 2 );    //Needed for initialisation of the fitting kernel
+    m_vkalFitControl = 0;
                                
 /*--------------------------------------------------------------------------*/
 /*  New magnetic field object is created. It's provided to VKalVrtCore.     */
@@ -125,22 +121,16 @@ TrkVKalVrtFitter:: TrkVKalVrtFitter(const std::string& type,
 /*           myMagFld is a static oblect in VKalVrtCore                     */ 
 
     m_fitField = new VKalAtlasMagFld();
-    m_fitField->setAtlasMag(m_BMAG);
-    Trk::myMagFld.setMagHandler(m_fitField);  // fixed field
-    m_PropagatorType = 0;                     // fixed field propagator from VKalVrtCore
+    m_fitField->setAtlasField(m_BMAG);
 
-    m_fitRotatedField = new VKalAtlasMagFld();   // New field object for  field in rotated frame
-    m_fitRotatedField->setAtlasMag(m_BMAG);
-
-//    Trk::myPropagator.setTypeProp(1);     //For test only. Runge-Kutta propagator
 /*--------------------------------------------------------------------------*/
 /*  New propagator object is created. It's provided to VKalVrtCore.         */
 /*  VKalVrtFitter must set up Core BEFORE any call required propagation!!!  */  
 /*  This object is created ONLY if IExtrapolator pointer is provideded.     */
 /*         see VKalExtPropagator.cxx for details                            */
-//  m_fitPropagator = new VKalExtPropagator( this );
-    m_fitPropagator = 0;
-    m_InDetExtrapolator = 0;
+/*--------------------------------------------------------------------------*/
+    m_fitPropagator = 0;       //Pointer to VKalVrtFitter propagator object to supply to VKalVrtCore (specific interface) 
+    m_InDetExtrapolator = 0;   //Direct pointer to Athena propagator
 
     m_isAtlasField       = false;   // To allow callback and then field first call only at execute stage
     m_isFieldInitialized = false;   //
@@ -152,9 +142,9 @@ TrkVKalVrtFitter::~TrkVKalVrtFitter(){
     //log << MSG::DEBUG << "TrkVKalVrtFitter destructor called" << endmsg;
     if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"TrkVKalVrtFitter destructor called" << endmsg;
     delete m_fitField;
-    delete m_fitRotatedField;
     if(m_fitPropagator) delete m_fitPropagator;
     if(m_ErrMtx)delete[] m_ErrMtx;
+    if(m_vkalFitControl) delete m_vkalFitControl;
 }
 
 
@@ -200,7 +190,7 @@ StatusCode TrkVKalVrtFitter::initialize()
     m_TrackCharge.resize(nItr);       for(int itr=0; itr<nItr; itr++)m_TrackCharge[itr]        =m_c_TrackCharge[itr];
 
 
-// Setting constraint type
+// Setting constraint type - not used anymore, left for old code reference here....
 //    if( m_Constraint == 2)  m_usePointingCnst   = true;    
 //    if( m_Constraint == 3)  m_useZPointingCnst  = true;    
 //    if( m_Constraint == 4)  m_usePointingCnst   = true;    
@@ -213,12 +203,6 @@ StatusCode TrkVKalVrtFitter::initialize()
 //    if( m_Constraint == 11) m_usePhiCnst = true;    
 //    if( m_Constraint == 12) { m_usePhiCnst = true; m_useThetaCnst = true;}
 //    setCnstType((int)m_Constraint);
-    if( m_Constraint ){
-       if(msgLvl(MSG::INFO))msg(MSG::INFO)<<"jobOption Constraint is obsolte now! Use the following jobO instead:"<< endmsg;
-       if(msgLvl(MSG::INFO))msg(MSG::INFO)<<"       useAprioriVertexCnst,useThetaCnst,usePhiCnst,usePointingCnst"<<endmsg;
-       if(msgLvl(MSG::INFO))msg(MSG::INFO)<<"       useZPointingCnst,usePassNearCnst,usePassWithTrkErrCnst"<<endmsg;
-       m_Constraint=0;
-    }
 
     StatusCode sc=m_magFieldAthenaSvc.retrieve();
     if (sc.isFailure() ){
@@ -228,7 +212,12 @@ StatusCode TrkVKalVrtFitter::initialize()
         if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<< "MagFieldAthenaSvc is retrieved" << endmsg;  
     }
 //
-//
+// Only here the VKalVrtFitter propagator object is created if ATHENA propagator is provided (see setAthenaPropagator)
+// In this case the ATHENA propagator can be used via pointers:
+//     m_InDetExtrapolator - direct access
+//     m_fitPropagator     - via VKalVrtFitter object VKalExtPropagator
+// If ATHENA propagator is not provided, only defined object is
+//     myPropagator      - extern propagator from TrkVKalVrtCore
 //
     if (m_extPropagator.name() == "DefaultVKalPropagator" ){
       if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<< "External propagator is not supplied - use internal one"<<endmsg;
@@ -241,17 +230,38 @@ StatusCode TrkVKalVrtFitter::initialize()
       }else{
         if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<< "External propagator="<<m_extPropagator<<" retrieved" << endmsg;
         const IExtrapolator * tmp =& (*m_extPropagator);
-        setAthenaPropagator(tmp);
+        setAthenaPropagator(tmp); 
       }
     }
-
+//
+//---Set Control object for TrkVKalVrtCore with constraints defined in jobO
+//
+    m_vkalFitControl = new VKalVrtControl(VKalVrtControlBase(m_fitField,0,m_fitPropagator,0));  // Create main control object for TrkVKalVrtCore
+
+    for(int it=0; it<(int)m_MassInputParticles.size(); it++) m_vkalFitControl->m_forcft.wm[it]=m_MassInputParticles[it]; //jobO track masses
+    m_vkalFitControl->setRobustness(m_Robustness);
+    m_vkalFitControl->setRobustScale(m_RobustScale);
+    for(int it=0; it<(int)m_VertexForConstraint.size(); it++) m_vkalFitControl->m_forcft.vrt[it]=m_VertexForConstraint[it]; //jobO vertex for cnst
+    for(int it=0; it<(int)m_CovVrtForConstraint.size(); it++) m_vkalFitControl->m_forcft.covvrt[it]=m_CovVrtForConstraint[it]; //jobO vertex covariance
+    if(m_massForConstraint>0.) m_vkalFitControl->setMassCnstData(m_MassInputParticles.size(),m_massForConstraint); // configure general mass constraint
+    if(m_IterationPrecision>0.)m_vkalFitControl->setIterationPrec(m_IterationPrecision);
+    if(m_IterationNumber)  m_vkalFitControl->setIterationNum(m_IterationNumber);
+    if(m_useAprioriVertex) m_vkalFitControl->setUseAprioriVrt();
+    if(m_useThetaCnst)     m_vkalFitControl->setUseThetaCnst();
+    if(m_usePhiCnst)       m_vkalFitControl->setUsePhiCnst();
+    if(m_usePointingCnst)  m_vkalFitControl->setUsePointingCnst(1);
+    if(m_useZPointingCnst) m_vkalFitControl->setUsePointingCnst(2);
+    if(m_usePassNear)      m_vkalFitControl->setUsePassNear(1);
+    if(m_usePassWithTrkErr)m_vkalFitControl->setUsePassNear(2);
+//
+//
     m_timingProfile=0;
     sc = service("ChronoStatSvc", m_timingProfile);
     if ( sc.isFailure() || 0 == m_timingProfile) {
       if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Can not find ChronoStatSvc name="<<m_timingProfile << endmsg;
     }
 
-//    m_PropagatorType=1;  //Just for technical checks
+
 //
     m_ErrMtx=0;            // pointer to double array for error matrix
 //
@@ -265,8 +275,8 @@ StatusCode TrkVKalVrtFitter::initialize()
        msg(MSG::DEBUG)<< "   ZPointing to other vertex constraint: "<< m_useZPointingCnst <<endmsg;
        msg(MSG::DEBUG)<< "   Comb. particle pass near other vertex:"<< m_usePassNear <<endmsg;
        msg(MSG::DEBUG)<< "   Pass near with comb.particle errors:  "<< m_usePassWithTrkErr <<endmsg;
-       if(m_MassForConstraint>0){ 
-         msg(MSG::DEBUG)<< "   Mass constraint M="<< m_MassForConstraint <<endmsg; 
+       if(m_massForConstraint>0){ 
+         msg(MSG::DEBUG)<< "   Mass constraint M="<< m_massForConstraint <<endmsg; 
          msg(MSG::DEBUG)<< " with particles M=";
          for(int i=0; i<(int)m_MassInputParticles.size(); i++) msg(MSG::DEBUG)<<m_MassInputParticles[i]<<", ";
          msg(MSG::DEBUG)<<endmsg; ;
@@ -283,10 +293,6 @@ StatusCode TrkVKalVrtFitter::initialize()
        if(m_firstMeasuredPoint){ msg(MSG::DEBUG)<< " VKalVrt will use FirstMeasuredPoint strategy in fits with InDetExtrapolator"<<endmsg; }
        else                    { msg(MSG::DEBUG)<< " VKalVrt will use Perigee strategy in fits with InDetExtrapolator"<<endmsg; }
        if(m_firstMeasuredPointLimit){ msg(MSG::DEBUG)<< " VKalVrt will use FirstMeasuredPointLimit strategy "<<endmsg; }
-       if(m_useMagFieldRotation){ 
-                 msg(MSG::DEBUG)<< " VKalVrt will use ROTATION to magnetic field direction. NO pointing constraints are allowed "<<endmsg;
-                 msg(MSG::DEBUG)<< "        The only function fit(Trk::TrackParameters trk, Trk::Vertex vrt) is allowed for the moment "<<endmsg;
-       }
     }
 
 
@@ -303,12 +309,6 @@ StatusCode TrkVKalVrtFitter::initialize()
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*> & vectorTrk,
                                     const Amg::Vector3D & firstStartingPoint)
 {
-//    m_fitSvc->setDefault();
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<< " fit(Track trk, Vertex vrt) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Vertex vrt) instead"<<endmsg;
-       return 0;
-    }
     m_globalFirstHit = 0;
     setApproximateVertex(firstStartingPoint.x(),
                          firstStartingPoint.y(),
@@ -341,12 +341,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*> & vectorTrk
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const TrackParticleBase*> & vectorTrk,
                                     const Amg::Vector3D & firstStartingPoint)
 {
-//    m_fitSvc->setDefault();
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(TrackParticleBase trk, Vertex vrt) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Vertex vrt) instead"<<endmsg;
-       return 0;
-    }
     m_globalFirstHit = 0;
     setApproximateVertex(firstStartingPoint.x(),
                          firstStartingPoint.y(),
@@ -386,11 +380,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const TrackParticleBase*>
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*>& vectorTrk,
                                                  const xAOD::Vertex& firstStartingPoint)
 {   
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(Track trk, xAOD::Vertex vrt) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Amg::Vector3D vrt) instead"<<endmsg;
-       return 0;
-    }
     if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)<< "A priori vertex constraint is added to VKalVrt fitter!" << endmsg;
 //    m_fitSvc->setDefault();
     m_globalFirstHit = 0;
@@ -440,11 +429,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*>& vectorTrk,
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const TrackParticleBase*>& vectorTrk,
                                     const xAOD::Vertex & firstStartingPoint)
 {   
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(TrackParticleBase trk, xAOD::Vertex vrt) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Amg::Vector3D vrt) instead"<<endmsg;
-       return 0;
-    }
     if(msgLvl(MSG::DEBUG)) msg(MSG::DEBUG)<< "A priori vertex constraint is added to VKalVrt fitter!" << endmsg;
 //    m_fitSvc->setDefault();
     m_globalFirstHit = 0;
@@ -838,11 +822,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const xAOD::TrackParticle
 
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*> & vectorTrk)
 {
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(Track trk) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(ParametersBase trk, Amg::Vector3D vrt) instead"<<endmsg;
-       return 0;
-    }
     Amg::Vector3D VertexIni(0.,0.,0.);
     m_globalFirstHit = 0;
 
@@ -873,11 +852,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const Track*> & vectorTrk
 
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const  TrackParameters*> & perigeeListC)
 {
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(TrackParameters trk) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Vertex vrt) instead"<<endmsg;
-       return 0;
-    }
     m_globalFirstHit = 0;
     Amg::Vector3D VertexIni(0.,0.,0.);
     StatusCode sc=VKalVrtFitFast(perigeeListC, VertexIni); 
@@ -901,11 +875,6 @@ xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const  TrackParameters*>
 xAOD::Vertex * TrkVKalVrtFitter::fit(const std::vector<const  TrackParameters*>   & perigeeListC,
                                     const std::vector<const  NeutralParameters*> & perigeeListN)
 {
-    if(m_useMagFieldRotation){ 
-       msg(MSG::WARNING)<<"fit(TrackParameters trk) is not allowed with  useMagFieldRotation jobO"<<endmsg;
-       msg(MSG::WARNING)<<"Use fit(TrackParameters trk, Vertex vrt) instead"<<endmsg;
-       return 0;
-    }
     m_globalFirstHit = 0;
     Amg::Vector3D VertexIni(0.,0.,0.);
     StatusCode sc=VKalVrtFitFast(perigeeListC, VertexIni); 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx
index 979d1792ff4c6a2699929b296a3d5ee22d65e39b..0fa199318ddd8d4a15b83994959dc9a99b6fb571 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx
@@ -1,6 +1,20 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 */
+//
+// The VKalExtPropagator object is created if ATHENA propagator exists 
+// and is supplied via jobOptions. A pointer to it is supplied to VKalVrtCore
+// for every vertex fit via VKalVrtControlBase object.
+// VKalVrtCore uses it to extrapolate tracks for a vertex fit.
+// 
+// If ATHENA propagator doesn't exist, the VKalVrtCore uses its internal 
+// propagator without material. 
+//
+// myPropagator object exists always in VKalVrtCore and should be used
+// by default for track propagation in VKalVrtFitter.
+//------------------------------------------------------------------------- 
+
+
 
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
@@ -15,12 +29,8 @@
 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
 //                  External propagator access for VKalVrt
 
-  namespace Trk {
-    extern vkalPropagator  myPropagator;
-  }
-
-  namespace Trk{
-
+namespace Trk {
+ 
   // Constructor
   VKalExtPropagator::VKalExtPropagator( TrkVKalVrtFitter* pnt)
   {
@@ -33,7 +43,6 @@
   void VKalExtPropagator::setPropagator(const IExtrapolator*  Pnt)
   {
      m_extrapolator = Pnt;
-     Trk::myPropagator.setPropagator(this);
   }
 
 //Protection against exit outside ID volume
@@ -52,29 +61,6 @@
   bool VKalExtPropagator::checkTarget( double *RefEnd) const
   {
       double vX=RefEnd[0]; double vY=RefEnd[1]; double vZ=RefEnd[2];
-      if( m_vkalFitSvc->m_trkControl[0].rotateToField) {
-        double fx,fy,fz, oldField, newField;
-        Amg::Vector3D step(RefEnd[0]-m_vkalFitSvc->m_trkControl[0].trkSavedLocalVertex.x(),
-                           RefEnd[1]-m_vkalFitSvc->m_trkControl[0].trkSavedLocalVertex.y(),
-                           RefEnd[2]-m_vkalFitSvc->m_trkControl[0].trkSavedLocalVertex.z());
-        Amg::Vector3D globalRefEnd = (m_vkalFitSvc->m_trkControl[0].trkRotation.inverse())*step 
-                                    + m_vkalFitSvc->m_trkControl[0].trkRotationVertex;
-//
-        vX=m_vkalFitSvc->m_trkControl[0].trkRotationVertex.x()-m_vkalFitSvc->m_refFrameX;
-        vY=m_vkalFitSvc->m_trkControl[0].trkRotationVertex.y()-m_vkalFitSvc->m_refFrameY;
-        vZ=m_vkalFitSvc->m_trkControl[0].trkRotationVertex.z()-m_vkalFitSvc->m_refFrameZ;
-        m_vkalFitSvc->m_fitField->getMagFld(vX,vY,vZ,fx,fy,fz);
-        oldField=sqrt(fx*fx+fy*fy+fz*fz); if(oldField<0.2) oldField=0.2;
-//
-        vX=globalRefEnd.x()-m_vkalFitSvc->m_refFrameX;
-        vY=globalRefEnd.y()-m_vkalFitSvc->m_refFrameY;
-        vZ=globalRefEnd.z()-m_vkalFitSvc->m_refFrameZ;
-        m_vkalFitSvc->m_fitField->getMagFld(vX,vY,vZ,fx,fy,fz);
-        newField=sqrt(fx*fx+fy*fy+fz*fz); if(newField<0.2) newField=0.2;
-//
-        if( fabs(newField-oldField)/oldField > 1.0 ) return false;
-      }
-
       double targV[3]={ vX, vY, vZ};
       if( Protection(targV) >1. ) return false;
       return true;
@@ -87,8 +73,6 @@
 //    it always use this point as starting point, 
 //     so ParOld,CovOld,RefStart are irrelevant
 //
-//    When ROTATION is used in the fit   RefEnd is also in ROTATED frame,
-//      and must be rotated back
 /*------------------------------------------------------------------------------------*/
   void VKalExtPropagator::Propagate( long int trkID, long int Charge, 
                                      double *ParOld, double *CovOld, double *RefStart, 
@@ -96,22 +80,8 @@
   {
       int trkID_loc=trkID; if(trkID_loc<0)trkID_loc=0;
 //std::cout<<" Ext.Propagator TrkID="<<trkID<<"to (local!!!)="<<RefEnd[0]<<", "<<RefEnd[1]<<", "<<RefEnd[2]<<'\n';
-//End point. In case of rotation extrapolation target is given in old rotated system
-//           so it's rotated back using saved on given track rotation parameters 
 //-----------
       double vX=RefEnd[0]; double vY=RefEnd[1]; double vZ=RefEnd[2];
-      if(  m_vkalFitSvc->m_trkControl.at(trkID_loc).rotateToField &&
-          !m_vkalFitSvc->m_trkControl[trkID_loc].trkRotation.isIdentity()) {
-
-        Amg::Vector3D step(RefEnd[0]-m_vkalFitSvc->m_trkControl[trkID_loc].trkSavedLocalVertex.x(),
-                           RefEnd[1]-m_vkalFitSvc->m_trkControl[trkID_loc].trkSavedLocalVertex.y(),
-                           RefEnd[2]-m_vkalFitSvc->m_trkControl[trkID_loc].trkSavedLocalVertex.z());
-        Amg::Vector3D globalRefEnd = (m_vkalFitSvc->m_trkControl[trkID_loc].trkRotation.inverse())*step 
-                                    + m_vkalFitSvc->m_trkControl[trkID_loc].trkRotationVertex;
-        vX=globalRefEnd.x()-m_vkalFitSvc->m_refFrameX;
-        vY=globalRefEnd.y()-m_vkalFitSvc->m_refFrameY;
-        vZ=globalRefEnd.z()-m_vkalFitSvc->m_refFrameZ;
-      }
       Amg::Vector3D endPoint( vX + m_vkalFitSvc->m_refFrameX, vY + m_vkalFitSvc->m_refFrameY, vZ + m_vkalFitSvc->m_refFrameZ);
 //
 // ---- Make MeasuredPerigee from input. Mag.field at start point is used here
@@ -133,20 +103,7 @@
 //
       double fx,fy,fz,BMAG_FIXED;
       m_vkalFitSvc->m_fitField->getMagFld(vX,vY,vZ,fx,fy,fz);
-      BMAG_FIXED=fz;  // standard when rotation to field direction is absent 
-      if(m_vkalFitSvc->m_trkControl[trkID_loc].rotateToField) {
-         BMAG_FIXED=sqrt(fx*fx+fy*fy+fz*fz);
-         m_vkalFitSvc->m_fitRotatedField->setAtlasMag(BMAG_FIXED);  //set fixed ROTATED field in corresponding VKal oblect
-      }
-//
-// ----- Prepare line target. In case of rotation - save new rotation parameters to track object
-      Amg::RotationMatrix3D magFldRot; magFldRot.setIdentity();
-      if(trkID>=0 && m_vkalFitSvc->m_trkControl[trkID].rotateToField){
-          magFldRot=m_vkalFitSvc->getMagFldRotation(fx,fy,fz,m_vkalFitSvc->m_refFrameX,m_vkalFitSvc->m_refFrameY,0.);
-          m_vkalFitSvc->m_trkControl[trkID].trkRotation=magFldRot;
-          m_vkalFitSvc->m_trkControl[trkID].trkRotationVertex   = Amg::Vector3D(endPoint.x(),endPoint.y(),endPoint.z());
-          m_vkalFitSvc->m_trkControl[trkID].trkSavedLocalVertex = Amg::Vector3D(RefEnd[0],RefEnd[1],RefEnd[2]);
-      }
+      BMAG_FIXED=fz;  // standard 
 //
 //-------------------- Extrapolation itself
 //
@@ -154,16 +111,7 @@
       if(trkID<0){
             endPer = myExtrapWithMatUpdate( trkID, inpPar, &endPoint);
       }else{
-        if(m_vkalFitSvc->m_trkControl[trkID].rotateToField) {
-            Amg::Vector3D lineCenter( vX + m_vkalFitSvc->m_refFrameX, vY + m_vkalFitSvc->m_refFrameY, vZ + m_vkalFitSvc->m_refFrameZ);
-            StraightLineSurface lineTarget(new Amg::Transform3D( magFldRot.inverse() , lineCenter));
-//=Check StraightLineSurface
-//          GlobalPosition testpos(lineCenter.x()-100.*fx,lineCenter.y()-100.*fy,lineCenter.z()-100.*fz);
-//          std::cout<<" checkLineSurface="<<*(lineTarget.globalToLocal(testpos))<<" BMAG="<<BMAG_FIXED<<'\n';
-            endPer = myExtrapToLine(trkID,  inpPar, &endPoint, lineTarget);
-        }else{	   
             endPer = myExtrapWithMatUpdate( trkID, inpPar, &endPoint);
-        }
       }
 //-----------------------------------
       if( endPer == 0 ) {   // No extrapolation done!!!
@@ -186,14 +134,6 @@
         ParNew[0]=0.; ParNew[1]=0.;ParNew[2]=0.;ParNew[3]=0.;ParNew[4]=0.;
         delete inpPer; return;
       }
-      if(m_vkalFitSvc->m_trkControl[trkID_loc].rotateToField) {
-         Amg::Vector3D rotatedMomentum(0.,0.,0.);
-         if(mPer)rotatedMomentum=magFldRot*Amg::Vector3D(mPer->momentum().x(),mPer->momentum().y(),mPer->momentum().z());
-         if(Line)rotatedMomentum=magFldRot*Amg::Vector3D(Line->momentum().x(),Line->momentum().y(),Line->momentum().z());
-//         VectPerig[2] += atan2(rotatedMomentum.y(),rotatedMomentum.x()); //VK wrong 27.09.10
-         VectPerig[2] = atan2(rotatedMomentum.y(),rotatedMomentum.x());
-         VectPerig[3] = atan2(rotatedMomentum.perp(),rotatedMomentum.z());
-      }
 
       if((*CovMtx)(0,0)<=0. || (*CovMtx)(1,1)<=0.){                     //protection against bad error matrix
         ParNew[0]=0.; ParNew[1]=0.;ParNew[2]=0.;ParNew[3]=0.;ParNew[4]=0.;
@@ -353,7 +293,7 @@
   }
 
 /*--------------------------------------------------------------------------------------*/
-/* Extrapolation to line to allow rotation of coordinate system in nonuniform mag.field */
+/* Extrapolation to line                                                                */
 /*											*/
 /*    All points are in GLOBAL Atlas frame here!					*/
 /*         DOESN't WORK FOR COMBINED TRACKS!						*/
@@ -467,7 +407,6 @@
      if(m_fitPropagator != 0) delete m_fitPropagator;
      m_fitPropagator = new VKalExtPropagator( this );
      m_fitPropagator->setPropagator(Pnt); 
-     m_PropagatorType = 3;       // Set up external propagator
      m_InDetExtrapolator = Pnt;  // Pointer to InDet extrapolator
   }
 
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx
index 2cf744a5c6dfb5108620e300863c12e1300fee09..f606c415a37eb77c42977c87219ebaf356f19f8e 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalGetImpact.cxx
@@ -5,6 +5,7 @@
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 #include "TrkVKalVrtFitter/VKalVrtAtlas.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 //-------------------------------------------------
 //
 #include<iostream>
@@ -13,9 +14,8 @@ namespace Trk {
  extern   
   void cfimp(long int TrkID, long int  ICH, long int IFL, double* PAR, double* ERR,
               double* VRT, double* VCOV,
-	      double* RIMP, double* RCOV, double*  SIGN);
- extern vkalMagFld      myMagFld;
- extern vkalPropagator  myPropagator;
+	      double* RIMP, double* RCOV, double*  SIGN, const VKalVrtControlBase * FitCONTROL );
+
 }
 //
 //__________________________________________________________________________
@@ -41,12 +41,6 @@ namespace Trk{
     long int vkCharge=Charge;
 
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -66,7 +60,7 @@ namespace Trk{
     double VrtCov[6]={0.,0.,0.,0.,0.,0.};
 //
 //
-    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF);
+    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF, m_vkalFitControl);
 
     Impact.push_back(RIMP[0]);
     Impact.push_back(RIMP[1]);
@@ -101,12 +95,6 @@ namespace Trk{
     long int vkCharge=Charge;
 
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -126,7 +114,7 @@ namespace Trk{
     double VrtCov[6]={0.,0.,0.,0.,0.,0.};
 //
 //
-    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF);
+    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF, m_vkalFitControl);
 
     Impact.push_back(RIMP[0]);
     Impact.push_back(RIMP[1]);
@@ -158,12 +146,6 @@ namespace Trk{
     long int vkCharge=Charge;
 
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -183,7 +165,7 @@ namespace Trk{
     double VrtCov[6]={0.,0.,0.,0.,0.,0.};
 //
 //
-    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF);
+    Trk::cfimp( 0, vkCharge, 0, &m_apar[0][0], &m_awgt[0][0], &VrtInp[0], &VrtCov[0], &RIMP[0], &RCOV[0], &SIGNIF, m_vkalFitControl);
 
     Impact.push_back(RIMP[0]);
     Impact.push_back(RIMP[1]);
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalMagFld.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalMagFld.cxx
index de224d1e353c3cfd51947becff00048f7fe31f6f..e025e425d6afff28349b766e623fb6f03940feab 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalMagFld.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalMagFld.cxx
@@ -3,7 +3,7 @@
 */
 
 //  AtlasMagFld object inherits from Trk::baseMagFld.  So pointer
-//  AtlasMagFld*  is transferred to VKalVrtCore through Trk::myMagFld.setMagHandler().
+//  AtlasMagFld*  is transferred to VKalVrtCore through VKalVrtControlBase object
 //  Then this field is used in CORE for fitting
 //
 //
@@ -23,10 +23,6 @@
 //  
 //  Currently works with both TrackingMagField and AtlasMagField
 //
-//
-//  ATHENA  object "m_fitRotatedField" of AtlasMagFld type is created in VKalVrtFitter during init.
-//  This object is provided to VKalVrtCore when ROTATED reference frame ( Z axis is along magnetic field )
-//  is used. It gives constant value (magnitude) at given point
 //-----------------------------------------------------------------------------------------------
 
 // Header include
@@ -35,34 +31,23 @@
 //-------------------------------------------------
 #include<iostream>
 
- namespace Trk {
- extern vkalPropagator  myPropagator;
-}
-
 namespace Trk{
 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
 //                  ATLAS magnetic field access
-  VKalAtlasMagFld::VKalAtlasMagFld(): m_mm(1.) {
+  VKalAtlasMagFld::VKalAtlasMagFld() {
      m_VKalAthenaField=0; 
-     m_FIXED_ATLAS_FIELD=1.997;
      m_magFrameX=0.;
      m_magFrameY=0.;
      m_magFrameZ=0.;
-     m_saveXpos=-10000000000.;
-     m_saveYpos=-20000000000.;
-     m_saveZpos=-30000000000.;
-     m_saveBX=0.;
-     m_saveBY=0.;
-     m_saveBZ=0.;
   }
   VKalAtlasMagFld::~VKalAtlasMagFld(){}
 //
 //  Setting of parameters
 //
-  void VKalAtlasMagFld::setAtlasMag(MagField::IMagFieldSvc*  pnt)
+  void VKalAtlasMagFld::setAtlasField(MagField::IMagFieldSvc*  pnt)
   {   m_VKalAthenaField = pnt;  }
      
-  void VKalAtlasMagFld::setAtlasMag(const double  field)
+  void VKalAtlasMagFld::setAtlasField(const double  field)
   {   m_FIXED_ATLAS_FIELD = field; }
   
   void VKalAtlasMagFld::setAtlasMagRefFrame( double x, double y, double z)
@@ -72,33 +57,17 @@ namespace Trk{
 // Coordinates here are in mm. - default for TrkVKalVrtCore
 //
   void VKalAtlasMagFld::getMagFld(const double x, const double y, const double z, 
-                                    double &bx, double &by, double &bz)
+                                    double &bx, double &by, double &bz) const
   {   
       double fieldXYZ[3];  double BField[3];
       fieldXYZ[0]= (x +m_magFrameX) *m_mm;
       fieldXYZ[1]= (y +m_magFrameY) *m_mm;
       fieldXYZ[2]= (z +m_magFrameZ) *m_mm;
       if( m_VKalAthenaField ) {
-	 double Shift= (m_saveXpos-fieldXYZ[0])*(m_saveXpos-fieldXYZ[0])
-	              +(m_saveYpos-fieldXYZ[1])*(m_saveYpos-fieldXYZ[1])
-	              +(m_saveZpos-fieldXYZ[2])*(m_saveZpos-fieldXYZ[2]);
-         if(Shift < -1.*1.*m_mm*m_mm){   //17.03.2010 VK no caching - mag.field is steplike
-	   bx=m_saveBX;
-	   by=m_saveBY;
-	   bz=m_saveBZ;
-         }else{	 	 
-           m_VKalAthenaField->getField(fieldXYZ,BField); 
-           bx = BField[0]/CLHEP::tesla;
-           by = BField[1]/CLHEP::tesla;   // Field in TESLA!!!!
-           bz = BField[2]/CLHEP::tesla;
-//	     if(bz<0.2)bz=0.2;     //some protection  !!VK NO PROTECTION!!!
-           m_saveXpos=fieldXYZ[0];
-           m_saveYpos=fieldXYZ[1];
-           m_saveZpos=fieldXYZ[2];
-	   m_saveBX=bx;
-	   m_saveBY=by;
-	   m_saveBZ=bz;
-         }
+         m_VKalAthenaField->getField(fieldXYZ,BField); 
+         bx = BField[0]/CLHEP::tesla;
+         by = BField[1]/CLHEP::tesla;   // Field in TESLA!!!!
+         bz = BField[2]/CLHEP::tesla;
 //std::cout<<" Exact mag="<<bz<<" at "<<fieldXYZ[0]<<", "<<fieldXYZ[1]<<", "<<fieldXYZ[2]<<", "<<'\n';
       }else{
          bx = 0.;
@@ -112,20 +81,14 @@ namespace Trk{
 //  Setting interface
   void TrkVKalVrtFitter::setAthenaField(MagField::IMagFieldSvc * pnt)
   {
-     m_fitField->setAtlasMag(pnt);
-     //double Bx,By,Bz;                             //22.01.2009 - moved to SetFitOption due to callback
-     //m_fitField->getMagFld(0.,0.,0.,Bx,By,Bz);
-     //m_fitField->setAtlasMag(Bz);
-     if(m_PropagatorType == 0) m_PropagatorType = 1;  // set up Runge-Kutta propagator from Core
+     m_fitField->setAtlasField(pnt);
      m_isFieldInitialized = true;   //  to signal end of mag.field init procedure 
   }
 
 
   void TrkVKalVrtFitter::setAthenaField(const double  Field)
   {
-     m_fitField->setAtlasMag( Field );
-     if(m_PropagatorType == 1) m_PropagatorType = 0;  // set up constant field propagator if Runge-Kutta was
-                                                      // used before. Otherwise use what is set.
+     m_fitField->setAtlasField( Field );
      m_isFieldInitialized = true;   //  to signal end of mag.field init procedure 
   }
 }
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalTransform.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalTransform.cxx
index e4514b75dea5f0d90b7129ab8722fe1f5ef38f81..e83a7f98a1ee95297c143630805ce0213873206f 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalTransform.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalTransform.cxx
@@ -129,65 +129,4 @@ namespace Trk{
      return;
 
 }
-//--------------------------------------------------------------------------
-   Amg::RotationMatrix3D TrkVKalVrtFitter::getMagFldRotation(double bx,double by, double bz, double vX,double vY,double vZ)
-   {
-     
-     Amg::Vector3D field(bx,by,bz); Amg::Vector3D addon(vX,vY,vZ);
-     Amg::Vector3D axis1=field.unit();
-//-------------------------------------------------
-//     CLHEP::Hep3Vector axis2=field.orthogonal().unit();
-//
-     if(addon.mag2()==0.) addon[0]=100.;
-     Amg::Vector3D axis2=field.cross(addon);
-     if(axis2.mag2() < 1.e-10){addon[1]+=100.; axis2=field.cross(addon);}
-     axis2.unit();
-//-------------------------------------------------
-     Amg::Vector3D axis3=axis2.cross(axis1).unit();
-     //CLHEP::HepRotation ROT(axis3,axis2,axis1);
-     Amg::RotationMatrix3D ROT; ROT.col(0)=axis3; ROT.col(1)=axis2; ROT.col(2)=axis1;
-//std::cout<<"test="<<ROT.inverse()*field<<'\n';
-//CLHEP::Hep3Vector fieldC(0.,0.,(ROT.inverse()*field).z());
-//std::cout<<"inversion test="<<ROT*fieldC<<'\n';
-     return ROT.inverse();
-   }
-//-----------------------------------------------------------------
-//  Rotation of fit results back to global ATLAS ref.system
-//    vi[] and pi[] are in LOCAL(CORE) rotated fitter frame
-//    v0[] and po[] are in LOCAL ATLAS nonrotated frame
-//
-   void TrkVKalVrtFitter::rotateBack(double vi[],double pi[], double covi[],
-                                     double vo[],double po[], double covo[])
-   {
-       CLHEP::HepMatrix CNV(6,6,1);
-       CLHEP::HepMatrix tmp(3,3,0); 
-       Amg::RotationMatrix3D amgtmp=m_trkControl[0].trkRotation.inverse();
-       tmp[0][0]=amgtmp(0,0);  tmp[0][1]=amgtmp(0,1);  tmp[0][2]=amgtmp(0,2);
-       tmp[1][0]=amgtmp(1,0);  tmp[1][1]=amgtmp(1,1);  tmp[1][2]=amgtmp(1,2);
-       tmp[2][0]=amgtmp(2,0);  tmp[2][1]=amgtmp(2,1);  tmp[2][2]=amgtmp(2,2);
-       CNV.sub(1,1,tmp); CNV.sub(4,4,tmp);
-//-------------------------------------------------
-       CLHEP::HepMatrix COV(6,6,1);
-       int cnt=0;  //counter
-       for(int i=0; i<6; i++) for(int j=0; j<=i; j++){ COV[i][j]=COV[j][i]=covi[cnt]; cnt++;}	
-       CLHEP::HepMatrix newCOV = CNV*COV*(CNV.T());
-//----------Vector rotation
-       CLHEP::HepVector param_rot(6);
-       param_rot[0] = vi[0] - m_trkControl[0].trkSavedLocalVertex.x();
-       param_rot[1] = vi[1] - m_trkControl[0].trkSavedLocalVertex.y();
-       param_rot[2] = vi[2] - m_trkControl[0].trkSavedLocalVertex.z();
-       param_rot[3] = pi[0]; param_rot[4] = pi[1]; param_rot[5] = pi[2];
-       CLHEP::HepVector param_atl=CNV*param_rot;
-//------------------------------------------------------------------------------------------
-       vo[0]=param_atl[0] + m_trkControl[0].trkRotationVertex.x() - m_refFrameX;
-       vo[1]=param_atl[1] + m_trkControl[0].trkRotationVertex.y() - m_refFrameY;
-       vo[2]=param_atl[2] + m_trkControl[0].trkRotationVertex.z() - m_refFrameZ;
-       po[0]=param_atl[4];  po[1]=param_atl[5]; po[2]=param_atl[6];
-       cnt=0; for(int i=0; i<6; i++) for(int j=0; j<=i; j++){ covo[cnt]=newCOV[i][j]; cnt++;}	
-   }
-//--
-   Amg::Vector3D TrkVKalVrtFitter::rotateBack(double px,double py, double pz)
-   {
-       return (m_trkControl[0].trkRotation.inverse())*Amg::Vector3D(px,py,pz);
-   }
 } // end of namespace
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx
index 4dc2330795aad9c8e290dd5a5a0d9a4325197dea..69bdaa21061adc754a0cbba7d34b75d0c9074ca6 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitFastSvc.cxx
@@ -15,7 +15,6 @@
 namespace Trk {
  extern void vkvfast_( double* , double* , double* , double*);
  extern void vkvFastV( double* , double* , double* vRef, double dbmag, double*);
- extern vkalPropagator  myPropagator;
 }
 //
 //__________________________________________________________________________
@@ -36,9 +35,6 @@ namespace Trk{
 //--- Magnetic field
 //
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    if(m_useMagFieldRotation) return StatusCode::FAILURE;
-    if(m_PropagatorType <=1 ){  Trk::myPropagator.setTypeProp(m_PropagatorType);   // needed for reenterability
-    }else{                      Trk::myPropagator.setPropagator(m_fitPropagator);} // needed for reenterability
 //
 //  Convert particles and setup reference frame
 //
@@ -103,9 +99,6 @@ namespace Trk{
 //--- Magnetic field
 //
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    if(m_useMagFieldRotation) return StatusCode::FAILURE;
-    if(m_PropagatorType <=1 ){    Trk::myPropagator.setTypeProp(m_PropagatorType);    // needed for reenterability
-    }else{                        Trk::myPropagator.setPropagator(m_fitPropagator); } // needed for reenterability
 //
 //  Convert particles and setup reference frame
 //
@@ -170,9 +163,6 @@ namespace Trk{
 //--- Magnetic field
 //
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    if(m_useMagFieldRotation) return StatusCode::FAILURE;
-    if(m_PropagatorType <=1 ){  Trk::myPropagator.setTypeProp(m_PropagatorType);    // needed for reenterability
-    }else{                      Trk::myPropagator.setPropagator(m_fitPropagator); } // needed for reenterability
 //
 //  Convert particles and setup reference frame
 //
@@ -237,8 +227,6 @@ namespace Trk{
 //--- Magnetic field
 //
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    if(m_PropagatorType <=1 ){  Trk::myPropagator.setTypeProp(m_PropagatorType);     // needed for reenterability
-    }else{                      Trk::myPropagator.setPropagator(m_fitPropagator); }  // needed for reenterability
 //
 //  Convert particles and setup reference frame
 //
diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx
index 222adb34961eb3ba5674dc307819880027477f65..b5ee79d7ab588411314ea45444ee61712789a211 100755
--- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx
+++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalVrtFitSvc.cxx
@@ -5,39 +5,26 @@
 // Header include
 #include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
 #include "TrkVKalVrtFitter/VKalVrtAtlas.h"
+#include "TrkVKalVrtCore/TrkVKalVrtCore.h"
 //-------------------------------------------------
 // Other stuff
 #include "GaudiKernel/IChronoStatSvc.h"
 //
 #include<iostream>
+#include<algorithm>
 
 
  namespace Trk {
- extern
-  void cfpest( long int* ntrk, double* vrt, long int* Charge,double* part, double* par0);
- extern
-  void xyztrp( long int* Charge, double* Vertex, double* Mom,
-                double* CovVrtMom, double* Perig, double* CovPerig );
- extern
-   int fiterm( long int ntrk, double* errmtx);
-
- extern
-  void cfmasserr_( long int* NTRK,  long int* List, double* parfs, double* wm, double* Deriv,
-		  double* dM, double* MassError);
- extern
-   void getWeights( long int NTRK, double* Weights);
-
- extern vkalMagFld      myMagFld;
- extern vkalPropagator  myPropagator;
-
- extern
-      int CFit(long int iflag, long int ifCovV0, long int NTRK, 
+
+ extern void cfpest( long int* ntrk, double* vrt, long int* Charge,double* part, double* par0);
+ extern void xyztrp( long int* Charge, double* vrt, double* Mom, double* CovVrtMom, double BMAG, double* Perig, double* CovPerig );
+
+ extern int CFit(VKalVrtControl &FitControl, long int ifCovV0, long int NTRK, 
 	       long int *ich, double *xyz0, double *par0,
 	       double *inp_Trk5, double *inp_CovTrk5, 
 	       double *xyzfit, double *parfs, double *ptot,
                double *covf, double *chi2, double *chi2tr);
- extern
-   void vksetUsePlaneCnst(double , double , double , double ); 
+
 
 //__________________________________________________________________________
 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
@@ -57,12 +44,6 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const Track*>& InpTrk,
 //------  extract information about selected tracks
 //
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 
     long int ntrk=0;
     StatusCode sc=CvtTrkTrack(InpTrk,ntrk);
@@ -87,12 +68,6 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const xAOD::TrackParti
 	double& Chi2 ) 
 {
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -103,7 +78,7 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const xAOD::TrackParti
     if(m_firstMeasuredPoint){               //First measured point strategy
        //------
        if(InpTrkC.size()){
-          if( m_InDetExtrapolator == 0 && m_PropagatorType != 3 ){
+          if( m_InDetExtrapolator == 0 ){
             if(msgLvl(MSG::WARNING))msg()<< "No InDet extrapolator given."<<
 	                                 "Can't use FirstMeasuredPoint with xAOD::TrackParticle!!!" << endmsg;
             return StatusCode::FAILURE;        
@@ -162,14 +137,14 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const xAOD::TrackParti
           double D= pp[0]*(cnstRefPoint.x()-m_refFrameX)
                    +pp[1]*(cnstRefPoint.y()-m_refFrameY)
                    +pp[2]*(cnstRefPoint.z()-m_refFrameZ);
-          vksetUsePlaneCnst( pp[0], pp[1], pp[2], D); 
+          m_vkalFitControl->setUsePlaneCnst( pp[0], pp[1], pp[2], D); 
 	  std::vector<double> saveApproxV(3,0.); m_ApproximateVertex.swap(saveApproxV); 
           m_ApproximateVertex[0]=cnstRefPoint.x();
           m_ApproximateVertex[1]=cnstRefPoint.y();
           m_ApproximateVertex[2]=cnstRefPoint.z();
           ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge, ErrorMatrix, 
                                  Chi2PerTrk, TrkAtVrt,Chi2 ) ;
-          vksetUsePlaneCnst(0.,0.,0.,0.);
+          m_vkalFitControl->setUsePlaneCnst(0.,0.,0.,0.);
           if (ierr)  {
 	     ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge,   // refit without plane cnst
 	                  ErrorMatrix, Chi2PerTrk, TrkAtVrt,Chi2 ) ;        // if fit with it failed
@@ -196,12 +171,6 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const TrackParticleBas
 	double& Chi2 ) 
 {
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -237,12 +206,6 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const TrackParameters*
 	double& Chi2 ) 
 {
     if(!m_isFieldInitialized)setInitializedField();  //to allow callback for init
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
 //
 //------  extract information about selected tracks
 //
@@ -263,8 +226,7 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const TrackParameters*
         m_ApproximateVertex.push_back(m_globalFirstHit->position().y());
         m_ApproximateVertex.push_back(m_globalFirstHit->position().z());
     }
-    long int ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge, ErrorMatrix, 
-                                 Chi2PerTrk, TrkAtVrt,Chi2 ) ;
+    int ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge, ErrorMatrix, Chi2PerTrk, TrkAtVrt,Chi2 ) ;
     if (ierr) return StatusCode::FAILURE;
 //
 //-- Check vertex position with respect to first measured hit and refit with plane constraint if needed
@@ -277,14 +239,14 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const TrackParameters*
           double D= pp[0]*(m_globalFirstHit->position().x()-m_refFrameX)
                    +pp[1]*(m_globalFirstHit->position().y()-m_refFrameY)
                    +pp[2]*(m_globalFirstHit->position().z()-m_refFrameZ);
-          vksetUsePlaneCnst( pp[0], pp[1], pp[2], D); 
+          m_vkalFitControl->setUsePlaneCnst( pp[0], pp[1], pp[2], D); 
 	  std::vector<double> saveApproxV(3,0.); m_ApproximateVertex.swap(saveApproxV); 
           m_ApproximateVertex[0]=m_globalFirstHit->position().x();
           m_ApproximateVertex[1]=m_globalFirstHit->position().y();
           m_ApproximateVertex[2]=m_globalFirstHit->position().z();
           ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge, ErrorMatrix, 
                                  Chi2PerTrk, TrkAtVrt,Chi2 ) ;
-          vksetUsePlaneCnst(0.,0.,0.,0.);
+          m_vkalFitControl->setUsePlaneCnst(0.,0.,0.,0.);
           if (ierr)  {
 	     ierr = VKalVrtFit3( ntrk, Vertex, Momentum, Charge,   // refit without plane cnst
 	                  ErrorMatrix, Chi2PerTrk, TrkAtVrt,Chi2 ) ;        // if fit with it failed
@@ -305,7 +267,7 @@ StatusCode TrkVKalVrtFitter::VKalVrtFit(const std::vector<const TrackParameters*
 //--------------------------------------------------------------------------------------------------
 //  Main code
 //
-long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
+long int TrkVKalVrtFitter::VKalVrtFit3(long int ntrk,
         Amg::Vector3D& Vertex,
 	TLorentzVector&   Momentum,
 	long int& Charge,
@@ -330,39 +292,33 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
 //
     double Bx,By,Bz;
     m_fitField->getMagFld(-m_refFrameX,-m_refFrameY,-m_refFrameZ,Bx,By,Bz);
-    m_fitField->setAtlasMag(Bz);
 //std::cout.precision(8);std::cout<<" Exact mag="<<Bx<<", "<<By<<", "<<Bz<<" at 0,0,0"<<'\n';
 //
 //------  Fit option setting
 //
-    VKalVrtSetOptions( ntrk );
-    initCnstList();
-    if(m_useMagFieldRotation) {                         // Set rotated magnetic field provider for VKalVrtCore
-       Trk::myMagFld.setMagHandler(m_fitRotatedField);  // Rotated mag.field value is calculated during extrapolation
-    }                                                   // This happens already in cfpest
+    VKalVrtConfigureFitterCore(ntrk);
 //
 //------  Fit itself
 //
     m_FitStatus=0;
-    if(m_ErrMtx)delete[] m_ErrMtx;              //delete previous array is exist
-    m_ErrMtx=0;
+    if(m_ErrMtx)delete[] m_ErrMtx; //delete previous array is exist
+    m_ErrMtx=0;                    //
+    if(m_vkalFitControl->m_fullCovariance)delete[] m_vkalFitControl->m_fullCovariance;  //delete previous array is exist
+    m_vkalFitControl->m_fullCovariance=0;                                               //
+    m_vkalFitControl->m_vrtMassTot=-1.;
+    m_vkalFitControl->m_vrtMassError=-1.;
     if(m_ApproximateVertex.size()==3 && fabs(m_ApproximateVertex[2])<m_IDsizeZ &&
          sqrt(m_ApproximateVertex[0]*m_ApproximateVertex[0]+m_ApproximateVertex[1]*m_ApproximateVertex[1])<m_IDsizeR)
     {
        xyz0[0]=(double)m_ApproximateVertex[0] - m_refFrameX;
        xyz0[1]=(double)m_ApproximateVertex[1] - m_refFrameY;
        xyz0[2]=(double)m_ApproximateVertex[2] - m_refFrameZ;
-       if(m_useMagFieldRotation) {                         // Rotate initial guess
-         Amg::Vector3D tmpv=m_trkControl[0].trkRotation*Amg::Vector3D(xyz0[0],xyz0[1],xyz0[2]);
-         if(tmpv.mag()<20000.){ xyz0[0]=tmpv.x(); xyz0[1]=tmpv.y(); xyz0[2]=tmpv.z();}
-         else{ xyz0[0]=0.; xyz0[1]=0.; xyz0[2]=0.; }                       //To avoid crazy initial guesses
-       }
     } else {
        xyz0[0]=xyz0[1]=xyz0[2]=0.;
     }
     Trk::cfpest( &ntrk, xyz0, m_ich, &m_apar[0][0], &m_par0[0][0]);
 
-    ierr=Trk::CFit( m_iflag, m_ifcovv0, ntrk,
+    ierr=Trk::CFit( *m_vkalFitControl, m_ifcovv0, ntrk,
                     m_ich, xyz0, &m_par0[0][0], &m_apar[0][0], &m_awgt[0][0],
                     xyzfit, &m_parfs[0][0], ptot, covf, &chi2f, m_chi2tr); 
 
@@ -377,23 +333,15 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
 //  Postfit operation. Creation of array for different error calculations and full error matrix copy
 //
     m_FitStatus=ntrk;
-    if(m_ifcovv0){      //If exists - get full fit error matrix from CORE to keep it in FITTER for safety 
-       m_ErrMtx = new double[ (3*ntrk+3)*(3*ntrk+4)/2  ];      //create new array for errors
-       int IERR = Trk::fiterm(ntrk,m_ErrMtx);                //Real error matrix after fit
-       if(IERR)  {delete[] m_ErrMtx; m_ErrMtx=0;}
+    if(m_ifcovv0 && m_vkalFitControl->m_fullCovariance){   //If full fit error matrix is returned by VKalVrtCORE 
+       int SymCovMtxSize=(3*ntrk+3)*(3*ntrk+4)/2;
+       m_ErrMtx = new double[ SymCovMtxSize  ];    //create new array for errors
+       std::move(m_vkalFitControl->m_fullCovariance,m_vkalFitControl->m_fullCovariance+SymCovMtxSize,m_ErrMtx);
+       delete[] m_vkalFitControl->m_fullCovariance; m_vkalFitControl->m_fullCovariance=0;
        ErrorMatrix.clear(); ErrorMatrix.reserve(21); ErrorMatrix.assign(covf,covf+21);
     } else {
        ErrorMatrix.clear(); ErrorMatrix.reserve(6);  ErrorMatrix.assign(covf,covf+6);
     }
-//--------------------------------------------------------------------------- 
-// Rotate back to ATLAS frame if rotation was used in the fit
-//
-    if(m_useMagFieldRotation){
-      double vnew[3],pnew[3],cnew[21];
-      rotateBack(xyzfit, ptot, covf, vnew, pnew, cnew);
-      for(int ik=0; ik<3;  ik++) { xyzfit[ik]=vnew[ik]; ptot[ik]=pnew[ik];}
-      for(int ik=0; ik<21; ik++) { covf[ik]=cnew[ik];}
-    }
 //---------------------------------------------------------------------------
     Chi2 = (double) chi2f;
 
@@ -407,10 +355,8 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
 //
 // ------  Magnetic field in fitted vertex
 //
-    double fx,fy,fz,BMAG_CUR;
-    m_fitField->getMagFld(xyzfit[0] ,xyzfit[1] ,xyzfit[2] ,fx,fy,fz); 
-    BMAG_CUR=fz;
-    if(m_useMagFieldRotation) BMAG_CUR=sqrt(fx*fx+fy*fy+fz*fz);
+    double fx,fy,BMAG_CUR;
+    m_fitField->getMagFld(xyzfit[0] ,xyzfit[1] ,xyzfit[2] ,fx,fy,BMAG_CUR); 
     if(fabs(BMAG_CUR) < 0.01) BMAG_CUR=0.01;  // Safety
 
 
@@ -420,14 +366,6 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
       Px = Pt*cos(m_parfs[i][1]);
       Py = Pt*sin(m_parfs[i][1]);
       Pz = Pt/tan(m_parfs[i][0]);
-      if(m_useMagFieldRotation){
-        Amg::Vector3D po=rotateBack(Px,Py,Pz); Px=po.x(); Py=po.y(); Pz=po.z();
-        double npt=sqrt(Px*Px+Py*Py); if(m_parfs[i][2]<0)npt=-npt;
-	double npp=sqrt(Px*Px+Py*Py+Pz*Pz);
-	m_parfs[i][0]= acos( Pz/npp);
-	m_parfs[i][1]=atan2( Py, Px);
-	m_parfs[i][2]=m_CNVMAG*BMAG_CUR/npt;
-      }
       Ee = sqrt(Px*Px+Py*Py+Pz*Pz+m_wm[i]*m_wm[i]);
       pmom[0] += Px; pmom[1] += Py; pmom[2] += Pz; pmom[3] += Ee;
     }
@@ -488,15 +426,14 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
     }
     m_refFrameX=m_refFrameY=m_refFrameZ=0.; //VK Work in ATLAS ref frame ONLY!!!
     long int vkCharge=-Charge; //VK 30.11.2009 Change sign according to ATLAS
+//
+// ------  Magnetic field in vertex
+//
+    double fx,fy,BMAG_CUR;
+    m_fitField->getMagFld(Vrt[0], Vrt[1], Vrt[2] ,fx,fy,BMAG_CUR); 
+    if(fabs(BMAG_CUR) < 0.01) BMAG_CUR=0.01;  // Safety
 
-    Trk::myMagFld.setMagHandler(m_fitField);             // needed for reenterability
-    if(m_PropagatorType <=1 ){                           // needed for reenterability
-       Trk::myPropagator.setTypeProp(m_PropagatorType);  // needed for reenterability
-    }else{                                               // needed for reenterability
-       Trk::myPropagator.setPropagator(m_fitPropagator); // needed for reenterability
-    }
-
-    Trk::xyztrp( &vkCharge, Vrt, PMom, Cov0, Per, CovPer );
+    Trk::xyztrp( &vkCharge, Vrt, PMom, Cov0, BMAG_CUR, Per, CovPer );
 
     Perigee.clear();
     CovPerigee.clear();
@@ -558,10 +495,6 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
     double CovMtxOld[6][6];
     double CovMtx   [6][6];
 
-//    long int vkNTrk = NTrk;
-//    int IERR = Trk::fiterm(vkNTrk,m_ErrMtx); //Real error matrix after fit
-//    if(IERR)       return StatusCode::FAILURE;
-
     CovVrtTrk.clear();
 
     CovMtxOld[0][0] =                   m_ErrMtx[0];
@@ -791,23 +724,11 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
 
 
 
-  StatusCode TrkVKalVrtFitter::VKalGetMassError( std::vector<int> ListOfTracks , double& dM, double& MassError)
+  StatusCode TrkVKalVrtFitter::VKalGetMassError( double& dM, double& MassError)
   {    
     if(!m_FitStatus) return StatusCode::FAILURE;
-    if((int) ListOfTracks.size() != m_FitStatus) return StatusCode::FAILURE;
-
-    double Deriv[ 3*NTrMaxVFit+3 ] = {0.};
-    long int Tist[NTrMaxVFit+1] = {0};
- 
-    for (int i=0; i<(int)ListOfTracks.size();i++){
-       Tist[i]=0;
-       if(ListOfTracks[i] != 0 ) Tist[i]=1;
-    }
-
-    long int NTRK=ListOfTracks.size();
-        
-    Trk::cfmasserr_(&NTRK, Tist, &m_parfs[0][0], m_wm, Deriv, &dM, &MassError);
-
+    dM        = m_vkalFitControl->m_vrtMassTot;
+    MassError = m_vkalFitControl->m_vrtMassError;
     return StatusCode::SUCCESS;
   }
   
@@ -817,13 +738,10 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
     if(!m_FitStatus) return StatusCode::FAILURE;  // no fit made
     trkWeights.clear();
 
-    double *tmp = new double[m_FitStatus];
-    long int NTRK=m_FitStatus;
+    int NTRK=m_FitStatus;
 
-    Trk::getWeights( NTRK, tmp);
+    for (int i=0; i<NTRK; i++) trkWeights.push_back(m_vkalFitControl->m_forcft.robres[i]);
 
-    for (int i=0; i<NTRK; i++) trkWeights.push_back(tmp[i]);
-    delete[] tmp;
     return StatusCode::SUCCESS;
   }
   
@@ -836,8 +754,8 @@ long int TrkVKalVrtFitter::VKalVrtFit3( long int ntrk,
     else if(m_useZPointingCnst)   { NDOF+=1; }
     if( m_usePassNear || m_usePassWithTrkErr ) { NDOF+= 2; } 
 
-    if( m_MassForConstraint>0. )  { NDOF+=1; }
-    if( m_PartMassCnst.size()>0 ) { NDOF+= m_PartMassCnst.size(); }
+    if( m_massForConstraint>0. )  { NDOF+=1; }
+    if( m_partMassCnst.size()>0 ) { NDOF+= m_partMassCnst.size(); }
     if( m_useAprioriVertex )      { NDOF+= 3; }    
     if( m_usePhiCnst )            { NDOF+=1; }  
     if( m_useThetaCnst )          { NDOF+=1; }