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