20 #include "StHbtMaker/CorrFctn/MinvLikeSignCorrFctn.h"
28 MinvLikeSignCorrFctn::MinvLikeSignCorrFctn(
char* title1,
char* title2,
29 const int& nbins,
const float& MinvLo,
const float& MinvHi){
31 mTagWriter = StHbtTagWriter::Instance();
36 sprintf(theTitle2,
"%s",title2);
38 sprintf(theTitle1,
"MinvLikeSignCorrFctnNum_%s",title1);
39 mNumerator =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
41 sprintf(theTitle1,
"MinvLikeSignCorrFctnMixedEventDen_%s",title1);
42 mMixedEventDenominator =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
44 sprintf(theTitle1,
"MinvLikeSignCorrFctnPositiveDen_%s",title1);
45 mPositiveDenominator =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
47 sprintf(theTitle1,
"MinvLikeSignCorrFctnNegativeDen_%s",title1);
48 mNegativeDenominator =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
50 sprintf(theTitle1,
"MinvLikeSignCorrFctnMixedEventDif_%s",title1);
51 mMixedEventDifference =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
53 sprintf(theTitle1,
"MinvLikeSignCorrFctnLikeSignDif_%s",title1);
54 mLikeSignDifference =
new StHbt1DHisto(theTitle1,theTitle2,nbins,MinvLo,MinvHi);
57 mNumerator->SetDirectory(0);
58 mMixedEventDenominator->SetDirectory(0);
59 mPositiveDenominator->SetDirectory(0);
60 mNegativeDenominator->SetDirectory(0);
61 mMixedEventDifference->SetDirectory(0);
62 mLikeSignDifference->SetDirectory(0);
65 mMixedEventDenominator->Sumw2();
66 mPositiveDenominator->Sumw2();
67 mNegativeDenominator->Sumw2();
68 mMixedEventDifference->Sumw2();
69 mLikeSignDifference->Sumw2();
77 MinvLikeSignCorrFctn::~MinvLikeSignCorrFctn(){
79 delete mMixedEventDenominator;
80 delete mPositiveDenominator;
81 delete mNegativeDenominator;
82 delete mMixedEventDifference;
83 delete mLikeSignDifference;
86 void MinvLikeSignCorrFctn::Finish(){
88 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
89 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
93 mNumerator->Scale(1./NEvents);
94 mMixedEventDenominator->Scale(1./NEvents);
95 mPositiveDenominator->Scale(1./NEvents);
96 mNegativeDenominator->Scale(1./NEvents);
97 mMixedEventDifference->Scale(1./NEvents);
98 mLikeSignDifference->Scale(1./NEvents);
100 double NumeratorInt = mNumerator->Integral();
101 double MixedEventDenominatorInt = mMixedEventDenominator->Integral();
102 mMixedEventDifference->Add(mNumerator,mMixedEventDenominator,1.0,-1*NumeratorInt/MixedEventDenominatorInt);
103 mLikeSignDifference->Add(mNumerator,mPositiveDenominator,1.,-1.);
104 mLikeSignDifference->Add(mLikeSignDifference,mNegativeDenominator,1.,-1.);
108 StHbtString MinvLikeSignCorrFctn::Report(){
109 string stemp =
"Minv Correlation Function Report:\n";
111 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
113 sprintf(ctemp,
"Number of entries in mixed event denominator:\t%E\n",mMixedEventDenominator->GetEntries());
115 sprintf(ctemp,
"Number of entries in like sign positive denominator:\t%E\n",mPositiveDenominator->GetEntries());
117 sprintf(ctemp,
"Number of entries in like sign negative denominator:\t%E\n",mNegativeDenominator->GetEntries());
119 sprintf(ctemp,
"Number of entries in mixed event difference:\t%E\n",mMixedEventDifference->GetEntries());
121 sprintf(ctemp,
"Number of entries in like sign difference:\t%E\n",mLikeSignDifference->GetEntries());
123 StHbtString returnThis = stemp;
127 inline void MinvLikeSignCorrFctn::AddRealPair(
const StHbtPair* pair){
128 mNumerator->Fill(pair->mInv());
131 inline void MinvLikeSignCorrFctn::AddMixedPair(
const StHbtPair* pair){
132 mMixedEventDenominator->Fill(pair->mInv());
135 inline void MinvLikeSignCorrFctn::AddLikeSignPositivePair(
const StHbtPair* pair){
136 mPositiveDenominator->Fill(pair->mInv());
139 inline void MinvLikeSignCorrFctn::AddLikeSignNegativePair(
const StHbtPair* pair){
140 mNegativeDenominator->Fill(pair->mInv());