StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AverageSepCorrFctn.cxx
1 /***************************************************************************
2  *
3  * $Id: AverageSepCorrFctn.cxx,v 1.1 2000/10/05 23:08:58 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-AverageSeparation correlation function used for studying 2-track cuts
10  *
11  ***************************************************************************
12  *
13  * $Log: AverageSepCorrFctn.cxx,v $
14  * Revision 1.1 2000/10/05 23:08:58 lisa
15  * Added kT-dependent radii to mixed-event simulator AND implemented AverageSeparation Cut and CorrFctn
16  *
17  *
18  **************************************************************************/
19 
20 #include "StHbtMaker/CorrFctn/AverageSepCorrFctn.h"
21 #include <cstdio>
22 
23 #ifdef __ROOT__
24 ClassImp(AverageSepCorrFctn)
25 #endif
26 
27 
28 //____________________________
29 AverageSepCorrFctn::AverageSepCorrFctn(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,"2DNum");
34  strcat(Tit,title);
35  mNumerator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
36 
37  // set up denominatorS
38  sprintf(Tit,"2DDen");
39  strcat(Tit,title);
40  mDenominator2D = new StHbt2DHisto(Tit,title,nbinsQ,QLo,QHi,nbinsExSep,ExSepLo,ExSepHi);
41 
42  // set up ratioS
43  sprintf(Tit,"2DRat");
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 AverageSepCorrFctn::~AverageSepCorrFctn(){
56  delete mNumerator2D;
57  delete mDenominator2D;
58  delete mRatio2D;
59 }
60 //_________________________
61 void AverageSepCorrFctn::Finish(){
62  mRatio2D->Divide(mNumerator2D,mDenominator2D,1.0,1.0);
63 }
64 
65 //____________________________
66 StHbtString AverageSepCorrFctn::Report(){
67  string stemp = "Average Seperation 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 AverageSepCorrFctn::AddRealPair(const StHbtPair* pair){
80 
81  // MALisa July2000 - take explicit calculation of exit points and exit separation out of this
82  // class and put it into StHbtParticle and StHbtPair where they belong
83  // StHbtThreeVector exitPt1 = FindExitPoint(pair->track1()->Helix());
84  // StHbtThreeVector exitPt2 = FindExitPoint(pair->track2()->Helix());
85  // StHbtThreeVector diff = exitPt1 - exitPt2;
86  // double exitSep = diff.mag();
87 
88  double aveSep = pair->NominalTpcAverageSeparation();
89  double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
90 
91  mNumerator2D->Fill(Qinv,aveSep,1.0);
92 }
93 //____________________________
94 void AverageSepCorrFctn::AddMixedPair(const StHbtPair* pair){
95 
96  double aveSep = pair->NominalTpcAverageSeparation();
97  double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
98 
99  mDenominator2D->Fill(Qinv,aveSep,1.0);
100 }
101