]>
Commit | Line | Data |
---|---|---|
76ce4b5b | 1 | //////////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoCorrFctnTPCNcls - A correlation function that saves the correlation// | |
4 | // function as a function of number of TPC clusters of the track // | |
5 | // // | |
6 | // Authors: Adam Kisiel kisiel@mps.ohio-state.edu // | |
7 | // // | |
8 | //////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #include "AliFemtoCorrFctnTPCNcls.h" | |
11 | //#include "AliFemtoHisto.hh" | |
12 | #include <cstdio> | |
13 | ||
14 | #ifdef __ROOT__ | |
15 | ClassImp(AliFemtoCorrFctnTPCNcls) | |
16 | #endif | |
17 | ||
18 | //____________________________ | |
19 | AliFemtoCorrFctnTPCNcls::AliFemtoCorrFctnTPCNcls(char* title, const int& nbins, const float& QinvLo, const float& QinvHi): | |
20 | AliFemtoCorrFctn(), | |
21 | fNclsTPCMinNumerator(0), | |
22 | fNclsTPCMinDenominator(0) | |
23 | { | |
24 | // set up numerator | |
25 | char tTitNum[101] = "NumNclsTPCMin"; | |
26 | strncat(tTitNum,title, 100); | |
27 | fNclsTPCMinNumerator = new TH2D(tTitNum,title,nbins,QinvLo,QinvHi,159,0.5,159.5); | |
28 | // set up denominator | |
29 | char tTitDen[101] = "DenNclsTPCMin"; | |
30 | strncat(tTitDen,title, 100); | |
31 | fNclsTPCMinDenominator = new TH2D(tTitDen,title,nbins,QinvLo,QinvHi,159,0.5,159.5); | |
32 | ||
33 | // to enable error bar calculation... | |
34 | fNclsTPCMinNumerator->Sumw2(); | |
35 | fNclsTPCMinDenominator->Sumw2(); | |
36 | } | |
37 | ||
38 | //____________________________ | |
39 | AliFemtoCorrFctnTPCNcls::AliFemtoCorrFctnTPCNcls(const AliFemtoCorrFctnTPCNcls& aCorrFctn) : | |
40 | AliFemtoCorrFctn(), | |
41 | fNclsTPCMinNumerator(0), | |
42 | fNclsTPCMinDenominator(0) | |
43 | { | |
44 | // copy constructor | |
45 | if (aCorrFctn.fNclsTPCMinNumerator) | |
46 | fNclsTPCMinNumerator = new TH2D(*aCorrFctn.fNclsTPCMinNumerator); | |
47 | if (aCorrFctn.fNclsTPCMinDenominator) | |
48 | fNclsTPCMinDenominator = new TH2D(*aCorrFctn.fNclsTPCMinDenominator); | |
49 | } | |
50 | //____________________________ | |
51 | AliFemtoCorrFctnTPCNcls::~AliFemtoCorrFctnTPCNcls(){ | |
52 | // destructor | |
53 | delete fNclsTPCMinNumerator; | |
54 | delete fNclsTPCMinDenominator; | |
55 | } | |
56 | //_________________________ | |
57 | AliFemtoCorrFctnTPCNcls& AliFemtoCorrFctnTPCNcls::operator=(const AliFemtoCorrFctnTPCNcls& aCorrFctn) | |
58 | { | |
59 | // assignment operator | |
60 | if (this == &aCorrFctn) | |
61 | return *this; | |
62 | ||
63 | if (aCorrFctn.fNclsTPCMinNumerator) | |
64 | fNclsTPCMinNumerator = new TH2D(*aCorrFctn.fNclsTPCMinNumerator); | |
65 | else | |
66 | fNclsTPCMinNumerator = 0; | |
67 | if (aCorrFctn.fNclsTPCMinDenominator) | |
68 | fNclsTPCMinDenominator = new TH2D(*aCorrFctn.fNclsTPCMinDenominator); | |
69 | else | |
70 | fNclsTPCMinDenominator = 0; | |
71 | ||
72 | return *this; | |
73 | } | |
74 | //_________________________ | |
75 | void AliFemtoCorrFctnTPCNcls::Finish(){ | |
76 | // here is where we should normalize, fit, etc... | |
77 | // we should NOT Draw() the histos (as I had done it below), | |
78 | // since we want to insulate ourselves from root at this level | |
79 | // of the code. Do it instead at root command line with browser. | |
80 | // mShareNumerator->Draw(); | |
81 | //mShareDenominator->Draw(); | |
82 | //mRatio->Draw(); | |
83 | ||
84 | } | |
85 | ||
86 | //____________________________ | |
87 | AliFemtoString AliFemtoCorrFctnTPCNcls::Report(){ | |
88 | // create report | |
89 | string stemp = "TPC Ncls Correlation Function Report:\n"; | |
90 | char ctemp[100]; | |
91 | snprintf(ctemp , 100, "Number of entries in numerator:\t%E\n",fNclsTPCMinNumerator->GetEntries()); | |
92 | stemp += ctemp; | |
93 | snprintf(ctemp , 100, "Number of entries in denominator:\t%E\n",fNclsTPCMinDenominator->GetEntries()); | |
94 | stemp += ctemp; | |
95 | // stemp += mCoulombWeight->Report(); | |
96 | AliFemtoString returnThis = stemp; | |
97 | return returnThis; | |
98 | } | |
99 | //____________________________ | |
100 | void AliFemtoCorrFctnTPCNcls::AddRealPair( AliFemtoPair* pair){ | |
101 | // add real (effect) pair | |
102 | double tQinv = fabs(pair->QInv()); // note - qInv() will be negative for identical pairs... | |
103 | ||
104 | if (pair->Track1()->Track()->TPCncls()>pair->Track2()->Track()->TPCncls()) | |
105 | fNclsTPCMinNumerator->Fill(tQinv, pair->Track2()->Track()->TPCncls()); | |
106 | else | |
107 | fNclsTPCMinNumerator->Fill(tQinv, pair->Track1()->Track()->TPCncls()); | |
108 | } | |
109 | //____________________________ | |
110 | void AliFemtoCorrFctnTPCNcls::AddMixedPair( AliFemtoPair* pair){ | |
111 | // add mixed (background) pair | |
112 | double tQinv = fabs(pair->QInv()); // note - qInv() will be negative for identical pairs... | |
113 | ||
114 | if (pair->Track1()->Track()->TPCncls()>pair->Track2()->Track()->TPCncls()) | |
115 | fNclsTPCMinDenominator->Fill(tQinv, pair->Track2()->Track()->TPCncls()); | |
116 | else | |
117 | fNclsTPCMinDenominator->Fill(tQinv, pair->Track1()->Track()->TPCncls()); | |
118 | } | |
119 | ||
120 | ||
121 | void AliFemtoCorrFctnTPCNcls::WriteHistos() | |
122 | { | |
123 | // Write out result histograms | |
124 | fNclsTPCMinNumerator->Write(); | |
125 | fNclsTPCMinDenominator->Write(); | |
126 | } | |
127 | ||
128 | TList* AliFemtoCorrFctnTPCNcls::GetOutputList() | |
129 | { | |
130 | // Prepare the list of objects to be written to the output | |
131 | TList *tOutputList = new TList(); | |
132 | ||
133 | tOutputList->Add(fNclsTPCMinNumerator); | |
134 | tOutputList->Add(fNclsTPCMinDenominator); | |
135 | ||
136 | return tOutputList; | |
137 | ||
138 | } |