AliPhysics  1811c8f (1811c8f)
AliAnalysisTaskdPhi.h
Go to the documentation of this file.
1 //---------------------------------------------
3 // Class doing conversion gamma dPhi correlations
4 // Gamma Conversion analysis
5 //---------------------------------------------
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 <THn.h>
17 
18 //#include <AliAnalysisFilter.h>
19 #include <iostream>
20 //#include <AliAnaConvCorrBase.h>
21 #include <AliLog.h>
22 #include <AliAnalysisCuts.h>
23 //class AliAnaConvCorrPion;
24 class AliConvEventCuts;
27 class AliV0ReaderV1;
28 class TList;
29 class TH2I;
30 //class THnSparseF;
31 
32 using namespace std;
33 
35 
36 public:
37  AliAnalysisTaskdPhi(const char *name="slindal_dPhi");
38  virtual ~AliAnalysisTaskdPhi();
39 
40  virtual void UserCreateOutputObjects();
41  //virtual void SetUpCorrObjects();
42  // virtual void SetUpCorrAxes(AliAnaConvCorrBase * corr);
43  virtual void SetUpBins();
44  virtual void UserExec(Option_t *option);
45  virtual void Terminate(Option_t *);
46 
47  TAxis& GetAxistPt() { return fAxistPt; }
48  TAxis& GetAxiscPt() { return fAxiscPt; }
49  TAxis& GetAxisdEta() { return fAxisdEta; }
50  TAxis& GetAxisTrigEta() { return fAxisTrigEta; }
51  TAxis& GetAxisAssEta() { return fAxisAssEta; }
52  TAxis& GetAxisPhi() { return fAxisdPhi; }
53  TAxis& GetAxisZ() { return fAxisZ; }
54  TAxis& GetAxisCent() { return fAxisCent; }
55  TAxis& GetAxisPiMass() { return fAxisPiM; }
56 
57  void SetV0Filter(AliConvEventCuts * filterEvent, AliConversionPhotonCuts * filter) { fV0FilterEvent=filterEvent, fV0FilterPhoton = filter; }
58  void AddEventFilter(TObject * filter, Bool_t high = kTRUE) { fEventFilters[high].AddLast(filter); }
59  void AddV0Filter(TObject * filter, Bool_t high = kTRUE) { fV0Filters[high].AddLast(filter); }
60  void AddMesonFilter(TObject * filter, Bool_t high = kTRUE) { fMesonFilters[high].AddLast(filter); }
61  void AddTrackFilter(TObject * filter, Bool_t high = kTRUE) { fTrackFilters[high].AddLast(filter); }
62  void SetCorrectionMap(THnF * map) { fCorrectionMap = map; }
63 
64  void SetEventFilter(AliConvEventCuts * filter) { fEventFilter = filter; }
65  void SetMesonFilter(AliConversionMesonCuts * filter) { fMesonFilter = filter; }
66  void SetPhotonFilter(AliConversionPhotonCuts * filter) { fPhotonFilter = filter; }
67  void SetV0Reader(AliV0ReaderV1 * reader) { fV0Reader = reader; }
68  void SaveReaderHists(Bool_t save = kTRUE) { fSaveReaderHists = save; }
69  AliAnalysisCuts * GetTrackCuts() const { return fTrackFilter; }
70  void SetTrackFilter( AliAnalysisCuts * cuts) { if (fTrackFilter) delete fTrackFilter; fTrackFilter = cuts; }
71 
72 protected:
73 
74  TClonesArray * GetConversionGammas(Bool_t isAOD);
75 
76 private:
77 
78  //void CorrelateWithTracks(AliAODConversionParticle * particle, TObjArray tracks[], Int_t ntrackfilters, Bool_t ** lowtrackmap, Int_t nltf, Int_t const tIDs[4], Double_t dphiValues[]);
79  //void FillCounters(TObjArray * particles, TObjArray tracks[], Int_t ntrackfilters, Float_t cent, Float_t vtxz);
80 
81  Double_t GetTrackCorrection(Double_t vtxz, AliVTrack * track);
82 
83 
86  if ( dPhi < 3*TMath::PiOver2() && dPhi > - TMath::PiOver2() ) return dPhi;
87  else return ( (dPhi>0)? dPhi - TMath::TwoPi() : dPhi + TMath::TwoPi() );
88  }
89 
90  THnSparseF * CreateSparse(TString nameString, TString titleString, TList * axesList);
91  Int_t GetBin(TAxis &axis, Double_t value);
92  THnSparseF * GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array);
93  // AliAnaConvCorrBase * GetCorrObject(Int_t binz, Int_t binc, TObjArray * array);
94  void Process(TObjArray * gammas, TObjArray * tracks, Float_t cent, Float_t vtxz);
95  void FindDeltaAODBranchName(AliVEvent * event);
96 
97 
99  TList *fHistograms; //histograms
100  THnSparseF *fCorrSparse;
101  THnSparseF *fTrigSparse;
102  THnSparseF *fTrackSparse;
103  THnSparseF *fMassSparse;
104 
105  AliV0ReaderV1 *fV0Reader; // V0 reader
106  Bool_t fSaveReaderHists; // save histograms from v0 reader
107  AliConvEventCuts *fV0FilterEvent; // additional v0 filter on top of v0 reader
108  AliConversionPhotonCuts *fV0FilterPhoton; // additional v0 filter on top of v0 reader
109  TObjArray fV0Filters[2]; // Array of v0 filters, increasingly loose ideally.
110  TObjArray fEventFilters[2]; // Array of event filters, increasingly loose ideally.
111  AliConvEventCuts *fEventFilter; // additional v0 filter for events only
112  AliConversionPhotonCuts *fPhotonFilter; // additional v0 filter for photons only
113  AliConversionMesonCuts *fMesonFilter; // additional meson filter behind fv0filter
114  TObjArray fMesonFilters[2]; // Array of Meson filters
115  AliAnalysisCuts *fTrackFilter; // Cuts for corr tracks
116  TObjArray fTrackFilters[2]; // Array of track cuts
117 
120  //Int_t fTFBin; // Axis for track filters
121 
122  TH2I *hMEvents; // event histrogam
123  TH2I *hTrackCent; // event histrogam
124  TH3F *hTrigPt; // trigger pt
125  TH2F *hTrackPt; // track pt
126  TH1F *hTrigPhi; // trigger phi
127 
128  //AliAnaConvCorrBase * fPhotonCorr; // photon
129  //AliAnaConvCorrPion * fPionCorr; // pion
130 
132 
133  TAxis fAxistPt; // comment
134  TAxis fAxiscPt; // comment
135  TAxis fAxisdEta; // comment
136  TAxis fAxisTrigEta; // comment
137  TAxis fAxisAssEta; // comment
138  TAxis fAxisdPhi; // comment
139  TAxis fAxisCent; // comment
140  TAxis fAxisZ; // comment
141  TAxis fAxisPiM; // comment
143  TAxis fAxisV0Filters; // comment
145  Bool_t fkTrackAxis; // on or off
146  Bool_t fkV0Axis; // on or off
147  Bool_t fkPionAxis; // on or off
148 
149  TList fAxesList; // dphi axes list
150  TList fTrigAxesList; // Trigger axes list
151  TList fTrackAxesList; // Trackociated particles axes list
152  TList fMassAxesList; // Mass vs pt sparse
153 
154  Bool_t fDoPhoton; // do photon analysis?
156 
157 
158  AliAnalysisTaskdPhi(const AliAnalysisTaskdPhi&); // not implemented
159  AliAnalysisTaskdPhi& operator=(const AliAnalysisTaskdPhi&); // not implemented
160 
161  ClassDef(AliAnalysisTaskdPhi, 11);
162 };
163 
164 inline THnSparseF * AliAnalysisTaskdPhi::GetMEHistogram(Int_t binz, Int_t binc, TObjArray * array) {
166  if(binz < 0 || binz > fAxisZ.GetNbins()) {
167  cout << "error out of z axis range: " << binz << endl;
168  return NULL;
169  }
170  if(binc < 0 || binc >= fAxisCent.GetNbins()) {
171  cout << "error out of centraliy axis range: " << binc << endl;
172  return NULL;
173  }
174 
175  TObjArray * arrayc = static_cast<TObjArray*>(array->At(binc));
176  THnSparseF * histogram = static_cast<THnSparseF*>(arrayc->At(binz));
177  return histogram;
178 }
179 
180 
181 // inline AliAnaConvCorrBase * AliAnalysisTaskdPhi::GetCorrObject(Int_t binz, Int_t binc, TObjArray * array) {
182 // ///Get correlation object
183 // if(binc < 0 || binz < 0) {
184 // AliError("We have a bad bin!!!");
185 // return NULL;
186 // }
187 
188 // TObjArray * arrayc = static_cast<TObjArray*>(array->At(binc));
189 // AliAnaConvCorrBase * corrmaker = static_cast<AliAnaConvCorrBase*>(arrayc->At(binz));
190 // return corrmaker;
191 // }
192 
194  //Return bin - 1 if within range, else return -1
195  Int_t bin = axis.FindFixBin(value);
196  bin = (bin > 0 && bin <= axis.GetNbins()) ? bin -1 : -1;
197  return bin;
198 }
199 
200 #endif
201 
THnSparseF * GetMEHistogram(Int_t binz, Int_t binc, TObjArray *array)
void SetCorrectionMap(THnF *map)
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
AliAnalysisCuts * fTrackFilter
AliConversionMesonCuts * fMesonFilter
AliConversionPhotonCuts * fV0FilterPhoton
void SetPhotonFilter(AliConversionPhotonCuts *filter)
void SaveReaderHists(Bool_t save=kTRUE)
AliV0ReaderV1 * fV0Reader
AliConvEventCuts * fV0FilterEvent
void SetEventFilter(AliConvEventCuts *filter)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
void AddV0Filter(TObject *filter, Bool_t high=kTRUE)
TList * fHistograms
Members.
void SetMesonFilter(AliConversionMesonCuts *filter)
Float_t GetDPhi(Float_t dPhi)
Get the distance in phi between trigger particle and correlated particle.
Class handling all kinds of selection cuts for Gamma Conversion analysis.
void AddMesonFilter(TObject *filter, Bool_t high=kTRUE)
void SetV0Filter(AliConvEventCuts *filterEvent, AliConversionPhotonCuts *filter)
void SetTrackFilter(AliAnalysisCuts *cuts)
void AddEventFilter(TObject *filter, Bool_t high=kTRUE)
AliConvEventCuts * fEventFilter
Int_t GetBin(TAxis &axis, Double_t value)
AliAnalysisCuts * GetTrackCuts() const
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Class handling all kinds of selection cuts for Gamma Conversion analysis.
const char Option_t
Definition: External.C:48
void Process(Int_t *pflag[23040][7], TH1 *inhisto, Double_t Nsigma=4., Int_t dnbins=200, Double_t dmaxval=-1., Int_t compteur=1)
bool Bool_t
Definition: External.C:53
void SetV0Reader(AliV0ReaderV1 *reader)
AliConversionPhotonCuts * fPhotonFilter
void AddTrackFilter(TObject *filter, Bool_t high=kTRUE)