Fitting of the integral of a function

Dear All,

I am trying to fit a function f(y) = Integral 1/cosh(y-a)da, with a data set, where the limit is from ‘-a’ to ‘a’,
N.B ‘a’ is a free parameter need to be calculated from the fit.

Now, it is easy to fit the function without the ‘integral’ which is -

//=====================================================
Double_t Th(Double_t *y, Double_t *a){
Double_t f2 = 1/cosh(*y-a[0]);
return f2;
}

           void fitting(){
            gStyle->SetOptStat(0);
            gStyle->SetOptFit(1111);

            TF1* func=new TF1("func",Th,-1,6,1);
            func->SetParameter(0, 0.2);

          TGraphErrors *gr1 = new TGraphErrors ("data/x11.txt", "%lg %lg");

            TCanvas *c1 = new TCanvas();
            c1->cd();
            gr1->Draw("AP");
            gr1->Fit("func", "q");
            }
   //=============================================================

But, I have no idea how fit with the integral of the function.

Please help me in this regards.

Sincerely-
Kalyan