00001 #include "TKinemCut.h" 00002 #include <stdexcept> 00003 00004 TKinemCut::TKinemCut(){ 00005 using namespace std; 00006 fDeltaTheta = -1.; 00007 fDeltaPhi = -1.; 00008 fPAverage = -1.; 00009 fPCross = -1.; 00010 fEMin = -1.; 00011 fPAverageAbs= -1.; 00012 fPCrossAbs = -1.; 00013 fEMinAbs = -1.; 00014 fCosPsi = -2.; 00015 fAverageThetaMin = -1.; 00016 fAverageThetaMax = gConst->Pi() + 1.; 00017 fThetaMinMinus = -1.; 00018 fThetaMinPlus = -1.; 00019 // cout<<fPAverage<<" "<<fPAverageAbs<<endl; 00020 } 00021 00022 void TKinemCut::Default(){ 00023 fDeltaTheta = 0.25; 00024 fDeltaPhi = 0.15; 00025 fPAverageAbs = 90.; 00026 fPCrossAbs = 90.; 00027 fEMinAbs = 50.; 00028 fCosPsi = 1.; 00029 fAverageThetaMin = 1.1; 00030 fAverageThetaMax = gConst->Pi() - 1.1; 00031 } 00032 00033 void TKinemCut::Init(){ 00034 double E = gGlobal->Get_E(); 00035 if(0>E) 00036 throw std::logic_error("Energy is not defined!"); 00037 00038 if(0>fDeltaTheta) 00039 throw std::logic_error("Delta Theta is not defined!"); 00040 00041 if(0>fDeltaPhi) 00042 throw std::logic_error("Delta Phi is not defined!"); 00043 00044 if(0>fPAverage) 00045 if(0>fPAverageAbs) 00046 throw std::logic_error("Average momentum of final particle is not defined!"); 00047 else 00048 fPAverage = fPAverageAbs/E; 00049 00050 if(0>fPCross) 00051 if(0>fPCrossAbs) 00052 throw std::logic_error("Cross momentum for each final particle is not defined!"); 00053 else 00054 fPCross = fPCrossAbs/E; 00055 00056 if(0>fEMin) 00057 if(0>fEMinAbs) 00058 throw std::logic_error("Minumum final particle energy is not defined!"); 00059 else 00060 fEMin = fEMinAbs/E; 00061 00062 if(-1>fCosPsi) 00063 throw std::logic_error("Space angle between final particles is not defined!"); 00064 00065 if(0>fAverageThetaMin || gConst->Pi() < fAverageThetaMax ) 00066 throw std::logic_error("Average angle of final particles is not defined!"); 00067 00068 fThetaMin = gGlobal->Get_ThetaMin(); 00069 fThetaMax = gConst->Pi() - gGlobal->Get_ThetaMin(); 00070 if(0>fThetaMin || gConst->Pi() < fThetaMax ) 00071 throw std::logic_error("ThetaMin is not defined!"); 00072 00073 if(fThetaMinMinus<0) 00074 ThetaMinM(fThetaMin); 00075 00076 if(fThetaMinPlus<0) 00077 ThetaMinP(fThetaMin); 00078 } 00079 00080 void TKinemCut::Print(){ 00081 using namespace std; 00082 cout 00083 <<"Delta Theta = "<<fDeltaTheta<<" rad"<<endl 00084 <<"Delta Phi = "<<fDeltaPhi<<" rad"<<endl 00085 <<"Average Momentum = "<<fPAverage*gGlobal->Get_E()<<" MeV"<<endl 00086 <<"Cross Momentum = "<<fPCross*gGlobal->Get_E()<<" MeV"<<endl 00087 <<"Minimum Energy = "<<fEMin*gGlobal->Get_E()<<" MeV"<<endl 00088 <<"Cosine of Psi = "<<fCosPsi<<endl 00089 <<"Average Theta = "<<fAverageThetaMin<<" rad"<<endl 00090 <<"ThetaRangeMinus = from "<<fThetaMinMinus<<" to "<<fThetaMaxMinus<<" rad"<<endl 00091 <<"ThetaRangePlus = from "<<fThetaMinPlus<<" to "<<fThetaMaxPlus<<" rad"<<endl 00092 <<flush; 00093 }