28 #include "StHbtMaker/CorrFctn/BPLCMSFrame3DCorrFctnKt.h"
36 BPLCMSFrame3DCorrFctnKt::BPLCMSFrame3DCorrFctnKt(
char* title,
const int& nbins,
const float& QLo,
const float& QHi,
37 const int& nCFs,
const float& KtLo,
const float& KtHi){
44 mDeltaKt = (mKtMax-mKtMin)/mNumberCFs;
53 mNumerator =
new StHbt3DHisto[mNumberCFs];
56 mDenominator =
new StHbt3DHisto[mNumberCFs];
59 mRatio =
new StHbt3DHisto[mNumberCFs];
62 mQinvHisto =
new StHbt3DHisto[mNumberCFs];
64 char TitNum[100] =
"Num";
66 char TitDen[100] =
"Den";
68 char TitRat[100] =
"Rat";
70 char TitQinv[100] =
"Qinv";
71 strcat(TitQinv,title);
73 for (
int i=0; i<mNumberCFs; i++){
75 sprintf(TitNum,
"NumBPLCMSFrameCFKtBin%d",i);
76 mNumerator[i].SetName(TitNum);
77 mNumerator[i].SetTitle(title);
78 mNumerator[i].SetBins(nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
79 mNumerator[i].SetDirectory(0);
80 mNumerator[i].Sumw2();
82 sprintf(TitDen,
"DenBPLCMSFrameCFKtBin%d",i);
83 mDenominator[i].SetName(TitDen);
84 mDenominator[i].SetTitle(title);
85 mDenominator[i].SetBins(nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
86 mDenominator[i].SetDirectory(0);
87 mDenominator[i].Sumw2();
89 sprintf(TitRat,
"RatBPLCMSFrameCFKtBin%d",i);
90 mRatio[i].SetName(TitRat);
91 mRatio[i].SetTitle(title);
92 mRatio[i].SetBins(nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
93 mRatio[i].SetDirectory(0);
96 sprintf(TitQinv,
"QInvHistoKtBin%d",i);
97 mQinvHisto[i].SetName(TitRat);
98 mQinvHisto[i].SetTitle(title);
99 mQinvHisto[i].SetBins(nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
100 mQinvHisto[i].SetDirectory(0);
101 mQinvHisto[i].Sumw2();
105 BPLCMSFrame3DCorrFctnKt::~BPLCMSFrame3DCorrFctnKt(){
106 delete [] mNumerator;
107 delete [] mDenominator;
109 delete [] mQinvHisto;
112 void BPLCMSFrame3DCorrFctnKt::Finish(){
115 for (
int i=0; i<mNumberCFs; i++){
116 double NumFact,DenFact;
117 if ((mNumRealsNorm !=0) && (mNumMixedNorm !=0)){
118 NumFact = double(mNumRealsNorm);
119 DenFact = double(mNumMixedNorm);
125 cout <<
"Warning! - no normalization constants defined - I do the best I can..." << endl;
126 int nbins = mNumerator[i].GetNbinsX();
127 int half_way = nbins/2;
128 NumFact = mNumerator[i].Integral(half_way,nbins,half_way,nbins,half_way,nbins);
129 DenFact = mDenominator[i].Integral(half_way,nbins,half_way,nbins,half_way,nbins);
132 mRatio[i].Divide(&mNumerator[i],&mDenominator[i],DenFact,NumFact);
133 mQinvHisto[i].Divide(&mDenominator[i]);
138 StHbtString BPLCMSFrame3DCorrFctnKt::Report(){
139 int mNumeratorEntries=0;
140 int mDenominatorEntries=0;
142 int mQinvHistoEntries=0;
144 for (
int i=0; i<mNumberCFs; i++){
145 mNumeratorEntries += (int)mNumerator[i].GetEntries();
146 mDenominatorEntries += (int)mDenominator[i].GetEntries();
147 mRatioEntries += (int)mRatio[i].GetEntries();
148 mQinvHistoEntries += (int)mQinvHisto[i].GetEntries();
151 string stemp =
"LCMS Frame Bertsch-Pratt 3D Correlation Function Report:\n";
153 sprintf(ctemp,
"Number of entries in numerator:\t%i\n",mNumeratorEntries);
155 sprintf(ctemp,
"Number of entries in denominator:\t%i\n",mDenominatorEntries);
157 sprintf(ctemp,
"Number of entries in ratio:\t%i\n",mRatioEntries);
161 float radius = mCorrection->GetRadius();
162 sprintf(ctemp,
"Coulomb correction used radius of\t%E\n",radius);
166 sprintf(ctemp,
"No Coulomb Correction applied to this CorrFctn\n");
170 StHbtString returnThis = stemp;
174 void BPLCMSFrame3DCorrFctnKt::AddRealPair(
const StHbtPair* pair){
175 int mIndex = (int)(((fabs(pair->kT())-mKtMin)/mDeltaKt));
176 if ((mIndex>=0)&&(mIndex<mNumberCFs)){
177 double Qinv = fabs(pair->qInv());
178 if ((Qinv < mQinvNormHi) && (Qinv > mQinvNormLo)) mNumRealsNorm++;
179 double qOut = fabs(pair->qOutCMS());
180 double qSide = fabs(pair->qSideCMS());
181 double qLong = fabs(pair->qLongCMS());
183 mNumerator[mIndex].Fill(qOut,qSide,qLong);
188 void BPLCMSFrame3DCorrFctnKt::AddMixedPair(
const StHbtPair* pair){
189 int mIndex = (int)(((fabs(pair->kT())-mKtMin)/mDeltaKt));
190 if ((mIndex>=0)&&(mIndex<mNumberCFs)){
191 double CoulombWeight = (mCorrection ? mCorrection->CoulombCorrect(pair) : 1.0);
193 double Qinv = fabs(pair->qInv());
194 if ((Qinv < mQinvNormHi) && (Qinv > mQinvNormLo)) mNumMixedNorm++;
195 double qOut = fabs(pair->qOutCMS());
196 double qSide = fabs(pair->qSideCMS());
197 double qLong = fabs(pair->qLongCMS());
199 mDenominator[mIndex].Fill(qOut,qSide,qLong,CoulombWeight);
200 mQinvHisto[mIndex].Fill(qOut,qSide,qLong,Qinv);