StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EntranceSepCorrFctn.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 Qinv-EntranceSeparation correlation function used for studying 2-track cuts
8  *
9  ***************************************************************************
10  *
11  **************************************************************************/
12 
13 #include "StHbtMaker/CorrFctn/EntranceSepCorrFctn.h"
14 #include <cstdio>
15 
16 #ifdef __ROOT__
17 ClassImp(EntranceSepCorrFctn)
18 #endif
19 
20 
21 //____________________________
22 EntranceSepCorrFctn::EntranceSepCorrFctn(char* title, const int& nbinsQ, const float& QLo, const float& QHi,
23  const int& nbinsExSep, const float& ExSepLo, const float& ExSepHi){
24  // set up numeratorS
25  char Tit[100];
26  sprintf(Tit,"2D Num");
27  strcat(Tit,title);
28  mNumerator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
29 
30  // set up denominatorS
31  sprintf(Tit,"2D Den");
32  strcat(Tit,title);
33  mDenominator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
34 
35  // set up ratioS
36  sprintf(Tit,"2D Rat");
37  strcat(Tit,title);
38  mRatio2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
39 
40  // these histograms should have errors associated with them...
41  mNumerator2D->Sumw2();
42  mDenominator2D->Sumw2();
43  mRatio2D->Sumw2();
44 
45 }
46 
47 //____________________________
48 EntranceSepCorrFctn::~EntranceSepCorrFctn(){
49  delete mNumerator2D;
50  delete mDenominator2D;
51  delete mRatio2D;
52 }
53 //_________________________
54 void EntranceSepCorrFctn::Finish(){
55  mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0);
56 }
57 
58 //____________________________
59 StHbtString EntranceSepCorrFctn::Report(){
60  string stemp = "Entrance Seperation Correlation Function Report:\n";
61  char ctemp[100];
62  sprintf(ctemp,"Number of entries in numerator:\t%E\n",
63  mNumerator2D->GetEntries());
64  stemp += ctemp;
65  sprintf(ctemp,"Number of entries in denominator:\t%E\n",
66  mDenominator2D->GetEntries());
67  stemp += ctemp;
68  StHbtString returnThis = stemp;
69  return returnThis;
70 }
71 //____________________________
72 void EntranceSepCorrFctn::AddRealPair(const StHbtPair* pair){
73 
74  // MALisa July2000 - take explicit calculation of exit points and exit separation out of this
75  // class and put it into StHbtParticle and StHbtPair where they belong
76  // StHbtThreeVector exitPt1 = FindExitPoint(pair->track1()->Helix());
77  // StHbtThreeVector exitPt2 = FindExitPoint(pair->track2()->Helix());
78  // StHbtThreeVector diff = exitPt1 - exitPt2;
79  // double exitSep = diff.mag();
80 
81  double entSep = pair->NominalTpcEntranceSeparation();
82  double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
83 
84  mNumerator2D->Fill(Qinv,entSep,1.0);
85 }
86 //____________________________
87 void EntranceSepCorrFctn::AddMixedPair(const StHbtPair* pair){
88 
89  double entSep = pair->NominalTpcEntranceSeparation();
90  double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
91 
92  mDenominator2D->Fill(Qinv,entSep,1.0);
93 }
94