83c266f1700c1b4e72b8b210c5c582fb7cd5a9e6
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliPWG4HighPtTrackQA.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //-----------------------------------------------------------------------
17 // This class compares the global reconstruction with the MC information
18 // Author : Marta Verweij - UU
19 //-----------------------------------------------------------------------
20
21 #ifndef ALIPWG4HIGHPTTRACKQA_H
22 #define ALIPWG4HIGHPTTRACKQA_H
23
24 #include "AliAnalysisTaskSE.h"
25
26 class TH1F;
27 class TH2F;
28 class TH3F;
29 class TProfile;
30 class TList;
31 class TArrayF;
32
33 class AliVEvent;
34 class AliESDEvent;
35 class AliESDtrackCuts;
36 class AliESDVertex;
37 class AliAODTrack;
38
39 class AliGenPythiaEventHeader;
40 class AliMCEvent;
41 //class AliAnalysisHelperJetTasks;
42
43 class AliPWG4HighPtTrackQA: public AliAnalysisTaskSE {
44
45  public:
46   AliPWG4HighPtTrackQA();
47   AliPWG4HighPtTrackQA(const char *name);
48   virtual ~AliPWG4HighPtTrackQA() {;}
49  
50   //  virtual void   ConnectInputData(Option_t *);
51   virtual void   UserCreateOutputObjects();
52   virtual void   UserExec(Option_t *option);
53   virtual void   Terminate(Option_t *);
54   virtual Bool_t Notify(); //Copied from AliAnalysisTaskJetSpectrum2
55
56   enum DataType {kESD,kAOD};
57
58   Bool_t IsPbPb() {return fIsPbPb;}  //is PbPb data?
59   Bool_t SelectEvent();              //decides if event is used for analysis
60   Int_t CalculateCentrality(AliVEvent *ev);
61   Int_t CalculateCentrality(AliESDEvent *esd);
62   Int_t CalculateCentrality(AliAODEvent *aod);
63   void DoAnalysisESD();
64   void DoAnalysisAOD();
65   void FillHistograms();
66
67
68   //Setters
69   void SetDataType(DataType d)             {fDataType = d;}
70   void SetIsPbPb(Bool_t cs)                {fIsPbPb = cs;}
71   void SetCentralityClass(int cent)        {fCentClass=cent;}
72   void SetCuts(AliESDtrackCuts* trackCuts) {fTrackCuts = trackCuts;}
73   void SetTrackType(Int_t trackType) {fTrackType = trackType;}
74   void SetFilterMask(UInt_t filterMask)    {fFilterMask = filterMask;}
75
76   void SetPtMax(Float_t ptmax) {fPtMax = ptmax;}
77   void SetNVariables(Int_t nv) {fNVariables = nv;}
78
79   Float_t GetPtMax()           {return fPtMax;}
80   Float_t GetTPCClusterInfo(AliAODTrack *tr,Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159) const;
81
82   static AliGenPythiaEventHeader*  GetPythiaEventHeader(AliMCEvent *mcEvent);
83   static Bool_t PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials);// get the cross section and the trails either from pyxsec.root or from pysec_hists.root
84
85  protected:
86
87  private:
88   AliPWG4HighPtTrackQA(const AliPWG4HighPtTrackQA&);
89   AliPWG4HighPtTrackQA& operator=(const AliPWG4HighPtTrackQA&);
90
91   DataType fDataType;             //! kESD or kAOD
92
93   AliVEvent   *fEvent;
94   AliESDEvent *fESD;      //! ESD object
95   const AliESDVertex   *fVtx;     //! vertex object
96
97   AliESDtrackCuts *fTrackCuts;    // TrackCuts
98   Int_t   fTrackType;             // 0: global track; 1:TPConly track 2: TPConly constrained track 3: global ITSrefit
99   UInt_t fFilterMask;             //! Select tracks from specific track cuts belonging to certain filter mask for AOD analysis
100
101   Float_t fPtMax;                 // Maximum pT for histograms
102
103   Bool_t   fIsPbPb;               //  kTRUE if PbPb
104   Int_t fCentClass;               // Select only events from predefined centrality class
105
106   /*
107   0: pt
108   1: phi
109   2: eta
110   3: dca2D
111   4: dcaZ 
112   5: nClustersTPC
113   6: nPointITS   
114   7: chi2C       
115   8: nSigmaToVertex
116   9: relUncertainty1Pt
117   10: chi2PerClusterTPC
118   11: #crossed rows
119   12: (#crossed rows)/(#findable clusters)
120   */
121   Int_t fNVariables;             // Number of variables
122   TArrayF *fVariables;           // QA variables
123
124   Float_t fAvgTrials;             // Average number of trials
125   
126   TH1F *fNEventAll;                            //! Event counter
127   TH1F *fNEventSel;                            //! Event counter
128   TH1F *fNEventReject;                         //! Book keeping of reason of rejecting events
129  
130   TH1F *fh1Centrality;                         //! Centrality
131
132   TProfile*     fh1Xsec;                       //! pythia cross section and trials
133   TH1F*         fh1Trials;                     //! trials which are added
134   TH1F*         fh1PtHard;                     //! pt hard of the event
135   TH1F*         fh1PtHardTrials;               //! pt hard of the event
136
137   TH1F *fh1NTracksAll;                         //! All tracks
138   TH1F *fh1NTracksReject;                      //! Reason why track was rejected
139   TH1F *fh1NTracksSel;                         //! Number of accepted tracks
140
141   TH1F *fPtAll;                                //! Pt spectrum all charged particles
142   TH1F *fPtSel;                                //! Pt spectrum all selected charged particles by fTrackCuts
143   TH2F *fPtPhi;                                //! Pt vs Phi
144   TH2F *fPtEta;                                //! Pt vs Eta
145   TH2F *fPtDCA2D;                              //! Pt vs DCA2D
146   TH2F *fPtDCAZ;                               //! Pt vs DCAZ
147   TH2F *fPtNClustersTPC;                       //! Pt vs nClustersTPC
148   TH2F *fPtNPointITS;                          //! Pt vs nPointITS
149   TH2F *fPtChi2C;                              //! Pt vs Chi2C
150   TH2F *fPtNSigmaToVertex;                     //! Pt vs nSigmaToVertex
151   TH2F *fPtRelUncertainty1Pt;                  //! Pt vs relUncertainty1Pt
152   TH2F *fPtChi2PerClusterTPC;                  //! Pt vs Chi2PerClusterTPC
153   TH2F *fPtNCrossedRows;                       //! Pt vs NCrossedRows
154   TH2F *fPtNCrossedRowsNClusF;                 //! Pt vs NCrossedRows/NClusF
155   TH3F *fPtNCrRNCrRNClusF;                     //! Pt vs NCrossedRows vs NCrossedRows/NClusF 
156
157
158   TList *fHistList; //! List of Histograms
159   
160  
161   ClassDef(AliPWG4HighPtTrackQA,1) 
162   
163 };
164 #endif