delete aodgamma array
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / AliAnalysisTaskdPhi.h
CommitLineData
3b77b2d1 1////////////////////////////////////////////////
2//---------------------------------------------
3// Class doing conversion gamma dPhi correlations
4// Gamma Conversion analysis
5//---------------------------------------------
6////////////////////////////////////////////////
7
8#ifndef AliAnalysisTaskdPhi_cxx
9#define AliAnalysisTaskdPhi_cxx
10
11#include "AliAnalysisTaskSE.h"
12
13#include <TAxis.h>
14#include <TH3I.h>
15#include <THnSparse.h>
16#include <AliAnalysisFilter.h>
17#include <iostream>
18#include <AliAnaConvCorrBase.h>
19#include <AliLog.h>
20class AliAnaConvIsolation;
21//class AliConversionPi0Filter;
22class AliConversionCuts;
23class TList;
24class TH2I;
25//class THnSparseF;
26
27using namespace std;
28
29class AliAnalysisTaskdPhi : public AliAnalysisTaskSE {
30
31public:
32 AliAnalysisTaskdPhi(const char *name);
33 virtual ~AliAnalysisTaskdPhi();
34
35 virtual void UserCreateOutputObjects();
36 virtual void SetUpCorrObjects();
37 virtual void UserExec(Option_t *option);
38 virtual void Terminate(Option_t *);
39
40 AliAnalysisFilter& GetDielV0Filter() { return fDielV0Filter; }
41 AliAnalysisFilter& GetDielV0TrackFilter() { return fDielV0TrackFilter; }
42 AliAnalysisFilter& GetDielTrackFilter() { return fDielTrackFilter; }
43 AliAnalysisFilter& GetDielPi0Filter() { return fDielPi0Filter; }
44
45 TAxis& GetAxisPt() { return fAxisPt; }
46 TAxis& GetAxisEta() { return fAxisEta; }
47 TAxis& GetAxisPhi() { return fAxisPhi; }
48 TAxis& GetAxisZ() { return fAxisZ; }
49 TAxis& GetAxisCent() { return fAxisCent; }
50 TAxis& GetAxisPiMass() { return fAxisPiM; }
51
52 // void SetDielV0Filter(AliAnalysisFilter * filter) { fVDielV0Filter = filter; }
53 // void SetDielPi0Filter(AliAnalysisFilter * filter) { fDielPi0Filter = filter; }
54 // void SetDielV0TrackFilter(AliAnalysisFilter * filter) { fVDielV0TrackFilter = filter; }
55 // void SetDielTrackFilter(AliAnalysisFilter * filter) { fTDielrackFilter = filter; }
56
57 void SetV0Filter(AliConversionCuts * filter) { fV0Filter = filter; }
58 //void SetPi0Filter(AliConversionPi0Filter * filter) { fPionFilter = filter; }
59
60
61 //enum kAxes { kVertexZ, kCentrality, kEta, kPhi, kPt };
62
63protected:
64
65 TClonesArray * GetConversionGammas(Bool_t isAOD);
66
67private:
68
69 THnSparseF * CreateSparse(TString nameString, TString titleString, TList * axesList);
70 Int_t GetBin(TAxis &axis, Double_t value);
71 THnSparseF * GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array);
72 AliAnaConvCorrBase * GetCorrObject(Int_t binz, Int_t binc, TObjArray * array);
73 void Process(TObjArray * gammas, TObjArray * tracks, Int_t vertexBin, Int_t centBin);
74 void FindDeltaAODBranchName(AliAODEvent * event);
75
76 TList * fHistograms; //histograms
77 TList * fHistoGamma; //gamma histo
78 TList * fHistoPion; //pion histo
79
80 AliAnalysisFilter fDielV0TrackFilter; //Track filter
81 AliAnalysisFilter fDielV0Filter; //v0 filter
82 AliAnalysisFilter fDielPi0Filter; //pion filter
83 AliAnalysisFilter fDielTrackFilter; //track filter
84
85 AliConversionCuts * fV0Filter; //v0 filter
86 //AliConversionPi0Filter * fPionFilter;
87
88 TObjArray * fGammas; //gammas
89 TObjArray * fPions; //poins
90
91 TObjArray * hMETracks; //mixed event tracks
92 TObjArray * hMEPhotons; //photons
93 TObjArray * hMEPions; //pions
94 TH2I * hMEvents; //event histrogam
95
96 TObjArray * fPhotonCorr; //photon
97 TObjArray * fPionCorr; //poin
98 AliAnaConvIsolation * fIsoAna; //comment
99
100 Int_t fL1; //comment
101 Int_t fL2; //comment
102
103 TString fDeltaAODBranchName; //comment
104
105 TAxis fAxisPt; //comment
106 TAxis fAxisEta; //comment
107 TAxis fAxisPhi; //comment
108 TAxis fAxisCent; //comment
109 TAxis fAxisZ; //comment
110 TAxis fAxisPiM; //comment
111
112 AliAnalysisTaskdPhi(const AliAnalysisTaskdPhi&); // not implemented
113 AliAnalysisTaskdPhi& operator=(const AliAnalysisTaskdPhi&); // not implemented
114
115 ClassDef(AliAnalysisTaskdPhi, 2); // example of analysis
116};
117
118inline THnSparseF * AliAnalysisTaskdPhi::GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array) {
119 ///Get Mixed Event histogram
120 if(binz < 0 || binz > fAxisZ.GetNbins()) {
121 cout << "error out of z axis range: " << binz << endl;
122 return NULL;
123 }
124 if(binc < 0 || binc >= fAxisCent.GetNbins()) {
125 cout << "error out of centraliy axis range: " << binc << endl;
126 return NULL;
127 }
128
129 TObjArray * arrayc = static_cast<TObjArray*>(array->At(binz));
130 THnSparseF * histogram = static_cast<THnSparseF*>(arrayc->At(binc));
131 return histogram;
132}
133
134
135inline AliAnaConvCorrBase * AliAnalysisTaskdPhi::GetCorrObject(Int_t binz, Int_t binc, TObjArray * array) {
136 ///Get correlation object
137 if(binc < 0 || binz < 0) {
138 AliError("We have a bad bin!!!");
139 return NULL;
140 }
141
142 TObjArray * arrayc = static_cast<TObjArray*>(array->At(binz));
143 AliAnaConvCorrBase * corrmaker = static_cast<AliAnaConvCorrBase*>(arrayc->At(binc));
144 return corrmaker;
145
146}
147
148inline Int_t AliAnalysisTaskdPhi::GetBin(TAxis & axis, Double_t value) {
149 //Return bin - 1 if within range, else return -1
150 Int_t bin = axis.FindFixBin(value);
151
152
153 bin = (bin > 0 && bin <= axis.GetNbins()) ? bin -1 : -1;
154 return bin;
155}
156
157#endif
158