StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FracMergRowvsQinv.cxx
1 /***************************************************************************
2  *
3  * Author: Mercedes Lopez Noriega, OSU, mercedes@pacific.mps.ohio-state.edu
4  *
5  ***************************************************************************
6  *
7  * Description: part of STAR HBT Framework: StHbtMaker package
8  * 2D correlation function: Qinv vs. Fraction of merged rows.
9  *
10  **************************************************************************/
11 
12 #include "TMath.h"
13 #include "StHbtMaker/CorrFctn/FracMergRowvsQinv.h"
14 #include <cstdio>
15 
16 #ifdef __ROOT__
17 ClassImp(FracMergRowvsQinv)
18 #endif
19 
20 //____________________________
21  FracMergRowvsQinv::FracMergRowvsQinv(char* title, const int& nbinsX, const float& XLo, const float& XHi,
22  const int& nbinsY, const float& YLo, const float& YHi){
23  // set up numerator
24  char Tit[100];
25  sprintf(Tit,"Num2D");
26  strcat(Tit,title);
27  mNumerator2D = new StHbt2DHisto(Tit,title,nbinsX,XLo,XHi,nbinsY,YLo,YHi);
28 
29  // set up denominator
30  sprintf(Tit,"Den2D");
31  strcat(Tit,title);
32  mDenominator2D = new StHbt2DHisto(Tit,title,nbinsX,XLo,XHi,nbinsY,YLo,YHi);
33 
34  // set up ratio
35  sprintf(Tit,"Rat2D");
36  strcat(Tit,title);
37  mRatio2D = new StHbt2DHisto(Tit,title,nbinsX,XLo,XHi,nbinsY,YLo,YHi);
38 
39  mNumerator2D->Sumw2();
40  mDenominator2D->Sumw2();
41  mRatio2D->Sumw2();
42 }
43 //____________________________
44 FracMergRowvsQinv::~FracMergRowvsQinv(){
45  delete mNumerator2D;
46  delete mDenominator2D;
47  delete mRatio2D;
48 }
49 //_________________________
50 void FracMergRowvsQinv::Finish(){
51  mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0);
52 }
53 
54 
55 //____________________________
56 StHbtString FracMergRowvsQinv::Report(){
57  string stemp = "Qinv Correlation Function Report:\n";
58  char ctemp[100];
59  sprintf(ctemp,"Number of entries in numerator:\t%E\n",mNumerator2D->GetEntries());
60  stemp += ctemp;
61  sprintf(ctemp,"Number of entries in denominator:\t%E\n",mDenominator2D->GetEntries());
62  stemp += ctemp;
63  sprintf(ctemp,"Number of entries in ratio:\t%E\n",mRatio2D->GetEntries());
64  stemp += ctemp;
65  StHbtString returnThis = stemp;
66  return returnThis;
67 }
68 //____________________________
69 void FracMergRowvsQinv::AddRealPair(const StHbtPair* pair){
70  double Qinv = fabs(pair->qInv());
71  mNumerator2D->Fill(Qinv,
72  pair->getFracOfMergedRow(),1.0);
73 }
74 
75 //____________________________
76 void FracMergRowvsQinv::AddMixedPair(const StHbtPair* pair){
77  double Qinv = fabs(pair->qInv());
78  mDenominator2D->Fill(Qinv,
79  pair->getFracOfMergedRow(),1.0);
80 }