]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/EMCAL/AliAnalysisTaskEmcal.h
add protection agains null energy - A. Mas
[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 class AliVParticle;
14 class AliVCaloCells;
15 class TH1F;
16 class AliEMCALGeometry;
17
18 #include "AliAnalysisTaskSE.h"
19
20 class AliAnalysisTaskEmcal : public AliAnalysisTaskSE {
21  public:
22   
23   enum EmcalAnaType {
24     kTPC       = 0,     // TPC acceptance
25     kEMCAL     = 1,     // EMCal acceptance
26     kUser      = 2,     // User defined acceptance
27   };
28
29   enum BeamType {
30     kNA       = -1,
31     kpp       = 0,
32     kAA       = 1,
33     kpA       = 2
34   };
35
36   AliAnalysisTaskEmcal();
37   AliAnalysisTaskEmcal(const char *name, Bool_t histo=kFALSE); 
38   virtual ~AliAnalysisTaskEmcal();
39
40   void                        UserExec(Option_t *option);
41   void                        UserCreateOutputObjects();
42
43   void                        SetAnaType(EmcalAnaType type)                         { fAnaType           = type ;                         ; }
44   void                        SetCentRange(Double_t min, Double_t max)              { fMinCent           = min  ; fMaxCent = max          ; }
45   void                        SetClusName(const char *n)                            { fCaloName          = n                              ; }
46   void                        SetCaloCellsName(const char *n)                       { fCaloCellsName     = n                              ; }
47   void                        SetClusPtCut(Double_t cut)                            { fClusPtCut         = cut                            ; }
48   void                        SetClusTimeCut(Double_t min, Double_t max)            { fClusTimeCutLow    = min  ; fClusTimeCutUp = max    ; }
49   void                        SetHistoBins(Int_t nbins, Double_t min, Double_t max) { fNbins = nbins; fMinBinPt = min; fMaxBinPt = max    ; }
50   void                        SetOffTrigger(UInt_t t)                               { fOffTrigger        = t                              ; }
51   void                        SetPtCut(Double_t cut)                                { SetClusPtCut(cut)         ; SetTrackPtCut(cut)      ; }
52   void                        SetTrackPtCut(Double_t cut)                           { fTrackPtCut        = cut                            ; }
53   void                        SetTrackEtaLimits(Double_t min, Double_t max)         { fTrackMaxEta       = max  ; fTrackMinEta      = min ; }
54   void                        SetTrackPhiLimits(Double_t min, Double_t max)         { fTrackMaxPhi       = max  ; fTrackMinPhi      = min ; }
55   void                        SetTracksName(const char *n)                          { fTracksName        = n                              ; }
56   void                        SetTrigClass(const char *n)                           { fTrigClass         = n                              ; }  
57   void                        SetVzRange(Double_t min, Double_t max)                { fMinVz             = min  ; fMaxVz   = max          ; }
58   void                        SetForceBeamType(BeamType f)                          { fForceBeamType     = f                              ; }
59   void                        SetMakeGeneralHistograms(Bool_t g)                    { fGeneralHistograms = g                              ; }
60   void                        SetMinPtTrackInEmcal(Double_t min)                    { fMinPtTrackInEmcal = min                            ; }
61   void                        SetEventPlaneVsEmcal(Double_t ep)                     { fEventPlaneVsEmcal = ep                             ; }
62   void                        SetCentralityEstimator(const char *c)                 { fCentEst           = c                              ; }
63   void                        SetTrackBitMap(UInt_t m)                              { fTrackBitMap       = m                              ; }
64   void                        SetClusterBitMap(UInt_t m)                            { fClusterBitMap     = m                              ; }
65   void                        SetParticleBitMap(UInt_t m)                           { fClusterBitMap     = m    ; fTrackBitMap       = m  ; }
66   void                        SetMCTrackBitMap(UInt_t m)                            { fMCTrackBitMap     = m                              ; }
67   void                        SetMCClusterBitMap(UInt_t m)                          { fMCClusterBitMap   = m                              ; }
68   void                        SetMCParticleBitMap(UInt_t m)                         { fMCClusterBitMap   = m    ; fMCTrackBitMap     = m  ; }
69   void                        SetMinMCLabel(Int_t s)                                { fMinMCLabel        = s                              ; }
70   void                        SetIsEmbedded(Bool_t i)                               { fIsEmbedded        = i                              ; }
71
72  protected:
73   Bool_t                      AcceptCluster(AliVCluster        *clus)  const;
74   Bool_t                      AcceptEmcalPart(AliEmcalParticle *part)  const;
75   Bool_t                      AcceptTrack(AliVParticle         *track) const;
76   virtual void                ExecOnce();
77   virtual Bool_t              FillGeneralHistograms();
78   virtual Bool_t              FillHistograms()                                     { return kTRUE                 ; }
79   BeamType                    GetBeamType();
80   TClonesArray               *GetArrayFromEvent(const char *name, const char *clname=0);
81   virtual Bool_t              IsEventSelected();
82   virtual Bool_t              RetrieveEventObjects();
83   virtual Bool_t              Run()                                                { return kTRUE                 ; }
84
85   EmcalAnaType                fAnaType;                    // analysis type
86   BeamType                    fForceBeamType;              // forced beam type
87   Bool_t                      fGeneralHistograms;          // whether or not it should fill some general histograms
88   Bool_t                      fInitialized;                // whether or not the task has been already initialized
89   Bool_t                      fCreateHisto;                // whether or not create histograms
90   TString                     fTracksName;                 // name of track collection
91   TString                     fCaloName;                   // name of calo cluster collection
92   TString                     fCaloCellsName;              // name of calo cell collection
93   Double_t                    fMinCent;                    // min centrality for event selection
94   Double_t                    fMaxCent;                    // max centrality for event selection
95   Double_t                    fMinVz;                      // min vertex for event selection
96   Double_t                    fMaxVz;                      // max vertex for event selection
97   UInt_t                      fOffTrigger;                 // offline trigger for event selection
98   TString                     fTrigClass;                  // trigger class name for event selection
99   Int_t                       fNbins;                      // no. of pt bins
100   Double_t                    fMinBinPt;                   // min pt in histograms
101   Double_t                    fMaxBinPt;                   // max pt in histograms
102   Double_t                    fClusPtCut;                  // cut on cluster pt
103   Double_t                    fTrackPtCut;                 // cut on track pt
104   Double_t                    fTrackMinEta;                // cut on track eta
105   Double_t                    fTrackMaxEta;                // cut on track eta
106   Double_t                    fTrackMinPhi;                // cut on track phi
107   Double_t                    fTrackMaxPhi;                // cut on track phi
108   Double_t                    fClusTimeCutLow;             // low time cut for clusters
109   Double_t                    fClusTimeCutUp;              // up time cut for clusters
110   Double_t                    fMinPtTrackInEmcal;          // min pt track in emcal
111   Double_t                    fEventPlaneVsEmcal;          // select events which have a certain event plane wrt the emcal
112   Double_t                    fMinEventPlane;              // minimum event plane value
113   Double_t                    fMaxEventPlane;              // maximum event plane value
114   TString                     fCentEst;                    // name of V0 centrality estimator
115   UInt_t                      fTrackBitMap;                // bit map of accepted tracks (non MC)
116   UInt_t                      fClusterBitMap;              // bit map of accepted clusters (non MC)
117   UInt_t                      fMCTrackBitMap;              // bit map of accepted MC tracks
118   UInt_t                      fMCClusterBitMap;            // bit map of accepted MC clusters
119   Int_t                       fMinMCLabel;                 // minimum MC label value for the tracks/clusters being considered MC particles
120   Bool_t                      fIsEmbedded;                 // trigger, embedded signal
121   Int_t                       fNcentBins;                  //!how many centrality bins
122   AliEMCALGeometry           *fGeom;                       //!emcal geometry
123   TClonesArray               *fTracks;                     //!tracks
124   TClonesArray               *fCaloClusters;               //!clusters
125   AliVCaloCells              *fCaloCells;                  //!cells
126   Double_t                    fCent;                       //!event centrality
127   Int_t                       fCentBin;                    //!event centrality bin
128   Double_t                    fEPV0;                       //!event plane V0
129   Double_t                    fEPV0A;                      //!event plane V0A
130   Double_t                    fEPV0C;                      //!event plane V0C
131   Double_t                    fVertex[3];                  //!event vertex
132   Int_t                       fNVertCont;                  //!event vertex number of contributors
133   BeamType                    fBeamType;                   //!event beam type
134   TList                      *fOutput;                     //!output list
135
136   TH1F                       *fHistCentrality;             //!Event centrality distribution
137   TH1F                       *fHistZVertex;                //!Z vertex position
138   TH1F                       *fHistEventPlane;             //!Event plane distribution
139
140  private:
141   AliAnalysisTaskEmcal(const AliAnalysisTaskEmcal&);            // not implemented
142   AliAnalysisTaskEmcal &operator=(const AliAnalysisTaskEmcal&); // not implemented
143
144   ClassDef(AliAnalysisTaskEmcal, 14) // EMCAL base analysis task
145 };
146 #endif