adding track cut filter. Only add used ME tracks to ME
[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;
3b77b2d1 21class AliConversionCuts;
2dd6ec26 22#include "AliConversionTrackCuts.h"
3b77b2d1 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
3b77b2d1 40
3bff49c3 41 TAxis& GetAxistPt() { return fAxistPt; }
42 TAxis& GetAxiscPt() { return fAxiscPt; }
3b77b2d1 43 TAxis& GetAxisEta() { return fAxisEta; }
44 TAxis& GetAxisPhi() { return fAxisPhi; }
45 TAxis& GetAxisZ() { return fAxisZ; }
46 TAxis& GetAxisCent() { return fAxisCent; }
47 TAxis& GetAxisPiMass() { return fAxisPiM; }
48
49 // void SetDielV0Filter(AliAnalysisFilter * filter) { fVDielV0Filter = filter; }
50 // void SetDielPi0Filter(AliAnalysisFilter * filter) { fDielPi0Filter = filter; }
51 // void SetDielV0TrackFilter(AliAnalysisFilter * filter) { fVDielV0TrackFilter = filter; }
52 // void SetDielTrackFilter(AliAnalysisFilter * filter) { fTDielrackFilter = filter; }
53
54 void SetV0Filter(AliConversionCuts * filter) { fV0Filter = filter; }
55 //void SetPi0Filter(AliConversionPi0Filter * filter) { fPionFilter = filter; }
56
57
58 //enum kAxes { kVertexZ, kCentrality, kEta, kPhi, kPt };
59
60protected:
61
62 TClonesArray * GetConversionGammas(Bool_t isAOD);
63
64private:
65
66 THnSparseF * CreateSparse(TString nameString, TString titleString, TList * axesList);
67 Int_t GetBin(TAxis &axis, Double_t value);
68 THnSparseF * GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array);
69 AliAnaConvCorrBase * GetCorrObject(Int_t binz, Int_t binc, TObjArray * array);
70 void Process(TObjArray * gammas, TObjArray * tracks, Int_t vertexBin, Int_t centBin);
e3598cd0 71 void FindDeltaAODBranchName(AliVEvent * event);
3b77b2d1 72
73 TList * fHistograms; //histograms
74 TList * fHistoGamma; //gamma histo
75 TList * fHistoPion; //pion histo
76
3b77b2d1 77
78 AliConversionCuts * fV0Filter; //v0 filter
2dd6ec26 79 AliConversionTrackCuts fTrackCuts;
3b77b2d1 80
81 TObjArray * fGammas; //gammas
82 TObjArray * fPions; //poins
83
84 TObjArray * hMETracks; //mixed event tracks
85 TObjArray * hMEPhotons; //photons
86 TObjArray * hMEPions; //pions
87 TH2I * hMEvents; //event histrogam
88
89 TObjArray * fPhotonCorr; //photon
90 TObjArray * fPionCorr; //poin
91 AliAnaConvIsolation * fIsoAna; //comment
92
93 Int_t fL1; //comment
94 Int_t fL2; //comment
95
96 TString fDeltaAODBranchName; //comment
97
3bff49c3 98 TAxis fAxistPt; //comment
99 TAxis fAxiscPt; //comment
3b77b2d1 100 TAxis fAxisEta; //comment
101 TAxis fAxisPhi; //comment
102 TAxis fAxisCent; //comment
103 TAxis fAxisZ; //comment
104 TAxis fAxisPiM; //comment
105
106 AliAnalysisTaskdPhi(const AliAnalysisTaskdPhi&); // not implemented
107 AliAnalysisTaskdPhi& operator=(const AliAnalysisTaskdPhi&); // not implemented
108
109 ClassDef(AliAnalysisTaskdPhi, 2); // example of analysis
110};
111
112inline THnSparseF * AliAnalysisTaskdPhi::GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array) {
113 ///Get Mixed Event histogram
114 if(binz < 0 || binz > fAxisZ.GetNbins()) {
115 cout << "error out of z axis range: " << binz << endl;
116 return NULL;
117 }
118 if(binc < 0 || binc >= fAxisCent.GetNbins()) {
119 cout << "error out of centraliy axis range: " << binc << endl;
120 return NULL;
121 }
122
123 TObjArray * arrayc = static_cast<TObjArray*>(array->At(binz));
124 THnSparseF * histogram = static_cast<THnSparseF*>(arrayc->At(binc));
125 return histogram;
126}
127
128
129inline AliAnaConvCorrBase * AliAnalysisTaskdPhi::GetCorrObject(Int_t binz, Int_t binc, TObjArray * array) {
130 ///Get correlation object
131 if(binc < 0 || binz < 0) {
132 AliError("We have a bad bin!!!");
133 return NULL;
134 }
135
136 TObjArray * arrayc = static_cast<TObjArray*>(array->At(binz));
137 AliAnaConvCorrBase * corrmaker = static_cast<AliAnaConvCorrBase*>(arrayc->At(binc));
138 return corrmaker;
139
140}
141
142inline Int_t AliAnalysisTaskdPhi::GetBin(TAxis & axis, Double_t value) {
143 //Return bin - 1 if within range, else return -1
144 Int_t bin = axis.FindFixBin(value);
145
146
147 bin = (bin > 0 && bin <= axis.GetNbins()) ? bin -1 : -1;
148 return bin;
149}
150
151#endif
152