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