// ******************************************************************** // $Id: ReadPCorrMap.h,v 1.3 2008/03/25 22:43:32 jixie Exp $ // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // // ReadPCorrMap.h interface for the ReadPCorrMap class. // header file for momentum fit // note that all length unit is mm and mommentum unit is MeV/c // R_fit is the radius in mm fitted by heliex with supressing to the beam line // Theta0 and Z0 is at the reaction point(degree and mm) // The output is the total momentum (MeV/c) #if !defined (_READ_PCORR_MAP_) #define _READ_PCORR_MAP_ //////////////////////// //#define READ_MAP_DEBUG 2 //////////////////////// #include using namespace std; typedef struct MapLine{ double Theta_low; double Theta_high; double Z_low; double Z_high; double A[200]; }MapL_t; typedef struct FitLine{ double Theta_low; double Theta_high; double Z_low; double Z_high; double A[7]; }FitL_t; class ReadPCorrMap { public: ReadPCorrMap(int pDVCS_B_Cur=450); virtual ~ReadPCorrMap(); public: double GetMomByFit(double R_fit,double Z0,double Theta0); double GetMom(double R_fit,double Z0,double Theta0); int GetDVCSCur(){return DVCS_B_Cur;}; int SetDVCSCur(int pDVCS_B_Cur); double GetPThreshold(double Theta0); private: void LoadMap(int pDVCS_B_Cur=450); void LoadMapFit(int pDVCS_B_Cur=450); int FetchIndex(double Z0,double Theta0); int FetchIndexFit(double Z0,double Theta0); void WriteLog(const char *str,const char *filename="RTPC_P_Corr_Log.txt", int unit=1); public: private: int DVCS_B_Cur; vector MapBuf; vector FitBuf; double Z_min,Z_max,Theta_min,Theta_max,R_min,R_max; double P_min; char strLog[255]; }; typedef ReadPCorrMap ReadMap; #endif