StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
QvecQualCorrFctn.cxx
1 /***************************************************************************
2  *
3  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
4  ***************************************************************************
5  *
6  * Description: part of STAR HBT Framework: StHbtMaker package
7  * a simple QualityFactor correlation function used for studying 2-track cuts
8  *
9  ***************************************************************************
10  *
11  **************************************************************************/
12 
13 #include "StHbtMaker/CorrFctn/QvecQualCorrFctn.h"
14 #include <cstdio>
15 
16 #ifdef __ROOT__
17 ClassImp(QvecQualCorrFctn)
18 #endif
19 //____________________________
20 QvecQualCorrFctn:: QvecQualCorrFctn(char* title, const int& nbinsQ, const float& QLo, const float& QHi,
21  const int& nbinsQual, const float& QualLo, const float& QualHi){
22  // set up numeratorS
23  char Tit[100];
24  sprintf(Tit,"Num2D");
25  strcat(Tit,title);
26  mNumerator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi);
27 
28  // set up denominatorS
29  sprintf(Tit,"Den2D");
30  strcat(Tit,title);
31  mDenominator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi);
32 
33  // set up ratioS
34  sprintf(Tit,"Rat2D");
35  strcat(Tit,title);
36  mRatio2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi);
37 
38  // these histograms should have errors associated with them...
39  mNumerator2D->Sumw2();
40  mDenominator2D->Sumw2();
41  mRatio2D->Sumw2();
42 
43 }
44 
45 //____________________________
46 QvecQualCorrFctn::~QvecQualCorrFctn(){
47  delete mNumerator2D;
48  delete mDenominator2D;
49  delete mRatio2D;
50 }
51 //_________________________
52 void QvecQualCorrFctn::Finish(){
53  // here is where we should normalize, fit, etc...
54  // we should NOT Draw() the histos (as I had done it below),
55  // since we want to insulate ourselves from root at this level
56  // of the code. Do it instead at root command line with browser.
57  mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0);
58 }
59 
60 //____________________________
61 StHbtString QvecQualCorrFctn::Report(){
62  string stemp = "Qvector-QualityFactor Correlation Function Report:\n";
63  char ctemp[100];
64  sprintf(ctemp,"Number of entries in numerator:\t%E\n",
65  mNumerator2D->GetEntries());
66  stemp += ctemp;
67  sprintf(ctemp,"Number of entries in denominator:\t%E\n",
68  mDenominator2D->GetEntries());
69  stemp += ctemp;
70  StHbtString returnThis = stemp;
71  return returnThis;
72 }
73 //____________________________
74 void QvecQualCorrFctn::AddRealPair(const StHbtPair* pair){
75 
76  double Qual = pair->quality();
77  double Q = fabs(pair->fourMomentumDiff().vect().mag());
78 
79  mNumerator2D->Fill(Q,Qual,1.0);
80 }
81 //____________________________
82 void QvecQualCorrFctn::AddMixedPair(const StHbtPair* pair){
83 
84  double Qual = pair->quality();
85  double Q = fabs(pair->fourMomentumDiff().vect().mag());
86 
87  mDenominator2D->Fill(Q,Qual,1.0);
88 
89 }
90 
91 
92