StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EntSep_pTCorrFctn.cxx
1 /***************************************************************************
2  *
3  * $Id: EntSep_pTCorrFctn.cxx,v 1.1 2000/09/14 18:36:54 lisa Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * a simple Qinv-EntranceSeparation correlation function used for studying 2-track cuts
10  *
11  ***************************************************************************
12  *
13  * $Log: EntSep_pTCorrFctn.cxx,v $
14  * Revision 1.1 2000/09/14 18:36:54 lisa
15  * Added Qinv and ExitSep pair cuts and BPLCMSFrame3DCorrFctn_SIM CorrFctn
16  *
17  *
18  **************************************************************************/
19 
20 #include "StHbtMaker/CorrFctn/EntSep_pTCorrFctn.h"
21 #include <cstdio>
22 
23 #ifdef __ROOT__
24 ClassImp(EntSep_pTCorrFctn)
25 #endif
26 
27 
28 //____________________________
29 EntSep_pTCorrFctn::EntSep_pTCorrFctn(char* title, const int& nbinsQ, const float& QLo, const float& QHi,
30  const int& nbinsExSep, const float& ExSepLo, const float& ExSepHi){
31  // set up numeratorS
32  char Tit[100];
33  sprintf(Tit,"2D Num");
34  strcat(Tit,title);
35  mNumerator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
36 
37  // set up denominatorS
38  sprintf(Tit,"2D Den");
39  strcat(Tit,title);
40  mDenominator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
41 
42  // set up ratioS
43  sprintf(Tit,"2D Rat");
44  strcat(Tit,title);
45  mRatio2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
46 
47  // these histograms should have errors associated with them...
48  mNumerator2D->Sumw2();
49  mDenominator2D->Sumw2();
50  mRatio2D->Sumw2();
51 
52 }
53 
54 //____________________________
55 EntSep_pTCorrFctn::~EntSep_pTCorrFctn(){
56  delete mNumerator2D;
57  delete mDenominator2D;
58  delete mRatio2D;
59 }
60 //_________________________
61 void EntSep_pTCorrFctn::Finish(){
62  mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0);
63 }
64 
65 //____________________________
66 StHbtString EntSep_pTCorrFctn::Report(){
67  string stemp = "EntSep_pT Correlation Function Report:\n";
68  char ctemp[100];
69  sprintf(ctemp,"Number of entries in numerator:\t%E\n",
70  mNumerator2D->GetEntries());
71  stemp += ctemp;
72  sprintf(ctemp,"Number of entries in denominator:\t%E\n",
73  mDenominator2D->GetEntries());
74  stemp += ctemp;
75  StHbtString returnThis = stemp;
76  return returnThis;
77 }
78 //____________________________
79 void EntSep_pTCorrFctn::AddRealPair(const StHbtPair* pair){
80 
81 
82  double entSep = pair->NominalTpcEntranceSeparation();
83  // double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
84  double kT = pair->kT();
85 
86  mNumerator2D->Fill(entSep,kT,1.0);
87 }
88 //____________________________
89 void EntSep_pTCorrFctn::AddMixedPair(const StHbtPair* pair){
90 
91  double entSep = pair->NominalTpcEntranceSeparation();
92  // double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
93  double kT = pair->kT();
94 
95  mDenominator2D->Fill(entSep,kT,1.0);
96 }
97