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/03/07 10:14:49 mchojnacki
15 * First version on CVS
17 * Revision 1.4 2000/01/25 17:34:45 laue
18 * I. In order to run the stand alone version of the AliFemtoMaker the following
19 * changes have been done:
20 * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
21 * b) unnecessary includes of StMaker.h have been removed
22 * c) the subdirectory AliFemtoMaker/doc/Make has been created including everything
23 * needed for the stand alone version
25 * II. To reduce the amount of compiler warning
26 * a) some variables have been type casted
27 * b) some destructors have been declared as virtual
29 * Revision 1.3 1999/07/29 02:47:09 lisa
30 * 1) add OpeningAngle correlation function 2) add AliFemtoMcEventReader 3) make histos in CorrFctns do errors correctly
32 * Revision 1.2 1999/07/06 22:33:20 lisa
33 * Adjusted all to work in pro and new - dev itself is broken
35 * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
36 * Installation of AliFemtoMaker
38 **************************************************************************/
40 #include "CorrFctn/AliFemtoShareQualityCorrFctn.h"
41 //#include "Infrastructure/AliFemtoHisto.hh"
45 ClassImp(AliFemtoShareQualityCorrFctn)
48 //____________________________
49 AliFemtoShareQualityCorrFctn::AliFemtoShareQualityCorrFctn(char* title, const int& nbins, const float& QinvLo, const float& QinvHi){
51 // title = "Num Qinv (MeV/c)";
52 char TitNum[100] = "NumShare";
54 fShareNumerator = new TH2D(TitNum,title,nbins,QinvLo,QinvHi,50,0.0,1.00001);
56 //title = "Den Qinv (MeV/c)";
57 char TitDen[100] = "DenShare";
59 fShareDenominator = new TH2D(TitDen,title,nbins,QinvLo,QinvHi,50,0.0,1.00001);
61 char Tit2Num[100] = "NumQuality";
62 strcat(Tit2Num,title);
63 fQualityNumerator = new TH2D(Tit2Num,title,nbins,QinvLo,QinvHi,75,-0.500001,1.000001);
65 //title = "Den Qinv (MeV/c)";
66 char Tit2Den[100] = "DenQuality";
67 strcat(Tit2Den,title);
68 fQualityDenominator = new TH2D(Tit2Den,title,nbins,QinvLo,QinvHi,75,-0.500001,1.000001);
70 //title = "Ratio Qinv (MeV/c)";
71 // this next bit is unfortunately needed so that we can have many histos of same "title"
72 // it is neccessary if we typedef TH2D to TH1d (which we do)
73 //mShareNumerator->SetDirectory(0);
74 //mShareDenominator->SetDirectory(0);
75 //mRatio->SetDirectory(0);
77 // to enable error bar calculation...
78 fShareNumerator->Sumw2();
79 fShareDenominator->Sumw2();
81 fQualityNumerator->Sumw2();
82 fQualityDenominator->Sumw2();
85 //____________________________
86 AliFemtoShareQualityCorrFctn::~AliFemtoShareQualityCorrFctn(){
87 delete fShareNumerator;
88 delete fShareDenominator;
89 delete fQualityNumerator;
90 delete fQualityDenominator;
92 //_________________________
93 void AliFemtoShareQualityCorrFctn::Finish(){
94 // here is where we should normalize, fit, etc...
95 // we should NOT Draw() the histos (as I had done it below),
96 // since we want to insulate ourselves from root at this level
97 // of the code. Do it instead at root command line with browser.
98 // mShareNumerator->Draw();
99 //mShareDenominator->Draw();
104 //____________________________
105 AliFemtoString AliFemtoShareQualityCorrFctn::Report(){
106 string stemp = "Qinv Correlation Function Report:\n";
108 sprintf(ctemp,"Number of entries in numerator:\t%E\n",fShareNumerator->GetEntries());
110 sprintf(ctemp,"Number of entries in denominator:\t%E\n",fShareDenominator->GetEntries());
112 // stemp += mCoulombWeight->Report();
113 AliFemtoString returnThis = stemp;
116 //____________________________
117 void AliFemtoShareQualityCorrFctn::AddRealPair(const AliFemtoPair* pair){
118 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
123 for (unsigned int imap=0; imap<pair->track1()->Track()->TPCclusters().GetNbits(); imap++) {
124 // If both have clusters in the same row
125 if (pair->track1()->Track()->TPCclusters().TestBitNumber(imap) &&
126 pair->track2()->Track()->TPCclusters().TestBitNumber(imap)) {
127 // Do they share it ?
128 if (pair->track1()->Track()->TPCsharing().TestBitNumber(imap) ||
129 pair->track2()->Track()->TPCsharing().TestBitNumber(imap))
132 cout << "Shared cluster in row " << imap << endl;
139 // Different hits on the same padrow
145 else if (pair->track1()->Track()->TPCclusters().TestBitNumber(imap) ||
146 pair->track2()->Track()->TPCclusters().TestBitNumber(imap)) {
147 // One track has a hit, the other does not
153 cout << "Qinv of the pair is " << Qinv << endl;
154 cout << "Clusters: " << endl;
155 for (unsigned int imap=0; imap<pair->track1()->Track()->TPCclusters().GetNbits(); imap++) {
157 if (pair->track1()->Track()->TPCclusters().TestBitNumber(imap)) cout << " 1 ";
159 if (pair->track2()->Track()->TPCclusters().TestBitNumber(imap)) cout << " 1 ";
162 if (pair->track1()->Track()->TPCsharing().TestBitNumber(imap)) cout << " S ";
164 if (pair->track2()->Track()->TPCsharing().TestBitNumber(imap)) cout << " S ";
170 Float_t hsmval = 0.0;
171 Float_t hsfval = 0.0;
179 cout << "Quality Sharity " << hsmval << " " << hsfval << " " << pair->track1()->Track() << " " << pair->track2()->Track() << endl;
182 fShareNumerator->Fill(Qinv, hsfval);
183 fQualityNumerator->Fill(Qinv, hsmval);
184 // cout << "AliFemtoShareQualityCorrFctn::AddRealPair : " << pair->qInv() << " " << Qinv <<
185 //" " << pair->track1().FourMomentum() << " " << pair->track2().FourMomentum() << endl;
187 //____________________________
188 void AliFemtoShareQualityCorrFctn::AddMixedPair(const AliFemtoPair* pair){
190 double Qinv = fabs(pair->qInv()); // note - qInv() will be negative for identical pairs...
195 for (unsigned int imap=0; imap<pair->track1()->Track()->TPCclusters().GetNbits(); imap++) {
196 // If both have clusters in the same row
197 if (pair->track1()->Track()->TPCclusters().TestBitNumber(imap) &&
198 pair->track2()->Track()->TPCclusters().TestBitNumber(imap)) {
199 // Do they share it ?
200 if (pair->track1()->Track()->TPCsharing().TestBitNumber(imap) ||
201 pair->track2()->Track()->TPCsharing().TestBitNumber(imap))
203 // cout << "A shared cluster !!!" << endl;
204 // cout << "imap idx1 idx2 "
206 // << tP1idx[imap] << " " << tP2idx[imap] << endl;
212 // Different hits on the same padrow
218 else if (pair->track1()->Track()->TPCclusters().TestBitNumber(imap) ||
219 pair->track2()->Track()->TPCclusters().TestBitNumber(imap)) {
220 // One track has a hit, the other does not
226 Float_t hsmval = 0.0;
227 Float_t hsfval = 0.0;
234 fShareDenominator->Fill(Qinv,hsfval,weight);
235 fQualityDenominator->Fill(Qinv,hsmval,weight);
239 void AliFemtoShareQualityCorrFctn::WriteHistos()
241 fShareNumerator->Write();
242 fShareDenominator->Write();
243 fQualityNumerator->Write();
244 fQualityDenominator->Write();