20 #include "StHbtMaker/CorrFctn/MinvLikeSignCorrFctn_Minv_vs_Phi.h"
28 MinvLikeSignCorrFctn_Minv_vs_Phi::MinvLikeSignCorrFctn_Minv_vs_Phi(
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_Phi_Num_%s",title1);
37 mNumerator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
39 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Phi_MixedEventDen_%s",title1);
40 mMixedEventDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
42 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Phi_PositiveDen_%s",title1);
43 mPositiveDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
45 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Phi_NegativeDen_%s",title1);
46 mNegativeDenominator =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
48 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Phi_MixedEventDif_%s",title1);
49 mMixedEventDifference =
new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
51 sprintf(theTitle1,
"MinvLikeSignCorrFctn_Minv_vs_Phi_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_Phi::~MinvLikeSignCorrFctn_Minv_vs_Phi(){
74 delete mMixedEventDenominator;
75 delete mPositiveDenominator;
76 delete mNegativeDenominator;
77 delete mMixedEventDifference;
78 delete mLikeSignDifference;
81 void MinvLikeSignCorrFctn_Minv_vs_Phi::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_Phi::Report(){
104 string stemp =
"MinvLikeSignCorrFctn_Minv_vs_Phi 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_Phi::AddRealPair(
const StHbtPair* pair){
124 if ( !::isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
125 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
127 if (angle > M_PIl) angle = 2.*M_PIl-angle;
128 mNumerator->Fill(pair->mInv(),angle);
132 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddMixedPair(
const StHbtPair* pair){
134 if ( !::isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
135 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
137 if (angle > M_PIl) angle = 2.*M_PIl-angle;
138 mMixedEventDenominator->Fill(pair->mInv(),angle);
142 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddLikeSignPositivePair(
const StHbtPair* pair){
144 if ( !::isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
145 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
147 if (angle > M_PIl) angle = 2.*M_PIl-angle;
148 mPositiveDenominator->Fill(pair->mInv(),angle);
152 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddLikeSignNegativePair(
const StHbtPair* pair){
154 if ( !::isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
155 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
157 if (angle > M_PIl) angle = 2.*M_PIl-angle;
158 mNegativeDenominator->Fill(pair->mInv(),angle);