1 #include "StEpdEpInfo.h"
5 StEpdEpInfo::StEpdEpInfo(){
6 for (
int iorder=0; iorder<_EpOrderMax; iorder++){
7 for (
int ew=0; ew<2; ew++){
8 for (
int xy=0; xy<2; xy++){
9 QrawOneSide[ew][iorder][xy] = 0.0;
10 QphiWeightedOneSide[ew][iorder][xy] = 0.0;
11 for (
int ring=0; ring<16; ring++){
12 QringRaw[ew][iorder][xy][ring] = 0.0;
13 QringPhiWeighted[ew][iorder][xy][ring] = 0.0;
19 for (
int iorder=0; iorder<_EpOrderMax; iorder++){
20 for (
int ewfull=0; ewfull<3; ewfull++){
21 PsiRaw[ewfull][iorder] = -999.0;
22 PsiPhiWeighted[ewfull][iorder] = -999.0;
23 PsiPhiWeightedAndShifted[ewfull][iorder] = -999.0;
32 TVector2 StEpdEpInfo::RawQ(
int ew,
int order){
33 if (ArgumentOutOfBounds(order)){
34 TVector2 crap(-999,-999);
37 TVector2 q(QrawOneSide[ew][order-1][0],QrawOneSide[ew][order-1][1]);
45 TVector2 StEpdEpInfo::PhiWeightedQ(
int ew,
int order){
46 if (ArgumentOutOfBounds(order)){
47 TVector2 crap(-999,-999);
50 TVector2 q(QphiWeightedOneSide[ew][order-1][0],QphiWeightedOneSide[ew][order-1][1]);
58 TVector2 StEpdEpInfo::RingRawQ(
int ew,
int order,
int ring){
59 if (ArgumentOutOfBounds(order,ring)){
60 TVector2 crap(-999,-999);
63 TVector2 q(QringRaw[ew][order-1][0][ring-1],QringRaw[ew][order-1][1][ring-1]);
71 TVector2 StEpdEpInfo::RingPhiWeightedQ(
int ew,
int order,
int ring){
72 if (ArgumentOutOfBounds(order,ring)){
73 TVector2 crap(-999,-999);
76 TVector2 q(QringPhiWeighted[ew][order-1][0][ring-1],QringPhiWeighted[ew][order-1][1][ring-1]);
86 double StEpdEpInfo::RingSW_Raw(
int ew,
int ring){
87 if (ArgumentOutOfBounds(1,ring))
return -999;
88 return RingSumWeightsRaw[ew][ring-1];
93 double StEpdEpInfo::RingSW_PhiWeighted(
int ew,
int ring){
94 if (ArgumentOutOfBounds(1,ring))
return -999;
95 return RingSumWeightsPhiWeighted[ew][ring-1];
100 double StEpdEpInfo::WheelSW_Raw(
int ew,
int order){
101 if (ArgumentOutOfBounds(order))
return -999;
102 return WheelSumWeightsRaw[ew][order-1];
107 double StEpdEpInfo::WheelSW_PhiWeighted(
int ew,
int order){
108 if (ArgumentOutOfBounds(order))
return -999;
109 return WheelSumWeightsPhiWeighted[ew][order-1];
119 double StEpdEpInfo::RawPsi(
int ewfull,
int order){
120 if (ArgumentOutOfBounds(order))
return -999;
121 return Range(PsiRaw[ewfull][order-1],order);
129 double StEpdEpInfo::PhiWeightedPsi(
int ewfull,
int order){
130 if (ArgumentOutOfBounds(order))
return -999;
131 return Range(PsiPhiWeighted[ewfull][order-1],order);
139 double StEpdEpInfo::PhiWeightedAndShiftedPsi(
int ewfull,
int order){
140 if (ArgumentOutOfBounds(order))
return -999;
141 return Range(PsiPhiWeightedAndShifted[ewfull][order-1],order);
149 double StEpdEpInfo::RingRawPsi(
int ew,
int order,
int ring){
150 if (ArgumentOutOfBounds(order,ring))
return -999;
151 return Range(PsiRingRaw[ew][order-1][ring-1],order);
158 double StEpdEpInfo::RingPhiWeightedPsi(
int ew,
int order,
int ring){
159 if (ArgumentOutOfBounds(order,ring))
return -999;
160 return Range(PsiRingPhiWeighted[ew][order-1][ring-1],order);
171 double StEpdEpInfo::Range(
double psi,
int order){
172 if (ArgumentOutOfBounds(order))
return -999;
173 double wrap = 2.0*TMath::Pi()/(double)order;
174 if (psi<0.0) psi += (1.0+(int)(fabs(psi)/wrap))*wrap;
175 else{
if (psi>wrap) psi -= ((int)(psi/wrap))*wrap;}
180 bool StEpdEpInfo::ArgumentOutOfBounds(
int order){
181 if ((order<1)||(order>_EpOrderMax)){
182 std::cout <<
"\n *** Invalid order requested ***\n";
183 std::cout <<
" order must be between 1 (for first-order EP) and " << _EpOrderMax
184 <<
". To change the upuper limit, edit StEpdUtil/StEpdEpInfo.h\n";
185 std::cout <<
" I will now return you an invalid result. Have a nice day\n";
191 bool StEpdEpInfo::ArgumentOutOfBounds(
int order,
int ring){
192 if (ArgumentOutOfBounds(order))
return true;
193 if ((ring<1)||(ring>16)){
194 std::cout <<
"\n *** Invalid ring requested. Ring must be between 1 and 16\n";
195 std::cout <<
" I will now return you an invalid result. Have a nice day\n";
double EastRawPsi(int order)
double EastSumWeightsPhiWeighted(int order)
TVector2 EastRingPhiWeightedQ(int order, int ring)
double FullPhiWeightedAndShiftedPsi(int order)
double WestRingSumWeightsRaw(int ring)
double WestPhiWeightedAndShiftedPsi(int order)
double FullRawPsi(int order)
double EastRingSumWeightsPhiWeighted(int ring)
TVector2 WestRingPhiWeightedQ(int order, int ring)
double EastPhiWeightedPsi(int order)
double WestRingPhiWeightedPsi(int order, int ring)
double EastPhiWeightedAndShiftedPsi(int order)
double WestPhiWeightedPsi(int order)
double EastRingRawPsi(int order, int ring)
TVector2 EastPhiWeightedQ(int order)
TVector2 WestPhiWeightedQ(int order)
TVector2 EastRingRawQ(int order, int ring)
double FullPhiWeightedPsi(int order)
double EastSumWeightsRaw(int order)
double WestRawPsi(int order)
TVector2 WestRingRawQ(int order, int ring)
TVector2 WestRawQ(int order)
TVector2 EastRawQ(int order)
double WestRingSumWeightsPhiWeighted(int ring)
double WestRingRawPsi(int order, int ring)
double WestSumWeightsPhiWeighted(int order)
double EastRingSumWeightsRaw(int ring)
double EastRingPhiWeightedPsi(int order, int ring)
double WestSumWeightsRaw(int order)