30 #include "StHbtMaker/CorrFctn/MinvCorrFctnY_vs_Pt.h"
38 MinvCorrFctnY_vs_Pt::MinvCorrFctnY_vs_Pt(
char* title,
39 const int& nbins1,
const float& MinvLo1,
const float& MinvHi1,
40 const int& nbins2,
const float& MinvLo2,
const float& MinvHi2){
43 const char* TitNum =
"MinvCorrFctnY_vs_Pt_Num";
44 sprintf(theTitle,
"Num %s",title);
45 mNumerator =
new StHbt2DHisto(TitNum,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
47 const char* TitDen =
"MinvCorrFctnY_vs_Pt_Den";
48 sprintf(theTitle,
"Den %s",title);
49 mDenominator =
new StHbt2DHisto(TitDen,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
51 const char* TitDif =
"MinvCorrFctnY_vs_Pt_Dif";
52 sprintf(theTitle,
"Dif %s",title);
53 mDifference =
new StHbt2DHisto(TitDif,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
56 mNumerator->SetDirectory(0);
57 mDenominator->SetDirectory(0);
58 mDifference->SetDirectory(0);
60 mDenominator->Sumw2();
65 MinvCorrFctnY_vs_Pt::~MinvCorrFctnY_vs_Pt(){
71 void MinvCorrFctnY_vs_Pt::Finish(){
82 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
83 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
87 mNumerator->Scale(1./NEvents);
88 mDenominator->Scale(1./NEvents);
89 mDifference->Scale(1./NEvents);
94 double NumeratorInt = mRealPairs;
95 double DenominatorInt = mMixedPairs;
96 mDifference->Add(mNumerator,mDenominator,1.0,-1*NumeratorInt/DenominatorInt);
101 StHbtString MinvCorrFctnY_vs_Pt::Report(){
102 string stemp =
"Minv Correlation Function Report:\n";
104 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
106 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
108 sprintf(ctemp,
"Number of entries in difference:\t%E\n",mDifference->GetEntries());
110 StHbtString returnThis = stemp;
114 void MinvCorrFctnY_vs_Pt::AddRealPair(
const StHbtPair* pair){
115 if ( fabs( pair->mInv()-1.02 ) < .01 )
116 mNumerator->Fill( pair->fourMomentumSum().rapidity(), pair->fourMomentumSum().perp(), 1.);
121 void MinvCorrFctnY_vs_Pt::AddMixedPair(
const StHbtPair* pair){
122 if ( fabs( pair->mInv()-1.02 ) < .01 )
123 mDenominator->Fill( pair->fourMomentumSum().rapidity(), pair->fourMomentumSum().perp(), 1.);