35 #include "StHbtMaker/CorrFctn/NonIdReal3DCorrFctn.h"
44 NonIdReal3DCorrFctn::NonIdReal3DCorrFctn(
char* title,
const int& nbins,
const float& QLo,
const float& QHi){
54 char TitNum[100] =
"Num";
56 mNumerator =
new StHbt3DHisto(TitNum,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
58 char TitDen[100] =
"Den";
60 mDenominator =
new StHbt3DHisto(TitDen,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
62 char TitRat[100] =
"Rat";
64 mRatio =
new StHbt3DHisto(TitRat,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
66 char TitQinv[100] =
"Qinv";
67 strcat(TitQinv,title);
68 mQinvHisto =
new StHbt3DHisto(TitQinv,title,nbins,QLo,QHi,nbins,QLo,QHi,nbins,QLo,QHi);
72 mDenominator->Sumw2();
78 NonIdReal3DCorrFctn::~NonIdReal3DCorrFctn(){
85 void NonIdReal3DCorrFctn::Finish(){
87 double NumFact,DenFact;
88 if ((mNumRealsNorm !=0) && (mNumMixedNorm !=0)){
89 NumFact = double(mNumRealsNorm);
90 DenFact = double(mNumMixedNorm);
96 cout <<
"Warning! - no normalization constants defined - I do the best I can..." << endl;
97 int nbins = mNumerator->GetNbinsX();
98 int half_way = nbins/2;
99 NumFact = mNumerator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
100 DenFact = mDenominator->Integral(half_way,nbins,half_way,nbins,half_way,nbins);
103 mRatio->Divide(mNumerator,mDenominator,DenFact,NumFact);
104 mQinvHisto->Divide(mDenominator);
108 StHbtString NonIdReal3DCorrFctn::Report(){
109 string stemp =
"Labframe Bertsch-Pratt 3D Correlation Function Report:\n";
111 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
113 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
115 sprintf(ctemp,
"Number of entries in ratio:\t%E\n",mRatio->GetEntries());
117 sprintf(ctemp,
"Normalization region in Qinv was:\t%E\t%E\n",mQinvNormLo,mQinvNormHi);
119 sprintf(ctemp,
"Number of pairs in Normalization region was:\n");
121 sprintf(ctemp,
"In numerator:\t%lu\t In denominator:\t%lu\n",mNumRealsNorm,mNumMixedNorm);
126 StHbtString returnThis = stemp;
130 void NonIdReal3DCorrFctn::AddRealPair(
const StHbtPair* pair){
131 double tKStar = 2*fabs(pair->KStar());
132 double tKOut = pair->dKOut();
133 double tKSide = pair->dKSide();
134 double tKLong = pair->dKLong();
137 if ((tKStar < mQinvNormHi) && (tKStar > mQinvNormLo)) mNumRealsNorm++;
142 mNumerator->Fill(tKOut,tKSide,tKLong);
147 void NonIdReal3DCorrFctn::AddMixedPair(
const StHbtPair* pair){
148 double tKStar = 2*fabs(pair->KStar());
149 double tKOut = pair->dKOut();
150 double tKSide = pair->dKSide();
151 double tKLong = pair->dKLong();
156 if ((tKStar < mQinvNormHi) && (tKStar > mQinvNormLo)) mNumMixedNorm++;
161 mDenominator->Fill(tKOut,tKSide,tKLong,weight);
162 mQinvHisto->Fill(tKOut,tKSide,tKLong,tKStar);
166 void NonIdReal3DCorrFctn::Write()
169 mDenominator->Write();