1 /***************************************************************************
5 * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6 ***************************************************************************
8 * Description: part of STAR HBT Framework: AliFemtoMaker package
9 * a simple Q-invariant correlation function
11 ***************************************************************************
14 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
15 * Importing the HBT code dir
17 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
18 * First version on CVS
20 * Revision 1.4 2000/01/25 17:34:45 laue
21 * I. In order to run the stand alone version of the AliFemtoMaker the following
22 * changes have been done:
23 * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
24 * b) unnecessary includes of StMaker.h have been removed
25 * c) the subdirectory AliFemtoMaker/doc/Make has been created including everything
26 * needed for the stand alone version
28 * II. To reduce the amount of compiler warning
29 * a) some variables have been type casted
30 * b) some destructors have been declared as virtual
32 * Revision 1.3 1999/07/29 02:47:09 lisa
33 * 1) add OpeningAngle correlation function 2) add AliFemtoMcEventReader 3) make histos in CorrFctns do errors correctly
35 * Revision 1.2 1999/07/06 22:33:20 lisa
36 * Adjusted all to work in pro and new - dev itself is broken
38 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
39 * Installation of AliFemtoMaker
41 **************************************************************************/
43 #include "CorrFctn/AliFemtoQinvCorrFctn.h"
44 //#include "Infrastructure/AliFemtoHisto.h"
48 ClassImp(AliFemtoQinvCorrFctn)
51 //____________________________
52 AliFemtoQinvCorrFctn::AliFemtoQinvCorrFctn(char* title, const int& nbins, const float& QinvLo, const float& QinvHi):
58 // title = "Num Qinv (MeV/c)";
59 char TitNum[100] = "Num";
61 fNumerator = new TH1D(TitNum,title,nbins,QinvLo,QinvHi);
63 //title = "Den Qinv (MeV/c)";
64 char TitDen[100] = "Den";
66 fDenominator = new TH1D(TitDen,title,nbins,QinvLo,QinvHi);
68 //title = "Ratio Qinv (MeV/c)";
69 char TitRat[100] = "Rat";
71 fRatio = new TH1D(TitRat,title,nbins,QinvLo,QinvHi);
72 // this next bit is unfortunately needed so that we can have many histos of same "title"
73 // it is neccessary if we typedef TH1D to TH1d (which we do)
74 //fNumerator->SetDirectory(0);
75 //fDenominator->SetDirectory(0);
76 //fRatio->SetDirectory(0);
78 // to enable error bar calculation...
80 fDenominator->Sumw2();
85 //____________________________
86 AliFemtoQinvCorrFctn::AliFemtoQinvCorrFctn(const AliFemtoQinvCorrFctn& aCorrFctn) :
91 fNumerator = new TH1D(*aCorrFctn.fNumerator);
92 fDenominator = new TH1D(*aCorrFctn.fDenominator);
93 fRatio = new TH1D(*aCorrFctn.fRatio);
95 //____________________________
96 AliFemtoQinvCorrFctn::~AliFemtoQinvCorrFctn(){
101 //_________________________
102 AliFemtoQinvCorrFctn& AliFemtoQinvCorrFctn::operator=(const AliFemtoQinvCorrFctn& aCorrFctn)
104 if (this == &aCorrFctn)
107 if (fNumerator) delete fNumerator;
108 fNumerator = new TH1D(*aCorrFctn.fNumerator);
109 if (fDenominator) delete fDenominator;
110 fDenominator = new TH1D(*aCorrFctn.fDenominator);
111 if (fRatio) delete fRatio;
112 fRatio = new TH1D(*aCorrFctn.fRatio);
117 //_________________________
118 void AliFemtoQinvCorrFctn::Finish(){
119 // here is where we should normalize, fit, etc...
120 // we should NOT Draw() the histos (as I had done it below),
121 // since we want to insulate ourselves from root at this level
122 // of the code. Do it instead at root command line with browser.
123 // fNumerator->Draw();
124 //fDenominator->Draw();
126 fRatio->Divide(fNumerator,fDenominator,1.0,1.0);
130 //____________________________
131 AliFemtoString AliFemtoQinvCorrFctn::Report(){
132 string stemp = "Qinv Correlation Function Report:\n";
134 sprintf(ctemp,"Number of entries in numerator:\t%E\n",fNumerator->GetEntries());
136 sprintf(ctemp,"Number of entries in denominator:\t%E\n",fDenominator->GetEntries());
138 sprintf(ctemp,"Number of entries in ratio:\t%E\n",fRatio->GetEntries());
140 // stemp += mCoulombWeight->Report();
141 AliFemtoString returnThis = stemp;
144 //____________________________
145 void AliFemtoQinvCorrFctn::AddRealPair(const AliFemtoPair* pair){
146 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
147 fNumerator->Fill(Qinv);
148 // cout << "AliFemtoQinvCorrFctn::AddRealPair : " << pair->qInv() << " " << Qinv <<
149 //" " << pair->track1().FourMomentum() << " " << pair->track2().FourMomentum() << endl;
151 //____________________________
152 void AliFemtoQinvCorrFctn::AddMixedPair(const AliFemtoPair* pair){
154 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
155 fDenominator->Fill(Qinv,weight);