create general emcal task lib
[u/mrichter/AliRoot.git] / PWG / EMCAL / AliAnalysisTaskEmcal.h
1 #ifndef ALIANALYSISTASKEMCAL_H
2 #define ALIANALYSISTASKEMCAL_H
3
4 // $Id: AliAnalysisTaskEmcal.h 56756 2012-05-30 05:03:02Z loizides $
5
6 class TClonesArray;
7 class TString;
8 class TList;
9 class AliEmcalParticle;
10 class AliMCParticle;
11 class AliVCluster;
12 class AliVTrack;
13
14 #include "AliAnalysisTaskSE.h"
15
16 class AliAnalysisTaskEmcal : public AliAnalysisTaskSE {
17  public:
18   
19   enum EmcalAnaType {
20     kTPC       = 0,     // TPC only analysis
21     kEMCAL     = 1,     // EMCal + TPC analysis
22     kTPCSmall  = 2,     // TPC only in EMCal acceptance
23     kEMCALOnly = 3,     // EMCal only analysis
24   };
25
26   enum BeamType {
27     kNA       = -1,
28     kpp       = 0,
29     kAA       = 1,
30     kpA       = 2
31   };
32
33   AliAnalysisTaskEmcal();
34   AliAnalysisTaskEmcal(const char *name, Bool_t histo=kFALSE); 
35   virtual ~AliAnalysisTaskEmcal();
36
37   void                        UserExec(Option_t *option);
38
39   void                        SetAnaType(EmcalAnaType type)                         { fAnaType        = type;         }
40   void                        SetCentRange(Double_t min, Double_t max)              { fMinCent = min; fMaxCent = max; }
41   void                        SetClusName(const char *n)                            { fCaloName       = n;            }
42   void                        SetClusPtCut(Double_t cut)                            { fClusPtCut      = cut;          }
43   void                        SetClusTimeCut(Double_t min, Double_t max)            { fClusTimeCutLow = min; fClusTimeCutUp = max;      }
44   void                        SetHistoBins(Int_t nbins, Double_t min, Double_t max) { fNbins = nbins; fMinBinPt = min; fMaxBinPt = max; }
45   void                        SetOffTrigger(UInt_t t)                               { fOffTrigger    = t;                               }
46   void                        SetPtCut(Double_t cut)                                { SetClusPtCut(cut); SetTrackPtCut(cut);            }
47   void                        SetTrackPtCut(Double_t cut)                           { fTrackPtCut     = cut;          }
48   void                        SetTrackEtaLimits(Double_t min, Double_t max)         { fMaxTrackEta      = max ; fMinTrackEta      = min ; }
49   void                        SetTrackPhiLimits(Double_t min, Double_t max)         { fMaxTrackPhi      = max ; fMinTrackPhi      = min ; }
50   void                        SetTracksName(const char *n)                          { fTracksName     = n;            }
51   void                        SetTrigClass(const char *n)                           { fTrigClass = n;                 } 
52   void                        SetVzRange(Double_t min, Double_t max)                { fMinVz = min; fMaxVz   = max;   }
53
54  protected:
55   Bool_t                      AcceptCluster(AliVCluster        *clus,  Bool_t acceptMC = kFALSE) const;
56   Bool_t                      AcceptEmcalPart(AliEmcalParticle *part,  Bool_t acceptMC = kFALSE) const;
57   Bool_t                      AcceptTrack(AliVTrack            *track, Bool_t acceptMC = kFALSE) const;
58   virtual void                ExecOnce();
59   virtual Bool_t              FillHistograms()                                     { return fCreateHisto; }
60   BeamType                    GetBeamType();
61   TClonesArray               *GetArrayFromEvent(const char *name, const char *clname=0);
62   virtual Bool_t              IsEventSelected();
63   virtual Bool_t              RetrieveEventObjects();
64   virtual Bool_t              Run()                                                { return kTRUE                 ; }
65   void                        SetInitialized(Bool_t ini = kTRUE)                   { fInitialized    = ini        ; }
66
67   EmcalAnaType                fAnaType;                    // analysis type
68   Bool_t                      fInitialized;                // whether or not the task has been already initialized
69   Bool_t                      fCreateHisto;                // whether or not create histograms
70   TString                     fTracksName;                 // name of track collection
71   TString                     fCaloName;                   // name of calo cluster collection
72   Double_t                    fMinCent;                    // min centrality for event selection
73   Double_t                    fMaxCent;                    // max centrality for event selection
74   Double_t                    fMinVz;                      // min vertex for event selection
75   Double_t                    fMaxVz;                      // max vertex for event selection
76   UInt_t                      fOffTrigger;                 // offline trigger for event selection
77   TString                     fTrigClass;                  // trigger class name for event selection
78   Int_t                       fNbins;                      // no. of pt bins
79   Double_t                    fMinBinPt;                   // min pt in histograms
80   Double_t                    fMaxBinPt;                   // max pt in histograms
81   Double_t                    fClusPtCut;                  // cut on cluster pt
82   Double_t                    fTrackPtCut;                 // cut on track pt
83   Double_t                    fMinTrackEta;                // cut on track eta
84   Double_t                    fMaxTrackEta;                // cut on track eta
85   Double_t                    fMinTrackPhi;                // cut on track phi
86   Double_t                    fMaxTrackPhi;                // cut on track phi
87   Double_t                    fClusTimeCutLow;             // low time cut for clusters
88   Double_t                    fClusTimeCutUp;              // up time cut for clusters
89   TClonesArray               *fTracks;                     //!tracks
90   TClonesArray               *fCaloClusters;               //!clusters
91   Double_t                    fCent;                       //!event centrality
92   Int_t                       fCentBin;                    //!event centrality bin
93   Double_t                    fEPV0;                       //!event plane V0
94   Double_t                    fEPV0A;                      //!event plane V0A
95   Double_t                    fEPV0C;                      //!event plane V0C
96   Double_t                    fVertex[3];                  //!event vertex
97   Int_t                       fNVertCont;                  //!event vertex number of contributors
98   BeamType                    fBeamType;                   //!event beam type
99   TList                      *fOutput;                     //!output list
100
101  private:
102   AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&);            // not implemented
103   AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented
104
105   ClassDef(AliAnalysisTaskEmcal, 6) // EMCAL base analysis task
106 };
107 #endif