27 #include "StHbtMaker/CorrFctn/QinvCorrFctnKt.h"
36 QinvCorrFctnKt::QinvCorrFctnKt(
char* title,
const int& nbins,
const float& QinvLo,
const float& QinvHi,
37 const int& nCFs,
const float& KtLo,
const float& KtHi){
41 mDeltaKt = (mKtMax-mKtMin)/mNumberCFs;
52 char TitNum[100] =
"Num";
54 char TitDen[100] =
"Den";
56 char TitRat[100] =
"Rat";
59 for (
int i=0; i<mNumberCFs; i++){
61 sprintf(TitNum,
"NumQInvCFKtBin%d",i);
62 mNumerator[i].SetName(TitNum);
63 mNumerator[i].SetTitle(title);
64 mNumerator[i].SetBins(nbins,QinvLo,QinvHi);
65 mNumerator[i].SetDirectory(0);
66 mNumerator[i].Sumw2();
68 sprintf(TitDen,
"DenQInvCFKtBin%d",i);
69 mDenominator[i].SetName(TitDen);
70 mDenominator[i].SetTitle(title);
71 mDenominator[i].SetBins(nbins,QinvLo,QinvHi);
72 mDenominator[i].SetDirectory(0);
73 mDenominator[i].Sumw2();
75 sprintf(TitRat,
"RatQInvCFKtBin%d",i);
76 mRatio[i].SetName(TitRat);
77 mRatio[i].SetTitle(title);
78 mRatio[i].SetBins(nbins,QinvLo,QinvHi);
79 mRatio[i].SetDirectory(0);
84 QinvCorrFctnKt::~QinvCorrFctnKt(){
86 delete [] mDenominator;
90 void QinvCorrFctnKt::Finish(){
91 for (
int i=0; i<mNumberCFs; i++){
92 mRatio[i].Divide(&mNumerator[i],&mDenominator[i],1.0,1.0);
96 StHbtString QinvCorrFctnKt::Report(){
97 int mNumeratorEntries=0;
98 int mDenominatorEntries=0;
101 for (
int i=0; i<mNumberCFs; i++){
102 mNumeratorEntries += (int)mNumerator[i].GetEntries();
103 mDenominatorEntries += (int)mDenominator[i].GetEntries();
104 mRatioEntries += (int)mRatio[i].GetEntries();
106 string stemp =
"Qinv Correlation Function Report:\n";
108 sprintf(ctemp,
"Number of entries in all numerators:\t%i\n",mNumeratorEntries);
110 sprintf(ctemp,
"Number of entries in all denominators:\t%i\n",mDenominatorEntries);
112 sprintf(ctemp,
"Number of entries in all ratios:\t%i\n",mRatioEntries);
114 StHbtString returnThis = stemp;
118 void QinvCorrFctnKt::AddRealPair(
const StHbtPair* pair){
119 int mIndex = (int)(((fabs(pair->kT())-mKtMin)/mDeltaKt));
120 if ((mIndex>=0)&&(mIndex<mNumberCFs)){
121 mNumerator[mIndex].Fill(fabs(pair->qInv()),1.0);
125 void QinvCorrFctnKt::AddMixedPair(
const StHbtPair* pair){
126 int mIndex = (int)(((fabs(pair->kT())-mKtMin)/mDeltaKt));
127 if ((mIndex>=0)&&(mIndex<mNumberCFs)){
128 mDenominator[mIndex].Fill(fabs(pair->qInv()),1.0);