]>
Commit | Line | Data |
---|---|---|
3b77b2d1 | 1 | //////////////////////////////////////////////// |
2 | //--------------------------------------------- | |
3 | // Class doing conversion gamma dPhi correlations | |
4 | // Gamma Conversion analysis | |
5 | //--------------------------------------------- | |
6 | //////////////////////////////////////////////// | |
7 | ||
92efd725 | 8 | #ifndef AliAnalysisTaskdPhi_cxx |
9 | #define AliAnalysisTaskdPhi_cxx | |
3b77b2d1 | 10 | |
11 | #include "AliAnalysisTaskSE.h" | |
12 | ||
13 | #include <TAxis.h> | |
14 | #include <TH3I.h> | |
15 | #include <THnSparse.h> | |
c15c23b8 | 16 | //#include <AliAnalysisFilter.h> |
3b77b2d1 | 17 | #include <iostream> |
65ec4890 | 18 | //#include <AliAnaConvCorrBase.h> |
3b77b2d1 | 19 | #include <AliLog.h> |
4267afec | 20 | #include <AliAnalysisCuts.h> |
65ec4890 | 21 | //class AliAnaConvCorrPion; |
3b77b2d1 | 22 | class AliConversionCuts; |
c15c23b8 | 23 | class AliConversionMesonCuts; |
24 | class AliV0ReaderV1; | |
3b77b2d1 | 25 | class TList; |
26 | class TH2I; | |
27 | //class THnSparseF; | |
28 | ||
29 | using namespace std; | |
30 | ||
31 | class AliAnalysisTaskdPhi : public AliAnalysisTaskSE { | |
65ec4890 | 32 | |
3b77b2d1 | 33 | public: |
c15c23b8 | 34 | AliAnalysisTaskdPhi(const char *name="slindal_dPhi"); |
3b77b2d1 | 35 | virtual ~AliAnalysisTaskdPhi(); |
65ec4890 | 36 | |
3b77b2d1 | 37 | virtual void UserCreateOutputObjects(); |
65ec4890 | 38 | //virtual void SetUpCorrObjects(); |
39 | // virtual void SetUpCorrAxes(AliAnaConvCorrBase * corr); | |
40 | virtual void SetUpBins(); | |
3b77b2d1 | 41 | virtual void UserExec(Option_t *option); |
42 | virtual void Terminate(Option_t *); | |
65ec4890 | 43 | |
9e6bd607 | 44 | TAxis& GetAxistPt() { return fAxistPt; } |
45 | TAxis& GetAxiscPt() { return fAxiscPt; } | |
46 | TAxis& GetAxisdEta() { return fAxisdEta; } | |
47 | TAxis& GetAxisTrigEta() { return fAxisTrigEta; } | |
48 | TAxis& GetAxisAssEta() { return fAxisAssEta; } | |
65ec4890 | 49 | TAxis& GetAxisPhi() { return fAxisdPhi; } |
9e6bd607 | 50 | TAxis& GetAxisZ() { return fAxisZ; } |
51 | TAxis& GetAxisCent() { return fAxisCent; } | |
52 | TAxis& GetAxisPiMass() { return fAxisPiM; } | |
65ec4890 | 53 | |
3b77b2d1 | 54 | void SetV0Filter(AliConversionCuts * filter) { fV0Filter = filter; } |
65ec4890 | 55 | void AddV0Filter(TObject * filter, Bool_t high = kTRUE) { fV0Filters[high].AddLast(filter); } |
56 | void AddMesonFilter(TObject * filter, Bool_t high = kTRUE) { fMesonFilters[high].AddLast(filter); } | |
57 | void AddTrackFilter(TObject * filter, Bool_t high = kTRUE) { fTrackFilters[high].AddLast(filter); } | |
439cf020 | 58 | |
c15c23b8 | 59 | void SetMesonFilter(AliConversionMesonCuts * filter) { fMesonFilter = filter; } |
60 | void SetPhotonFilter(AliConversionCuts * filter) { fPhotonFilter = filter; } | |
439cf020 | 61 | void SetV0Reader(AliV0ReaderV1 * reader) { fV0Reader = reader; } |
62 | void SaveReaderHists(Bool_t save = kTRUE) { fSaveReaderHists = save; } | |
65ec4890 | 63 | AliAnalysisCuts * GetTrackCuts() const { return fTrackFilter; } |
64 | void SetTrackFilter( AliAnalysisCuts * cuts) { if (fTrackFilter) delete fTrackFilter; fTrackFilter = cuts; } | |
3b77b2d1 | 65 | |
66 | protected: | |
67 | ||
68 | TClonesArray * GetConversionGammas(Bool_t isAOD); | |
65ec4890 | 69 | |
ca257f2a | 70 | private: |
65ec4890 | 71 | |
72 | //void CorrelateWithTracks(AliAODConversionParticle * particle, TObjArray tracks[], Int_t ntrackfilters, Bool_t ** lowtrackmap, Int_t nltf, Int_t const tIDs[4], Double_t dphiValues[]); | |
73 | //void FillCounters(TObjArray * particles, TObjArray tracks[], Int_t ntrackfilters, Float_t cent, Float_t vtxz); | |
74 | ||
75 | ///Get the distance in phi between trigger particle and correlated particle | |
76 | Float_t GetDPhi(Float_t dPhi) { | |
77 | if ( dPhi < 3*TMath::PiOver2() && dPhi > - TMath::PiOver2() ) return dPhi; | |
78 | else return ( (dPhi>0)? dPhi - TMath::TwoPi() : dPhi + TMath::TwoPi() ); | |
79 | } | |
80 | ||
81 | ||
3b77b2d1 | 82 | |
83 | THnSparseF * CreateSparse(TString nameString, TString titleString, TList * axesList); | |
84 | Int_t GetBin(TAxis &axis, Double_t value); | |
85 | THnSparseF * GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array); | |
65ec4890 | 86 | // AliAnaConvCorrBase * GetCorrObject(Int_t binz, Int_t binc, TObjArray * array); |
6252ea9d | 87 | void Process(TObjArray * gammas, TObjArray * tracks, Float_t cent, Float_t vtxz); |
e3598cd0 | 88 | void FindDeltaAODBranchName(AliVEvent * event); |
3b77b2d1 | 89 | |
65ec4890 | 90 | |
91 | ///Members | |
3b77b2d1 | 92 | TList * fHistograms; //histograms |
65ec4890 | 93 | THnSparseF * fCorrSparse; |
94 | THnSparseF * fTrigSparse; | |
95 | THnSparseF * fTrackSparse; | |
96 | THnSparseF * fMassSparse; | |
92efd725 | 97 | |
c15c23b8 | 98 | AliV0ReaderV1 * fV0Reader; // V0 reader |
6252ea9d | 99 | Bool_t fSaveReaderHists; // save histograms from v0 reader |
c15c23b8 | 100 | AliConversionCuts * fV0Filter; //additional v0 filter on top of v0 reader |
65ec4890 | 101 | TObjArray fV0Filters[2]; // Array of v0 filters, increasingly loose ideally. |
c15c23b8 | 102 | AliConversionCuts * fPhotonFilter; //additional v0 filter for photons only |
103 | AliConversionMesonCuts * fMesonFilter; //additional meson filter behind fv0filter | |
65ec4890 | 104 | TObjArray fMesonFilters[2]; // Array of Meson filters |
105 | AliAnalysisCuts * fTrackFilter; //Cuts for corr tracks | |
106 | TObjArray fTrackFilters[2]; // Array of track cuts | |
107 | ||
108 | TObjArray fGammas; | |
109 | TObjArray fTracks; | |
110 | //Int_t fTFBin; // Axis for track filters | |
3b77b2d1 | 111 | |
3b77b2d1 | 112 | TH2I * hMEvents; //event histrogam |
439cf020 | 113 | TH2I * hTrackCent; //event histrogam |
a8515f2e | 114 | TH2F * hTrigPt; // trigger pt |
115 | TH2F * hTrackPt; // track pt | |
116 | ||
3b77b2d1 | 117 | |
65ec4890 | 118 | //AliAnaConvCorrBase * fPhotonCorr; //photon |
119 | //AliAnaConvCorrPion * fPionCorr; //poin | |
3b77b2d1 | 120 | |
121 | TString fDeltaAODBranchName; //comment | |
122 | ||
3bff49c3 | 123 | TAxis fAxistPt; //comment |
124 | TAxis fAxiscPt; //comment | |
9e6bd607 | 125 | TAxis fAxisdEta; //comment |
126 | TAxis fAxisTrigEta; //comment | |
127 | TAxis fAxisAssEta; //comment | |
65ec4890 | 128 | TAxis fAxisdPhi; //comment |
3b77b2d1 | 129 | TAxis fAxisCent; //comment |
130 | TAxis fAxisZ; //comment | |
131 | TAxis fAxisPiM; //comment | |
65ec4890 | 132 | TAxis fAxisTrackFilters; //comment |
133 | TAxis fAxisV0Filters; //comment | |
134 | TAxis fAxisMesonFilters; //comment | |
135 | Bool_t fkTrackAxis; // on or off | |
136 | Bool_t fkV0Axis; // on or off | |
137 | Bool_t fkPionAxis; // on or off | |
138 | ||
139 | TList fAxesList; //dphi axes list | |
140 | TList fTrigAxesList; // Trigger axes list | |
141 | TList fTrackAxesList; //Trackociated particles axes list | |
142 | TList fMassAxesList; // Mass vs pt sparse | |
6252ea9d | 143 | |
144 | Bool_t fDoPhoton; // do photon analysis? | |
3b77b2d1 | 145 | |
146 | AliAnalysisTaskdPhi(const AliAnalysisTaskdPhi&); // not implemented | |
147 | AliAnalysisTaskdPhi& operator=(const AliAnalysisTaskdPhi&); // not implemented | |
148 | ||
a8515f2e | 149 | ClassDef(AliAnalysisTaskdPhi, 9); |
3b77b2d1 | 150 | }; |
151 | ||
152 | inline THnSparseF * AliAnalysisTaskdPhi::GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array) { | |
153 | ///Get Mixed Event histogram | |
154 | if(binz < 0 || binz > fAxisZ.GetNbins()) { | |
155 | cout << "error out of z axis range: " << binz << endl; | |
156 | return NULL; | |
157 | } | |
158 | if(binc < 0 || binc >= fAxisCent.GetNbins()) { | |
159 | cout << "error out of centraliy axis range: " << binc << endl; | |
160 | return NULL; | |
161 | } | |
162 | ||
c15c23b8 | 163 | TObjArray * arrayc = static_cast<TObjArray*>(array->At(binc)); |
164 | THnSparseF * histogram = static_cast<THnSparseF*>(arrayc->At(binz)); | |
3b77b2d1 | 165 | return histogram; |
166 | } | |
167 | ||
168 | ||
65ec4890 | 169 | // inline AliAnaConvCorrBase * AliAnalysisTaskdPhi::GetCorrObject(Int_t binz, Int_t binc, TObjArray * array) { |
170 | // ///Get correlation object | |
171 | // if(binc < 0 || binz < 0) { | |
172 | // AliError("We have a bad bin!!!"); | |
173 | // return NULL; | |
174 | // } | |
3b77b2d1 | 175 | |
65ec4890 | 176 | // TObjArray * arrayc = static_cast<TObjArray*>(array->At(binc)); |
177 | // AliAnaConvCorrBase * corrmaker = static_cast<AliAnaConvCorrBase*>(arrayc->At(binz)); | |
178 | // return corrmaker; | |
179 | // } | |
3b77b2d1 | 180 | |
181 | inline Int_t AliAnalysisTaskdPhi::GetBin(TAxis & axis, Double_t value) { | |
182 | //Return bin - 1 if within range, else return -1 | |
183 | Int_t bin = axis.FindFixBin(value); | |
184 | ||
185 | ||
186 | bin = (bin > 0 && bin <= axis.GetNbins()) ? bin -1 : -1; | |
187 | return bin; | |
188 | } | |
189 | ||
190 | #endif | |
191 |