1 #include "StHbtMaker/CorrFctn/QoslCMSCorrFctnRPkT.h"
3 #include "StHbtMaker/Infrastructure/StHbtReactionPlaneAnalysis.h"
4 #include "PhysicalConstants.h"
12 QoslCMSCorrFctnRPkT::QoslCMSCorrFctnRPkT(
char* title,
const int& nbinso,
const float& QoLo,
const float& QoHi,
13 const int& nbinss,
const float& QsLo,
const float& QsHi,
14 const int& nbinsl,
const float& QlLo,
const float& QlHi,
const int& rpBins){
17 mCorrection->SetRadius(5.0);
18 mCorrection->SetChargeProduct(1.0);
25 for(
int i=0; i<nRPbins; i++) {
26 TString TitAngle=Form(
"_phi%i",i*180/nRPbins);
28 for(
int j=0; j<nKtBins; j++) {
29 TString TitKt=Form(
"_kt%i",j);
32 TString TitNum =
"Num";
34 TitNum += TitAngle.Data();
35 TitNum += TitKt.Data();
36 mNumerator[i][j] =
new TH3S(TitNum.Data(),TitNum.Data(),nbinso,QoLo,QoHi,
41 TString TitDen =
"Den";
43 TitDen += TitAngle.Data();
44 TitDen += TitKt.Data();
45 mDenominator[i][j] =
new TH3S(TitDen.Data(),TitDen.Data(),nbinso,QoLo,QoHi,
57 TString TitCoul =
"Coul";
59 TitCoul += TitAngle.Data();
60 TitCoul += TitKt.Data();
61 mCoulHisto[i][j] =
new StHbt3DHisto(TitCoul.Data(),TitCoul.Data(),nbinso,QoLo,QoHi,nbinss,QsLo,QsHi,nbinsl,QlLo,QlHi);
72 QoslCMSCorrFctnRPkT::~QoslCMSCorrFctnRPkT(){
73 for(
int i=0; i<nRPbins; i++) {
74 for(
int j=0; j<nKtBins; j++) {
75 delete mNumerator[i][j];
76 delete mDenominator[i][j];
77 delete mCoulHisto[i][j];
82 void QoslCMSCorrFctnRPkT::Finish(){
93 StHbtString QoslCMSCorrFctnRPkT::Report(){
94 string stemp =
"QoslCMS Correlation Function Report:\n";
96 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator[0][0]->GetEntries());
98 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator[0][0]->GetEntries());
102 StHbtString returnThis = stemp;
106 void QoslCMSCorrFctnRPkT::AddRealPair(
const StHbtPair* pair){
109 rpBin = GetRPBin(pair);
110 ktBin = GetKtBin(pair);
113 double Qo = pair->qOutCMS();
114 double Qs = pair->qSideCMS();
115 double Ql = pair->qLongCMS();
117 if(fabs(Qo)>qMax || fabs(Qs)>qMax || fabs(Ql)>qMax)
return;
124 mNumerator[rpBin][ktBin]->Fill(Qo,Qs,Ql);
127 void QoslCMSCorrFctnRPkT::AddMixedPair(
const StHbtPair* pair){
130 rpBin = GetRPBin(pair);
131 ktBin = GetKtBin(pair);
137 if (mCorrection) weight = mCorrection->CoulombCorrect(pair);
139 double Qo = pair->qOutCMS();
140 double Qs = pair->qSideCMS();
141 double Ql = pair->qLongCMS();
143 if(fabs(Qo)>qMax || fabs(Qs)>qMax || fabs(Ql)>qMax)
return;
150 mDenominator[rpBin][ktBin]->Fill(Qo,Qs,Ql);
151 mCoulHisto[rpBin][ktBin]->Fill(Qo,Qs,Ql,weight);
155 int QoslCMSCorrFctnRPkT::GetRPBin(
const StHbtPair* pair) {
158 double pxTotal = pair->fourMomentumSum().x();
159 double pyTotal = pair->fourMomentumSum().y();
160 double angle = atan2(pyTotal,pxTotal)*180.0/pi;
161 if (angle<0.0) angle+=360.0;
165 double RPangle = RPanal->ReactionPlane()*180.0/pi;
171 double angleDifference = angle-RPangle;
172 if (angleDifference<0.0) angleDifference+=360.0;
173 if (angleDifference>=180.0) angleDifference-=180.0;
174 if (angleDifference>=(180.0-90.0/nRPbins)) angleDifference-=180.0;
178 rpBin = (int) ((angleDifference*nRPbins/180.0)+0.5);
179 if(rpBin>=nRPbins || ((angleDifference*nRPbins/180.0)+0.5)<0.0)
180 cout << endl << endl << endl << endl <<
"PROBLEM!!!!" << endl << endl << endl
181 << endl << endl << endl;
186 int QoslCMSCorrFctnRPkT::GetKtBin(
const StHbtPair* pair) {
188 double kT = fabs(pair->kT());
191 if(kT<0.15 || kT>0.6)
return -1;
195 else if( kT >= 0.25 && kT < 0.35 )
197 else if( kT >= 0.35 && kT < 0.45 )
199 else if( kT >= 0.45 && kT <= 0.6 )
206 void QoslCMSCorrFctnRPkT::SetCorrection(
StHbtCoulomb* coulomb) {
207 mCorrection = coulomb;