20 #include "StHbtMaker/CorrFctn/MinvLikeSignCorrFctn_Minv_vs_Pt.h"
28 MinvLikeSignCorrFctn_Minv_vs_Pt::MinvLikeSignCorrFctn_Minv_vs_Pt(
char* title1,
char* title2,
29 const int& nxbins,
const float& xLo,
const float& xHi,
30 const int& nybins,
const float& yLo,
const float& yHi){
34 sprintf(theTitle2,
"%s",title2);
36 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_Num_%s",title1);
37 mNumerator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
39 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_MixedEventDen_%s",title1);
40 mMixedEventDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
42 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_PositiveDen_%s",title1);
43 mPositiveDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
45 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_NegativeDen_%s",title1);
46 mNegativeDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
48 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_MixedEventDif_%s",title1);
49 mMixedEventDifference =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
51 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Pt_LikeSignDif_%s",title1);
52 mLikeSignDifference =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
55 mNumerator->SetDirectory(0);
56 mMixedEventDenominator->SetDirectory(0);
57 mPositiveDenominator->SetDirectory(0);
58 mNegativeDenominator->SetDirectory(0);
59 mMixedEventDifference->SetDirectory(0);
60 mLikeSignDifference->SetDirectory(0);
63 mMixedEventDenominator->Sumw2();
64 mPositiveDenominator->Sumw2();
65 mNegativeDenominator->Sumw2();
66 mMixedEventDifference->Sumw2();
67 mLikeSignDifference->Sumw2();
72 MinvLikeSignCorrFctn_Minv_vs_Pt::~MinvLikeSignCorrFctn_Minv_vs_Pt(){
74 delete mMixedEventDenominator;
75 delete mPositiveDenominator;
76 delete mNegativeDenominator;
77 delete mMixedEventDifference;
78 delete mLikeSignDifference;
81 void MinvLikeSignCorrFctn_Minv_vs_Pt::Finish(){
83 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
84 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
88 mNumerator->Scale(1./NEvents);
89 mMixedEventDenominator->Scale(1./NEvents);
90 mPositiveDenominator->Scale(1./NEvents);
91 mNegativeDenominator->Scale(1./NEvents);
92 mMixedEventDifference->Scale(1./NEvents);
93 mLikeSignDifference->Scale(1./NEvents);
95 double NumeratorInt = mNumerator->Integral();
96 double MixedEventDenominatorInt = mMixedEventDenominator->Integral();
97 mMixedEventDifference->Add(mNumerator,mMixedEventDenominator,1.0,-1*NumeratorInt/MixedEventDenominatorInt);
98 mLikeSignDifference->Add(mNumerator,mPositiveDenominator,1.,-1.);
99 mLikeSignDifference->Add(mLikeSignDifference,mNegativeDenominator,1.,-1.);
103 StHbtString MinvLikeSignCorrFctn_Minv_vs_Pt::Report(){
104 string stemp =
"MinvLikeSignCorrFctn_Minv_vs_Pt Report():\n";
106 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
108 sprintf(ctemp,
"Number of entries in mixed event denominator:\t%E\n",mMixedEventDenominator->GetEntries());
110 sprintf(ctemp,
"Number of entries in like sign positive denominator:\t%E\n",mPositiveDenominator->GetEntries());
112 sprintf(ctemp,
"Number of entries in like sign negative denominator:\t%E\n",mNegativeDenominator->GetEntries());
114 sprintf(ctemp,
"Number of entries in mixed event difference:\t%E\n",mMixedEventDifference->GetEntries());
116 sprintf(ctemp,
"Number of entries in like sign difference:\t%E\n",mLikeSignDifference->GetEntries());
118 StHbtString returnThis = stemp;
122 inline void MinvLikeSignCorrFctn_Minv_vs_Pt::AddRealPair(
const StHbtPair* pair){
123 mNumerator->Fill(pair->mInv(),pair->fourMomentumSum().vect().perp());
126 inline void MinvLikeSignCorrFctn_Minv_vs_Pt::AddMixedPair(
const StHbtPair* pair){
127 mMixedEventDenominator->Fill(pair->mInv(),pair->fourMomentumSum().vect().perp());
130 inline void MinvLikeSignCorrFctn_Minv_vs_Pt::AddLikeSignPositivePair(
const StHbtPair* pair){
131 mPositiveDenominator->Fill(pair->mInv(),pair->fourMomentumSum().vect().perp());
134 inline void MinvLikeSignCorrFctn_Minv_vs_Pt::AddLikeSignNegativePair(
const StHbtPair* pair){
135 mNegativeDenominator->Fill(pair->mInv(),pair->fourMomentumSum().vect().perp());