AliPhysics  master (3d17d9d)
AliAnalysisTaskStudentsML.h
Go to the documentation of this file.
1 /*
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.
3  * See cxx source for full Copyright notice
4  * $Id$
5  */
6 
7 /**********************************************
8 * template class for student projects *
9 * author: Marcel Lesch (marcel.lesch@cern.ch) *
10 **********************************************/
11 
12 #ifndef ALIANALYSISTASKSTUDENTSML_H
13 #define ALIANALYSISTASKSTUDENTSML_H
14 
15 #include "AliAnalysisTaskSE.h"
16 #include "AliAODTrack.h"
17 #include "AliAODEvent.h"
18 #include "AliVEvent.h"
19 #include "TProfile.h"
20 #include "TH1F.h"
21 #include "TH1I.h"
22 #include "TComplex.h"
23 #include <TArrayD.h>
24 #include <vector>
25 #include "TMath.h"
26 #include "TF1.h"
27 #include "TRandom3.h"
28 #include "AliMCEvent.h"
29 #include "AliAODMCParticle.h"
30 #include "AliMCVertex.h"
31 #include "AliAODVertex.h"
32 #include "AliCentrality.h"
33 #include "AliHeader.h"
34 #include "TExMap.h"
35 #include "TDirectoryFile.h"
36 #include "TList.h"
37 #include "TFile.h"
38 #include "TSystem.h"
39 
40 //================================================================================================================
41 
43  public:
44 
46  AliAnalysisTaskStudentsML(const char *name, Bool_t useParticleWeights=kFALSE);
47  virtual ~AliAnalysisTaskStudentsML();
48  virtual void UserCreateOutputObjects();
49  virtual void UserExec(Option_t *);
50  virtual void Terminate(Option_t *);
51 
52  // 0.) Methods called in the constructor:
53  virtual void InitializeArrays();
54 
55  TComplex Q(Int_t n, Int_t p);
56  TComplex Recursion(Int_t n, Int_t* harmonic, Int_t mult, Int_t skip);
57  // 1.) Methods called in UserCreateOutputObjects():
58  virtual void BookAndNestAllLists();
59  virtual void BookControlHistograms();
60  virtual void BookFinalResultsHistograms();
61  virtual void Cosmetics();
62 
63  // 2.) Methods called in UserExec(Option_t *) or subsquent Methods:
64  virtual void PhysicsAnalysis(AliAODEvent *aAODEvent);
65  virtual void GetKineDist(AliAODEvent *aAODEve, AliMCEvent *aMCEve);
66 
68  Bool_t TrackSelection(AliAODTrack *aTrack);
69  Bool_t GlobalQualityAssurance(AliMCEvent *aMCKineEvent);
70  Bool_t TrackSelection(AliAODMCParticle *aMCtrack);
71 
72  virtual void CalculateWeight(Int_t RunNumber, Double_t* weights, Int_t Multi, Double_t* angles, Double_t* pt, Double_t* eta);
73  TH1F* GetHistogramWithWeights(Int_t RunNumber, const char *variable);
74 
75  virtual void CalculateQvectors(Int_t CalculateQvectors_nParticles, Double_t* CalculateQvectors_angles, Double_t* CalculateQvectors_weights);
76  TComplex CalculateMixedQVectors(Double_t Harm, Int_t M_A, Int_t M_B, Double_t* Ang_A, Double_t* Ang_B);
77  virtual void Correlation(Int_t Number, Int_t h1, Int_t h2, Int_t h3, Int_t h4, Int_t h5, Int_t h6, Int_t h7, Int_t h8, Int_t h9, Int_t h10, Int_t h11, Int_t h12, Double_t* Correlation_Angle, Int_t Correlation_Mult, Double_t* Correlation_Weight);
78 
79  virtual void MainTask(Int_t MainTask_Mult, Double_t* MainTask_Angle_Array, Double_t* MainTask_Weight_Array);
80  virtual void MixedParticle(Int_t Harmonicus, Int_t Mixed_Mult_A, Double_t* Mixed_Angle_A, Int_t Mixed_Mult_B, Double_t* Mixed_Angle_B);
81 
82  // 3.) Methods called in Terminate():
83  // ...
84 
85  // 4.) Setters and getters:
86  void SetControlHistogramsList(TList* const chl) {this->fControlHistogramsList = chl;};
88 
89  void SetFinalResultsList(TList* const frl) {this->fFinalResultsList = frl;};
90  TList* GetFinalResultsList() const {return this->fFinalResultsList;}
91 
92  void SetDoAnalysis(Bool_t DoAnalysis, Bool_t RicoKineTable){this->bDoAnalysis = DoAnalysis; this->bUseRecoKineTable = RicoKineTable;}
93 
94  void SetBoolMultCut(Bool_t top, Int_t otp){this->bMultCut = top; this->fSecondFilter=otp;}
95 
96  void SetUpperLineCut(Float_t slope, Float_t axis)
97  {this->fSlopeUpperLine = slope; this->fAxisUpperLine = axis; }
98 
99  void SetLowerLineCut(Float_t slope, Float_t axis)
100  {this->fSlopeLowerLine = slope; this->fAxisLowerLine = axis; }
101 
102  void SetFilter(Int_t top){this->fMainFilter = top;}
103 
105 
106  void SetUseWeights(Bool_t Weights, Bool_t Grid_Weight_Or_Local, Bool_t Phi, Bool_t Pt, Bool_t Eta, TString Period)
107  {this->bUseWeights = Weights; this->bGridWeights=Grid_Weight_Or_Local; this->bUsePhiWeights = Phi; this->bUsePtWeights = Pt; this->bUseEtaWeights = Eta; this->fPeriodUsedForWeight = Period;}
108 
109  void SetVertexX(Bool_t Cut, Double_t Min, Double_t Max)
110  {this->bCutOnVertexX=Cut; this->fMinVertexX=Min; this->fMaxVertexX=Max;}
111 
112  void SetVertexY(Bool_t Cut, Double_t Min, Double_t Max)
113  {this->bCutOnVertexY=Cut; this->fMinVertexY=Min; this->fMaxVertexY=Max;}
114 
115  void SetVertexZ(Bool_t Cut, Double_t Min, Double_t Max)
116  {this->bCutOnVertexZ=Cut; this->fMinVertexZ=Min; this->fMaxVertexZ=Max;}
117 
118  void SetEtaCut(Bool_t Cut, Double_t Min, Double_t Max)
119  {this->bCutOnEta=Cut; this->fMinEtaCut=Min; this->fMaxEtaCut=Max;}
120 
121  void SetPtCut(Bool_t Cut, Double_t Min, Double_t Max)
122  {this->bCutOnPt=Cut; this->fMinPtCut=Min; this->fMaxPtCut=Max;}
123 
125  {this->bNumberTPCCluster=Cut; this->fMinTPCCluster=Min; }
126 
128  {this->bNumberITSCluster=Cut; this->fMinITSCluster=Min; }
129 
131  {this->bChiSquareTPC=Cut; this->fMinChiSquareTPC=Min; this->fMaxChiSquareTPC=Max;}
132 
133  void SetDCAz(Bool_t Cut, Double_t Max)
134  {this->bDCAz=Cut; this->fMaxDCAz=Max;}
135 
136  void SetDCAxy(Bool_t Cut, Double_t Max)
137  {this->bDCAxy=Cut; this->fMaxDCAxy=Max;}
138 
139  void SetMinNuPar(Int_t top){this->fMinNumberPart = top;}
140  Int_t GetMinNuPar() const {return this->fMinNumberPart;}
141 
142  void SetCorrSet1(Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
143  {this->fNumber=Number; this->fh1=a; this->fh2=b; this->fh3=c; this->fh4=d; this->fh5=e; this->fh6=f; this->fh7=g; this->fh8=h; this->fh9=i; this->fh10=j; this->fh11=k; this->fh12=l;}
144 
145  void SetCorrSet2(Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
146  {this->fNumberSecond=Number; this->fa1=a; this->fa2=b; this->fa3=c; this->fa4=d; this->fa5=e; this->fa6=f; this->fa7=g; this->fa8=h; this->fa9=i; this->fa10=j;this->fa11=k; this->fa12=l;}
147 
148 void SetCorrSet3(Bool_t booly, Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
149  {this->bDoThirdCorrelation=booly; this->fNumberThird=Number; this->fb1=a; this->fb2=b; this->fb3=c; this->fb4=d; this->fb5=e; this->fb6=f; this->fb7=g; this->fb8=h; this->fb9=i; this->fb10=j;this->fb11=k; this->fb12=l;}
150 
151  void SetDoEbE(Bool_t top){this->bDoEbERatio=top;}
152 
153  void SetRatioWeight(Bool_t top){this->bUseRatioWeight=top;}
154 
156 
157  void SetMixed(Bool_t top, Int_t nop, Bool_t DifferentCharge, Bool_t PositiveCharge)
158  {this->bDoMixed = top; this->fMixedHarmonic = nop; this->bDifferentCharge = DifferentCharge;
159  this->bSetSameChargePositiv = PositiveCharge; }
160 
161  void SetMinCent(Float_t top){this->fMinCentrality = top;}
162  Float_t GetMinCent() const {return this->fMinCentrality;}
163 
164  void SetMaxCent(Float_t top){this->fMaxCentrality = top;}
165  Float_t GetMaxCent() const {return this->fMaxCentrality;}
166 
167 
168  void SetBinning(Int_t const nbins, Float_t min, Float_t max)
169  {
170  this->fNbins = nbins;
171  this->fMinBin = min;
172  this->fMaxBin = max;
173  };
174 
175  /*void SetHolder(Int_t const maxcorrelators)
176  {
177  this->fMaxCorrelator = maxcorrelators;
178  };*/
179 
180  private:
183 
184  // 0.) Base lists:
185  TList *fHistList; // base list to hold all output object (a.k.a. grandmother of all lists)
186 
187  // 1.) Control histograms:
188  TList *fControlHistogramsList; // list to hold all control histograms
189  Int_t fNbins; // number of bins
190  Float_t fMinBin; // min bin
191  Float_t fMaxBin; // min bin
192  TH1F *fPhiHistBeforeTrackSeletion; // atrack->Phi() - Distribution before Track Selection, all or positiv Particles
193  TH1F *fEtaHistBeforeTrackSeletion; // atrack->Eta() - Distribution before Track Selection, all or positiv Particles
194  TH1F *fPTHistBeforeTrackSeletction; // atrack->PT() - Distribution before Track Selection, all or positiv Particles
195  TH1F *fPhiHistBeforeTrackSeletionSecond; // atrack->Phi() - Distribution before Track Selection, negativ Particles
196  TH1F *fEtaHistBeforeTrackSeletionSecond; // atrack->Eta() - Distribution before Track Selection, negativ Particles
197  TH1F *fPTHistBeforeTrackSeletctionSecond; // atrack->PT() - Distribution before Track Selection, negativ Particles
198  TH1F *fTotalMultBeforeTrackSeletion; // total number of Multiplicity for a centrality before Track Selection
199  TH1F *fMultiHistoBeforeTrackSeletion; // multiplicity distribution before Track Selection
200 
201  TH1F *fPhiHistAfterTrackSeletion; // atrack->Phi() - Distribution before Track Selection, all or positiv Particles
202  TH1F *fEtaHistAfterTrackSeletion; // atrack->Eta() - Distribution before Track Selection, all or positiv Particles
203  TH1F *fPTHistAfterTrackSeletction; // atrack->PT() - Distribution before Track Selection, all or positiv Particles
204  TH1F *fPhiHistAfterTrackSeletionSecond; // atrack->Phi() - Distribution before Track Selection, negativ Particles
205  TH1F *fEtaHistAfterTrackSeletionSecond; // atrack->Eta() - Distribution before Track Selection, negativ Particles
206  TH1F *fPTHistAfterTrackSeletctionSecond; // atrack->PT() - Distribution before Track Selection, negativ Particles
207  TH1F *fTotalMultAfterTrackSeletion; // total number of Multiplicity for a centrality before Track Selection
208  TH1F *fMultiHistoAfterTrackSeletion; // multiplicity distribution after Track Selection, all or positiv Particles
209  TH1F *fMultiHistoAfterTrackSeletion_Second; // multiplicity distribution after Track Selection, negativ Particles
210  TH1F *fMultiHistoBeforeMultCut; // multiplicity distribution before high multiplicity outlier removel
211  TH1F *fTPCClustersBeforeCut; // Number of TPC clusters before cut
212  TH1F *fTPCClustersAfterCut; // Number of TPC clustes after cut
213  TH1F *fITSClustersBeforeCut; // Number of ITS clusters before cut
214  TH1F *fITSClustersAfterCut; // Number of ITS clusters after cut
215  TH1F *fChiSquareTPCBeforeCut; // Chi Square TPC before cut
216  TH1F *fChiSquareTPCAfterCut; // Chi Square TPC after cut
217  TH1F *fDCAzBeforeCut; // DCAz before cut
218  TH1F *fDCAzAfterCut; // DCAz after cut
219  TH1F *fDCAxyBeforeCut; // DCAxy before cut
220  TH1F *fDCAxyAfterCut; // DCAxy after cut
221 
222 
223  //2.) SelectionCuts
224  Bool_t bDoAnalysis; // if kTRUE: Run of AODs (real Data or MC on Recon level) -> Does Anaylsis, if kFALSE: -> Get Weights
225  Bool_t bUseRecoKineTable; // Necessary if bDoAnalysis = kFALSE
227  Int_t fMainFilter; // for main filter selection (default: Hypbrid)
228  Int_t fSecondFilter; // for filter selection (default: global)
229  Float_t fSlopeUpperLine; // slope of the upper line for multiplicity cut
230  Float_t fAxisUpperLine; // axis intercept of the upper line for multiplicity cut
231  Float_t fSlopeLowerLine; // slope of the lower line for multiplicity cut
232  Float_t fAxisLowerLine; // axis intercept of the lower line for multiplicity cut
233 
234  //Global
235  Float_t fMinCentrality; // min centrality (default 0.)
236  Float_t fMaxCentrality; // max centrality (default 100.)
237  Bool_t bCutOnVertexX; // Bool to apply Vertex Cut in X (default kFALSE)
238  Bool_t bCutOnVertexY; // Bool to apply Vertex Cut in Y (default kFALSE)
239  Bool_t bCutOnVertexZ; // Bool to apply Vertex Cut in Z (default kFALSE)
240  Double_t fMinVertexX; // min vertex cut X (default -44)
241  Double_t fMaxVertexX; // max vertex cut X (default -44)
242  Double_t fMinVertexY; // min vertex cut Y (default -44)
243  Double_t fMaxVertexY; // max vertex cut Y (default -44)
244  Double_t fMinVertexZ; // min vertex cut Z (default -10 cm)
245  Double_t fMaxVertexZ; // max vertex cut Z (default +10 cm)
246  TH1F *fVertexXBefore; // Histogram Vertex X before vertex cut
247  TH1F *fVertexXAfter; // Histogram Vertex X after vertex cut
248  TH1F *fVertexYBefore; // Histogram Vertex Y before vertex cut
249  TH1F *fVertexYAfter; // Histogram Vertex Y after vertex cut
250  TH1F *fVertexZBefore; // Histogram Vertex Z before vertex cut
251  TH1F *fVertexZAfter; // Histogram Vertex Z after vertex cut
252  Bool_t fCentralityfromVZero; // if kTRUE: Use V0 as centrality estimator, if kFALSE: SPD Cluster
253 
254  //Physics-Selection
255  Bool_t bCutOnEta; // Bool to apply eta cuts (default kTRUE)
256  Bool_t bCutOnPt; // Bool to apply pt cuts (default kTRUE)
257  Bool_t bNumberTPCCluster; // Bool to apply cuts on number of TPC clusters (default kTRUE)
258  Bool_t bNumberITSCluster; // Bool to apply cuts on number of ITS clusters (default kTRUE)
259  Bool_t bChiSquareTPC; // Bool to apply cuts on chi square TPC (default kTRUE)
260  Bool_t bDCAz; // Bool to apply cuts on DCAz (default kTRUE)
261  Bool_t bDCAxy; // Bool to apply cuts on DCAxy (default kTRUE)
262  Double_t fMinEtaCut; // min eta cut (default -0.8)
263  Double_t fMaxEtaCut; // max eta cut (default 0.8)
264  Double_t fMinPtCut; // min pt cut (default 0.2)
265  Double_t fMaxPtCut; // max pt cut (default 5.0)
266  Int_t fMinTPCCluster; // Number of minimum TPC clusters (default 70)
267  Int_t fMinITSCluster; // Number of minimum ITS clusters (default 2)
268  Double_t fMinChiSquareTPC; // Minimal Chi Square TPC (default 0.1)
269  Double_t fMaxChiSquareTPC; // Maximal Chi Square TPC (default 4.0)
270  Double_t fMaxDCAz; // Maximal DCAz (default 3.2 cm)
271  Double_t fMaxDCAxy; // Maximal DCAxy (default 2.4 cm)
272 
273  //Weights
278  Bool_t bGridWeights; //Use Weights on Grid (kTRUE, default) or some local Testing (kFALSE)
280  TH1F *fWeightsHist[3];
281 
282 
283  //3.) Variables for the correlation:
284  Int_t fMaxCorrelator; // maximum of correlation
285  TProfile *fRecursion[2][12];
286 
287  Int_t fNumber; // Number of correlation first correlator
288  Int_t fNumberSecond; // Number of correlation second correlator
289  Int_t fNumberThird; // Number of correlation third correlator
290  Bool_t bDoThirdCorrelation; // if kTRUE: do the third correlation (default kFALSE)
291  Int_t fMinNumberPart; // Minimal number of particles to do correlation
292  Bool_t bUseRatioWeight; // use number of combination weight for EbE Ratio (default kTRUE)
293  Double_t fDenominatorMinValue; // min value for the denominator in EbE Ratio (default
294 
295  Int_t fh1, fh2, fh3, fh4, fh5, fh6, fh7, fh8, fh9, fh10, fh11, fh12; //harmonics
296  Int_t fa1, fa2, fa3, fa4, fa5, fa6, fa7, fa8, fa9, fa10, fa11, fa12; //second set of harmonics
297  Int_t fb1, fb2, fb3, fb4, fb5, fb6, fb7, fb8, fb9, fb10, fb11, fb12; //third set of harmonics
298 
299  TComplex fQvector[97][13];
300 
301  // 4.) Final results:
302 
303  TProfile *fCentrality; // final centrality result
304  TProfile *fCentralitySecond; // final centrality result for second harmonics
305  TProfile *fCentralityThird; // final centrality result for third harmonics
306  TProfile *fEvCentrality; // final centrality result for event version
307  Bool_t bDoEbERatio; // if kTRUE: Do the EbE ratio, Default: kFALSE
308  TProfile *fMixedParticleHarmonics; // Stores output for special mixed particle analysis
309  Bool_t bDoMixed; // if kTRUE: Do special mixed particle analysis, default kFALSE (MainTask)
310  Bool_t bDifferentCharge; // used in DoMixed: if kTRUE mixed particle analysis between positiv and negativ
311  // if kFALSE mixed particle analysis between same charge
312  // (only positiv or only negativ particles)
313  // Default kTRUE
314  Bool_t bSetSameChargePositiv; // used if bDifferentCharge: if kTRUE use positiv, if kFALSE use negative (default kTRUE)
315  Int_t fMixedHarmonic; // Harmonic of special mixed particle analysis
316  TH1F *fCounterHistogram; // for some checks
317  TList *fFinalResultsList; // list to hold all histograms with final results
318 
319 
320 
321  ClassDef(AliAnalysisTaskStudentsML,26);
322 
323 };
324 
325 //================================================================================================================
326 
327 #endif
Int_t fMaxCorrelator
histograms holding weights [phi,pt,eta]
double Double_t
Definition: External.C:58
void SetCorrSet1(Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
void SetVertexY(Bool_t Cut, Double_t Min, Double_t Max)
virtual void CalculateQvectors(Int_t CalculateQvectors_nParticles, Double_t *CalculateQvectors_angles, Double_t *CalculateQvectors_weights)
virtual void Terminate(Option_t *)
TProfile * fCentrality
//[fMaxHarmonic*fMaxCorrelator+1][fMaxCorrelator+1]
Bool_t GlobalQualityAssurance(AliAODEvent *aAODevent)
TComplex CalculateMixedQVectors(Double_t Harm, Int_t M_A, Int_t M_B, Double_t *Ang_A, Double_t *Ang_B)
virtual void MainTask(Int_t MainTask_Mult, Double_t *MainTask_Angle_Array, Double_t *MainTask_Weight_Array)
void SetDCAxy(Bool_t Cut, Double_t Max)
void SetChiSquareTPC(Bool_t Cut, Double_t Min, Double_t Max)
TCanvas * c
Definition: TestFitELoss.C:172
virtual void CalculateWeight(Int_t RunNumber, Double_t *weights, Int_t Multi, Double_t *angles, Double_t *pt, Double_t *eta)
TH1F * GetHistogramWithWeights(Int_t RunNumber, const char *variable)
void SetMixed(Bool_t top, Int_t nop, Bool_t DifferentCharge, Bool_t PositiveCharge)
void SetVertexX(Bool_t Cut, Double_t Min, Double_t Max)
void SetCorrSet2(Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
void SetPtCut(Bool_t Cut, Double_t Min, Double_t Max)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
void SetEtaCut(Bool_t Cut, Double_t Min, Double_t Max)
virtual void MixedParticle(Int_t Harmonicus, Int_t Mixed_Mult_A, Double_t *Mixed_Angle_A, Int_t Mixed_Mult_B, Double_t *Mixed_Angle_B)
void SetCorrSet3(Bool_t booly, Int_t Number, Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t i, Int_t j, Int_t k, Int_t l)
void SetBoolMultCut(Bool_t top, Int_t otp)
void SetFinalResultsList(TList *const frl)
void SetBinning(Int_t const nbins, Float_t min, Float_t max)
virtual void Correlation(Int_t Number, Int_t h1, Int_t h2, Int_t h3, Int_t h4, Int_t h5, Int_t h6, Int_t h7, Int_t h8, Int_t h9, Int_t h10, Int_t h11, Int_t h12, Double_t *Correlation_Angle, Int_t Correlation_Mult, Double_t *Correlation_Weight)
void SetUpperLineCut(Float_t slope, Float_t axis)
void SetNumberTPCClusters(Bool_t Cut, Int_t Min)
virtual void PhysicsAnalysis(AliAODEvent *aAODEvent)
virtual void GetKineDist(AliAODEvent *aAODEve, AliMCEvent *aMCEve)
void SetDCAz(Bool_t Cut, Double_t Max)
void SetVertexZ(Bool_t Cut, Double_t Min, Double_t Max)
void SetControlHistogramsList(TList *const chl)
const char Option_t
Definition: External.C:48
void SetUseWeights(Bool_t Weights, Bool_t Grid_Weight_Or_Local, Bool_t Phi, Bool_t Pt, Bool_t Eta, TString Period)
Bool_t TrackSelection(AliAODTrack *aTrack)
void SetLowerLineCut(Float_t slope, Float_t axis)
const Int_t nbins
bool Bool_t
Definition: External.C:53
void SetDoAnalysis(Bool_t DoAnalysis, Bool_t RicoKineTable)
TComplex Recursion(Int_t n, Int_t *harmonic, Int_t mult, Int_t skip)
AliAnalysisTaskStudentsML & operator=(const AliAnalysisTaskStudentsML &aatmpf)
void SetNumberITSClusters(Bool_t Cut, Int_t Min)