]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODCluster.h
03db84e8155479943d29c4754047aab0d4025409
[u/mrichter/AliRoot.git] / STEER / AliAODCluster.h
1 #ifndef AliAODCluster_H
2 #define AliAODCluster_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     AOD cluster base class
10 //     Author: Markus Oldenburg, CERN
11 //-------------------------------------------------------------------------
12
13 #include <TObject.h>
14
15 class AliAODCluster : public TObject {
16
17  public:
18   
19   enum AODClu_t {kUndef = -1, 
20                  kPHOSNeutral, 
21                  kPHOSCharged,
22                  kEMCALClusterv1,
23                  kPMDNeutral, 
24                  kPMDCharged};
25
26   enum AODCluPID_t {
27     kUnknown = 0, 
28     kPhoton  = 1, 
29     kPi0     = 2, 
30     kNeutron = 3, 
31     kKaon0   = 4,
32     kEleCon  = 5, 
33     kCharged = 6, 
34     kNeutral = 7 , 
35     kOther   = 8};
36
37   AliAODCluster();
38   AliAODCluster(Int_t id,
39                 UInt_t nLabel,
40                 Int_t *label,
41                 Double_t energy,
42                 Double_t x[3],
43                 Double_t pid[9],
44                 Char_t ttype=kUndef,
45                 UInt_t selectInfo=0);
46
47    AliAODCluster(Int_t id,
48                  UInt_t nLabel,
49                  Int_t *label,
50                  Float_t energy,
51                  Float_t x[3],
52                  Float_t pid[9],
53                  Char_t ttype=kUndef,
54                  UInt_t selectInfo=0);
55
56   virtual ~AliAODCluster();
57   AliAODCluster(const AliAODCluster& clus); 
58   AliAODCluster& operator=(const AliAODCluster& clus);
59
60   Double_t Chi2() const { return fChi2; }
61
62   virtual Double_t E() const { return fEnergy; }
63
64   // PID
65   virtual const Double_t *PID() const { return fPID; }
66   AODCluPID_t GetMostProbablePID() const;
67  
68   template <class T> void GetPID(T *pid) const {
69     for(Int_t i=0; i<9; ++i) pid[i]=fPID[i];}
70  
71   template <class T> void SetPID(const T *pid) {
72     if(pid) for(Int_t i=0; i<9; ++i) fPID[i]=pid[i];
73     else {for(Int_t i=0; i<9; fPID[i++]=0);} fPID[AliAODCluster::kUnknown]=1.;}
74
75   Int_t  GetID() const { return fID; }
76   Int_t  GetLabel(UInt_t i) const;
77   UInt_t GetNLabel() const { return (UInt_t)fNLabel; }
78   Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
79   Char_t GetType() const { return fType; }
80
81   template <class T> Bool_t GetPosition(T *x) const {
82     x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
83     return kTRUE;}
84
85   Bool_t IsEMCALCluster() {if(fType == kEMCALClusterv1) return kTRUE;
86     else return kFALSE;}
87   Bool_t IsPHOSCluster() {if(fType == kPHOSCharged || fType == kPHOSNeutral) return kTRUE;
88     else return kFALSE;}
89
90   // print
91   void  Print(const Option_t *opt = "") const;
92
93   // setters
94   void SetID(Int_t id) { fID = id; }
95   void SetType(AODClu_t ttype) { fType=ttype; }
96   void SetLabel(Int_t *label, UInt_t size);  
97   void RemoveLabel();
98  
99   template <class T> void SetPosition(const T *x);
100
101   void SetChi2(Double_t chi2) { fChi2 = chi2; }
102
103  private :
104
105   // Energy & position
106   Double32_t    fEnergy;         // energy
107   Double32_t    fPosition[3];    // position of the cluster
108
109   Double32_t    fChi2;           // chi2 (probably not necessary for PMD)
110   Double32_t    fPID[9];         // [0.,1.,8] pointer to PID object
111
112   Int_t         fID;             // unique cluster ID, points back to the ESD cluster
113   Int_t         fNLabel;         // number of original track for this cluster      
114   Int_t        *fLabel;          // [fNLabel] particle label, points back to MC tracks
115   UInt_t        fFilterMap;      // filter information, one bit per set of cuts
116   
117   Char_t        fType;           // cluster type
118
119   ClassDef(AliAODCluster,4);
120 };
121
122 #endif