20 #include "StHbtMaker/CorrFctn/MinvLikeSignCorrFctn_MinvYPt.h"
28 MinvLikeSignCorrFctn_MinvYPt::MinvLikeSignCorrFctn_MinvYPt(
char* title1,
char* title2,
29 const int& nxbins,
const double& xLo,
const double& xHi,
30 const int& nybins,
const double& yLo,
const double& yHi,
31 const int& nzbins,
const double& zLo,
const double& zHi,
38 sprintf(theTitle2,
"%s",title2);
41 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_Num_%s",title1);
42 mNumeratorPt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nybins,zLo,zHi);
44 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_MixedEventDen_%s",title1);
45 mMixedEventDenominatorPt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
47 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_PositiveDen_%s",title1);
48 mPositiveDenominatorPt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
50 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_NegativeDen_%s",title1);
51 mNegativeDenominatorPt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
53 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_MixedEventDif_%s",title1);
54 mMixedEventDifferencePt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
56 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYPt_LikeSignDif_%s",title1);
57 mLikeSignDifferencePt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
60 mNumeratorPt->SetDirectory(0);
61 mMixedEventDenominatorPt->SetDirectory(0);
62 mPositiveDenominatorPt->SetDirectory(0);
63 mNegativeDenominatorPt->SetDirectory(0);
64 mMixedEventDifferencePt->SetDirectory(0);
65 mLikeSignDifferencePt->SetDirectory(0);
67 mNumeratorPt->Sumw2();
68 mMixedEventDenominatorPt->Sumw2();
69 mPositiveDenominatorPt->Sumw2();
70 mNegativeDenominatorPt->Sumw2();
71 mMixedEventDifferencePt->Sumw2();
72 mLikeSignDifferencePt->Sumw2();
75 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_Num_%s",title1);
76 mNumeratorMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nybins,zLo,zHi);
78 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_MixedEventDen_%s",title1);
79 mMixedEventDenominatorMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
81 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_PositiveDen_%s",title1);
82 mPositiveDenominatorMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
84 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_NegativeDen_%s",title1);
85 mNegativeDenominatorMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
87 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_MixedEventDif_%s",title1);
88 mMixedEventDifferenceMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
90 sprintf(theTitle1,
"MinvLikeSignCorrFctn_MinvYMt_LikeSignDif_%s",title1);
91 mLikeSignDifferenceMt =
new StHbt3DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi, nzbins,zLo,zHi);
94 mNumeratorMt->SetDirectory(0);
95 mMixedEventDenominatorMt->SetDirectory(0);
96 mPositiveDenominatorMt->SetDirectory(0);
97 mNegativeDenominatorMt->SetDirectory(0);
98 mMixedEventDifferenceMt->SetDirectory(0);
99 mLikeSignDifferenceMt->SetDirectory(0);
101 mNumeratorMt->Sumw2();
102 mMixedEventDenominatorMt->Sumw2();
103 mPositiveDenominatorMt->Sumw2();
104 mNegativeDenominatorMt->Sumw2();
105 mMixedEventDifferenceMt->Sumw2();
106 mLikeSignDifferenceMt->Sumw2();
111 MinvLikeSignCorrFctn_MinvYPt::~MinvLikeSignCorrFctn_MinvYPt(){
113 delete mMixedEventDenominatorPt;
114 delete mPositiveDenominatorPt;
115 delete mNegativeDenominatorPt;
116 delete mMixedEventDifferencePt;
117 delete mLikeSignDifferencePt;
119 delete mMixedEventDenominatorMt;
120 delete mPositiveDenominatorMt;
121 delete mNegativeDenominatorMt;
122 delete mMixedEventDifferenceMt;
123 delete mLikeSignDifferenceMt;
126 void MinvLikeSignCorrFctn_MinvYPt::Finish(){
128 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
129 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
134 double MixedEventDenominatorInt;
135 double PositiveDenominatorInt;
136 double NegativeDenominatorInt;
138 mNumeratorPt->Scale(1./NEvents);
139 mMixedEventDenominatorPt->Scale(1./NEvents);
140 mPositiveDenominatorPt->Scale(1./NEvents);
141 mNegativeDenominatorPt->Scale(1./NEvents);
142 mMixedEventDifferencePt->Scale(1./NEvents);
143 mLikeSignDifferencePt->Scale(1./NEvents);
146 NumeratorInt = mNumeratorPt->Integral();
147 MixedEventDenominatorInt = mMixedEventDenominatorPt->Integral();
148 PositiveDenominatorInt = mPositiveDenominatorPt->Integral();
149 NegativeDenominatorInt = mNegativeDenominatorPt->Integral();
150 mMixedEventDifferencePt->Add(mNumeratorPt,mMixedEventDenominatorPt,1.0,-1*NumeratorInt/MixedEventDenominatorInt);
151 mLikeSignDifferencePt->Add(mNumeratorPt,mPositiveDenominatorPt,1.,-1.);
152 mLikeSignDifferencePt->Add(mLikeSignDifferencePt,mNegativeDenominatorPt,1.,-1.);
154 mNumeratorMt->Scale(1./NEvents);
155 mMixedEventDenominatorMt->Scale(1./NEvents);
156 mPositiveDenominatorMt->Scale(1./NEvents);
157 mNegativeDenominatorMt->Scale(1./NEvents);
158 mMixedEventDifferenceMt->Scale(1./NEvents);
159 mLikeSignDifferenceMt->Scale(1./NEvents);
162 NumeratorInt = mNumeratorMt->Integral();
163 MixedEventDenominatorInt = mMixedEventDenominatorMt->Integral();
164 PositiveDenominatorInt = mPositiveDenominatorMt->Integral();
165 NegativeDenominatorInt = mNegativeDenominatorMt->Integral();
166 mMixedEventDifferenceMt->Add(mNumeratorMt,mMixedEventDenominatorMt,1.0,-1*NumeratorInt/MixedEventDenominatorInt);
167 mLikeSignDifferenceMt->Add(mNumeratorMt,mPositiveDenominatorMt,1.,-1.);
168 mLikeSignDifferenceMt->Add(mLikeSignDifferenceMt,mNegativeDenominatorMt,1.,-1.);
172 StHbtString MinvLikeSignCorrFctn_MinvYPt::Report(){
173 string stemp =
"MinvLikeSignCorrFctn_MinvYPt Report():\n";
175 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumeratorPt->GetEntries());
177 sprintf(ctemp,
"Number of entries in mixed event denominator:\t%E\n",mMixedEventDenominatorPt->GetEntries());
179 sprintf(ctemp,
"Number of entries in like sign positive denominator:\t%E\n",mPositiveDenominatorPt->GetEntries());
181 sprintf(ctemp,
"Number of entries in like sign negative denominator:\t%E\n",mNegativeDenominatorPt->GetEntries());
183 sprintf(ctemp,
"Number of entries in mixed event difference:\t%E\n",mMixedEventDifferencePt->GetEntries());
185 sprintf(ctemp,
"Number of entries in like sign difference:\t%E\n",mLikeSignDifferencePt->GetEntries());
187 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumeratorMt->GetEntries());
189 sprintf(ctemp,
"Number of entries in mixed event denominator:\t%E\n",mMixedEventDenominatorMt->GetEntries());
191 sprintf(ctemp,
"Number of entries in like sign positive denominator:\t%E\n",mPositiveDenominatorMt->GetEntries());
193 sprintf(ctemp,
"Number of entries in like sign negative denominator:\t%E\n",mNegativeDenominatorMt->GetEntries());
195 sprintf(ctemp,
"Number of entries in mixed event difference:\t%E\n",mMixedEventDifferenceMt->GetEntries());
197 sprintf(ctemp,
"Number of entries in like sign difference:\t%E\n",mLikeSignDifferenceMt->GetEntries());
199 StHbtString returnThis = stemp;
203 inline void MinvLikeSignCorrFctn_MinvYPt::AddRealPair(
const StHbtPair* pair){
204 mMinv = pair->mInv(); mY = pair->fourMomentumSum().rapidity();
205 mPt = pair->fourMomentumSum().vect().perp(); mMt = ::sqrt(::pow(mMinv,2.)+::pow(mPt,2.));
206 mNumeratorPt->Fill(mMinv,mY,mPt);
207 mNumeratorMt->Fill(mMinv,mY,mMt-mM0);
210 inline void MinvLikeSignCorrFctn_MinvYPt::AddMixedPair(
const StHbtPair* pair){
211 mMinv = pair->mInv(); mY = pair->fourMomentumSum().rapidity();
212 mPt = pair->fourMomentumSum().vect().perp(); mMt = ::sqrt(::pow(mMinv,2.)+::pow(mPt,2.));
213 mMixedEventDenominatorPt->Fill(mMinv,mY,mPt);
214 mMixedEventDenominatorMt->Fill(mMinv,mY,mMt-mM0);
217 inline void MinvLikeSignCorrFctn_MinvYPt::AddLikeSignPositivePair(
const StHbtPair* pair){
218 mMinv = pair->mInv(); mY = pair->fourMomentumSum().rapidity();
219 mPt = pair->fourMomentumSum().vect().perp(); mMt = ::sqrt(::pow(mMinv,2.)+::pow(mPt,2.));
220 mPositiveDenominatorPt->Fill(mMinv,mY,mPt);
221 mPositiveDenominatorMt->Fill(mMinv,mY,mMt-mM0);
224 inline void MinvLikeSignCorrFctn_MinvYPt::AddLikeSignNegativePair(
const StHbtPair* pair){
225 mMinv = pair->mInv(); mY = pair->fourMomentumSum().rapidity();
226 mPt = pair->fourMomentumSum().vect().perp(); mMt = ::sqrt(::pow(mMinv,2.)+::pow(mPt,2.));
227 mNegativeDenominatorPt->Fill(mMinv,mY,mPt);
228 mNegativeDenominatorMt->Fill(mMinv,mY,mMt-mM0);