for i in range(len(df3['set'])): if df3['set'][i] == 1: df3.loc[i, 'sigma'] = df3['sigma'][i] * fit['n1'][0] # Set 1 elif df3['set'][i] == 2: df3.loc[i, 'sigma'] = df3['sigma'][i] * fit['n2'][0] # Set 2 else: df3.loc[i, 'sigma'] = df3['sigma'][i] * fit['n3'][0] # Set 3 # Q^2 values: QQ_list = [1., 2.003, 2.497, 3.007, 1.75, 2.5, 3.25, 4., 5., 6., 7.] # An array for storing results: new_points = np.zeros((3, len(QQ_list))) # An object of the Kinematics class: kin = rc.Kinematics() for i in range(len(QQ_list)): # Q^2 value: QQ = QQ_list[i] # Tau value: tau = QQ / (2. * rc.m_p)**2 # Epsilon values (arguments to fit): x = df3[(df3['QQ'] - QQ)**2 < 1e-6]['epsilon'].values # Calculation of the Mott cross sections: sigma_Mott = np.zeros(len(x)) for j in range(len(x)): kin.Set_QQ_epsilon(QQ=QQ, epsilon=x[j])
# The axis labels: plt.xlabel(r"$E_3,~\mathrm{GeV}$", fontsize=20, labelpad=12) plt.ylabel(r"$d^2 \sigma_{\mathrm{int.br.}} / (d \Omega \, d E_3),~\mathrm{GeV}^{-3} \, \mathrm{sr}^{-1}$", fontsize=20) # Reading the Monte Carlo data obtained using the ESEPP event generator # (see https://github.com/gramolin/esepp): esepp = pd.read_csv('data_esepp.csv') # Plotting the Monte Carlo data: plt.errorbar(esepp['E3'], esepp['cross_section'], xerr=0.012, fmt='ok', markersize=6, capsize=0, linewidth=1.5) # An object of the FormFactors class: ff = rc.FormFactors('Dipole') # The dipole parameterization # Setting the kinematics (E1 = 1 GeV, theta = 70 deg): kin = rc.Kinematics(E1=1., theta=rc.DegToRad(70.)) # Radiative tail according to the soft-photon approximation: xx = np.arange(0.005, kin.Get_E3()-0.001, 0.001) tail_soft = rc.sigma_IntBr_soft(E3=xx, kinematics=kin, ff=ff) # More accurate description of the radiative tail: tail_hard = rc.sigma_IntBr(E3=xx, kinematics=kin, ff=ff) tail_hard = tail_hard + (2.*rc.alpha/rc.pi)*(1./(kin.Get_E3() - xx))*(2.*np.log(kin.Get_eta()) + \ kin.Get_E4()*np.log(kin.Get_x())/kin.Get_p4() - 1.)*rc.sigma_Rosenbluth(E1=1., theta=rc.DegToRad(70.), ff=ff) # Plotting the curves: plt.plot(xx, tail_hard, '-r', linewidth=2, alpha=0.8) # Red solid line plt.plot(xx, tail_soft, '--b', linewidth=2) # Blue dashed line # Saving the figure to pdf and png files: