]>
Commit | Line | Data |
---|---|---|
2bb2434e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
e5b6e8a6 | 3 | * * |
4 | * Authors: Svein Lindal, Daniel Lohner * | |
5 | * Version 1.0 * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
2bb2434e | 14 | **************************************************************************/ |
15 | ||
16 | //////////////////////////////////////////////// | |
17 | //--------------------------------------------- | |
18 | // QA Task for V0 Reader V1 | |
19 | //--------------------------------------------- | |
20 | //////////////////////////////////////////////// | |
21 | ||
22 | #include "AliAnalysisTaskConversionQA.h" | |
23 | #include "TChain.h" | |
24 | #include "AliAnalysisManager.h" | |
25 | #include "TParticle.h" | |
26 | #include "TVectorF.h" | |
27 | #include "AliPIDResponse.h" | |
28 | #include "TFile.h" | |
e5b6e8a6 | 29 | #include "AliESDtrackCuts.h" |
2bb2434e | 30 | |
31 | class iostream; | |
32 | ||
33 | using namespace std; | |
34 | ||
35 | ClassImp(AliAnalysisTaskConversionQA) | |
36 | ||
37 | //________________________________________________________________________ | |
38 | AliAnalysisTaskConversionQA::AliAnalysisTaskConversionQA(const char *name) : AliAnalysisTaskSE(name), | |
e5b6e8a6 | 39 | fV0Reader(NULL), |
2bb2434e | 40 | fConversionGammas(NULL), |
41 | fConversionCuts(NULL), | |
e5b6e8a6 | 42 | fInputEvent(NULL), |
43 | fNumberOfESDTracks(0), | |
44 | fMCEvent(NULL), | |
45 | fMCStack(NULL), | |
2bb2434e | 46 | fStreamQA(NULL), |
47 | fIsHeavyIon(kFALSE), | |
e5b6e8a6 | 48 | ffillTree(kFALSE), |
49 | ffillHistograms(kFALSE), | |
50 | fOutputList(NULL), | |
51 | fESDList(NULL), | |
52 | hVertexZ(NULL), | |
53 | hNGoodESDTracks(NULL), | |
54 | hNV0Tracks(NULL), | |
55 | hNContributorsVertex(NULL), | |
56 | hITSClusterPhi(NULL), | |
57 | hGammaPt(NULL), | |
58 | hGammaPhi(NULL), | |
59 | hGammaEta(NULL), | |
60 | hGammaChi2perNDF(NULL), | |
61 | hGammaPsiPair(NULL), | |
62 | hGammaQt(NULL), | |
63 | hGammaCosinePointingAngle(NULL), | |
64 | hGammaXY(NULL), | |
65 | hGammaZR(NULL), | |
66 | hElecPt(NULL), | |
67 | hElecEta(NULL), | |
68 | hElecPhi(NULL), | |
69 | hElecNfindableClsTPC(NULL), | |
70 | hPosiNfindableClsTPC(NULL), | |
71 | fTrueList(NULL), | |
72 | hTrueResoulutionR(NULL), | |
73 | hTrueResoulutionZ(NULL), | |
74 | hTrueResoulutionPhi(NULL), | |
75 | hTrueGammaPt(NULL), | |
76 | hTrueGammaPhi(NULL), | |
77 | hTrueGammaEta(NULL), | |
78 | hTrueGammaMass(NULL), | |
79 | hTrueGammaChi2perNDF(NULL), | |
80 | hTrueGammaPsiPair(NULL), | |
81 | hTrueGammaQt(NULL), | |
82 | hTrueGammaCosinePointingAngle(NULL), | |
83 | hTrueGammaXY(NULL), | |
84 | hTrueGammaZR(NULL), | |
85 | hTrueElecPt(NULL), | |
86 | hTrueElecEta(NULL), | |
87 | hTrueElecPhi(NULL), | |
88 | hTrueElecNfindableClsTPC(NULL), | |
89 | hTruePosiNfindableClsTPC(NULL) | |
2bb2434e | 90 | { |
91 | // Default constructor | |
92 | ||
93 | DefineInput(0, TChain::Class()); | |
94 | DefineOutput(1, TList::Class()); | |
95 | } | |
96 | ||
97 | //________________________________________________________________________ | |
98 | AliAnalysisTaskConversionQA::~AliAnalysisTaskConversionQA() | |
99 | { | |
100 | // default deconstructor | |
101 | if(fStreamQA){ | |
102 | delete fStreamQA; | |
103 | fStreamQA = 0x0; | |
104 | } | |
105 | } | |
106 | //________________________________________________________________________ | |
107 | void AliAnalysisTaskConversionQA::UserCreateOutputObjects() | |
108 | { | |
109 | // Create User Output Objects | |
110 | ||
111 | if(fOutputList != NULL){ | |
112 | delete fOutputList; | |
113 | fOutputList = NULL; | |
114 | } | |
115 | if(fOutputList == NULL){ | |
116 | fOutputList = new TList(); | |
117 | fOutputList->SetOwner(kTRUE); | |
118 | } | |
119 | ||
e5b6e8a6 | 120 | if(ffillHistograms){ |
121 | fESDList = new TList(); | |
122 | fESDList->SetOwner(kTRUE); | |
123 | fESDList->SetName("ESD QA"); | |
124 | fOutputList->Add(fESDList); | |
2bb2434e | 125 | |
e5b6e8a6 | 126 | hVertexZ = new TH1F("Vertex_Z","Vertex_Z",300,-15,15); |
127 | fESDList->Add(hVertexZ); | |
128 | hNContributorsVertex = new TH1I("ContrVertex_Z","ContrVertex_Z",3000,0,3000); | |
129 | fESDList->Add(hNContributorsVertex); | |
130 | if(fIsHeavyIon) hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",3000,0,3000); | |
131 | else hNGoodESDTracks = new TH1I("GoodESDTracks","GoodESDTracks",200,0,200); | |
132 | fESDList->Add(hNGoodESDTracks); | |
133 | if(fIsHeavyIon) hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",30000,0,30000); | |
134 | else hNV0Tracks = new TH1I("V0 Multiplicity","V0 Multiplicity",2000,0,2000); | |
135 | fESDList->Add(hNV0Tracks); | |
136 | ||
137 | hITSClusterPhi = new TH2F("ITSClusterPhi","hITSClusterPhi",72,0,2*TMath::Pi(),7,0,7); | |
138 | fESDList->Add(hITSClusterPhi); | |
139 | hGammaPt = new TH1F("Gamma_Pt","Gamma_Pt",250,0,25); | |
140 | fESDList->Add(hGammaPt); | |
141 | hGammaPhi = new TH1F("Gamma_Phi","Gamma_Phi",360,0,2*TMath::Pi()); | |
142 | fESDList->Add(hGammaPhi); | |
143 | hGammaEta = new TH1F("Gamma_Eta","Gamma_Eta",400,-1.2,1.2); | |
144 | fESDList->Add(hGammaEta); | |
145 | hGammaChi2perNDF = new TH1F("Gamma_Chi2perNDF","Gamma_Chi2perNDF",500,0,100); | |
146 | fESDList->Add(hGammaChi2perNDF); | |
147 | hGammaPsiPair = new TH1F("Gamma_PsiPair","Gamma_PsiPair",500,0,2); | |
148 | fESDList->Add(hGammaPsiPair); | |
149 | hGammaQt = new TH1F("Gamma_Qt","Gamma_Qt",400,0,0.1); | |
150 | fESDList->Add(hGammaQt); | |
151 | hGammaCosinePointingAngle = new TH1F("Gamma_CosinePointingAngle","Gamma_CosinePointingAngle",900,0.7,1.); | |
152 | fESDList->Add(hGammaCosinePointingAngle); | |
153 | hGammaXY = new TH2F("Gamma_ConversionPoint_XY","Gamma_ConversionPoint_XY",960,-120,120,960,-120,120); | |
154 | fESDList->Add(hGammaXY); | |
155 | hGammaZR= new TH2F("Gamma_ConversionPoint_ZR","Gamma_ConversionPoint_ZR",1200,-150,150,480,0,120); | |
156 | fESDList->Add(hGammaZR); | |
157 | ||
158 | hElecPt = new TH2F("Electron_Positron_Pt","Electron_Positron_Pt",250,0,25,250,0,25); | |
159 | fESDList->Add(hElecPt); | |
160 | hElecEta = new TH2F("Electron_Positron_Eta","Electron_Positron_Eta",400,-1.2,1.2,400,-1.2,1.2); | |
161 | fESDList->Add(hElecEta); | |
162 | hElecPhi = new TH2F("Electron_Positron_Phi","Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi()); | |
163 | fESDList->Add(hElecPhi); | |
164 | hElecNfindableClsTPC = new TH1F("Electron_findableClusterTPC","Electron_findableClusterTPC",100,0,1); | |
165 | fESDList->Add(hElecNfindableClsTPC); | |
166 | hPosiNfindableClsTPC = new TH1F("Positron_findableClusterTPC","Positron_findableClusterTPC",100,0,1); | |
167 | fESDList->Add(hPosiNfindableClsTPC); | |
168 | ||
169 | if(MCEvent()){ | |
170 | fTrueList = new TList(); | |
171 | fTrueList->SetOwner(kTRUE); | |
172 | fTrueList->SetName("True QA"); | |
173 | fOutputList->Add(fTrueList); | |
2bb2434e | 174 | |
e5b6e8a6 | 175 | hTrueResoulutionR = new TH2F("True_ConversionPointResolution_R","True_ConversionPointResolution_R",240,0,120,200,-20,20); |
176 | fTrueList->Add(hTrueResoulutionR); | |
177 | hTrueResoulutionZ = new TH2F("True_ConversionPointResolution_Z","True_ConversionPointResolution_Z",480,-120,120,200,-20,20); | |
178 | fTrueList->Add(hTrueResoulutionZ); | |
179 | hTrueResoulutionPhi = new TH2F("True_ConversionPointResolution_Phi","True_ConversionPointResolution_Phi",360,0,2*TMath::Pi(),200,-20,20); | |
180 | fTrueList->Add(hTrueResoulutionPhi); | |
181 | ||
182 | hTrueGammaPt = new TH1F("True_Gamma_Pt","True_Gamma_Pt",250,0,25); | |
183 | fTrueList->Add(hTrueGammaPt); | |
184 | hTrueGammaPhi = new TH1F("True_Gamma_Phi","True_Gamma_Phi",360,0,2*TMath::Pi()); | |
185 | fTrueList->Add(hTrueGammaPhi); | |
186 | hTrueGammaEta = new TH1F("True_Gamma_Eta","True_Gamma_Eta",400,-1.2,1.2); | |
187 | fTrueList->Add(hTrueGammaEta); | |
188 | hTrueGammaMass = new TH1F("True_Gamma_Mass","True_Gamma_Mass",1000,0,0.3); | |
189 | fTrueList->Add(hTrueGammaMass); | |
190 | hTrueGammaChi2perNDF = new TH1F("True_Gamma_Chi2perNDF","True_Gamma_Chi2perNDF",500,0,100); | |
191 | fTrueList->Add(hTrueGammaChi2perNDF); | |
192 | hTrueGammaPsiPair = new TH1F("True_Gamma_PsiPair","True_Gamma_PsiPair",500,0,2); | |
193 | fTrueList->Add(hTrueGammaPsiPair); | |
194 | hTrueGammaQt = new TH1F("True_Gamma_Qt","True_Gamma_Qt",400,0,0.1); | |
195 | fTrueList->Add(hTrueGammaQt); | |
196 | hTrueGammaCosinePointingAngle = new TH1F("True_Gamma_CosinePointingAngle","True_Gamma_CosinePointingAngle",900,0.7,1.); | |
197 | fTrueList->Add(hTrueGammaCosinePointingAngle); | |
198 | hTrueGammaXY = new TH2F("True_Gamma_ConversionPoint_XY","True_Gamma_ConversionPoint_XY",960,-120,120,960,-120,120); | |
199 | fTrueList->Add(hTrueGammaXY); | |
200 | hTrueGammaZR= new TH2F("TrueGamma_ConversionPoint_ZR","TrueGamma_ConversionPoint_ZR",1200,-150,150,480,0,120); | |
201 | fTrueList->Add(hTrueGammaZR); | |
202 | ||
203 | hTrueElecPt = new TH2F("True_Electron_Positron_Pt","True_Electron_Positron_Pt",250,0,25,250,0,25); | |
204 | fTrueList->Add(hTrueElecPt); | |
205 | hTrueElecEta = new TH2F("True_Electron_Positron_Eta","True_Electron_Positron_Eta",400,-1.2,1.2,400,-1.2,1.2); | |
206 | fTrueList->Add(hTrueElecEta); | |
207 | hTrueElecPhi = new TH2F("True_Electron_Positron_Phi","True_Electron_Positron_Phi",360,0,2*TMath::Pi(),360,0,2*TMath::Pi()); | |
208 | fTrueList->Add(hTrueElecPhi); | |
209 | hTrueElecNfindableClsTPC = new TH1F("True_Electron_findableClusterTPC","True_Electron_findableClusterTPC",100,0,1); | |
210 | fTrueList->Add(hTrueElecNfindableClsTPC); | |
211 | hTruePosiNfindableClsTPC = new TH1F("True_Positron_findableClusterTPC","True_Positron_findableClusterTPC",100,0,1); | |
212 | fTrueList->Add(hTruePosiNfindableClsTPC); | |
213 | } | |
214 | } | |
215 | ||
216 | if(ffillTree){ | |
217 | TString cutnumber = fConversionCuts->GetCutNumber(); | |
218 | fStreamQA = new TTreeSRedirector(Form("GammaConvV1_QATree_%s.root",cutnumber.Data())); | |
219 | } | |
220 | ||
221 | PostData(1, fOutputList); | |
2bb2434e | 222 | } |
223 | ||
224 | //________________________________________________________________________ | |
225 | void AliAnalysisTaskConversionQA::UserExec(Option_t *){ | |
e5b6e8a6 | 226 | |
2bb2434e | 227 | fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask("V0ReaderV1"); |
228 | ||
229 | Int_t eventQuality = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetEventQuality(); | |
230 | if(eventQuality != 0){// Event Not Accepted | |
231 | return; | |
232 | } | |
e5b6e8a6 | 233 | fInputEvent = InputEvent(); |
234 | fMCEvent = MCEvent(); | |
235 | if(fMCEvent) fMCStack = fMCEvent->Stack(); | |
236 | ||
237 | Int_t eventNotAccepted = | |
238 | fConversionCuts->IsEventAcceptedByConversionCut(fV0Reader->GetConversionCuts(),fInputEvent,fMCEvent,fIsHeavyIon); | |
239 | if(eventNotAccepted) return; // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1 | |
2bb2434e | 240 | |
241 | fConversionGammas=fV0Reader->GetReconstructedGammas(); | |
242 | ||
e5b6e8a6 | 243 | if(fMCEvent){ |
244 | if(fConversionCuts->GetSignalRejection() != 0){ | |
245 | fConversionCuts->GetNotRejectedParticles(fConversionCuts->GetSignalRejection(), | |
246 | fConversionCuts->GetAcceptedHeader(), | |
247 | fMCEvent); | |
248 | } | |
249 | } | |
250 | ||
251 | if(ffillTree)ProcessQATree(); | |
252 | if(ffillHistograms){ | |
253 | CountESDTracks(); | |
254 | ProcessQA(); | |
255 | } | |
256 | ||
2bb2434e | 257 | PostData(1, fOutputList); |
258 | } | |
259 | ||
260 | ||
261 | ///________________________________________________________________________ | |
e5b6e8a6 | 262 | void AliAnalysisTaskConversionQA::ProcessQATree(){ |
263 | ||
2bb2434e | 264 | // Fill Histograms for QA and MC |
265 | AliESDEvent* event = (AliESDEvent*) InputEvent(); | |
266 | AliPIDResponse* pidResonse = ((AliConversionCuts*)fV0Reader->GetConversionCuts())->GetPIDResponse(); | |
267 | for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast();firstGammaIndex++){ | |
268 | AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(firstGammaIndex)); | |
269 | if(!fConversionCuts->PhotonIsSelected(gamma,event)) continue; | |
e5b6e8a6 | 270 | if(fMCEvent && fConversionCuts->GetSignalRejection() != 0){ |
271 | if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelPositive(), fMCStack)) | |
272 | continue; | |
273 | if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelNegative(), fMCStack)) | |
274 | continue; | |
275 | } | |
2bb2434e | 276 | Float_t gammaPt = gamma->GetPhotonPt(); |
277 | Float_t gammaPhi = gamma->GetPhotonPhi(); | |
278 | Float_t gammaTheta = gamma->Theta(); | |
279 | Float_t gammaChi2NDF = gamma->GetChi2perNDF(); | |
280 | Float_t gammaQt = gamma->GetArmenterosQt(); | |
281 | Float_t gammaAlpha = gamma->GetArmenterosAlpha(); | |
282 | Float_t gammaPsiPair = gamma->GetPsiPair(); | |
e5b6e8a6 | 283 | Float_t gammaCosPointing = fConversionCuts->GetCosineOfPointingAngle(gamma,event); |
284 | TVectorF conversionPoint(3); | |
285 | conversionPoint(0) = gamma->GetConversionX(); | |
286 | conversionPoint(1) = gamma->GetConversionY(); | |
287 | conversionPoint(2) = gamma->GetConversionZ(); | |
288 | TVectorF daughterProp(18); | |
289 | AliESDtrack * negTrack = fConversionCuts->GetESDTrack(event, gamma->GetTrackLabelNegative()); | |
290 | AliESDtrack * posTrack = fConversionCuts->GetESDTrack(event, gamma->GetTrackLabelPositive()); | |
291 | ||
2bb2434e | 292 | if(!negTrack||!posTrack)return; |
293 | ||
e5b6e8a6 | 294 | Bool_t isTruePhoton = kFALSE; |
295 | if(fMCEvent){ | |
296 | if(IsTruePhoton(gamma)) isTruePhoton = kTRUE; | |
297 | } | |
298 | ||
2bb2434e | 299 | daughterProp(0) = posTrack->Pt(); |
300 | daughterProp(7) = negTrack->Pt(); | |
301 | daughterProp(1) = posTrack->Theta(); | |
302 | daughterProp(8) = negTrack->Theta(); | |
e5b6e8a6 | 303 | Double32_t signalPos[4] = {0,0,0,0}; |
304 | Char_t nclPos[3]; | |
305 | Char_t nrowsPos[3]; | |
306 | if (posTrack->GetTPCdEdxInfo()) { | |
307 | posTrack->GetTPCdEdxInfo()->GetTPCSignalRegionInfo(signalPos,nclPos,nrowsPos); | |
308 | daughterProp(2) = signalPos[0]; | |
309 | daughterProp(14) = signalPos[1]; | |
310 | daughterProp(16) = signalPos[2]; | |
311 | } else { | |
312 | daughterProp(2) = posTrack->GetTPCsignal(); | |
313 | daughterProp(14) = 0; | |
314 | daughterProp(16) = 0; | |
315 | } | |
316 | Double32_t signalNeg[4] = {0,0,0,0}; | |
317 | Char_t nclNeg[3]; | |
318 | Char_t nrowsNeg[3]; | |
319 | if (negTrack->GetTPCdEdxInfo()) { | |
320 | negTrack->GetTPCdEdxInfo()->GetTPCSignalRegionInfo(signalNeg,nclNeg,nrowsNeg); | |
321 | daughterProp(9) = signalNeg[0]; | |
322 | daughterProp(15) = signalNeg[1]; | |
323 | daughterProp(17) = signalNeg[2]; | |
324 | } else { | |
325 | daughterProp(9) = negTrack->GetTPCsignal(); | |
326 | daughterProp(15) = 0; | |
327 | daughterProp(17) = 0; | |
328 | } | |
2bb2434e | 329 | daughterProp(3) = pidResonse->NumberOfSigmasTPC(posTrack,AliPID::kElectron); |
ca91a3e1 | 330 | daughterProp(10) = pidResonse->NumberOfSigmasTPC(negTrack,AliPID::kElectron); |
2bb2434e | 331 | if((posTrack->GetStatus() & AliESDtrack::kTOFpid) && !(posTrack->GetStatus() & AliESDtrack::kTOFmismatch)){ |
e5b6e8a6 | 332 | Double_t t0pos = pidResonse->GetTOFResponse().GetStartTime(posTrack->P()); |
333 | Double_t timesPos[5]; | |
334 | posTrack->GetIntegratedTimes(timesPos); | |
335 | Double_t TOFsignalPos = posTrack->GetTOFsignal(); | |
336 | Double_t dTpos = TOFsignalPos - t0pos - timesPos[0]; | |
337 | daughterProp(4) = dTpos; | |
2bb2434e | 338 | daughterProp(5) = pidResonse->NumberOfSigmasTOF(posTrack, AliPID::kElectron); |
339 | } else { | |
340 | daughterProp(4) = 20000; | |
341 | daughterProp(5) = -20; | |
342 | } | |
343 | if((negTrack->GetStatus() & AliESDtrack::kTOFpid) && !(negTrack->GetStatus() & AliESDtrack::kTOFmismatch)){ | |
e5b6e8a6 | 344 | Double_t t0neg = pidResonse->GetTOFResponse().GetStartTime(negTrack->P()); |
345 | Double_t timesNeg[5]; | |
346 | negTrack->GetIntegratedTimes(timesNeg); | |
347 | Double_t TOFsignalNeg = negTrack->GetTOFsignal(); | |
348 | Double_t dTneg = TOFsignalNeg - t0neg - timesNeg[0]; | |
349 | daughterProp(11) = dTneg; | |
2bb2434e | 350 | daughterProp(12) = pidResonse->NumberOfSigmasTOF(negTrack, AliPID::kElectron); |
351 | } else { | |
352 | daughterProp(11) = 20000; | |
353 | daughterProp(12) = -20; | |
354 | } | |
e5b6e8a6 | 355 | |
356 | daughterProp(6) = (Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())); | |
357 | //posTrack->GetNcls(1)/(Float_t)posTrack->GetTPCNclsF(); | |
358 | daughterProp(13) = (Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius())); | |
359 | //negTrack->GetNcls(1)/(Float_t)negTrack->GetTPCNclsF(); | |
2bb2434e | 360 | |
361 | if (fStreamQA){ | |
e5b6e8a6 | 362 | if(fMCEvent){ |
363 | (*fStreamQA)<<"PhotonQA" | |
364 | << "pt=" << gammaPt | |
365 | << "phi=" << gammaPhi | |
366 | << "theta=" << gammaTheta | |
367 | << "chi2ndf=" << gammaChi2NDF | |
368 | << "qt="<< gammaQt | |
369 | << "alpha=" << gammaAlpha | |
370 | << "psipair=" << gammaPsiPair | |
371 | << "cosPoint=" << gammaCosPointing | |
372 | << "TruePhoton=" << isTruePhoton | |
373 | << "conversionPoint=" << &conversionPoint | |
374 | << "daugtherProp.=" << &daughterProp | |
375 | << "\n"; | |
376 | } | |
377 | else{ | |
378 | (*fStreamQA)<<"PhotonQA" | |
379 | << "pt=" << gammaPt | |
380 | << "phi=" << gammaPhi | |
381 | << "theta=" << gammaTheta | |
382 | << "chi2ndf=" << gammaChi2NDF | |
383 | << "qt="<< gammaQt | |
384 | << "alpha=" << gammaAlpha | |
385 | << "psipair=" << gammaPsiPair | |
386 | << "cosPoint=" << gammaCosPointing | |
387 | << "conversionPoint=" << &conversionPoint | |
388 | << "daugtherProp.=" << &daughterProp | |
389 | << "\n"; | |
390 | } | |
2bb2434e | 391 | } |
392 | } | |
393 | } | |
e5b6e8a6 | 394 | //_____________________________________________________________________________________________________ |
395 | void AliAnalysisTaskConversionQA::ProcessQA(){ | |
396 | ||
397 | hVertexZ->Fill(fInputEvent->GetPrimaryVertex()->GetZ()); | |
398 | hNContributorsVertex->Fill(fConversionCuts->GetNumberOfContributorsVtx(fInputEvent)); | |
399 | hNGoodESDTracks->Fill(fNumberOfESDTracks); | |
400 | hNV0Tracks->Fill(fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C()); | |
2bb2434e | 401 | |
e5b6e8a6 | 402 | // Fill Histograms for QA and MC |
403 | for(Int_t gammaIndex=0;gammaIndex<fConversionGammas->GetEntriesFast();gammaIndex++){ | |
404 | AliAODConversionPhoton *gamma = dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(gammaIndex)); | |
405 | if(!fConversionCuts->PhotonIsSelected(gamma,fInputEvent)) continue; | |
406 | ||
407 | if(fMCEvent && fConversionCuts->GetSignalRejection() != 0){ | |
408 | if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelPositive(), fMCStack)) | |
409 | continue; | |
410 | if(!fConversionCuts->IsParticleFromBGEvent(gamma->GetMCLabelNegative(), fMCStack)) | |
411 | continue; | |
412 | } | |
413 | hGammaPt->Fill(gamma->GetPhotonPt()); | |
414 | hGammaPhi->Fill(gamma->GetPhotonPhi()); | |
415 | hGammaEta->Fill(gamma->Eta()); | |
416 | hGammaChi2perNDF->Fill(gamma->GetChi2perNDF()); | |
417 | hGammaPsiPair->Fill(gamma->GetPsiPair()); | |
418 | hGammaQt->Fill(gamma->GetArmenterosQt()); | |
419 | hGammaCosinePointingAngle->Fill(fConversionCuts->GetCosineOfPointingAngle(gamma,fInputEvent)); | |
420 | hGammaXY->Fill(gamma->GetConversionX(),gamma->GetConversionY()); | |
421 | hGammaZR->Fill(gamma->GetConversionZ(),gamma->GetConversionRadius()); | |
422 | ||
423 | AliESDtrack * negTrack = fConversionCuts->GetESDTrack((AliESDEvent*)fInputEvent, gamma->GetTrackLabelNegative()); | |
424 | AliESDtrack * posTrack = fConversionCuts->GetESDTrack((AliESDEvent*)fInputEvent, gamma->GetTrackLabelPositive()); | |
425 | if(!negTrack||!posTrack)return; | |
426 | ||
427 | Double_t negtrackPhi = negTrack->Phi(); | |
428 | Double_t postrackPhi = posTrack->Phi(); | |
429 | hITSClusterPhi->Fill(negtrackPhi,6); | |
430 | hITSClusterPhi->Fill(postrackPhi,6); | |
431 | for(Int_t itsLayer = 0; itsLayer<6;itsLayer++){ | |
432 | if(TESTBIT(negTrack->GetITSClusterMap(),itsLayer)){ | |
433 | hITSClusterPhi->Fill(negtrackPhi,itsLayer); | |
434 | } | |
435 | if(TESTBIT(posTrack->GetITSClusterMap(),itsLayer)){ | |
436 | hITSClusterPhi->Fill(postrackPhi,itsLayer); | |
437 | } | |
438 | } | |
439 | ||
440 | hElecPt->Fill(negTrack->Pt(),posTrack->Pt()); | |
441 | hElecEta->Fill(negTrack->Eta(),posTrack->Eta()); | |
442 | hElecPhi->Fill(negTrack->Phi(),posTrack->Phi()); | |
443 | ||
444 | hElecNfindableClsTPC->Fill((Float_t)posTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()))); | |
445 | hPosiNfindableClsTPC->Fill((Float_t)negTrack->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(gamma->GetConversionRadius()))); | |
446 | ||
447 | // hElecNfindableClsTPC->Fill((Float_t)negTrack->GetNcls(1)/(Float_t)negTrack->GetTPCNclsF()); | |
448 | // hPosiNfindableClsTPC->Fill((Float_t)posTrack->GetNcls(1)/(Float_t)posTrack->GetTPCNclsF()); | |
449 | ||
450 | if(fMCEvent) | |
451 | ProcessTrueQA(gamma,negTrack,posTrack); | |
452 | } | |
453 | } | |
454 | //________________________________________________________________________ | |
455 | void AliAnalysisTaskConversionQA::ProcessTrueQA(AliAODConversionPhoton *TruePhotonCandidate, AliESDtrack *elec, AliESDtrack *posi) | |
456 | { | |
457 | ||
458 | if(!IsTruePhoton(TruePhotonCandidate)) return; | |
459 | ||
460 | TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(fMCStack); | |
461 | TParticle *mcPhoton = TruePhotonCandidate->GetMCParticle(fMCStack); | |
462 | ||
463 | // True Photon | |
464 | hTrueResoulutionR->Fill(TruePhotonCandidate->GetConversionRadius(), | |
465 | TruePhotonCandidate->GetConversionRadius()-negDaughter->R()); | |
466 | hTrueResoulutionZ->Fill(TruePhotonCandidate->GetConversionZ(), | |
467 | TruePhotonCandidate->GetConversionZ()-negDaughter->Vz()); | |
468 | hTrueResoulutionPhi->Fill(TruePhotonCandidate->Phi(), | |
469 | TruePhotonCandidate->Phi()-mcPhoton->Phi()); | |
470 | hTrueGammaPt->Fill(TruePhotonCandidate->Pt()); | |
471 | hTrueGammaPhi->Fill(TruePhotonCandidate->Phi()); | |
472 | hTrueGammaEta->Fill(TruePhotonCandidate->Eta()); | |
473 | hTrueGammaMass->Fill(TruePhotonCandidate->GetMass()); | |
474 | hTrueGammaChi2perNDF->Fill(TruePhotonCandidate->GetChi2perNDF()); | |
475 | hTrueGammaPsiPair->Fill(TruePhotonCandidate->GetPsiPair()); | |
476 | hTrueGammaQt->Fill(TruePhotonCandidate->GetArmenterosQt()); | |
477 | hTrueGammaCosinePointingAngle->Fill(fConversionCuts->GetCosineOfPointingAngle(TruePhotonCandidate,fInputEvent)); | |
478 | hTrueGammaXY->Fill(TruePhotonCandidate->GetConversionX(),TruePhotonCandidate->GetConversionY()); | |
479 | hTrueGammaZR->Fill(TruePhotonCandidate->GetConversionZ(),TruePhotonCandidate->GetConversionRadius()); | |
480 | ||
481 | hTrueElecPt->Fill(elec->Pt(),posi->Pt()); | |
482 | hTrueElecEta->Fill(elec->Eta(),posi->Eta()); | |
483 | hTrueElecPhi->Fill(elec->Phi(),posi->Phi()); | |
484 | hTrueElecNfindableClsTPC | |
485 | ->Fill((Float_t)elec->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(TruePhotonCandidate->GetConversionRadius()))); | |
486 | hTruePosiNfindableClsTPC | |
487 | ->Fill((Float_t)posi->GetTPCClusterInfo(2,0,fConversionCuts->GetFirstTPCRow(TruePhotonCandidate->GetConversionRadius()))); | |
488 | // hTrueElecNfindableClsTPC->Fill((Float_t)elec->GetNcls(1)/(Float_t)elec->GetTPCNclsF()); | |
489 | // hTruePosiNfindableClsTPC->Fill((Float_t)posi->GetNcls(1)/(Float_t)posi->GetTPCNclsF()); | |
490 | ||
491 | } | |
492 | //________________________________________________________________________ | |
493 | void AliAnalysisTaskConversionQA::CountESDTracks(){ | |
494 | ||
495 | AliESDtrackCuts *EsdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts"); | |
496 | // Using standard function for setting Cuts | |
497 | Bool_t selectPrimaries=kTRUE; | |
498 | EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries); | |
499 | EsdTrackCuts->SetMaxDCAToVertexZ(2); | |
500 | EsdTrackCuts->SetEtaRange(-0.8, 0.8); | |
501 | EsdTrackCuts->SetPtRange(0.15); | |
502 | ||
503 | fNumberOfESDTracks = 0; | |
504 | for(Int_t iTracks = 0; iTracks < fInputEvent->GetNumberOfTracks(); iTracks++){ | |
505 | AliESDtrack* curTrack = (AliESDtrack*)fInputEvent->GetTrack(iTracks); | |
506 | if(!curTrack) continue; | |
507 | // if(fMCEvent && fConversionCuts->GetSignalRejection() != 0){ | |
508 | // if(!fConversionCuts->IsParticleFromBGEvent(abs(curTrack->GetLabel()), fMCStack)) continue; | |
509 | // } | |
510 | if(EsdTrackCuts->AcceptTrack(curTrack) ) fNumberOfESDTracks++; | |
511 | } | |
512 | delete EsdTrackCuts; | |
513 | EsdTrackCuts=0x0; | |
514 | ||
515 | return; | |
516 | } | |
517 | //________________________________________________________________________ | |
518 | Bool_t AliAnalysisTaskConversionQA::IsTruePhoton(AliAODConversionPhoton *TruePhotonCandidate) | |
519 | { | |
520 | TParticle *posDaughter = TruePhotonCandidate->GetPositiveMCDaughter(fMCStack); | |
521 | TParticle *negDaughter = TruePhotonCandidate->GetNegativeMCDaughter(fMCStack); | |
522 | ||
523 | if(posDaughter == NULL || negDaughter == NULL) return kFALSE; // One particle does not exist | |
524 | Int_t pdgCode[2] = {abs(posDaughter->GetPdgCode()),abs(negDaughter->GetPdgCode())}; | |
525 | if(posDaughter->GetMother(0) != negDaughter->GetMother(0)) return kFALSE; | |
526 | else if(posDaughter->GetMother(0) == -1) return kFALSE; | |
527 | ||
528 | if(pdgCode[0]!=11 || pdgCode[1]!=11) return kFALSE; //One Particle is not electron | |
529 | if(posDaughter->GetPdgCode()==negDaughter->GetPdgCode()) return kFALSE; // Same Charge | |
530 | if(posDaughter->GetUniqueID() != 5 || negDaughter->GetUniqueID() !=5) return kFALSE;// check if the daughters come from a conversion | |
531 | ||
532 | TParticle *Photon = TruePhotonCandidate->GetMCParticle(fMCStack); | |
533 | if(Photon->GetPdgCode() != 22) return kFALSE; // Mother is no Photon | |
534 | ||
535 | return kTRUE; | |
536 | } | |
2bb2434e | 537 | |
538 | //________________________________________________________________________ | |
539 | void AliAnalysisTaskConversionQA::Terminate(Option_t *) | |
540 | { | |
e5b6e8a6 | 541 | if(ffillHistograms && fConversionCuts->GetCutHistograms()){ |
542 | fOutputList->Add(fConversionCuts->GetCutHistograms()); | |
2bb2434e | 543 | } |
e5b6e8a6 | 544 | |
545 | // if (fStreamQA){ | |
546 | // //fStreamQA->GetFile()->Write(); | |
547 | // } | |
2bb2434e | 548 | } |