]>
Commit | Line | Data |
---|---|---|
0852acd0 | 1 | /**************************************************************************\r |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r | |
3 | * *\r | |
4 | * Author: The ALICE Off-line Project. *\r | |
5 | * Contributors are mentioned in the code where appropriate. *\r | |
6 | * *\r | |
7 | * Permission to use, copy, modify and distribute this software and its *\r | |
8 | * documentation strictly for non-commercial purposes is hereby granted *\r | |
9 | * without fee, provided that the above copyright notice appears in all *\r | |
10 | * copies and that both the copyright notice and this permission notice *\r | |
11 | * appear in the supporting documentation. The authors make no claims *\r | |
12 | * about the suitability of this software for any purpose. It is *\r | |
13 | * provided "as is" without express or implied warranty. *\r | |
14 | **************************************************************************/\r | |
15 | /* $Id: $ */\r | |
16 | //_________________________________________________________________________\r | |
17 | // class to extract omega(782)->pi0+gamma->3gamma\r | |
18 | //\r | |
19 | //-- Author: Renzhuo Wan (IOPP-Wuhan, China)\r | |
20 | //_________________________________________________________________________\r | |
21 | \r | |
22 | // --- ROOT system\r | |
23 | class TROOT;\r | |
24 | \r | |
25 | // --- AliRoot system\r | |
26 | //class AliVEvent;\r | |
27 | // --- ROOT system ---\r | |
28 | #include "TH2F.h"\r | |
29 | #include "TLorentzVector.h"\r | |
30 | #include "TParticle.h"\r | |
31 | #include "TCanvas.h"\r | |
32 | #include "TFile.h"\r | |
33 | //---- AliRoot system ----\r | |
34 | #include "AliAnaOmegaToPi0Gamma.h"\r | |
35 | #include "AliCaloTrackReader.h"\r | |
36 | #include "AliCaloPID.h"\r | |
37 | #include "AliStack.h"\r | |
38 | #include "AliVEvent.h"\r | |
39 | #include "AliAODEvent.h"\r | |
40 | #include "AliAODMCParticle.h"\r | |
41 | ClassImp(AliAnaOmegaToPi0Gamma)\r | |
42 | \r | |
43 | //______________________________________________________________________________\r | |
44 | AliAnaOmegaToPi0Gamma::AliAnaOmegaToPi0Gamma() : AliAnaPartCorrBaseClass(),\r | |
45 | fInputAODGamma(0),fInputAODPi0(0), fInputAODGammaName(""),\r | |
f6862ceb | 46 | fEventsList(0),fNVtxZBin(1), fNCentBin(1), fNRpBin(1), fNBadChDistBin(3), fNpid(3),\r |
47 | fNmaxMixEv(4), fVtxZCut(0), fCent(0), fRp(0), \r | |
d5b2a3f1 | 48 | fPi0Mass(0.13498),fPi0MassWindow(0.015),fPi0OverOmegaPtCut(0.8),\r |
49 | fGammaOverOmegaPtCut(0.3),\r | |
0852acd0 | 50 | fhEtalon(0),\r |
d5b2a3f1 | 51 | fRealOmega0(0), fMixAOmega0(0),\r |
52 | fMixBOmega0(0), fMixCOmega0(0),\r | |
0852acd0 | 53 | fRealOmega1(0), fMixAOmega1(0),\r |
54 | fMixBOmega1(0), fMixCOmega1(0),\r | |
55 | fRealOmega2(0), fMixAOmega2(0),\r | |
56 | fMixBOmega2(0), fMixCOmega2(0),\r | |
57 | fhOmegaPriPt(0)\r | |
58 | {\r | |
59 | //Default Ctor\r | |
0852acd0 | 60 | }\r |
61 | \r | |
62 | //______________________________________________________________________________\r | |
63 | AliAnaOmegaToPi0Gamma::AliAnaOmegaToPi0Gamma(const AliAnaOmegaToPi0Gamma & ex) : AliAnaPartCorrBaseClass(ex),\r | |
64 | fInputAODGamma(new TClonesArray (*ex.fInputAODGamma)), \r | |
65 | fInputAODPi0(new TClonesArray (*ex.fInputAODPi0)),\r | |
66 | fInputAODGammaName(ex.fInputAODGammaName),\r | |
67 | fEventsList(ex.fEventsList), \r | |
0852acd0 | 68 | fNVtxZBin(ex.fNVtxZBin), fNCentBin(ex.fNCentBin), fNRpBin(ex.fNRpBin),\r |
d5b2a3f1 | 69 | fNBadChDistBin(ex.fNBadChDistBin),fNpid(ex.fNpid),\r |
70 | fNmaxMixEv(ex.fNmaxMixEv),\r | |
f6862ceb | 71 | fVtxZCut(ex.fVtxZCut), fCent(ex.fCent), fRp(ex.fRp), \r |
d5b2a3f1 | 72 | fPi0Mass(ex.fPi0Mass),\r |
73 | fPi0MassWindow(ex.fPi0MassWindow),\r | |
74 | fPi0OverOmegaPtCut(ex.fPi0OverOmegaPtCut),\r | |
75 | fGammaOverOmegaPtCut(ex.fGammaOverOmegaPtCut),\r | |
0852acd0 | 76 | fhEtalon(ex.fhEtalon),\r |
d5b2a3f1 | 77 | fRealOmega0(ex.fRealOmega0), fMixAOmega0(ex.fMixAOmega0),\r |
78 | fMixBOmega0(ex.fMixBOmega0), fMixCOmega0(ex.fMixCOmega0),\r | |
0852acd0 | 79 | fRealOmega1(ex.fRealOmega1), fMixAOmega1(ex.fMixAOmega1),\r |
80 | fMixBOmega1(ex.fMixBOmega1), fMixCOmega1(ex.fMixCOmega1),\r | |
81 | fRealOmega2(ex.fRealOmega2), fMixAOmega2(ex.fMixAOmega2),\r | |
82 | fMixBOmega2(ex.fMixBOmega2), fMixCOmega2(ex.fMixCOmega2),\r | |
83 | fhOmegaPriPt(ex.fhOmegaPriPt)\r | |
84 | {\r | |
85 | // cpy ctor\r | |
86 | //Do not need it\r | |
87 | }\r | |
88 | \r | |
89 | //______________________________________________________________________________\r | |
90 | AliAnaOmegaToPi0Gamma & AliAnaOmegaToPi0Gamma::operator = (const AliAnaOmegaToPi0Gamma & ex)\r | |
91 | {\r | |
92 | // assignment operator\r | |
c5b989a8 | 93 | \r |
0852acd0 | 94 | if(this == &ex)return *this;\r |
95 | ((AliAnaPartCorrBaseClass *)this)->operator=(ex);\r | |
96 | fInputAODGamma = new TClonesArray(*ex.fInputAODGamma);\r | |
97 | fInputAODPi0 = new TClonesArray(*ex.fInputAODPi0);\r | |
98 | // fInputAODGamma=ex.fInputAODGamma;\r | |
99 | // fInputAODPi0=ex.fInputAODPi0;\r | |
100 | fInputAODGammaName = ex.fInputAODGammaName;\r | |
101 | fEventsList = ex.fEventsList;\r | |
102 | \r | |
d5b2a3f1 | 103 | fNVtxZBin=ex.fNVtxZBin;\r |
0852acd0 | 104 | fNCentBin=ex.fNCentBin;\r |
105 | fNRpBin=ex.fNRpBin;\r | |
106 | fNBadChDistBin=ex.fNBadChDistBin;\r | |
107 | fNpid=ex.fNpid;\r | |
0852acd0 | 108 | fNmaxMixEv =ex.fNmaxMixEv;\r |
d5b2a3f1 | 109 | \r |
110 | fVtxZCut=ex.fVtxZCut;\r | |
111 | fCent=ex.fCent;\r | |
112 | fRp=ex.fRp;\r | |
d5b2a3f1 | 113 | \r |
0852acd0 | 114 | fPi0Mass=ex.fPi0Mass;\r |
115 | fPi0MassWindow=ex.fPi0MassWindow;\r | |
4007d0a2 | 116 | fPi0OverOmegaPtCut=ex.fPi0OverOmegaPtCut;\r |
117 | fGammaOverOmegaPtCut=ex.fGammaOverOmegaPtCut;\r | |
0852acd0 | 118 | \r |
0852acd0 | 119 | fhEtalon=ex.fhEtalon;\r |
d5b2a3f1 | 120 | fRealOmega0=ex.fRealOmega0;\r |
121 | fMixAOmega0=ex.fMixAOmega0;\r | |
122 | fMixBOmega0=ex.fMixBOmega0;\r | |
123 | fMixCOmega0=ex.fMixCOmega0;\r | |
0852acd0 | 124 | fRealOmega1=ex.fRealOmega1;\r |
125 | fMixAOmega1=ex.fMixAOmega1;\r | |
126 | fMixBOmega1=ex.fMixBOmega1;\r | |
127 | fMixCOmega1=ex.fMixCOmega1;\r | |
128 | fRealOmega2=ex.fRealOmega2;\r | |
129 | fMixAOmega2=ex.fMixAOmega2;\r | |
130 | fMixBOmega2=ex.fMixBOmega2;\r | |
131 | fMixCOmega2=ex.fMixCOmega2;\r | |
132 | fhOmegaPriPt=ex.fhOmegaPriPt;\r | |
133 | return *this;\r | |
134 | \r | |
135 | }\r | |
136 | \r | |
137 | //______________________________________________________________________________\r | |
138 | AliAnaOmegaToPi0Gamma::~AliAnaOmegaToPi0Gamma() {\r | |
139 | \r | |
140 | //dtor\r | |
141 | if(fInputAODGamma){\r | |
142 | fInputAODGamma->Clear();\r | |
143 | delete fInputAODGamma;\r | |
144 | }\r | |
145 | \r | |
146 | if(fInputAODPi0){\r | |
147 | fInputAODPi0->Clear();\r | |
148 | delete fInputAODPi0;\r | |
149 | } \r | |
150 | \r | |
151 | if(fEventsList){\r | |
152 | for(Int_t i=0;i<fNVtxZBin;i++){\r | |
153 | for(Int_t j=0;j<fNCentBin;j++){\r | |
154 | for(Int_t k=0;k<fNRpBin;k++){\r | |
155 | fEventsList[i*fNCentBin*fNRpBin+j*fNRpBin+k]->Clear();\r | |
156 | delete fEventsList[i*fNCentBin*fNRpBin+j*fNRpBin+k];\r | |
157 | }\r | |
158 | }\r | |
159 | }\r | |
160 | }\r | |
161 | delete [] fEventsList;\r | |
162 | fEventsList=0;\r | |
d5b2a3f1 | 163 | \r |
164 | delete [] fVtxZCut;\r | |
165 | delete [] fCent;\r | |
166 | delete [] fRp;\r | |
d5b2a3f1 | 167 | \r |
0852acd0 | 168 | }\r |
169 | \r | |
170 | //______________________________________________________________________________\r | |
171 | void AliAnaOmegaToPi0Gamma::InitParameters()\r | |
172 | {\r | |
173 | //Init parameters when first called the analysis\r | |
174 | //Set default parameters\r | |
0852acd0 | 175 | fVtxZCut = new Double_t [fNVtxZBin];\r |
4007d0a2 | 176 | for(Int_t i=0;i<fNVtxZBin;i++) fVtxZCut[i]=10*(i+1);\r |
0852acd0 | 177 | \r |
178 | fCent=new Double_t[fNCentBin];\r | |
c5b989a8 | 179 | for(int i = 0;i<fNCentBin;i++)fCent[i]=0;\r |
0852acd0 | 180 | \r |
181 | fRp=new Double_t[fNRpBin];\r | |
c5b989a8 | 182 | for(int i = 0;i<fNRpBin;i++)fRp[i]=0;\r |
0852acd0 | 183 | \r |
0852acd0 | 184 | }\r |
185 | \r | |
186 | \r | |
187 | //______________________________________________________________________________\r | |
188 | TList * AliAnaOmegaToPi0Gamma::GetCreateOutputObjects()\r | |
d5b2a3f1 | 189 | {\r |
190 | InitParameters();\r | |
4007d0a2 | 191 | \r |
192 | Int_t nptbins = GetHistoPtBins();\r | |
193 | Float_t ptmax = GetHistoPtMax();\r | |
194 | Float_t ptmin = GetHistoPtMin();\r | |
195 | \r | |
196 | Int_t nmassbins = GetHistoMassBins();\r | |
197 | Float_t massmin = GetHistoMassMin();\r | |
198 | Float_t massmax = GetHistoMassMax();\r | |
199 | \r | |
200 | fhEtalon = new TH2F("hEtalon","Histo with binning parameters", nptbins,ptmin,ptmax,nmassbins,massmin,massmax) ;\r | |
201 | fhEtalon->SetXTitle("P_{T} (GeV)") ;\r | |
202 | fhEtalon->SetYTitle("m_{inv} (GeV)") ;\r | |
203 | \r | |
0852acd0 | 204 | // store them in fOutputContainer\r |
205 | fEventsList = new TList*[fNVtxZBin*fNCentBin*fNRpBin];\r | |
206 | for(Int_t i=0;i<fNVtxZBin;i++){\r | |
207 | for(Int_t j=0;j<fNCentBin;j++){\r | |
208 | for(Int_t k=0;k<fNRpBin;k++){\r | |
209 | fEventsList[i*fNCentBin*fNRpBin+j*fNRpBin+k]=new TList();\r | |
210 | }\r | |
211 | }\r | |
212 | }\r | |
213 | \r | |
214 | \r | |
215 | TList * outputContainer = new TList() ; \r | |
216 | outputContainer->SetName(GetName());\r | |
217 | char key[255] ;\r | |
218 | char title[255] ;\r | |
219 | const char * detector= fInputAODGammaName.Data();\r | |
220 | Int_t ndim=fNVtxZBin*fNCentBin*fNRpBin*fNBadChDistBin*fNpid;\r | |
221 | \r | |
d5b2a3f1 | 222 | fRealOmega0 =new TH2F*[ndim];\r |
223 | fMixAOmega0 =new TH2F*[ndim];\r | |
224 | fMixBOmega0 =new TH2F*[ndim];\r | |
225 | fMixCOmega0 =new TH2F*[ndim];\r | |
0852acd0 | 226 | \r |
227 | fRealOmega1 =new TH2F*[ndim];\r | |
228 | fMixAOmega1 =new TH2F*[ndim];\r | |
229 | fMixBOmega1 =new TH2F*[ndim];\r | |
230 | fMixCOmega1 =new TH2F*[ndim];\r | |
231 | \r | |
232 | fRealOmega2 =new TH2F*[ndim];\r | |
233 | fMixAOmega2 =new TH2F*[ndim];\r | |
234 | fMixBOmega2 =new TH2F*[ndim];\r | |
235 | fMixCOmega2 =new TH2F*[ndim];\r | |
236 | \r | |
237 | for(Int_t i=0;i<fNVtxZBin;i++){\r | |
238 | for(Int_t j=0;j<fNCentBin;j++){\r | |
239 | for(Int_t k=0;k<fNRpBin;k++){ //at event level\r | |
240 | Int_t idim=i*fNCentBin*fNRpBin+j*fNRpBin+k;\r | |
241 | for(Int_t ipid=0;ipid<fNpid;ipid++){\r | |
242 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){ //at particle level\r | |
243 | \r | |
244 | Int_t index=idim*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
245 | \r | |
d5b2a3f1 | 246 | sprintf(key,"RealToPi0Gamma_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 247 | sprintf(title, "%s Real Pi0GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 248 | fhEtalon->Clone(key);\r |
d5b2a3f1 | 249 | fRealOmega0[index]=(TH2F*)fhEtalon->Clone(key) ;\r |
250 | fRealOmega0[index]->SetName(key) ;\r | |
251 | fRealOmega0[index]->SetTitle(title);\r | |
252 | outputContainer->Add(fRealOmega0[index]);\r | |
0852acd0 | 253 | \r |
d5b2a3f1 | 254 | sprintf(key,"MixAToPi0Gamma_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 255 | sprintf(title, "%s MixA Pi0GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 256 | fhEtalon->Clone(key);\r |
d5b2a3f1 | 257 | fMixAOmega0[index]=(TH2F*)fhEtalon->Clone(key) ;\r |
258 | fMixAOmega0[index]->SetName(key) ;\r | |
259 | fMixAOmega0[index]->SetTitle(title);\r | |
260 | outputContainer->Add(fMixAOmega0[index]);\r | |
0852acd0 | 261 | \r |
d5b2a3f1 | 262 | sprintf(key,"MixBToPi0Gamma_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 263 | sprintf(title, "%s MixB Pi0GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 264 | fhEtalon->Clone(key);\r |
d5b2a3f1 | 265 | fMixBOmega0[index]=(TH2F*)fhEtalon->Clone(key) ;\r |
266 | fMixBOmega0[index]->SetName(key) ;\r | |
267 | fMixBOmega0[index]->SetTitle(title);\r | |
268 | outputContainer->Add(fMixBOmega0[index]);\r | |
0852acd0 | 269 | \r |
d5b2a3f1 | 270 | sprintf(key,"MixCToPi0Gamma_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 271 | sprintf(title, "%s MixC Pi0GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 272 | fhEtalon->Clone(key);\r |
d5b2a3f1 | 273 | fMixCOmega0[index]=(TH2F*)fhEtalon->Clone(key) ;\r |
274 | fMixCOmega0[index]->SetName(key) ;\r | |
275 | fMixCOmega0[index]->SetTitle(title);\r | |
276 | outputContainer->Add(fMixCOmega0[index]);\r | |
0852acd0 | 277 | \r |
d5b2a3f1 | 278 | sprintf(key,"RealToPi0Gamma1_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 279 | sprintf(title, "%s Real Pi0(A<0.7)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 280 | fhEtalon->Clone(key);\r |
281 | fRealOmega1[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
282 | fRealOmega1[index]->SetName(key) ;\r | |
283 | fRealOmega1[index]->SetTitle(title);\r | |
284 | outputContainer->Add(fRealOmega1[index]);\r | |
285 | \r | |
d5b2a3f1 | 286 | sprintf(key,"MixAToPi0Gamma1_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 287 | sprintf(title, "%s MixA Pi0(A<0.7)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 288 | fhEtalon->Clone(key);\r |
289 | fMixAOmega1[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
290 | fMixAOmega1[index]->SetName(key) ;\r | |
291 | fMixAOmega1[index]->SetTitle(title);\r | |
292 | outputContainer->Add(fMixAOmega1[index]);\r | |
293 | \r | |
d5b2a3f1 | 294 | sprintf(key,"MixBToPi0Gamma1_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 295 | sprintf(title, "%s MixB Pi0(A<0.7)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 296 | fhEtalon->Clone(key);\r |
297 | fMixBOmega1[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
298 | fMixBOmega1[index]->SetName(key) ;\r | |
299 | fMixBOmega1[index]->SetTitle(title);\r | |
300 | outputContainer->Add(fMixBOmega1[index]);\r | |
301 | \r | |
d5b2a3f1 | 302 | sprintf(key,"MixCToPi0Gamma1_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 303 | sprintf(title, "%s MixC Pi0(A<0.7)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 304 | fhEtalon->Clone(key);\r |
305 | fMixCOmega1[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
306 | fMixCOmega1[index]->SetName(key) ;\r | |
307 | fMixCOmega1[index]->SetTitle(title);\r | |
308 | outputContainer->Add(fMixCOmega1[index]);\r | |
309 | \r | |
d5b2a3f1 | 310 | sprintf(key,"RealToPi0Gamma2_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 311 | sprintf(title, "%s Real Pi0(A<0.8)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 312 | fhEtalon->Clone(key);\r |
313 | fRealOmega2[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
314 | fRealOmega2[index]->SetName(key) ;\r | |
315 | fRealOmega2[index]->SetTitle(title);\r | |
316 | outputContainer->Add(fRealOmega2[index]);\r | |
317 | \r | |
d5b2a3f1 | 318 | sprintf(key,"MixAToPi0Gamma2_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 319 | sprintf(title, "%s MixA Pi0(A<0.8)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 320 | fhEtalon->Clone(key);\r |
321 | fMixAOmega2[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
322 | fMixAOmega2[index]->SetName(key) ;\r | |
323 | fMixAOmega2[index]->SetTitle(title);\r | |
324 | outputContainer->Add(fMixAOmega2[index]);\r | |
325 | \r | |
d5b2a3f1 | 326 | sprintf(key,"MixBToPi0Gamma2_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 327 | sprintf(title, "%s MixB Pi0(A<0.8)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 328 | fhEtalon->Clone(key);\r |
329 | fMixBOmega2[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
330 | fMixBOmega2[index]->SetName(key) ;\r | |
331 | fMixBOmega2[index]->SetTitle(title);\r | |
332 | outputContainer->Add(fMixBOmega2[index]);\r | |
333 | \r | |
d5b2a3f1 | 334 | sprintf(key,"MixCToPi0Gamma2_Vz%dC%dRp%dPid%dDist%d",i,j,k,ipid,idist);\r |
f6862ceb | 335 | sprintf(title, "%s MixC Pi0(A<0.8)GammaIVM vz_%2.1f_ct_%2.1f_Rp_%2.1f_pid_%d_dist_%d",detector,fVtxZCut[i],fCent[j],fRp[k],ipid,idist);\r |
0852acd0 | 336 | fhEtalon->Clone(key);\r |
337 | fMixCOmega2[index]=(TH2F*)fhEtalon->Clone(key) ;\r | |
338 | fMixCOmega2[index]->SetName(key) ;\r | |
339 | fMixCOmega2[index]->SetTitle(title);\r | |
340 | outputContainer->Add(fMixCOmega2[index]);\r | |
341 | }\r | |
342 | }\r | |
343 | }\r | |
344 | } \r | |
345 | }\r | |
346 | \r | |
347 | if(IsDataMC()){\r | |
348 | sprintf(key, "%sOmegaPri",detector);\r | |
349 | sprintf(title,"primary #omega in %s",detector);\r | |
4007d0a2 | 350 | fhOmegaPriPt=new TH1F(key, title,nptbins,ptmin,ptmax);\r |
0852acd0 | 351 | fhOmegaPriPt->GetXaxis()->SetTitle("P_{T}");\r |
352 | fhOmegaPriPt->GetYaxis()->SetTitle("dN/P_{T}");\r | |
353 | outputContainer->Add(fhOmegaPriPt);\r | |
354 | }\r | |
355 | \r | |
356 | delete fhEtalon;\r | |
357 | return outputContainer;\r | |
358 | }\r | |
359 | \r | |
360 | //______________________________________________________________________________\r | |
361 | void AliAnaOmegaToPi0Gamma::Print(const Option_t * /*opt*/) const\r | |
362 | {\r | |
363 | //Print some relevant parameters set in the analysis\r | |
364 | printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;\r | |
365 | AliAnaPartCorrBaseClass::Print(" ");\r | |
366 | printf("Omega->pi0+gamma->3gamma\n");\r | |
367 | printf("Cuts at event level: \n");\r | |
368 | printf("Bins of vertex Z: %d \n", fNVtxZBin);\r | |
369 | printf("Bins of centrality: %d \n",fNCentBin);\r | |
370 | printf("Bins of Reaction plane: %d\n",fNRpBin);\r | |
371 | printf("Cuts at AOD particle level:\n");\r | |
372 | printf("Number of PID: %d \n", fNpid);\r | |
373 | printf("Number of DistToBadChannel cuts: %d\n", fNBadChDistBin);\r | |
374 | printf("number of events buffer to be mixed: %d\n",fNmaxMixEv);\r | |
375 | } \r | |
376 | \r | |
377 | //______________________________________________________________________________\r | |
378 | void AliAnaOmegaToPi0Gamma::MakeAnalysisFillHistograms() \r | |
379 | {\r | |
380 | //fill the MC AOD if needed first\r | |
381 | //-----------\r | |
382 | //need to be further implemented\r | |
383 | AliStack * stack = 0x0;\r | |
384 | // TParticle * primary = 0x0;\r | |
385 | TClonesArray * mcparticles0 = 0x0;\r | |
386 | TClonesArray * mcparticles1 = 0x0;\r | |
387 | AliAODMCParticle * aodprimary = 0x0;\r | |
388 | Int_t pdg=0;\r | |
389 | Double_t pt=0;\r | |
390 | Double_t eta=0;\r | |
391 | \r | |
392 | if(IsDataMC()){\r | |
393 | if(GetReader()->ReadStack()){\r | |
394 | stack = GetMCStack() ;\r | |
395 | if(!stack)\r | |
396 | printf("AliAnaAcceptance::MakeAnalysisFillHistograms() - There is no stack!\n");\r | |
397 | for(Int_t i=0 ; i<stack->GetNtrack(); i++){\r | |
398 | TParticle * prim = stack->Particle(i) ;\r | |
399 | pdg = prim->GetPdgCode() ;\r | |
400 | eta=prim->Eta();\r | |
401 | pt=prim->Pt();\r | |
402 | if(TMath::Abs(eta)<0.5) {\r | |
403 | if(pdg==223) fhOmegaPriPt->Fill(pt);\r | |
404 | }\r | |
405 | }\r | |
406 | }\r | |
407 | else if(GetReader()->ReadAODMCParticles()){\r | |
408 | //Get the list of MC particles\r | |
409 | mcparticles0 = GetReader()->GetAODMCParticles(0);\r | |
410 | if(!mcparticles0 && GetDebug() > 0) {\r | |
411 | printf("AliAnaAcceptance::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");\r | |
412 | }\r | |
413 | if(GetReader()->GetSecondInputAODTree()){\r | |
414 | mcparticles1 = GetReader()->GetAODMCParticles(1);\r | |
415 | if(!mcparticles1 && GetDebug() > 0) {\r | |
416 | printf("AliAnaAcceptance::MakeAnalysisFillHistograms() - Second input MCParticles not available!\n");\r | |
417 | }\r | |
418 | }\r | |
419 | for(Int_t i=0;i<mcparticles0->GetEntries();i++){\r | |
420 | aodprimary =(AliAODMCParticle*)mcparticles0->At(i);\r | |
421 | pdg = aodprimary->GetPdgCode() ;\r | |
422 | eta=aodprimary->Eta();\r | |
423 | pt=aodprimary->Pt();\r | |
424 | if(TMath::Abs(eta)<0.5) {\r | |
425 | if(pdg==223) fhOmegaPriPt->Fill(pt);\r | |
426 | }\r | |
427 | \r | |
428 | }\r | |
429 | }\r | |
430 | }// is data and MC\r | |
431 | \r | |
432 | \r | |
433 | //process event from AOD brach \r | |
434 | //extract pi0, eta and omega analysis\r | |
435 | Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ;\r | |
436 | if(IsBadRun(iRun)) return ; \r | |
437 | \r | |
438 | //vertex z\r | |
439 | Double_t vert[]={0,0,0} ;\r | |
440 | GetReader()->GetVertex(vert);\r | |
441 | Int_t curEventBin =0;\r | |
4007d0a2 | 442 | \r |
443 | Int_t ivtxzbin=(Int_t)TMath::Abs(vert[2])/10;\r | |
444 | if(ivtxzbin>=fNVtxZBin)return;\r | |
445 | \r | |
0852acd0 | 446 | //centrality\r |
447 | Int_t icentbin=0;\r | |
448 | \r | |
449 | //reaction plane\r | |
450 | Int_t irpbin=0;\r | |
451 | \r | |
452 | if(ivtxzbin==-1) return; \r | |
453 | curEventBin = ivtxzbin*fNCentBin*fNRpBin + icentbin*fNRpBin + irpbin;\r | |
454 | \r | |
455 | fInputAODGamma = GetAODBranch(fInputAODGammaName); //photon array\r | |
456 | //fInputAODGamma = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaName); //photon array\r | |
457 | Int_t nphotons = fInputAODGamma->GetEntries();\r | |
458 | \r | |
459 | fInputAODPi0 = (TClonesArray*)GetInputAODBranch(); //pi0 array\r | |
460 | Int_t npi0s = fInputAODPi0 ->GetEntries();\r | |
461 | \r | |
d5b2a3f1 | 462 | if(nphotons<3 || npi0s<1)return; //for pi0, eta and omega->pi0+gamma->3gamma reconstruction\r |
0852acd0 | 463 | \r |
0852acd0 | 464 | //reconstruction of omega(782)->pi0+gamma->3gamma\r |
465 | //loop for pi0 and photon\r | |
d5b2a3f1 | 466 | if(GetDebug() > 0) printf("omega->pi0+gamma->3gamma invariant mass analysis ! This event have %d photons and %d pi0 \n", nphotons, npi0s);\r |
0852acd0 | 467 | for(Int_t i=0;i<npi0s;i++){\r |
468 | AliAODPWG4Particle * pi0 = (AliAODPWG4Particle*) (fInputAODPi0->At(i)) ; //pi0\r | |
469 | TLorentzVector vpi0(pi0->Px(),pi0->Py(),pi0->Pz(),pi0->E());\r | |
470 | Int_t lab1=pi0->GetCaloLabel(0); // photon1 from pi0 decay\r | |
471 | Int_t lab2=pi0->GetCaloLabel(1); // photon2 from pi0 decay\r | |
472 | //for omega->pi0+gamma, it needs at least three photons per event\r | |
0852acd0 | 473 | //Get the two decay photons from pi0\r |
474 | AliAODPWG4Particle * photon1 =0;\r | |
475 | AliAODPWG4Particle * photon2 =0;\r | |
476 | for(Int_t d1=0;d1<nphotons;d1++){\r | |
477 | for(Int_t d2=0;d2<nphotons;d2++){\r | |
478 | AliAODPWG4Particle * dp1 = (AliAODPWG4Particle*) (fInputAODGamma->At(d1));\r | |
479 | AliAODPWG4Particle * dp2 = (AliAODPWG4Particle*) (fInputAODGamma->At(d2));\r | |
480 | Int_t dlab1=dp1->GetCaloLabel(0);\r | |
481 | Int_t dlab2=dp2->GetCaloLabel(0);\r | |
482 | if(dlab1==lab1 && dlab2==lab2){\r | |
483 | photon1=dp1;\r | |
484 | photon2=dp2;\r | |
485 | }\r | |
486 | else continue;\r | |
487 | }\r | |
488 | }\r | |
0852acd0 | 489 | //caculate the asy and dist of the two photon from pi0 decay\r |
490 | TLorentzVector dph1(photon1->Px(),photon1->Py(),photon1->Pz(),photon1->E());\r | |
491 | TLorentzVector dph2(photon2->Px(),photon2->Py(),photon2->Pz(),photon2->E());\r | |
492 | \r | |
493 | Double_t pi0asy= TMath::Abs(dph1.E()-dph2.E())/(dph1.E()+dph2.E());\r | |
494 | // Double_t phi1=dph1.Phi();\r | |
495 | // Double_t phi2=dph2.Phi();\r | |
496 | // Double_t eta1=dph1.Eta();\r | |
497 | // Double_t eta2=dph2.Eta();\r | |
498 | // Double_t pi0dist=TMath::Sqrt((phi1-phi2)*(phi1-phi2)+(eta1-eta2)*(eta1-eta2));\r | |
499 | \r | |
0852acd0 | 500 | if(pi0->GetPdg()==111 && nphotons>2 && npi0s\r |
501 | && TMath::Abs(vpi0.M()-fPi0Mass)<fPi0MassWindow) { //pi0 candidates\r | |
502 | \r | |
503 | //avoid the double counting\r | |
504 | Int_t * dc1= new Int_t[nphotons];\r | |
505 | Int_t * dc2= new Int_t[nphotons];\r | |
506 | Int_t index1=0;\r | |
507 | Int_t index2=0;\r | |
508 | for(Int_t k=0;k<i;k++){\r | |
509 | AliAODPWG4Particle * p3=(AliAODPWG4Particle*)(fInputAODPi0->At(k));\r | |
510 | Int_t lab4=p3->GetCaloLabel(0);\r | |
511 | Int_t lab5=p3->GetCaloLabel(1);\r | |
512 | if(lab1==lab4){ dc1[index1]=lab5; index1++; }\r | |
513 | if(lab2==lab5){ dc2[index2]=lab4; index2++; }\r | |
514 | }\r | |
515 | \r | |
516 | \r | |
517 | //loop the pi0 with third gamma\r | |
518 | for(Int_t j=0;j<nphotons;j++){\r | |
519 | AliAODPWG4Particle *photon3 = (AliAODPWG4Particle*) (fInputAODGamma->At(j));\r | |
520 | TLorentzVector dph3(photon3->Px(),photon3->Py(),photon3->Pz(),photon3->E());\r | |
521 | Int_t lab3=photon3->GetCaloLabel(0);\r | |
4007d0a2 | 522 | Double_t pi0gammapt=(vpi0+dph3).Pt();\r |
523 | Double_t pi0gammamass=(vpi0+dph3).M();\r | |
524 | Double_t pi0OverOmegaPtRatio =vpi0.Pt()/pi0gammapt; \r | |
525 | Double_t gammaOverOmegaPtRatio= dph3.Pt()/pi0gammapt;\r | |
526 | \r | |
527 | //pi0, gamma pt cut \r | |
528 | if(pi0OverOmegaPtRatio>fPi0OverOmegaPtCut || \r | |
529 | gammaOverOmegaPtRatio<fGammaOverOmegaPtCut) continue;\r | |
0852acd0 | 530 | \r |
531 | for(Int_t l=0;l<index1;l++) if(lab3==dc1[l]) lab3=-1;\r | |
532 | for(Int_t l=0;l<index2;l++) if(lab3==dc2[l]) lab3=-1;\r | |
d5b2a3f1 | 533 | \r |
0852acd0 | 534 | if(lab3>0 && lab3!=lab1 && lab3!=lab2){\r |
535 | for(Int_t ipid=0;ipid<fNpid;ipid++){\r | |
536 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){\r | |
537 | Int_t index=curEventBin*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
538 | if(photon1->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
539 | photon2->IsPIDOK(ipid,AliCaloPID::kPhoton) && \r | |
540 | photon3->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
f6862ceb | 541 | photon1->DistToBad()>=idist &&\r |
542 | photon2->DistToBad()>=idist &&\r | |
543 | photon3->DistToBad()>=idist ){\r | |
0852acd0 | 544 | //fill the histograms\r |
d5b2a3f1 | 545 | if(GetDebug() > 2) printf("Real: index %d pt %2.3f mass %2.3f \n", index, pi0gammapt, pi0gammamass);\r |
546 | fRealOmega0[index]->Fill(pi0gammapt,pi0gammamass);\r | |
0852acd0 | 547 | if(pi0asy<0.7) fRealOmega1[index]->Fill(pi0gammapt,pi0gammamass);\r |
548 | if(pi0asy<0.8) fRealOmega2[index]->Fill(pi0gammapt,pi0gammamass);\r | |
0852acd0 | 549 | }\r |
550 | }\r | |
551 | }\r | |
552 | }\r | |
553 | } \r | |
554 | delete []dc1;\r | |
555 | delete []dc2;\r | |
d5b2a3f1 | 556 | if(GetDebug() > 0) printf("MixA: (r1_event1+r2_event1)+r3_event2 \n");\r |
0852acd0 | 557 | //-------------------------\r |
558 | //background analysis\r | |
559 | //three background\r | |
560 | // --A (r1_event1+r2_event1)+r3_event2\r | |
0852acd0 | 561 | Int_t nMixed = fEventsList[curEventBin]->GetSize();\r |
562 | for(Int_t im=0;im<nMixed;im++){\r | |
563 | TClonesArray* ev2= (TClonesArray*) (fEventsList[curEventBin]->At(im));\r | |
564 | for(Int_t mix1=0;mix1<ev2->GetEntries();mix1++){\r | |
565 | AliAODPWG4Particle *mix1ph = (AliAODPWG4Particle*) (ev2->At(mix1)); \r | |
566 | TLorentzVector vmixph(mix1ph->Px(),mix1ph->Py(),mix1ph->Pz(),mix1ph->E());\r | |
4007d0a2 | 567 | Double_t pi0gammapt=(vpi0+vmixph).Pt();\r |
568 | Double_t pi0gammamass=(vpi0+vmixph).M();\r | |
569 | Double_t pi0OverOmegaPtRatio =vpi0.Pt()/pi0gammapt;\r | |
570 | Double_t gammaOverOmegaPtRatio= vmixph.Pt()/pi0gammapt;\r | |
571 | \r | |
572 | //pi0, gamma pt cut \r | |
573 | if(pi0OverOmegaPtRatio>fPi0OverOmegaPtCut || \r | |
574 | gammaOverOmegaPtRatio<fGammaOverOmegaPtCut) continue;\r | |
575 | \r | |
0852acd0 | 576 | for(Int_t ipid=0;ipid<fNpid;ipid++){\r |
577 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){\r | |
578 | Int_t index=curEventBin*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
579 | if(photon1->IsPIDOK(ipid,AliCaloPID::kPhoton)&&\r | |
580 | photon2->IsPIDOK(ipid,AliCaloPID::kPhoton)&&\r | |
581 | mix1ph->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
f6862ceb | 582 | photon1->DistToBad()>=idist &&\r |
583 | photon2->DistToBad()>=idist &&\r | |
584 | mix1ph->DistToBad()>=idist ){\r | |
d5b2a3f1 | 585 | if(GetDebug() > 2) printf("MixA: index %d pt %2.3f mass %2.3f \n",index, pi0gammapt, pi0gammamass);\r |
0852acd0 | 586 | //fill the histograms\r |
d5b2a3f1 | 587 | fMixAOmega0[index]->Fill(pi0gammapt,pi0gammamass);\r |
0852acd0 | 588 | if(pi0asy<0.7)fMixAOmega1[index]->Fill(pi0gammapt,pi0gammamass);\r |
589 | if(pi0asy<0.8)fMixAOmega2[index]->Fill(pi0gammapt,pi0gammamass);\r | |
590 | //printf("mix A %d %2.2f \n", index, pi0gammamass);\r | |
591 | \r | |
592 | }\r | |
593 | }\r | |
594 | }\r | |
595 | }\r | |
596 | }\r | |
597 | }\r | |
598 | }\r | |
599 | \r | |
600 | //\r | |
601 | // --B (r1_event1+r2_event2)+r3_event2\r | |
602 | //\r | |
d5b2a3f1 | 603 | if(GetDebug() >0)printf("MixB: (r1_event1+r2_event2)+r3_event2 \n");\r |
0852acd0 | 604 | for(Int_t i=0;i<nphotons;i++){\r |
605 | AliAODPWG4Particle *ph1 = (AliAODPWG4Particle*) (fInputAODGamma->At(i)); \r | |
606 | TLorentzVector vph1(ph1->Px(),ph1->Py(),ph1->Pz(),ph1->E());\r | |
607 | \r | |
608 | Int_t nMixed = fEventsList[curEventBin]->GetSize();\r | |
609 | for(Int_t ie=0;ie<nMixed;ie++){\r | |
610 | TClonesArray* ev2= (TClonesArray*) (fEventsList[curEventBin]->At(ie));\r | |
611 | for(Int_t mix1=0;mix1<ev2->GetEntries();mix1++){\r | |
612 | AliAODPWG4Particle *ph2 = (AliAODPWG4Particle*) (ev2->At(mix1));\r | |
613 | TLorentzVector vph2(ph2->Px(),ph2->Py(),ph2->Pz(),ph2->E());\r | |
614 | Double_t pi0asy = TMath::Abs(vph1.E()-vph2.E())/(vph1.E()+vph2.E()); \r | |
615 | Double_t pi0mass=(vph1+vph2).M();\r | |
616 | \r | |
617 | if(TMath::Abs(pi0mass-fPi0Mass)<fPi0MassWindow){//for pi0 selection\r | |
618 | for(Int_t mix2=(mix1+1);mix2<ev2->GetEntries();mix2++){\r | |
619 | AliAODPWG4Particle *ph3 = (AliAODPWG4Particle*) (ev2->At(mix2));\r | |
620 | TLorentzVector vph3(ph3->Px(),ph3->Py(),ph3->Pz(),ph3->E());\r | |
621 | \r | |
622 | Double_t pi0gammapt=(vph1+vph2+vph3).Pt();\r | |
623 | Double_t pi0gammamass=(vph1+vph2+vph3).M(); \r | |
4007d0a2 | 624 | Double_t pi0OverOmegaPtRatio =(vph1+vph2).Pt()/pi0gammapt;\r |
625 | Double_t gammaOverOmegaPtRatio= vph3.Pt()/pi0gammapt;\r | |
4007d0a2 | 626 | //pi0, gamma pt cut \r |
627 | if(pi0OverOmegaPtRatio>fPi0OverOmegaPtCut ||\r | |
628 | gammaOverOmegaPtRatio<fGammaOverOmegaPtCut) continue;\r | |
629 | \r | |
0852acd0 | 630 | for(Int_t ipid=0;ipid<fNpid;ipid++){\r |
631 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){\r | |
632 | Int_t index=curEventBin*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
633 | if(ph1->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
634 | ph2->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
635 | ph3->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
f6862ceb | 636 | ph1->DistToBad()>=idist &&\r |
637 | ph2->DistToBad()>=idist &&\r | |
638 | ph3->DistToBad()>=idist ){\r | |
d5b2a3f1 | 639 | if(GetDebug() > 2) printf("MixB: index %d pt %2.3f mass %2.3f \n", index, pi0gammapt, pi0gammamass);\r |
0852acd0 | 640 | //fill histograms\r |
d5b2a3f1 | 641 | fMixBOmega0[index]->Fill(pi0gammapt,pi0gammamass);\r |
0852acd0 | 642 | if(pi0asy<0.7) fMixBOmega1[index]->Fill(pi0gammapt,pi0gammamass);\r |
643 | if(pi0asy<0.8) fMixBOmega2[index]->Fill(pi0gammapt,pi0gammamass);\r | |
644 | //printf("mix B %d %2.2f \n", index, pi0gammamass);\r | |
645 | }\r | |
646 | } \r | |
647 | }\r | |
648 | }\r | |
d5b2a3f1 | 649 | \r |
0852acd0 | 650 | //\r |
651 | // --C (r1_event1+r2_event2)+r3_event3\r | |
652 | //\r | |
d5b2a3f1 | 653 | if(GetDebug() >0)printf("MixC: (r1_event1+r2_event2)+r3_event3\n");\r |
0852acd0 | 654 | for(Int_t je=(ie+1);je<nMixed;je++){\r |
655 | TClonesArray* ev3= (TClonesArray*) (fEventsList[curEventBin]->At(je));\r | |
656 | for(Int_t mix3=0;mix3<ev3->GetEntries();mix3++){\r | |
657 | AliAODPWG4Particle *ph3 = (AliAODPWG4Particle*) (ev3->At(mix3));\r | |
658 | TLorentzVector vph3(ph3->Px(),ph3->Py(),ph3->Pz(),ph3->E());\r | |
659 | \r | |
660 | Double_t pi0gammapt=(vph1+vph2+vph3).Pt();\r | |
661 | Double_t pi0gammamass=(vph1+vph2+vph3).M();\r | |
4007d0a2 | 662 | Double_t pi0OverOmegaPtRatio =(vph1+vph2).Pt()/pi0gammapt;\r |
663 | Double_t gammaOverOmegaPtRatio= vph3.Pt()/pi0gammapt;\r | |
4007d0a2 | 664 | //pi0, gamma pt cut \r |
d5b2a3f1 | 665 | if(pi0OverOmegaPtRatio>fPi0OverOmegaPtCut ||\r |
4007d0a2 | 666 | gammaOverOmegaPtRatio<fGammaOverOmegaPtCut) continue;\r |
667 | \r | |
0852acd0 | 668 | for(Int_t ipid=0;ipid<fNpid;ipid++){\r |
669 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){\r | |
670 | Int_t index=curEventBin*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
671 | if(ph1->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
672 | ph2->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
673 | ph3->IsPIDOK(ipid,AliCaloPID::kPhoton) &&\r | |
f6862ceb | 674 | ph1->DistToBad()>=idist &&\r |
675 | ph2->DistToBad()>=idist &&\r | |
676 | ph3->DistToBad()>=idist ){\r | |
d5b2a3f1 | 677 | if(GetDebug() > 2) printf("MixC: index %d pt %2.3f mass %2.3f \n", index, pi0gammapt, pi0gammamass);\r |
0852acd0 | 678 | //fill histograms\r |
d5b2a3f1 | 679 | fMixCOmega0[index]->Fill(pi0gammapt,pi0gammamass);\r |
0852acd0 | 680 | if(pi0asy<0.7) fMixCOmega1[index]->Fill(pi0gammapt,pi0gammamass);\r |
681 | if(pi0asy<0.8) fMixCOmega2[index]->Fill(pi0gammapt,pi0gammamass);\r | |
682 | //printf("mix C %d %2.2f \n", index, pi0gammamass);\r | |
683 | }\r | |
684 | }\r | |
685 | }\r | |
686 | }\r | |
687 | }\r | |
688 | } //for pi0 selecton \r | |
689 | }\r | |
690 | }\r | |
691 | }\r | |
692 | \r | |
d5b2a3f1 | 693 | \r |
0852acd0 | 694 | //event buffer \r |
695 | TClonesArray *currentEvent = new TClonesArray(*fInputAODGamma);\r | |
696 | if(currentEvent->GetEntriesFast()>0){\r | |
697 | fEventsList[curEventBin]->AddFirst(currentEvent) ;\r | |
698 | currentEvent=0 ; \r | |
699 | if(fEventsList[curEventBin]->GetSize()>=fNmaxMixEv) {\r | |
700 | TClonesArray * tmp = (TClonesArray*) (fEventsList[curEventBin]->Last()) ;\r | |
701 | fEventsList[curEventBin]->RemoveLast() ;\r | |
702 | delete tmp ;\r | |
703 | }\r | |
704 | }\r | |
705 | else{ \r | |
706 | delete currentEvent ;\r | |
707 | currentEvent=0 ;\r | |
708 | }\r | |
0852acd0 | 709 | }\r |
710 | \r | |
711 | //______________________________________________________________________________\r | |
712 | void AliAnaOmegaToPi0Gamma::ReadHistograms(TList * outputList)\r | |
713 | {\r | |
714 | //read the histograms \r | |
715 | //for the finalization of the terminate analysis\r | |
716 | \r | |
d5b2a3f1 | 717 | Int_t index = outputList->IndexOf(outputList->FindObject(GetAddedHistogramsStringToName()+"RealToPi0Gamma_Vz0C0Rp0Pid0Dist0"));\r |
0852acd0 | 718 | \r |
719 | Int_t ndim=fNVtxZBin*fNCentBin*fNRpBin*fNBadChDistBin*fNpid;\r | |
720 | \r | |
d5b2a3f1 | 721 | if(!fRealOmega0) fRealOmega0 =new TH2F*[ndim];\r |
722 | if(!fMixAOmega0) fMixAOmega0 =new TH2F*[ndim];\r | |
723 | if(!fMixBOmega0) fMixBOmega0 =new TH2F*[ndim];\r | |
724 | if(!fMixCOmega0) fMixCOmega0 =new TH2F*[ndim];\r | |
0852acd0 | 725 | \r |
726 | if(!fRealOmega1) fRealOmega1 =new TH2F*[ndim];\r | |
727 | if(!fMixAOmega1) fMixAOmega1 =new TH2F*[ndim];\r | |
728 | if(!fMixBOmega1) fMixBOmega1 =new TH2F*[ndim];\r | |
729 | if(!fMixCOmega1) fMixCOmega1 =new TH2F*[ndim];\r | |
730 | \r | |
731 | if(!fRealOmega2) fRealOmega2 =new TH2F*[ndim];\r | |
732 | if(!fMixAOmega2) fMixAOmega2 =new TH2F*[ndim];\r | |
733 | if(!fMixBOmega2) fMixBOmega2 =new TH2F*[ndim];\r | |
734 | if(!fMixCOmega2) fMixCOmega2 =new TH2F*[ndim];\r | |
735 | \r | |
736 | for(Int_t i=0;i<fNVtxZBin;i++){\r | |
737 | for(Int_t j=0;j<fNCentBin;j++){\r | |
738 | for(Int_t k=0;k<fNRpBin;k++){ //at event level\r | |
739 | Int_t idim=i*fNCentBin*fNRpBin+j*fNRpBin+k;\r | |
740 | for(Int_t ipid=0;ipid<fNpid;ipid++){ \r | |
741 | for(Int_t idist=0;idist<fNBadChDistBin;idist++){ //at particle\r | |
742 | Int_t ind=idim*fNpid*fNBadChDistBin+ipid*fNBadChDistBin+idist;\r | |
d5b2a3f1 | 743 | fRealOmega0[ind]= (TH2F*) outputList->At(index++);\r |
744 | fMixAOmega0[ind]= (TH2F*) outputList->At(index++);\r | |
745 | fMixBOmega0[ind]= (TH2F*) outputList->At(index++);\r | |
746 | fMixCOmega0[ind]= (TH2F*) outputList->At(index++);\r | |
0852acd0 | 747 | \r |
748 | fRealOmega1[ind]= (TH2F*) outputList->At(index++);\r | |
749 | fMixAOmega1[ind]= (TH2F*) outputList->At(index++);\r | |
750 | fMixBOmega1[ind]= (TH2F*) outputList->At(index++);\r | |
751 | fMixCOmega1[ind]= (TH2F*) outputList->At(index++);\r | |
752 | \r | |
753 | fRealOmega2[ind]= (TH2F*) outputList->At(index++);\r | |
754 | fMixAOmega2[ind]= (TH2F*) outputList->At(index++);\r | |
755 | fMixBOmega2[ind]= (TH2F*) outputList->At(index++);\r | |
756 | fMixCOmega2[ind]= (TH2F*) outputList->At(index++);\r | |
757 | \r | |
758 | \r | |
759 | }\r | |
760 | }\r | |
761 | }\r | |
762 | }\r | |
763 | }\r | |
764 | \r | |
765 | if(IsDataMC()){\r | |
766 | fhOmegaPriPt = (TH1F*) outputList->At(index++);\r | |
767 | }\r | |
768 | \r | |
769 | }\r | |
770 | \r | |
771 | //______________________________________________________________________________\r | |
772 | void AliAnaOmegaToPi0Gamma::Terminate(TList * outputList) \r | |
773 | {\r | |
774 | // //Do some calculations and plots from the final histograms.\r | |
775 | if(GetDebug() >= 0) printf("AliAnaOmegaToPi0Gamma::Terminate() \n");\r | |
776 | ReadHistograms(outputList);\r | |
777 | char cvs1[128]; \r | |
778 | sprintf(cvs1, "Neutral_%s_IVM",fInputAODGammaName.Data());\r | |
779 | \r | |
780 | TCanvas * cvsIVM = new TCanvas(cvs1, cvs1, 400, 10, 600, 700) ;\r | |
781 | cvsIVM->Divide(2, 2);\r | |
782 | \r | |
783 | cvsIVM->cd(1);\r | |
4007d0a2 | 784 | char dec[128];\r |
785 | sprintf(dec,"h2Real_%s",fInputAODGammaName.Data());\r | |
d5b2a3f1 | 786 | TH2F * h2Real= (TH2F*)fRealOmega0[0]->Clone(dec);\r |
0852acd0 | 787 | h2Real->GetXaxis()->SetRangeUser(4,6);\r |
788 | TH1F * hRealOmega = (TH1F*) h2Real->ProjectionY();\r | |
789 | hRealOmega->SetTitle("RealPi0Gamma 4<pt<6");\r | |
790 | hRealOmega->SetLineColor(2);\r | |
791 | hRealOmega->Draw();\r | |
792 | \r | |
793 | cvsIVM->cd(2);\r | |
4007d0a2 | 794 | sprintf(dec,"hMixA_%s",fInputAODGammaName.Data());\r |
d5b2a3f1 | 795 | TH2F *h2MixA= (TH2F*)fMixAOmega0[0]->Clone(dec);\r |
0852acd0 | 796 | h2MixA->GetXaxis()->SetRangeUser(4,6);\r |
797 | TH1F * hMixAOmega = (TH1F*) h2MixA->ProjectionY();\r | |
798 | hMixAOmega->SetTitle("MixA 4<pt<6");\r | |
799 | hMixAOmega->SetLineColor(2);\r | |
800 | hMixAOmega->Draw();\r | |
801 | \r | |
802 | cvsIVM->cd(3);\r | |
4007d0a2 | 803 | sprintf(dec,"hMixB_%s",fInputAODGammaName.Data());\r |
d5b2a3f1 | 804 | TH2F * h2MixB= (TH2F*)fMixBOmega0[0]->Clone(dec);\r |
0852acd0 | 805 | h2MixB->GetXaxis()->SetRangeUser(4,6);\r |
806 | TH1F * hMixBOmega = (TH1F*) h2MixB->ProjectionY();\r | |
807 | hMixBOmega->SetTitle("MixB 4<pt<6");\r | |
808 | hMixBOmega->SetLineColor(2);\r | |
809 | hMixBOmega->Draw();\r | |
810 | \r | |
811 | cvsIVM->cd(4);\r | |
4007d0a2 | 812 | sprintf(dec,"hMixC_%s",fInputAODGammaName.Data());\r |
d5b2a3f1 | 813 | TH2F *h2MixC= (TH2F*)fMixCOmega0[0]->Clone(dec);\r |
0852acd0 | 814 | h2MixC->GetXaxis()->SetRangeUser(4,6);\r |
815 | TH1F * hMixCOmega = (TH1F*) h2MixC->ProjectionY();\r | |
816 | hMixCOmega->SetTitle("MixC 4<pt<6");\r | |
817 | hMixCOmega->SetLineColor(2);\r | |
818 | hMixCOmega->Draw();\r | |
819 | \r | |
820 | char eps[128 ];\r | |
821 | sprintf(eps,"CVS_%s_IVM.eps",fInputAODGammaName.Data());\r | |
822 | cvsIVM->Print(eps);\r | |
823 | cvsIVM->Modified();\r | |
824 | \r | |
825 | }\r |