]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODCluster.h
Updates (A. Toia)
[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 <AliVCluster.h>
14
15 class AliAODCluster : public AliVCluster {
16
17  public:
18   
19   AliAODCluster();
20   AliAODCluster(Int_t id,
21                 UInt_t nLabel,
22                 Int_t *label,
23                 Double_t energy,
24                 Double_t x[3],
25                 Double_t pid[13],
26                 Char_t ttype=kUndef,
27                 UInt_t selectInfo=0);
28
29    AliAODCluster(Int_t id,
30                  UInt_t nLabel,
31                  Int_t *label,
32                  Float_t energy,
33                  Float_t x[3],
34                  Float_t pid[13],
35                  Char_t ttype=kUndef,
36                  UInt_t selectInfo=0);
37    
38   virtual ~AliAODCluster();
39   AliAODCluster(const AliAODCluster& clus); 
40   AliAODCluster& operator=(const AliAODCluster& clus);
41
42   Double_t Chi2() const { return fChi2; }
43   
44   Double_t E() const { return fEnergy; }
45   
46   // PID
47   
48   UShort_t  GetMostProbablePID() const;
49   const Double_t *GetPID() const { return fPID; }//{ for(Int_t i=0; i<13; ++i) pid[i]=fPID[i]; }
50   Int_t     GetID()  const { return fID; }
51   Int_t     GetLabel() const   {
52     if( fLabel &&  fNLabel > 0)  return  fLabel[0]; 
53     else return -1;} //Most likely the track associated to the cluster
54   Int_t  GetLabelAt(UInt_t i) const;
55   Int_t  * GetLabels() const {return fLabel ; }
56   UInt_t GetNLabels() const { return (UInt_t)fNLabel; }
57   Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
58   Char_t GetType() const { return fType; }
59   
60   void GetPosition(Float_t *x) const {
61     x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];}
62   
63   Bool_t IsEMCAL() const {if(fType == kEMCALClusterv1) return kTRUE;
64     else return kFALSE;}
65   Bool_t IsPHOS() const {if(fType == kPHOSCharged || fType == kPHOSNeutral) return kTRUE;
66     else return kFALSE;}
67   
68   // print
69   void  Print(const Option_t *opt = "") const;
70   
71   // setters
72   void SetE(Double32_t energy) {fEnergy = energy ; }
73   void SetID(Int_t id) { fID = id; }
74   void SetType(Char_t ttype) { fType=ttype; }
75   void SetLabel(Int_t *label, UInt_t size);  
76   void SetChi2(Double_t chi2) { fChi2 = chi2; }
77   
78   void SetPosition(Float_t *x);
79   void SetPositionAt(Float_t x,Int_t i) { if(i>=0 && i<3) fPosition[i] = x ; 
80     else printf("Bad index for position array, i = %d\n",i);}
81   
82   void SetPIDAt(Float_t x,Int_t i) { if(i>=0 && i<13) fPID[i] = x ; 
83     else printf("Bad index for PID array, i = %d\n",i);}
84   void SetPID(const Float_t *pid) {
85     if(pid) for(Int_t i=0; i<13; ++i) fPID[i]=pid[i];
86     else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
87   template <class T> void SetPIDFromESD(const T *pid) {
88     if(pid) {for(Int_t i=0; i<11; ++i) fPID[i]=pid[i];  fPID[11]=0;   fPID[12]=0;}
89     else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
90   
91   void RemoveLabel();
92   
93   
94  private :
95   
96   // Energy & position
97   Double32_t    fEnergy;         // energy
98   Double32_t    fPosition[3];    // position of the cluster
99   
100   Double32_t    fChi2;           // chi2 (probably not necessary for PMD)
101   Double32_t    fPID[13];         // [0.,1.,8] pointer to PID object
102   
103   Int_t         fID;             // unique cluster ID, points back to the ESD cluster
104   Int_t         fNLabel;         // number of original track for this cluster      
105   Int_t        *fLabel;          // [fNLabel] particle label, points back to MC tracks
106   UInt_t        fFilterMap;      // filter information, one bit per set of cuts
107   
108   Char_t        fType;           // cluster type
109   
110   ClassDef(AliAODCluster,6);
111 };
112
113 #endif