#ifndef SWIMOBJSR_H
#define SWIMOBJSR_H

#include "Rtypes.h"
#include "TObjArray.h"

class UgliGeomHandle;
class VldContext;

class SwimObjSR
{

public:

  SwimObjSR(Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Int_t,const VldContext *);
  ~SwimObjSR();

  Int_t SwimTo(Double_t,Bool_t docheck = 0); // if docheck true, return 1 if momentum goes below 50 MeV/c or track goes outside far detector fiducial volume or |dx/dz|>50

  Double_t fu;
  Double_t fv;
  Double_t fz;
  Double_t fdudz;
  Double_t fdvdz;
  Double_t fqp;

  Int_t fizfor; // =1 if +z is forward, -1 if -z is forward

private:

  Int_t SwimToIron(Double_t,Bool_t docheck);
  Int_t SwimToVacuum(Double_t);
  Bool_t DoCheck();

  UgliGeomHandle *fugh;
  VldContext *fvldc;

  TObjArray fInterface;

};


#endif                                                    // SWIMOBJSR_H
