36 #include "StHbtMaker/CorrFctn/MinvCorrFctnArmenteros.h"
51 MinvCorrFctnArmenteros::MinvCorrFctnArmenteros(
char* title,
52 const int& nbins1,
const float& MinvLo1,
const float& MinvHi1,
53 const int& nbins2,
const float& MinvLo2,
const float& MinvHi2){
56 char TitNum[100] =
"NumArmenteros1 ";
57 sprintf(theTitle,
"Num %s",title);
58 mNumerator =
new StHbt2DHisto(TitNum,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
60 char TitDen[100] =
"DenArmenteros1";
61 sprintf(theTitle,
"Den %s",title);
62 mDenominator =
new StHbt2DHisto(TitDen,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
64 char TitDif[100] =
"DifArmenteros1";
65 sprintf(theTitle,
"Dif %s",title);
66 mDifference =
new StHbt2DHisto(TitDif,theTitle,nbins1,MinvLo1,MinvHi1,nbins2,MinvLo2,MinvHi2);
69 mNumerator->SetDirectory(0);
70 mDenominator->SetDirectory(0);
71 mDifference->SetDirectory(0);
78 MinvCorrFctnArmenteros::~MinvCorrFctnArmenteros(){
84 void MinvCorrFctnArmenteros::Finish(){
86 if ( dynamic_cast<StHbtAnalysis*>( HbtAnalysis() ) ) {
87 if ( dynamic_cast<mikesEventCut*>( ((
StHbtAnalysis*)HbtAnalysis())->EventCut() ) )
91 mNumerator->Scale(1./NEvents);
92 mDenominator->Scale(1./NEvents);
93 mDifference->Scale(1./NEvents);
98 mDifference->Add(mNumerator,mDenominator,1.0,-1.*mRealPairs/mMixedPairs);
103 StHbtString MinvCorrFctnArmenteros::Report(){
104 string stemp =
"Minv Correlation Function Report:\n";
106 sprintf(ctemp,
"Number of entries in numerator:\t%E\n",mNumerator->GetEntries());
108 sprintf(ctemp,
"Number of entries in denominator:\t%E\n",mDenominator->GetEntries());
110 sprintf(ctemp,
"Number of entries in difference:\t%E\n",mDifference->GetEntries());
112 StHbtString returnThis = stemp;
116 inline void MinvCorrFctnArmenteros::AddRealPair(
const StHbtPair* pair){
117 if ( pair->mInv()>mLo && pair->mInv()<mHi || mHi == mLo) {
118 pairD ptArmAlpha = armenteros(pair);
119 mNumerator->Fill( ptArmAlpha.first, ptArmAlpha.second, 1.);
124 inline void MinvCorrFctnArmenteros::AddMixedPair(
const StHbtPair* pair){
125 if ( pair->mInv()>mLo && pair->mInv()<mHi || mHi == mLo) {
126 pairD ptArmAlpha = armenteros(pair);
127 mDenominator->Fill( ptArmAlpha.first, ptArmAlpha.second, 1.);
132 inline pairD armenteros(
const StHbtPair* pair ) {
135 float pdotn = pp.dot(pn);
136 float ptotp2 = pp.mag2();
137 float ptotn2 = pn.mag2();
139 float ptot = pair->fourMomentumSum().vect().mag();
141 float ppp = ( ptotp2 + pdotn )/ptot;
142 float ppn = ( ptotn2 + pdotn )/ptot;
144 return pairD( (ppp - ppn)/(ppp + ppn), ::sqrt(fabs(ptotp2 - ppp*ppp)) );