#include #include "TAxis.h" #include #include #include #include #include #include #include #include #include "TROOT.h" void analytical_fit() { Double_t D_t_cm=237.*1e-4;//cm/sqrt(cm) Double_t L_drift = 30.;//cm Double_t v_drift=7.9*1e3;//cm/ns Double_t D_l_cm = 290.*1e-4;//cm/sqrt(cm) Double_t D_l=D_l_cm*D_l_cm*v_drift/2;//cm2/ns Double_t sigma_in=TMath::Sqrt(L_drift*L_drift/D_l);//;D_l*D_l*L_drift double tmax = 511*80; TF1* tf1_A = new TF1("tf1_A", "[2]*(x>[0])*TMath::Exp(-1*(x>[0])*(x-[0])*3/[1])*TMath::Power((x>[0])*(x-[0])/[1],3)*TMath::Sin((x>[0])*(x-[0])/[1])", 0, tmax); tf1_A->SetParameter(0, 9000.); tf1_A->SetParameter(1, 600.); tf1_A->SetParameter(2,1); TF1* tf1_L = new TF1("tf1_L", "gaus(0)", 0, tmax); tf1_L->SetParameter(0, 1); tf1_L->SetParameter(1, 9000); tf1_L->SetParameter(2, sigma_in); TF1Convolution* tf1conv_AL = new TF1Convolution("tf1_L", "tf1_A", -1*tmax, tmax, true); tf1conv_AL->SetNofPointsFFT(10000); TF1 *f = new TF1("f",*tf1conv_AL, 0.01, tmax, tf1conv_AL->GetNpar()); f->SetParameters(9000, 600, 1, 1, 0, sigma_in); TCanvas* c_tf = new TCanvas(); //tf1_A->Draw(); //tf1_L->Draw("same"); f->Draw(); }