StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
QinvQualAvSepCorrFctn.cxx
1 /***************************************************************************
2  *
3  * Author: Randy Wells, Ohio State, rcwells@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  * also has a merging axis built in for entrance separation
9  *
10  ***************************************************************************
11  *
12  **************************************************************************/
13 
14 
15 #include "StHbtMaker/CorrFctn/QinvQualAvSepCorrFctn.h"
16 #include <cstdio>
17 
18 #ifdef __ROOT__
19 ClassImp(QinvQualAvSepCorrFctn)
20 #endif
21 //____________________________
22 QinvQualAvSepCorrFctn::QinvQualAvSepCorrFctn(char* title, const int& nbinsQ, const float& QLo, const float& QHi,
23  const int& nbinsQual, const float& QualLo, const float& QualHi,
24  const int& nbinsSep, const float& SepLo, const float& SepHi) {
25  // set up numeratorS
26  char Tit[100];
27  sprintf(Tit,"Num3D");
28  strcat(Tit,title);
29  mNumerator3D = new StHbt3DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi,nbinsSep,SepLo,SepHi);
30 
31  // set up denominatorS
32  sprintf(Tit,"Den3D");
33  strcat(Tit,title);
34  mDenominator3D = new StHbt3DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi,nbinsSep,SepLo,SepHi);
35 
36  // set up ratioS
37  sprintf(Tit,"Rat3D");
38  strcat(Tit,title);
39  mRatio3D = new StHbt3DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsQual,QualLo,QualHi,nbinsSep,SepLo,SepHi);
40 
41  // these histograms should have errors associated with them...
42  mNumerator3D->Sumw2();
43  mDenominator3D->Sumw2();
44  mRatio3D->Sumw2();
45 
46 }
47 
48 //____________________________
49 QinvQualAvSepCorrFctn::~QinvQualAvSepCorrFctn(){
50  delete mNumerator3D;
51  delete mDenominator3D;
52  delete mRatio3D;
53 }
54 //_________________________
55 void QinvQualAvSepCorrFctn::Finish(){
56  // here is where we should normalize, fit, etc...
57  // we should NOT Draw() the histos (as I had done it below),
58  // since we want to insulate ourselves from root at this level
59  // of the code. Do it instead at root command line with browser.
60  mRatio3D->Divide(mNumerator3D,mDenominator3D,1.0,1.0);
61 }
62 
63 //____________________________
64 StHbtString QinvQualAvSepCorrFctn::Report(){
65  string stemp = "Qinv-QualityFactor Correlation Function Report:\n";
66  char ctemp[100];
67  sprintf(ctemp,"Number of entries in numerator:\t%E\n",
68  mNumerator3D->GetEntries());
69  stemp += ctemp;
70  sprintf(ctemp,"Number of entries in denominator:\t%E\n",
71  mDenominator3D->GetEntries());
72  stemp += ctemp;
73  StHbtString returnThis = stemp;
74  return returnThis;
75 }
76 //____________________________
77 void QinvQualAvSepCorrFctn::AddRealPair(const StHbtPair* pair){
78 
79  double Qual = pair->quality();
80  double AvSep = pair->NominalTpcAverageSeparation();
81  double Q = fabs(pair->qInv());
82 
83  mNumerator3D->Fill(Q,Qual,AvSep,1.0);
84 }
85 //____________________________
86 void QinvQualAvSepCorrFctn::AddMixedPair(const StHbtPair* pair){
87 
88  double Qual = pair->quality();
89  double AvSep = pair->NominalTpcAverageSeparation();
90  double Q = fabs(pair->qInv());
91 
92  mDenominator3D->Fill(Q,Qual,AvSep,1.0);
93 
94 }
95 
96 
97