16 #include "StHbtMaker/ThCorrFctn/ThNonId3DCF.h"
22 ThNonId3DCF::ThNonId3DCF(
char* title,
const int& nbins,
const float& QinvLo,
const float& QinvHi)
26 char TitNumOutP[100] =
"NumOutP";
27 strcat(TitNumOutP,title);
28 mNumOutP =
new StHbt1DHisto(TitNumOutP,title,nbins,QinvLo,QinvHi);
30 char TitDenOutP[100] =
"DenOutP";
31 strcat(TitDenOutP,title);
32 mDenOutP =
new StHbt1DHisto(TitDenOutP,title,nbins,QinvLo,QinvHi);
34 char TitRatOutP[100] =
"RatOutP";
35 strcat(TitRatOutP,title);
36 mRatOutP =
new StHbt1DHisto(TitRatOutP,title,nbins,QinvLo,QinvHi);
38 char TitNumOutN[100] =
"NumOutN";
39 strcat(TitNumOutN,title);
40 mNumOutN =
new StHbt1DHisto(TitNumOutN,title,nbins,QinvLo,QinvHi);
42 char TitDenOutN[100] =
"DenOutN";
43 strcat(TitDenOutN,title);
44 mDenOutN =
new StHbt1DHisto(TitDenOutN,title,nbins,QinvLo,QinvHi);
46 char TitRatOutN[100] =
"RatOutN";
47 strcat(TitRatOutN,title);
48 mRatOutN =
new StHbt1DHisto(TitRatOutN,title,nbins,QinvLo,QinvHi);
50 char TitRatOut[100] =
"RatOut";
51 strcat(TitRatOut,title);
52 mRatOut =
new StHbt1DHisto(TitRatOut,title,nbins,QinvLo,QinvHi);
54 char TitRatOutNOverP[100] =
"RatOutNOverP";
55 strcat(TitRatOutNOverP,title);
56 mRatOutNOverP =
new StHbt1DHisto(TitRatOutNOverP,title,nbins,QinvLo,QinvHi);
59 char TitNumSideP[100] =
"NumSideP";
60 strcat(TitNumSideP,title);
61 mNumSideP =
new StHbt1DHisto(TitNumSideP,title,nbins,QinvLo,QinvHi);
63 char TitDenSideP[100] =
"DenSideP";
64 strcat(TitDenSideP,title);
65 mDenSideP =
new StHbt1DHisto(TitDenSideP,title,nbins,QinvLo,QinvHi);
67 char TitRatSideP[100] =
"RatSideP";
68 strcat(TitRatSideP,title);
69 mRatSideP =
new StHbt1DHisto(TitRatSideP,title,nbins,QinvLo,QinvHi);
71 char TitNumSideN[100] =
"NumSideN";
72 strcat(TitNumSideN,title);
73 mNumSideN =
new StHbt1DHisto(TitNumSideN,title,nbins,QinvLo,QinvHi);
75 char TitDenSideN[100] =
"DenSideN";
76 strcat(TitDenSideN,title);
77 mDenSideN =
new StHbt1DHisto(TitDenSideN,title,nbins,QinvLo,QinvHi);
79 char TitRatSideN[100] =
"RatSideN";
80 strcat(TitRatSideN,title);
81 mRatSideN =
new StHbt1DHisto(TitRatSideN,title,nbins,QinvLo,QinvHi);
83 char TitRatSide[100] =
"RatSide";
84 strcat(TitRatSide,title);
85 mRatSide =
new StHbt1DHisto(TitRatSide,title,nbins,QinvLo,QinvHi);
87 char TitRatSideNOverP[100] =
"RatSideNOverP";
88 strcat(TitRatSideNOverP,title);
90 title,nbins,QinvLo,QinvHi);
93 char TitNumLongP[100] =
"NumLongP";
94 strcat(TitNumLongP,title);
95 mNumLongP =
new StHbt1DHisto(TitNumLongP,title,nbins,QinvLo,QinvHi);
97 char TitDenLongP[100] =
"DenLongP";
98 strcat(TitDenLongP,title);
99 mDenLongP =
new StHbt1DHisto(TitDenLongP,title,nbins,QinvLo,QinvHi);
101 char TitRatLongP[100] =
"RatLongP";
102 strcat(TitRatLongP,title);
103 mRatLongP =
new StHbt1DHisto(TitRatLongP,title,nbins,QinvLo,QinvHi);
105 char TitNumLongN[100] =
"NumLongN";
106 strcat(TitNumLongN,title);
107 mNumLongN =
new StHbt1DHisto(TitNumLongN,title,nbins,QinvLo,QinvHi);
109 char TitDenLongN[100] =
"DenLongN";
110 strcat(TitDenLongN,title);
111 mDenLongN =
new StHbt1DHisto(TitDenLongN,title,nbins,QinvLo,QinvHi);
113 char TitRatLongN[100] =
"RatLongN";
114 strcat(TitRatLongN,title);
115 mRatLongN =
new StHbt1DHisto(TitRatLongN,title,nbins,QinvLo,QinvHi);
117 char TitRatLong[100] =
"RatLong";
118 strcat(TitRatLong,title);
119 mRatLong =
new StHbt1DHisto(TitRatLong,title,nbins,QinvLo,QinvHi);
121 char TitRatLongNOverP[100] =
"RatLongNOverP";
122 strcat(TitRatLongNOverP,title);
123 mRatLongNOverP =
new StHbt1DHisto(TitRatLongNOverP,title,nbins,QinvLo,QinvHi);
125 char tOP[100] =
"ProfOutP";
127 mProfOutP =
new TProfile(tOP, tOP, nbins, QinvLo, QinvHi);
128 char tON[100] =
"ProfOutN";
130 mProfOutN =
new TProfile(tON, tON, nbins, QinvLo, QinvHi);
131 char tSP[100] =
"ProfSideP";
133 mProfSideP =
new TProfile(tSP, tSP, nbins, QinvLo, QinvHi);
134 char tSN[100] =
"ProfSideN";
136 mProfSideN =
new TProfile(tSN, tSN, nbins, QinvLo, QinvHi);
137 char tLP[100] =
"ProfLongP";
139 mProfLongP =
new TProfile(tLP, tLP, nbins, QinvLo, QinvHi);
140 char tLN[100] =
"ProfLongN";
142 mProfLongN =
new TProfile(tLN, tLN, nbins, QinvLo, QinvHi);
144 char tDOP[100] =
"ProfDenOutP";
146 mProfDenOutP =
new TProfile(tDOP, tDOP, nbins, QinvLo, QinvHi);
147 char tDON[100] =
"ProfDenOutN";
149 mProfDenOutN =
new TProfile(tDON, tDON, nbins, QinvLo, QinvHi);
150 char tDSP[100] =
"ProfDenSideP";
152 mProfDenSideP =
new TProfile(tDSP, tDSP, nbins, QinvLo, QinvHi);
153 char tDSN[100] =
"ProfDenSideN";
155 mProfDenSideN =
new TProfile(tDSN, tDSN, nbins, QinvLo, QinvHi);
156 char tDLP[100] =
"ProfDenLongP";
158 mProfDenLongP =
new TProfile(tDLP, tDLP, nbins, QinvLo, QinvHi);
159 char tDLN[100] =
"ProfDenLongN";
161 mProfDenLongN =
new TProfile(tDLN, tDLN, nbins, QinvLo, QinvHi);
171 mRatOutNOverP->Sumw2();
180 mRatSideNOverP->Sumw2();
189 mRatLongNOverP->Sumw2();
191 float klim = 1.2 * QinvHi;
193 100,-klim,klim,nbins,QinvLo,QinvHi);
195 100,-klim,klim,nbins,QinvLo,QinvHi);
196 mHSideKSame =
new StHbt2DHisto(
"HSideKSame",
"HSideKSame",
197 100,-klim,klim,nbins,QinvLo,QinvHi);
198 mHSideKDiff =
new StHbt2DHisto(
"HSideKDiff",
"HSideKDiff",
199 100,-klim,klim,nbins,QinvLo,QinvHi);
200 mHLongKSame =
new StHbt2DHisto(
"HLongKSame",
"HLongKSame",
201 100,-klim,klim,nbins,QinvLo,QinvHi);
202 mHLongKDiff =
new StHbt2DHisto(
"HLongKDiff",
"HLongKDiff",
203 100,-klim,klim,nbins,QinvLo,QinvHi);
225 mRatSideNOverP =
new StHbt1DHisto(*ThCf.mRatSideNOverP);
234 mRatLongNOverP =
new StHbt1DHisto(*ThCf.mRatLongNOverP);
243 mProfOutP =
new TProfile(*ThCf.mProfOutP);
244 mProfOutN =
new TProfile(*ThCf.mProfOutN);
245 mProfSideP =
new TProfile(*ThCf.mProfSideP);
246 mProfSideN =
new TProfile(*ThCf.mProfSideN);
247 mProfLongP =
new TProfile(*ThCf.mProfLongP);
248 mProfLongN =
new TProfile(*ThCf.mProfLongN);
250 mProfDenOutP =
new TProfile(*ThCf.mProfDenOutP);
251 mProfDenOutN =
new TProfile(*ThCf.mProfDenOutN);
252 mProfDenSideP =
new TProfile(*ThCf.mProfDenSideP);
253 mProfDenSideN =
new TProfile(*ThCf.mProfDenSideN);
254 mProfDenLongP =
new TProfile(*ThCf.mProfDenLongP);
255 mProfDenLongN =
new TProfile(*ThCf.mProfDenLongN);
258 ThNonId3DCF::~ThNonId3DCF(){
266 delete mRatOutNOverP;
275 delete mRatSideNOverP;
284 delete mRatLongNOverP;
302 delete mProfDenSideP;
303 delete mProfDenSideN;
304 delete mProfDenLongP;
305 delete mProfDenLongN;
312 double tKStar = fabs(aThPair->GetMeasPair()->KStar());
313 double tKOut = aThPair->GetMeasPair()->dKOut();
314 double tKSide = aThPair->GetMeasPair()->dKSide();
315 double tKLong = aThPair->GetMeasPair()->dKLong();
316 double weight = aThPair->GetWeightNum();
318 if ((aThPair->Betat() < mBtMax) && (aThPair->Betat() > mBtMin) &&
319 (aThPair->Ut() < mUtMax) && (aThPair->Ut() > mUtMin))
322 mNumOutP->Fill(tKStar, weight);
323 mProfOutP->Fill(tKStar, weight);
326 mNumOutN->Fill(tKStar, weight);
327 mProfOutN->Fill(tKStar, weight);
330 mNumSideP->Fill(tKStar, weight);
331 mProfSideP->Fill(tKStar, weight);
334 mNumSideN->Fill(tKStar, weight);
335 mProfSideN->Fill(tKStar, weight);
338 mNumLongP->Fill(tKStar, weight);
339 mProfLongP->Fill(tKStar, weight);
342 mNumLongN->Fill(tKStar, weight);
343 mProfLongN->Fill(tKStar, weight);
346 mHOutKSame->Fill(tKOut, tKStar, weight);
347 mHSideKSame->Fill(tKSide, tKStar, weight);
348 mHLongKSame->Fill(tKLong, tKStar, weight);
353 double tKStar = fabs(aThPair->GetMeasPair()->KStar());
354 double tKOut = aThPair->GetMeasPair()->dKOut();
355 double tKSide = aThPair->GetMeasPair()->dKSide();
356 double tKLong = aThPair->GetMeasPair()->dKLong();
357 double weight = aThPair->GetWeightDen();
359 if ((aThPair->Betat() < mBtMax) && (aThPair->Betat() > mBtMin) &&
360 (aThPair->Ut() < mUtMax) && (aThPair->Ut() > mUtMin))
363 mDenOutP->Fill(tKStar, weight);
364 mProfDenOutP->Fill(tKStar, weight);
367 mDenOutN->Fill(tKStar, weight);
368 mProfDenOutN->Fill(tKStar, weight);
371 mDenSideP->Fill(tKStar, weight);
372 mProfDenSideP->Fill(tKStar, weight);
375 mDenSideN->Fill(tKStar, weight);
376 mProfDenSideN->Fill(tKStar, weight);
379 mDenLongP->Fill(tKStar, weight);
380 mProfDenLongP->Fill(tKStar, weight);
383 mDenLongN->Fill(tKStar, weight);
384 mProfDenLongN->Fill(tKStar, weight);
387 mHOutKDiff->Fill(tKOut, tKStar, weight);
388 mHSideKDiff->Fill(tKSide, tKStar, weight);
389 mHLongKDiff->Fill(tKLong, tKStar, weight);
393 void ThNonId3DCF::Finish(){
396 int tLastNormBin = mNumOutP->GetNbinsX();
397 int tFirstNormBin = tLastNormBin/2+1;
401 mRatOutP->Divide(mNumOutP,mDenOutP,1.0,1.0);
402 tScale = mRatOutP->Integral(tFirstNormBin,tLastNormBin);
403 tScale/= (tLastNormBin-tFirstNormBin+1);
404 mRatOutP->Scale(1./tScale);
405 mRatOutN->Divide(mNumOutN,mDenOutN,1.0,1.0);
406 tScale = mRatOutN->Integral(tFirstNormBin,tLastNormBin);
407 tScale/= (tLastNormBin-tFirstNormBin+1);
408 mRatOutN->Scale(1./tScale);
409 mRatOutNOverP->Divide(mRatOutN,mRatOutP,1.0,1.0);
411 TH1D tHNumOut(*mNumOutP);
412 tHNumOut.SetName(
"tHNumOut");
413 tHNumOut.Add(mNumOutN);
414 TH1D tHDenOut(*mDenOutP);
415 tHDenOut.SetName(
"tHDenOut");
416 tHDenOut.Add(mDenOutN);
417 mRatOut->Divide(&tHNumOut,&tHDenOut);
418 tScale = mRatOut->Integral(tFirstNormBin,tLastNormBin);
419 tScale/= (tLastNormBin-tFirstNormBin+1);
420 mRatOut->Scale(1./tScale);
424 mRatSideP->Divide(mNumSideP,mDenSideP,1.0,1.0);
425 tScale = mRatSideP->Integral(tFirstNormBin,tLastNormBin);
426 tScale/= (tLastNormBin-tFirstNormBin+1);
427 mRatSideP->Scale(1./tScale);
428 mRatSideN->Divide(mNumSideN,mDenSideN,1.0,1.0);
429 tScale = mRatSideN->Integral(tFirstNormBin,tLastNormBin);
430 tScale/= (tLastNormBin-tFirstNormBin+1);
431 mRatSideN->Scale(1./tScale);
432 mRatSideNOverP->Divide(mRatSideN,mRatSideP,1.0,1.0);
434 TH1D tHNumSide(*mNumSideP);
435 tHNumSide.SetName(
"tHNumSide");
436 tHNumSide.Add(mNumSideN);
437 TH1D tHDenSide(*mDenSideP);
438 tHDenSide.SetName(
"tHDenSide");
439 tHDenSide.Add(mDenSideN);
440 mRatSide->Divide(&tHNumSide,&tHDenSide);
441 tScale = mRatSide->Integral(tFirstNormBin,tLastNormBin);
442 tScale/= (tLastNormBin-tFirstNormBin+1);
443 mRatSide->Scale(1./tScale);
447 mRatLongP->Divide(mNumLongP,mDenLongP,1.0,1.0);
448 tScale = mRatLongP->Integral(tFirstNormBin,tLastNormBin);
449 tScale/= (tLastNormBin-tFirstNormBin+1);
450 mRatLongP->Scale(1./tScale);
451 mRatLongN->Divide(mNumLongN,mDenLongN,1.0,1.0);
452 tScale = mRatLongN->Integral(tFirstNormBin,tLastNormBin);
453 tScale/= (tLastNormBin-tFirstNormBin+1);
454 mRatLongN->Scale(1./tScale);
455 mRatLongNOverP->Divide(mRatLongN,mRatLongP,1.0,1.0);
457 TH1D tHNumLong(*mNumLongP);
458 tHNumLong.SetName(
"tHNumLong");
459 tHNumLong.Add(mNumLongN);
460 TH1D tHDenLong(*mDenLongP);
461 tHDenLong.SetName(
"tHDenLong");
462 tHDenLong.Add(mDenLongN);
463 mRatLong->Divide(&tHNumLong,&tHDenLong);
464 tScale = mRatLong->Integral(tFirstNormBin,tLastNormBin);
465 tScale/= (tLastNormBin-tFirstNormBin+1);
466 mRatLong->Scale(1./tScale);
470 inline void ThNonId3DCF::Write() {
478 mRatOutNOverP->Write();
487 mRatSideNOverP->Write();
496 mRatLongNOverP->Write();
500 mHSideKSame->Write();
501 mHSideKDiff->Write();
502 mHLongKSame->Write();
503 mHLongKDiff->Write();
512 mProfDenOutP->Write();
513 mProfDenOutN->Write();
514 mProfDenSideP->Write();
515 mProfDenSideN->Write();
516 mProfDenLongP->Write();
517 mProfDenLongN->Write();
521 StHbtString ThNonId3DCF::Report(){
522 string stemp =
"Qinv Correlation Function Report:\n";
524 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumOutP->GetEntries());
526 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenOutP->GetEntries());
528 sprintf(ctemp,
"Number of entries in ratio:\t%E\n",mRatOutP->GetEntries());
530 StHbtString returnThis = stemp;
535 inline void ThNonId3DCF::SetBtRange(
double aBtMin,
double aBtMax)
540 inline void ThNonId3DCF::SetUtRange(
double aUtMin,
double aUtMax)