StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Trk2CorrFctn.cxx
1 /***************************************************************************
2  *
3  * $Id: Trk2CorrFctn.cxx,v 1.1 2001/12/14 23:11:25 fretiere Exp $
4  *
5  * Author:
6  *
7  * $Log: Trk2CorrFctn.cxx,v $
8  * Revision 1.1 2001/12/14 23:11:25 fretiere
9  * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify StHbtTrack, StHbtParticle, StHbtHiddenInfo, StHbtPair to handle the hit information and cope with my code
10  *
11  *
12  *
13  **************************************************************************/
14 
15 #include "TMath.h"
16 #include "StHbtMaker/CorrFctn/Trk2CorrFctn.h"
17 #include <cstdio>
18 
19 #ifdef __ROOT__
20 ClassImp(Trk2CorrFctn)
21 #endif
22 
23 //____________________________
24 Trk2CorrFctn::Trk2CorrFctn(char* title){
25  mNumFracRowClosestRow = new StHbt2DHisto("NumFC","NumFC",45,1.,46.,
26  20,0.,1.);
27  mDenFracRowClosestRow = new StHbt2DHisto("DenFC","DenFC",45,1.,46.,
28  20,0.,1.);
29  mRatFracRowClosestRow = new StHbt2DHisto("RatFC","RatFC",45,1.,46.,
30  20,0.,1.);
31 }
32 
33 //____________________________
34 Trk2CorrFctn::~Trk2CorrFctn(){
35  delete mNumFracRowClosestRow;
36  delete mDenFracRowClosestRow;
37  delete mRatFracRowClosestRow;
38 }
39 //_________________________
40 void Trk2CorrFctn::Finish(){
41  mRatFracRowClosestRow->Divide(mNumFracRowClosestRow,
42  mDenFracRowClosestRow,
43  mDenFracRowClosestRow->Integral(),
44  mNumFracRowClosestRow->Integral());
45 }
46 
47 void Trk2CorrFctn::Write(){
48  mNumFracRowClosestRow->Write();
49  mDenFracRowClosestRow->Write();
50  mRatFracRowClosestRow->Write();
51 }
52 
53 //____________________________
54 StHbtString Trk2CorrFctn::Report(){
55  string stemp = "Qinv Correlation Function Report:\n";
56  char ctemp[100];
57  sprintf(ctemp,"Number of entries in numerator:\t%E\n",mNumFracRowClosestRow->GetEntries());
58  stemp += ctemp;
59  sprintf(ctemp,"Number of entries in denominator:\t%E\n",mDenFracRowClosestRow->GetEntries());
60  stemp += ctemp;
61  sprintf(ctemp,"Number of entries in ratio:\t%E\n",mRatFracRowClosestRow->GetEntries());
62  stemp += ctemp;
63  StHbtString returnThis = stemp;
64  return returnThis;
65 }
66 //____________________________
67 void Trk2CorrFctn::AddRealPair(const StHbtPair* pair){
68  mNumFracRowClosestRow->Fill(pair->getClosestRowAtDCA(),
69  pair->getFracOfMergedRow(),1.);
70 }
71 
72 //____________________________
73 void Trk2CorrFctn::AddMixedPair(const StHbtPair* pair){
74  mDenFracRowClosestRow->Fill(pair->getClosestRowAtDCA(),
75  pair->getFracOfMergedRow(),1.);
76 }
77 
78