// //Fit_P_RTPC.h v3.0 //This file makes the c++ subrutine can be used by c or fortran code #ifndef _Fit_P_RTPC_ #define _Fit_P_RTPC_ #ifdef __cplusplus extern "C" { #endif /*------------------------------------------------------------------------\ Function name: double Threshold_P(double z0_mm,double theta0_rad) calculate the momentum threshold using z0,theta0. Input parameters: z0_mm: the vertex position in mm theta0_rad: the theta angle in rad at r=0(the vertex) OutPut: Momentum in Mev \------------------------------------------------------------------------*/ double Threshold_P(double z0_mm,double theta0_rad); /*------------------------------------------------------------------------\ Function name: double Fit_P_by_R(double r_mm,double z0_mm,double theta0_deg, int dvcs_cur) Input parameters: r_mm: the raidus of the trajectory,in unit mm z0_mm: the vertex position in mm theta0_deg: the theta angle in degree at r=0(the vertex) dvcs_cur: B field solinoid current, accepte 450 or 534 return: >0: total Momentum in MeV/c <0: this map doesn't work for the given r,z,theta \------------------------------------------------------------------------*/ double Fit_P_by_R(double r_mm,double z0_mm,double theta0_deg, int dvcs_cur); /*------------------------------------------------------------------------\ Function: int DoPCorr(double r_mm,double z0_mm,double theta0_rad, int dvcs_cur, double &p_total_mev) Input parameters: r_mm: the raidus of the trajectory,in unit mm z0_mm: the vertex position in mm theta0_rad: the theta angle in radians at r=0(the vertex) dvcs_cur: B field solinoid current, accepte 450 or 534 OutPut: p_total_mev >0: total Momentum in MeV/c <0: this map doesn't work for the given r,z,theta return: 0 no error. -1 error occurs! \------------------------------------------------------------------------*/ int DoPCorr(double r_mm,double z0_mm,double theta0_rad, int dvcs_cur, double &p_total_mev); #ifdef __cplusplus } #endif #endif