65 #include "StHbtMaker/CorrFctn/NonId3DCorrFctn.h"
73 NonId3DCorrFctn::NonId3DCorrFctn(
char* title,
const int& nbins,
const float& QinvLo,
const float& QinvHi){
74 makeHistos(title, nbins, QinvLo, QinvHi);
78 void NonId3DCorrFctn::makeHistos(
char* title,
const int& nbins,
const float& QinvLo,
const float& QinvHi){
80 char TitNumOutP[100] =
"NumOutP";
81 strcat(TitNumOutP,title);
82 mNumOutP =
new StHbt1DHisto(TitNumOutP,title,nbins,QinvLo,QinvHi);
84 char TitDenOutP[100] =
"DenOutP";
85 strcat(TitDenOutP,title);
86 mDenOutP =
new StHbt1DHisto(TitDenOutP,title,nbins,QinvLo,QinvHi);
88 char TitRatOutP[100] =
"RatOutP";
89 strcat(TitRatOutP,title);
90 mRatOutP =
new StHbt1DHisto(TitRatOutP,title,nbins,QinvLo,QinvHi);
92 char TitNumOutN[100] =
"NumOutN";
93 strcat(TitNumOutN,title);
94 mNumOutN =
new StHbt1DHisto(TitNumOutN,title,nbins,QinvLo,QinvHi);
96 char TitDenOutN[100] =
"DenOutN";
97 strcat(TitDenOutN,title);
98 mDenOutN =
new StHbt1DHisto(TitDenOutN,title,nbins,QinvLo,QinvHi);
100 char TitRatOutN[100] =
"RatOutN";
101 strcat(TitRatOutN,title);
102 mRatOutN =
new StHbt1DHisto(TitRatOutN,title,nbins,QinvLo,QinvHi);
104 char TitRatOut[100] =
"RatOut";
105 strcat(TitRatOut,title);
106 mRatOut =
new StHbt1DHisto(TitRatOut,title,nbins,QinvLo,QinvHi);
108 char TitRatOutNOverP[100] =
"RatOutNOverP";
109 strcat(TitRatOutNOverP,title);
110 mRatOutNOverP =
new StHbt1DHisto(TitRatOutNOverP,title,nbins,QinvLo,QinvHi);
113 char TitNumSideP[100] =
"NumSideP";
114 strcat(TitNumSideP,title);
115 mNumSideP =
new StHbt1DHisto(TitNumSideP,title,nbins,QinvLo,QinvHi);
117 char TitDenSideP[100] =
"DenSideP";
118 strcat(TitDenSideP,title);
119 mDenSideP =
new StHbt1DHisto(TitDenSideP,title,nbins,QinvLo,QinvHi);
121 char TitRatSideP[100] =
"RatSideP";
122 strcat(TitRatSideP,title);
123 mRatSideP =
new StHbt1DHisto(TitRatSideP,title,nbins,QinvLo,QinvHi);
125 char TitNumSideN[100] =
"NumSideN";
126 strcat(TitNumSideN,title);
127 mNumSideN =
new StHbt1DHisto(TitNumSideN,title,nbins,QinvLo,QinvHi);
129 char TitDenSideN[100] =
"DenSideN";
130 strcat(TitDenSideN,title);
131 mDenSideN =
new StHbt1DHisto(TitDenSideN,title,nbins,QinvLo,QinvHi);
133 char TitRatSideN[100] =
"RatSideN";
134 strcat(TitRatSideN,title);
135 mRatSideN =
new StHbt1DHisto(TitRatSideN,title,nbins,QinvLo,QinvHi);
137 char TitRatSide[100] =
"RatSide";
138 strcat(TitRatSide,title);
139 mRatSide =
new StHbt1DHisto(TitRatSide,title,nbins,QinvLo,QinvHi);
141 char TitRatSideNOverP[100] =
"RatSideNOverP";
142 strcat(TitRatSideNOverP,title);
144 title,nbins,QinvLo,QinvHi);
147 char TitNumLongP[100] =
"NumLongP";
148 strcat(TitNumLongP,title);
149 mNumLongP =
new StHbt1DHisto(TitNumLongP,title,nbins,QinvLo,QinvHi);
151 char TitDenLongP[100] =
"DenLongP";
152 strcat(TitDenLongP,title);
153 mDenLongP =
new StHbt1DHisto(TitDenLongP,title,nbins,QinvLo,QinvHi);
155 char TitRatLongP[100] =
"RatLongP";
156 strcat(TitRatLongP,title);
157 mRatLongP =
new StHbt1DHisto(TitRatLongP,title,nbins,QinvLo,QinvHi);
159 char TitNumLongN[100] =
"NumLongN";
160 strcat(TitNumLongN,title);
161 mNumLongN =
new StHbt1DHisto(TitNumLongN,title,nbins,QinvLo,QinvHi);
163 char TitDenLongN[100] =
"DenLongN";
164 strcat(TitDenLongN,title);
165 mDenLongN =
new StHbt1DHisto(TitDenLongN,title,nbins,QinvLo,QinvHi);
167 char TitRatLongN[100] =
"RatLongN";
168 strcat(TitRatLongN,title);
169 mRatLongN =
new StHbt1DHisto(TitRatLongN,title,nbins,QinvLo,QinvHi);
171 char TitRatLong[100] =
"RatLong";
172 strcat(TitRatLong,title);
173 mRatLong =
new StHbt1DHisto(TitRatLong,title,nbins,QinvLo,QinvHi);
175 char TitRatLongNOverP[100] =
"RatLongNOverP";
176 strcat(TitRatLongNOverP,title);
177 mRatLongNOverP =
new StHbt1DHisto(TitRatLongNOverP,title,nbins,QinvLo,QinvHi);
187 mRatOutNOverP->Sumw2();
196 mRatSideNOverP->Sumw2();
205 mRatLongNOverP->Sumw2();
207 float kstarlim = 0.5;
208 float klim = 0.6 * kstarlim;
211 strcpy(htitle,
"HOutKSame");
212 mHOutKSame =
new StHbt2DHisto(strcat(htitle,title),htitle,
213 100,-klim,klim,nbins,QinvLo,kstarlim);
214 strcpy(htitle,
"HOutKDiff");
215 mHOutKDiff =
new StHbt2DHisto(strcat(htitle,title),htitle,
216 100,-klim,klim,nbins,QinvLo,kstarlim);
217 strcpy(htitle,
"HSideKSame");
218 mHSideKSame =
new StHbt2DHisto(strcat(htitle,title),htitle,
219 100,-klim,klim,nbins,QinvLo,kstarlim);
220 strcpy(htitle,
"HSideKDiff");
221 mHSideKDiff =
new StHbt2DHisto(strcat(htitle,title),htitle,
222 100,-klim,klim,nbins,QinvLo,kstarlim);
223 strcpy(htitle,
"HLongKSame");
224 mHLongKSame =
new StHbt2DHisto(strcat(htitle,title),htitle,
225 100,-klim,klim,nbins,QinvLo,kstarlim);
226 strcpy(htitle,
"HLongKDiff");
227 mHLongKDiff =
new StHbt2DHisto(strcat(htitle,title),htitle,
228 100,-klim,klim,nbins,QinvLo,kstarlim);
271 NonId3DCorrFctn::NonId3DCorrFctn(
char* title,
const int& nbins,
const float& QinvLo,
272 const float& QinvHi,
const int aqSideSel){
273 makeHistos(title, nbins, QinvLo, QinvHi);
274 mqSideSel = aqSideSel;
279 NonId3DCorrFctn::NonId3DCorrFctn(
char* title,
const int& nbins,
const float& QinvLo,
280 const float& QinvHi,
const float KCompCut)
282 makeHistos(title, nbins, QinvLo, QinvHi);
283 mKCompCut = KCompCut;
289 NonId3DCorrFctn::~NonId3DCorrFctn(){
297 delete mRatOutNOverP;
306 delete mRatSideNOverP;
315 delete mRatLongNOverP;
343 void NonId3DCorrFctn::Finish(){
345 int tLastNormBin = mNumOutP->GetNbinsX();
346 int tFirstNormBin = tLastNormBin/2+1;
350 mRatOutP->Divide(mNumOutP,mDenOutP,1.0,1.0);
351 tScale = mRatOutP->Integral(tFirstNormBin,tLastNormBin);
352 tScale/= (tLastNormBin-tFirstNormBin+1);
353 mRatOutP->Scale(1./tScale);
354 mRatOutN->Divide(mNumOutN,mDenOutN,1.0,1.0);
355 tScale = mRatOutN->Integral(tFirstNormBin,tLastNormBin);
356 tScale/= (tLastNormBin-tFirstNormBin+1);
357 mRatOutN->Scale(1./tScale);
358 mRatOutNOverP->Divide(mRatOutN,mRatOutP,1.0,1.0);
360 TH1D tHNumOut(*mNumOutP);
361 tHNumOut.SetName(
"tHNumOut");
362 tHNumOut.Add(mNumOutN);
363 TH1D tHDenOut(*mDenOutP);
364 tHDenOut.SetName(
"tHDenOut");
365 tHDenOut.Add(mDenOutN);
366 mRatOut->Divide(&tHNumOut,&tHDenOut);
367 tScale = mRatOut->Integral(tFirstNormBin,tLastNormBin);
368 tScale/= (tLastNormBin-tFirstNormBin+1);
369 mRatOut->Scale(1./tScale);
373 mRatSideP->Divide(mNumSideP,mDenSideP,1.0,1.0);
374 tScale = mRatSideP->Integral(tFirstNormBin,tLastNormBin);
375 tScale/= (tLastNormBin-tFirstNormBin+1);
376 mRatSideP->Scale(1./tScale);
377 mRatSideN->Divide(mNumSideN,mDenSideN,1.0,1.0);
378 tScale = mRatSideN->Integral(tFirstNormBin,tLastNormBin);
379 tScale/= (tLastNormBin-tFirstNormBin+1);
380 mRatSideN->Scale(1./tScale);
381 mRatSideNOverP->Divide(mRatSideN,mRatSideP,1.0,1.0);
383 TH1D tHNumSide(*mNumSideP);
384 tHNumSide.SetName(
"tHNumSide");
385 tHNumSide.Add(mNumSideN);
386 TH1D tHDenSide(*mDenSideP);
387 tHDenSide.SetName(
"tHDenSide");
388 tHDenSide.Add(mDenSideN);
389 mRatSide->Divide(&tHNumSide,&tHDenSide);
390 tScale = mRatSide->Integral(tFirstNormBin,tLastNormBin);
391 tScale/= (tLastNormBin-tFirstNormBin+1);
392 mRatSide->Scale(1./tScale);
396 mRatLongP->Divide(mNumLongP,mDenLongP,1.0,1.0);
397 tScale = mRatLongP->Integral(tFirstNormBin,tLastNormBin);
398 tScale/= (tLastNormBin-tFirstNormBin+1);
399 mRatLongP->Scale(1./tScale);
400 mRatLongN->Divide(mNumLongN,mDenLongN,1.0,1.0);
401 tScale = mRatLongN->Integral(tFirstNormBin,tLastNormBin);
402 tScale/= (tLastNormBin-tFirstNormBin+1);
403 mRatLongN->Scale(1./tScale);
404 mRatLongNOverP->Divide(mRatLongN,mRatLongP,1.0,1.0);
406 TH1D tHNumLong(*mNumLongP);
407 tHNumLong.SetName(
"tHNumLong");
408 tHNumLong.Add(mNumLongN);
409 TH1D tHDenLong(*mDenLongP);
410 tHDenLong.SetName(
"tHDenLong");
411 tHDenLong.Add(mDenLongN);
412 mRatLong->Divide(&tHNumLong,&tHDenLong);
413 tScale = mRatLong->Integral(tFirstNormBin,tLastNormBin);
414 tScale/= (tLastNormBin-tFirstNormBin+1);
415 mRatLong->Scale(1./tScale);
418 void NonId3DCorrFctn::Write(){
426 mRatOutNOverP->Write();
435 mRatSideNOverP->Write();
444 mRatLongNOverP->Write();
448 mHSideKSame->Write();
449 mHSideKDiff->Write();
450 mHLongKSame->Write();
451 mHLongKDiff->Write();
473 StHbtString NonId3DCorrFctn::Report(){
474 string stemp =
"Non-Identical 3D Correlation Function Report:\n";
476 sprintf(ctemp,
"Number of entries in out numerator:\t%E\n",mHOutKSame->GetEntries());
478 sprintf(ctemp,
"Number of entries in out denominator:\t%E\n",mHOutKDiff->GetEntries());
480 sprintf(ctemp,
"Number of entries in out ratio:\t%E\n",mRatOut->GetEntries());
482 sprintf(ctemp,
"Number of entries in side numerator:\t%E\n",mHSideKSame->GetEntries());
484 sprintf(ctemp,
"Number of entries in side denominator:\t%E\n",mHSideKDiff->GetEntries());
486 sprintf(ctemp,
"Number of entries in side ratio:\t%E\n",mRatSide->GetEntries());
488 sprintf(ctemp,
"Number of entries in long numerator:\t%E\n",mHLongKSame->GetEntries());
490 sprintf(ctemp,
"Number of entries in long denominator:\t%E\n",mHLongKDiff->GetEntries());
492 sprintf(ctemp,
"Number of entries in long ratio:\t%E\n",mRatLong->GetEntries());
494 StHbtString returnThis = stemp;
498 void NonId3DCorrFctn::AddRealPair(
const StHbtPair* pair){
499 double tKStar = fabs(pair->KStar());
500 double tKOut = pair->dKOut();
501 double tKSide = pair->dKSide();
502 double tKLong = pair->dKLong();
505 if (mKCompCut <= 0.0)
507 if ((!mqSideSel) || (mqSideSel * tKSide > 0)) {
509 mNumOutP->Fill(tKStar);
513 mNumOutN->Fill(tKStar);
517 mNumSideP->Fill(tKStar);
521 mNumSideN->Fill(tKStar);
525 mNumLongP->Fill(tKStar);
528 mNumLongN->Fill(tKStar);
534 if ((fabs(tKLong) < mKCompCut) && (fabs(tKSide) < mKCompCut))
537 mNumOutP->Fill(tKStar);
541 mNumOutN->Fill(tKStar);
545 if ((fabs(tKOut) < mKCompCut) && (fabs(tKLong) < mKCompCut))
548 mNumSideP->Fill(tKStar);
552 mNumSideN->Fill(tKStar);
556 if ((fabs(tKOut) < mKCompCut) && (fabs(tKSide) < mKCompCut))
559 mNumLongP->Fill(tKStar);
562 mNumLongN->Fill(tKStar);
566 mHOutKSame->Fill(tKOut, tKStar, 1.);
567 mHSideKSame->Fill(tKSide, tKStar, 1.);
568 mHLongKSame->Fill(tKLong, tKStar, 1.);
577 void NonId3DCorrFctn::AddMixedPair(
const StHbtPair* pair){
578 double tKStar = fabs(pair->KStar());
579 double tKOut = pair->dKOut();
580 double tKSide = pair->dKSide();
581 double tKLong = pair->dKLong();
584 if (mKCompCut <= 0.0)
586 if ((!mqSideSel) || (mqSideSel * tKSide > 0)) {
588 mDenOutP->Fill(tKStar);
592 mDenOutN->Fill(tKStar);
596 mDenSideP->Fill(tKStar);
600 mDenSideN->Fill(tKStar);
604 mDenLongP->Fill(tKStar);
607 mDenLongN->Fill(tKStar);
613 if ((fabs(tKLong) < mKCompCut) && (fabs(tKSide) < mKCompCut))
616 mDenOutP->Fill(tKStar);
620 mDenOutN->Fill(tKStar);
624 if ((fabs(tKOut) < mKCompCut) && (fabs(tKLong) < mKCompCut))
627 mDenSideP->Fill(tKStar);
631 mDenSideN->Fill(tKStar);
635 if ((fabs(tKOut) < mKCompCut) && (fabs(tKSide) < mKCompCut))
638 mDenLongP->Fill(tKStar);
641 mDenLongN->Fill(tKStar);
646 mHOutKDiff->Fill(tKOut, tKStar, 1.);
647 mHSideKDiff->Fill(tKSide, tKStar, 1.);
648 mHLongKDiff->Fill(tKLong, tKStar, 1.);