Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoQinvCorrFctnEMCIC.cxx
CommitLineData
fa35b516 1/***************************************************************************
2 *
3 * $Id: AliFemtoQinvCorrFctnEMCIC.cxx $
4 *
5 * Author: Nicolas Bock, Ohio State University, bock@mps.ohio-state.edu
6 ***************************************************************************
7 *
8 * Description: Calculates of the Qinv Correlation Function, and also
9 * produces histograms to calculate EMCICs
10 *
11 ***************************************************************************
12 *
13 **************************************************************************/
14
15
16#include "AliFemtoQinvCorrFctnEMCIC.h"
17//#include "AliFemtoHisto.h"
18#include <cstdio>
19#include <TVector2.h>
20
21#ifdef __ROOT__
22ClassImp(AliFemtoQinvCorrFctnEMCIC)
23#endif
24
25//____________________________
26AliFemtoQinvCorrFctnEMCIC::AliFemtoQinvCorrFctnEMCIC(char* title, const int& nbins, const float& QinvLo, const float& QinvHi):
27AliFemtoQinvCorrFctn(title, nbins, QinvLo, QinvHi),
943d9a85 28/*fESumReal(0),
fa35b516 29 fEMultReal(0),
30 fPtMultReal(0),
943d9a85 31 fPzMultReal(0),*/
fa35b516 32 fESumMix(0),
33 fEMultMix(0),
34 fPtMultMix(0),
35 fPzMultMix(0)
36
37{
38
39
40 // set up emcic histograms
943d9a85 41 /*char tTitESum[100] = "ESumReal";
adecdc37 42 strncat(tTitESum,title, 100);
fa35b516 43 fESumReal = new TH1D(tTitESum,title,nbins,QinvLo,QinvHi);
44 char tTitEMult[100] = "EMultReal";
adecdc37 45 strncat(tTitEMult,title, 100);
fa35b516 46 fEMultReal = new TH1D(tTitEMult,title,nbins,QinvLo,QinvHi);
47 char tTitPt[100] = "PtMultReal";
adecdc37 48 strncat(tTitPt,title, 100);
fa35b516 49 fPtMultReal = new TH1D(tTitPt,title,nbins,QinvLo,QinvHi);
50 char tTitPz[100] = "PzMultReal";
adecdc37 51 strncat(tTitPz,title, 100);
943d9a85 52 fPzMultReal = new TH1D(tTitPz,title,nbins,QinvLo,QinvHi);*/
fa35b516 53
cf770285 54 char tTitESum2[101] = "ESumMix";
adecdc37 55 strncat(tTitESum2,title, 100);
fa35b516 56 fESumMix = new TH1D(tTitESum2,title,nbins,QinvLo,QinvHi);
cf770285 57 char tTitEMult2[101] = "EMultMix";
adecdc37 58 strncat(tTitEMult2,title, 100);
fa35b516 59 fEMultMix = new TH1D(tTitEMult2,title,nbins,QinvLo,QinvHi);
cf770285 60 char tTitPt2[101] = "PtMultMix";
adecdc37 61 strncat(tTitPt2,title, 100);
fa35b516 62 fPtMultMix = new TH1D(tTitPt2,title,nbins,QinvLo,QinvHi);
cf770285 63 char tTitPz2[101] = "PzMultMix";
adecdc37 64 strncat(tTitPz2,title, 100);
fa35b516 65 fPzMultMix = new TH1D(tTitPz2,title,nbins,QinvLo,QinvHi);
66
67
68
69 // to enable error bar calculation...
70
943d9a85 71 /* fESumReal->Sumw2();
fa35b516 72 fEMultReal->Sumw2();
73 fPtMultReal->Sumw2();
943d9a85 74 fPzMultReal->Sumw2();*/
fa35b516 75 fESumMix->Sumw2();
76 fEMultMix->Sumw2();
77 fPtMultMix->Sumw2();
78 fPzMultMix->Sumw2();
79}
80
81//____________________________
82AliFemtoQinvCorrFctnEMCIC::AliFemtoQinvCorrFctnEMCIC(const AliFemtoQinvCorrFctnEMCIC& aCorrFctn) :
83 AliFemtoQinvCorrFctn(aCorrFctn),
943d9a85 84 /*fESumReal(0),
fa35b516 85 fEMultReal(0),
86 fPtMultReal(0),
943d9a85 87 fPzMultReal(0),*/
fa35b516 88 fESumMix(0),
89 fEMultMix(0),
90 fPtMultMix(0),
91 fPzMultMix(0)
92{
93 // copy constructor
94
943d9a85 95 /*fESumReal= new TH1D(*aCorrFctn.fESumReal);
fa35b516 96 fEMultReal= new TH1D(*aCorrFctn.fEMultReal);
97 fPtMultReal= new TH1D(*aCorrFctn.fPtMultReal);
943d9a85 98 fPzMultReal= new TH1D(*aCorrFctn.fPzMultReal);*/
fa35b516 99 fESumMix= new TH1D(*aCorrFctn.fESumMix);
100 fEMultMix= new TH1D(*aCorrFctn.fEMultMix);
101 fPtMultMix= new TH1D(*aCorrFctn.fPtMultMix);
102 fPzMultMix= new TH1D(*aCorrFctn.fPzMultMix);
103
104}
105//____________________________
106AliFemtoQinvCorrFctnEMCIC::~AliFemtoQinvCorrFctnEMCIC(){
107 // destructor
108
943d9a85 109 /*delete fESumReal;
fa35b516 110 delete fEMultReal;
111 delete fPtMultReal;
943d9a85 112 delete fPzMultReal;*/
fa35b516 113 delete fESumMix;
114 delete fEMultMix;
115 delete fPtMultMix;
116 delete fPzMultMix;
117
118}
119//_________________________
120AliFemtoQinvCorrFctnEMCIC& AliFemtoQinvCorrFctnEMCIC::operator=(const AliFemtoQinvCorrFctnEMCIC& aCorrFctn)
121{
122 // assignment operator
123 if (this == &aCorrFctn)
124 return *this;
125
943d9a85 126 /*if (fESumReal) delete fESumReal;
fa35b516 127 fESumReal= new TH1D(*aCorrFctn.fESumReal);
128 if (fEMultReal) delete fEMultReal;
129 fEMultReal= new TH1D(*aCorrFctn.fEMultReal);
130 if (fPtMultReal) delete fPtMultReal;
131 fPtMultReal= new TH1D(*aCorrFctn.fPtMultReal);
132 if (fPzMultReal) delete fPzMultReal;
133 fPzMultReal= new TH1D(*aCorrFctn.fPzMultReal);
943d9a85 134 if (fESumMix) delete fESumMix;*/
135
fa35b516 136 fESumMix= new TH1D(*aCorrFctn.fESumMix);
137 if (fEMultMix) delete fEMultMix;
138 fEMultMix= new TH1D(*aCorrFctn.fEMultMix);
139 if (fPtMultMix) delete fPtMultMix;
140 fPtMultMix= new TH1D(*aCorrFctn.fPtMultMix);
141 if (fPzMultMix) delete fPzMultMix;
142 fPzMultMix= new TH1D(*aCorrFctn.fPzMultMix);
143
144 return *this;
145}
146
147//____________________________
148void AliFemtoQinvCorrFctnEMCIC::AddRealPair(AliFemtoPair* pair){
149 // add true pair
943d9a85 150
fa35b516 151 if (fPairCut)
152 if (!fPairCut->Pass(pair)) return;
943d9a85 153 AliFemtoQinvCorrFctn::AddRealPair(pair);
154
155
156 //double tQinv = fabs(pair->QInv()); // note - qInv() will be negative for identical pairs...
fa35b516 157
fa35b516 158// The EMCICs are calculated here for real pairs
943d9a85 159 /*AliFemtoLorentzVector tMom1 = pair->Track1()->FourMomentum();
fa35b516 160 AliFemtoLorentzVector tMom2 = pair->Track2()->FourMomentum();
161 double tE1 = tMom1.e();
162 double tE2 = tMom2.e();
163 double tPz1 = tMom1.pz();
164 double tPz2 = tMom2.pz();
fa35b516 165
943d9a85 166 TVector2 tPt1;
167 TVector2 tPt2;
fa35b516 168 tPt1.Set(tMom1.px(),tMom1.py());
169 tPt2.Set(tMom2.px(),tMom2.py());
943d9a85 170 double tPt1DotPt2 = tPt1*tPt2;
fa35b516 171
172 fESumReal->Fill(tQinv,tE1+tE2);
173 fEMultReal->Fill(tQinv,tE1*tE2);
174 fPzMultReal->Fill(tQinv,tPz1*tPz2);
943d9a85 175 fPtMultReal->Fill(tQinv,tPt1DotPt2);*/
fa35b516 176
177}
178//____________________________
179void AliFemtoQinvCorrFctnEMCIC::AddMixedPair(AliFemtoPair* pair){
180 // add mixed (background) pair
181 if (fPairCut)
182 if (!fPairCut->Pass(pair)) return;
943d9a85 183 AliFemtoQinvCorrFctn::AddMixedPair(pair);
fa35b516 184 double tQinv = fabs(pair->QInv()); // note - qInv() will be negative for identical pairs...
185
186
187 // The EMCICs are calculated here for mixed pairs
188 AliFemtoLorentzVector tMom1 = pair->Track1()->FourMomentum();
189 AliFemtoLorentzVector tMom2 = pair->Track2()->FourMomentum();
190 double tE1 = tMom1.e();
191 double tE2 = tMom2.e();
192 double tPz1 = tMom1.pz();
193 double tPz2 = tMom2.pz();
fa35b516 194
943d9a85 195 TVector2 tPt1;
196 TVector2 tPt2;
fa35b516 197 tPt1.Set(tMom1.px(),tMom1.py());
198 tPt2.Set(tMom2.px(),tMom2.py());
943d9a85 199 double tPt1DotPt2 = tPt1*tPt2;
fa35b516 200
201 fESumMix->Fill(tQinv,tE1+tE2);
202 fEMultMix->Fill(tQinv,tE1*tE2);
203 fPzMultMix->Fill(tQinv,tPz1*tPz2);
204 fPtMultMix->Fill(tQinv,tPt1DotPt2);
205
206
207
208}
209//____________________________
210void AliFemtoQinvCorrFctnEMCIC::Write(){
211 // Write out neccessary objects
943d9a85 212 AliFemtoQinvCorrFctn::Write(); //Write num and den
213 /*fESumReal->Write();
fa35b516 214 fEMultReal->Write();
215 fPtMultReal->Write();
943d9a85 216 fPzMultReal->Write(); */
fa35b516 217 fESumMix->Write();
218 fEMultMix->Write();
219 fPtMultMix->Write();
220 fPzMultMix->Write();
221
222}
223//______________________________
224TList* AliFemtoQinvCorrFctnEMCIC::GetOutputList()
225{
226 // Prepare the list of objects to be written to the output
adecdc37 227 TList *tOutputList;
943d9a85 228 tOutputList = (TList*)AliFemtoQinvCorrFctn::GetOutputList();
fa35b516 229 cout << "Getting list from Qinv CF emicic" << endl;
943d9a85 230 /*tOutputList->Add(fESumReal);
fa35b516 231 tOutputList->Add(fEMultReal);
232 tOutputList->Add(fPtMultReal);
943d9a85 233 tOutputList->Add(fPzMultReal); */
fa35b516 234 tOutputList->Add(fESumMix);
235 tOutputList->Add(fEMultMix);
236 tOutputList->Add(fPtMultMix);
237 tOutputList->Add(fPzMultMix);
238 return tOutputList;
239}
240
241