61 #include "StHbtMaker/CorrFctn/MinvCorrFctn.h"
63 #include "StHbtMaker/Infrastructure/StHbtAnalysis.h"
64 #include "StHbtMaker/Cut/mikesEventCut.h"
73 MinvCorrFctn::MinvCorrFctn(
char* title,
const int& nbins,
const float& MinvLo,
const float& MinvHi){
78 const char *TitNum =
"MinvCorrFctn_Num";
79 sprintf(theTitle,
"Num %s\n",title);
80 mNumerator =
new StHbt1DHisto(TitNum,theTitle,nbins,MinvLo,MinvHi);
82 const char *TitDen=
"MinvCorrFctn_Den";
83 sprintf(theTitle,
"Den %s\n",title);
84 mDenominator =
new StHbt1DHisto(TitDen,theTitle,nbins,MinvLo,MinvHi);
86 const char *TitDif =
"MinvCorrFctn_Dif";
87 sprintf(theTitle,
"Dif %s\n",title);
88 mDifference =
new StHbt1DHisto(TitDif,theTitle,nbins,MinvLo,MinvHi);
91 mNumerator->SetDirectory(0);
92 mDenominator->SetDirectory(0);
93 mDifference->SetDirectory(0);
96 mDenominator->Sumw2();
105 MinvCorrFctn::~MinvCorrFctn(){
111 void MinvCorrFctn::Finish(){
113 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
114 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
118 mNumerator->Scale(1./NEvents);
119 mDenominator->Scale(1./NEvents);
120 mDifference->Scale(1./NEvents);
122 double NumeratorInt = mNumerator->Integral();
123 double DenominatorInt = mDenominator->Integral();
124 mDifference->Add(mNumerator,mDenominator,1.0,-1*NumeratorInt/DenominatorInt);
128 StHbtString MinvCorrFctn::Report(){
129 string stemp =
"Minv Correlation Function Report:\n";
131 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
133 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
135 sprintf(ctemp,
"Number of entries in difference:\t%E\n",mDifference->GetEntries());
137 StHbtString returnThis = stemp;
141 inline void MinvCorrFctn::AddRealPair(
const StHbtPair* pair){
142 mNumerator->Fill(pair->mInv());
146 inline void MinvCorrFctn::AddMixedPair(
const StHbtPair* pair){
147 mDenominator->Fill(pair->mInv());