Added PID task, some fixes for coding conventions
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskPWG4PidDetEx.h
1 #ifndef ALIANALYSISTASKPWG4PidDetEx_H
2 #define ALIANALYSISTASKPWG4PidDetEx_H
3
4 #include <TList.h>
5 #include <TH1.h>
6 #include <TH2.h>
7 #include <TProfile.h>
8
9 #include "AliAnalysisTaskSE.h"
10 #include "AliAODEvent.h"
11 #include "AliESDEvent.h"
12 #include "AliAnalysisFilter.h"
13
14 class AliAnalysisTaskPWG4PidDetEx : public AliAnalysisTaskSE {
15  public:
16   enum TriggerMode {kMB1, kMB2, kSPDFASTOR}; 
17
18   AliAnalysisTaskPWG4PidDetEx();
19   AliAnalysisTaskPWG4PidDetEx(const char *name);
20   virtual ~AliAnalysisTaskPWG4PidDetEx();
21
22   virtual void   ConnectInputData(Option_t *);
23   virtual void   CreateOutputObjects();
24   virtual void   Exec(Option_t *option);
25   virtual void   Terminate(Option_t *); 
26
27   virtual void  SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
28   void  SetAnalysisType(const char* analysisType) {fAnalysisType = analysisType;}
29   void  SetTriggerMode(TriggerMode triggermode) {fTriggerMode = triggermode;}
30   void  SetMC(Bool_t analysisMC){fAnalysisMC = analysisMC;}
31   void  SetPtCut(Double_t ptCut){fPtCut = ptCut;}
32   void  SetEtaCut(Double_t etaCut){fEtaCut = etaCut;}
33
34   Bool_t IsEventTriggered(AliVEvent* ev, TriggerMode trigger);
35
36   void AnalyzeESD(AliESDEvent* esd);
37   void AnalyzeAOD(AliAODEvent* aod);
38
39  private:
40   AliAnalysisTaskPWG4PidDetEx(const AliAnalysisTaskPWG4PidDetEx&);
41   AliAnalysisTaskPWG4PidDetEx& operator=(const AliAnalysisTaskPWG4PidDetEx&);
42
43   Double_t IntegratedLength(AliVTrack* track) const;
44   Double_t MassSquared     (AliVTrack* track) const;
45   Double_t KaonDecay       (AliVTrack* track) const;
46
47   static const Double_t fgkCtau;                //  distance for kaon decay
48   static const Double_t fgkPionMass;            //  pion mass
49   static const Double_t fgkKaonMass;            //  kaon mass
50   static const Double_t fgkProtonMass;          //  proton mass
51
52
53   AliESDEvent* fESD;                //! ESD object
54   AliAODEvent* fAOD;                //! AOD object
55   TList*       fListOfHists;        //! Output list of histograms
56   Double_t     fEtaCut;             //  Eta cut used to select particles
57   Double_t     fPtCut;              //  pT cut used to select particles
58   Int_t        fXbins;              //  #bins for Pt histos range
59   Double_t     fXmin;               //  min X value for histo range
60   Double_t     fTOFCutP;            //  max X value for histo range; also the p cut used in TOF for PID
61
62   AliAnalysisFilter* fTrackFilter;  //  Track Filter
63   Bool_t       fAnalysisMC;         //  Flag for MC analysis
64   TString      fAnalysisType;       //  "ESD" or "AOD"
65   TriggerMode  fTriggerMode;        //  Trigger mode
66
67
68   //Histograms
69   TH1I*         fEvents;             //! #analyzed events           
70   TH1F*         fEffTot;             //! pT for all charged particles
71   TH1F*         fEffPID;             //! pT for charged particles with TOF signal
72   TH1F*         fAccP;               //! pT for charged particles with p < fTOFCutP
73   TH1F*         fAccPt;              //! pT for charged particles with pT < fTOFCutP
74   TProfile*     fKaonDecayCorr;      //! decay correction for Kaons
75   TH1F*         fdNdPt;              //! pT dist (Rec)
76   TH2F*         fMassAll;            //! mass calculated from TOF vs p
77   TH1F*         fdNdPtPion;          //! pT for pions identified with TOF
78   TH2F*         fMassPion;           //! mass for pions identified with TOF
79   TH2F*         fdEdxTPCPion;        //! dE/dx vs p (TPC) for pions identified with TOF
80   TH2F*         fbgTPCPion;          //! dE/dx vs betagamma (TPC) for pions identified with TOF
81   TH1F*         fdNdPtKaon;          //! pT for kaons identified with TOF
82   TH2F*         fMassKaon;           //! mass for kaons identified with TOF
83   TH2F*         fdEdxTPCKaon;        //! dE/dx vs p (TPC) for kaons identified with TOF
84   TH2F*         fbgTPCKaon;          //! dE/dx vs betagamma (TPC) for kaons identified with TOF
85   TH1F*         fdNdPtProton;        //! pT for protons identified with TOF
86   TH2F*         fMassProton;         //! mass for protons identified with TOF
87   TH2F*         fdEdxTPCProton;      //! dE/dx vs p (TPC) for protons identified with TOF
88   TH2F*         fbgTPCProton;        //! dE/dx vs betagamma (TPC) for protons identified with TOF
89   TH1F*         fdNdPtMC;            //! pT dist (MC)
90   TH1F*         fdNdPtMCPion;        //! pT dist for pions (MC)
91   TH1F*         fdNdPtMCKaon;        //! pT dist for kaons (MC)
92   TH1F*         fdNdPtMCProton;      //! pT dist for protons (MC)
93
94   ClassDef(AliAnalysisTaskPWG4PidDetEx, 1);    //Analysis task for PWG4 PID using detector signals 
95 };
96
97 #endif