00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "StHbtMaker/CorrFctn/MinvLikeSignCorrFctn_Minv_vs_Phi.h"
00021 #include <cstdio>
00022
00023 #ifdef __ROOT__
00024 ClassImp(MinvLikeSignCorrFctn_Minv_vs_Phi)
00025 #endif
00026
00027
00028 MinvLikeSignCorrFctn_Minv_vs_Phi::MinvLikeSignCorrFctn_Minv_vs_Phi(char* title1, char* title2,
00029 const int& nxbins, const float& xLo, const float& xHi,
00030 const int& nybins, const float& yLo, const float& yHi){
00031
00032 char theTitle1[100];
00033 char theTitle2[100];
00034 sprintf(theTitle2,"%s",title2);
00035
00036 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_Num_%s",title1);
00037 mNumerator = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00038
00039 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_MixedEventDen_%s",title1);
00040 mMixedEventDenominator = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00041
00042 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_PositiveDen_%s",title1);
00043 mPositiveDenominator = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00044
00045 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_NegativeDen_%s",title1);
00046 mNegativeDenominator = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00047
00048 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_MixedEventDif_%s",title1);
00049 mMixedEventDifference = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00050
00051 sprintf(theTitle1,"MinvLikeSignCorrFctn_Minv_vs_Phi_LikeSignDif_%s",title1);
00052 mLikeSignDifference = new StHbt2DHisto(theTitle1,theTitle2,nxbins,xLo,xHi,nybins,yLo,yHi);
00053
00054
00055 mNumerator->SetDirectory(0);
00056 mMixedEventDenominator->SetDirectory(0);
00057 mPositiveDenominator->SetDirectory(0);
00058 mNegativeDenominator->SetDirectory(0);
00059 mMixedEventDifference->SetDirectory(0);
00060 mLikeSignDifference->SetDirectory(0);
00061
00062 mNumerator->Sumw2();
00063 mMixedEventDenominator->Sumw2();
00064 mPositiveDenominator->Sumw2();
00065 mNegativeDenominator->Sumw2();
00066 mMixedEventDifference->Sumw2();
00067 mLikeSignDifference->Sumw2();
00068
00069 }
00070
00071
00072 MinvLikeSignCorrFctn_Minv_vs_Phi::~MinvLikeSignCorrFctn_Minv_vs_Phi(){
00073 delete mNumerator;
00074 delete mMixedEventDenominator;
00075 delete mPositiveDenominator;
00076 delete mNegativeDenominator;
00077 delete mMixedEventDifference;
00078 delete mLikeSignDifference;
00079 }
00080
00081 void MinvLikeSignCorrFctn_Minv_vs_Phi::Finish(){
00082 int NEvents = 1;
00083 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
00084 if ( dynamic_cast<mikesEventCut*>( ((StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
00085 NEvents = ((mikesEventCut*)((StHbtAnalysis*)HbtAnalysis())->EventCut())->NEventsPassed();
00086 }
00087
00088 mNumerator->Scale(1./NEvents);
00089 mMixedEventDenominator->Scale(1./NEvents);
00090 mPositiveDenominator->Scale(1./NEvents);
00091 mNegativeDenominator->Scale(1./NEvents);
00092 mMixedEventDifference->Scale(1./NEvents);
00093 mLikeSignDifference->Scale(1./NEvents);
00094
00095 double NumeratorInt = mNumerator->Integral();
00096 double MixedEventDenominatorInt = mMixedEventDenominator->Integral();
00097 mMixedEventDifference->Add(mNumerator,mMixedEventDenominator,1.0,-1.*NumeratorInt/MixedEventDenominatorInt);
00098 mLikeSignDifference->Add(mNumerator,mPositiveDenominator,1.,-1.);
00099 mLikeSignDifference->Add(mLikeSignDifference,mNegativeDenominator,1.,-1.);
00100
00101 }
00102
00103 StHbtString MinvLikeSignCorrFctn_Minv_vs_Phi::Report(){
00104 string stemp = "MinvLikeSignCorrFctn_Minv_vs_Phi Report():\n";
00105 char ctemp[100];
00106 sprintf(ctemp,"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
00107 stemp += ctemp;
00108 sprintf(ctemp,"Number of entries in mixed event denominator:\t%E\n",mMixedEventDenominator->GetEntries());
00109 stemp += ctemp;
00110 sprintf(ctemp,"Number of entries in like sign positive denominator:\t%E\n",mPositiveDenominator->GetEntries());
00111 stemp += ctemp;
00112 sprintf(ctemp,"Number of entries in like sign negative denominator:\t%E\n",mNegativeDenominator->GetEntries());
00113 stemp += ctemp;
00114 sprintf(ctemp,"Number of entries in mixed event difference:\t%E\n",mMixedEventDifference->GetEntries());
00115 stemp += ctemp;
00116 sprintf(ctemp,"Number of entries in like sign difference:\t%E\n",mLikeSignDifference->GetEntries());
00117 stemp += ctemp;
00118 StHbtString returnThis = stemp;
00119 return returnThis;
00120 }
00121
00122 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddRealPair(const StHbtPair* pair){
00123
00124 if ( !isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
00125 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
00126 angle = fabs(angle);
00127 if (angle > M_PIl) angle = 2.*M_PIl-angle;
00128 mNumerator->Fill(pair->mInv(),angle);
00129 }
00130 }
00131
00132 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddMixedPair(const StHbtPair* pair){
00133
00134 if ( !isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
00135 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
00136 angle = fabs(angle);
00137 if (angle > M_PIl) angle = 2.*M_PIl-angle;
00138 mMixedEventDenominator->Fill(pair->mInv(),angle);
00139 }
00140 }
00141
00142 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddLikeSignPositivePair(const StHbtPair* pair){
00143
00144 if ( !isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
00145 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
00146 angle = fabs(angle);
00147 if (angle > M_PIl) angle = 2.*M_PIl-angle;
00148 mPositiveDenominator->Fill(pair->mInv(),angle);
00149 }
00150 }
00151
00152 inline void MinvLikeSignCorrFctn_Minv_vs_Phi::AddLikeSignNegativePair(const StHbtPair* pair){
00153
00154 if ( !isnan(mReactionPlaneError) && mReactionPlaneError!=0. ) {
00155 double angle = pair->fourMomentumSum().vect().phi()-mReactionPlane;
00156 angle = fabs(angle);
00157 if (angle > M_PIl) angle = 2.*M_PIl-angle;
00158 mNegativeDenominator->Fill(pair->mInv(),angle);
00159 }
00160 }
00161
00162