32 #include "StHbtMaker/CorrFctn/BPLabFrame3DCorrFctn.h"
41 BPLabFrame3DCorrFctn::BPLabFrame3DCorrFctn(
char* title,
const int& nbins,
const float& QLo,
const float& QHi){
51 char TitNum[100] =
"Num";
53 mNumerator =
new StHbt3DHisto(TitNum,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
55 char TitDen[100] =
"Den";
57 mDenominator =
new StHbt3DHisto(TitDen,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
59 char TitRat[100] =
"Rat";
61 mRatio =
new StHbt3DHisto(TitRat,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
63 char TitQinv[100] =
"Qinv";
64 strcat(TitQinv,title);
65 mQinvHisto =
new StHbt3DHisto(TitQinv,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
69 mDenominator->Sumw2();
75 BPLabFrame3DCorrFctn::~BPLabFrame3DCorrFctn(){
82 void BPLabFrame3DCorrFctn::Finish(){
84 double NumFact,DenFact;
85 if ((mNumRealsNorm !=0) && (mNumMixedNorm !=0)){
86 NumFact = double(mNumRealsNorm);
87 DenFact = double(mNumMixedNorm);
93 cout <<
"Warning! - no normalization constants defined - I do the best I can..." << endl;
94 int nbins = mNumerator->GetNbinsX();
95 int half_way = nbins/2;
96 NumFact = mNumerator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
97 DenFact = mDenominator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
100 mRatio->Divide(mNumerator,mDenominator,DenFact,NumFact);
101 mQinvHisto->Divide(mDenominator);
105 StHbtString BPLabFrame3DCorrFctn::Report(){
106 string stemp =
"Labframe Bertsch-Pratt 3D Correlation Function Report:\n";
108 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
110 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
112 sprintf(ctemp,
"Number of entries in ratio:\t%E\n",mRatio->GetEntries());
114 sprintf(ctemp,
"Normalization region in Qinv was:\t%E\t%E\n",mQinvNormLo,mQinvNormHi);
116 sprintf(ctemp,
"Number of pairs in Normalization region was:\n");
118 sprintf(ctemp,
"In numerator:\t%lu\t In denominator:\t%lu\n",mNumRealsNorm,mNumMixedNorm);
122 float radius = mCorrection->GetRadius();
123 sprintf(ctemp,
"Coulomb correction used radius of\t%E\n",radius);
127 sprintf(ctemp,
"No Coulomb Correction applied to this CorrFctn\n");
131 StHbtString returnThis = stemp;
135 void BPLabFrame3DCorrFctn::AddRealPair(
const StHbtPair* pair){
136 double Qinv = fabs(pair->qInv());
137 if ((Qinv < mQinvNormHi) && (Qinv > mQinvNormLo)) mNumRealsNorm++;
138 double qOut = fabs(pair->qOutBf());
139 double qSide = fabs(pair->qSideBf());
140 double qLong = fabs(pair->qLongBf());
142 mNumerator->Fill(qOut,qSide,qLong);
145 void BPLabFrame3DCorrFctn::AddMixedPair(
const StHbtPair* pair){
149 weight = mCorrection->CoulombCorrect(pair);
151 double Qinv = fabs(pair->qInv());
152 if ((Qinv < mQinvNormHi) && (Qinv > mQinvNormLo)) mNumMixedNorm++;
153 double qOut = fabs(pair->qOutBf());
154 double qSide = fabs(pair->qSideBf());
155 double qLong = fabs(pair->qLongBf());
157 mDenominator->Fill(qOut,qSide,qLong,weight);
158 mQinvHisto->Fill(qOut,qSide,qLong,Qinv);