]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - STEER/AliAODCluster.h
Fix for Savannah bug report 59287
[u/mrichter/AliRoot.git] / STEER / AliAODCluster.h
... / ...
CommitLineData
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
15class 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 kElectron = 0,
28 kMuon = 1,
29 kPion = 2,
30 kKaon = 3,
31 kProton = 4,
32 kPhoton = 5,
33 kPi0 = 6,
34 kNeutron = 7,
35 kKaon0 = 8,
36 kEleCon = 9,
37 kUnknown = 10,
38 kCharged = 11, //For PMD?
39 kNeutral =12 //For PMD?
40 };
41
42 AliAODCluster();
43 AliAODCluster(Int_t id,
44 UInt_t nLabel,
45 Int_t *label,
46 Double_t energy,
47 Double_t x[3],
48 Double_t pid[13],
49 Char_t ttype=kUndef,
50 UInt_t selectInfo=0);
51
52 AliAODCluster(Int_t id,
53 UInt_t nLabel,
54 Int_t *label,
55 Float_t energy,
56 Float_t x[3],
57 Float_t pid[13],
58 Char_t ttype=kUndef,
59 UInt_t selectInfo=0);
60
61 virtual ~AliAODCluster();
62 AliAODCluster(const AliAODCluster& clus);
63 AliAODCluster& operator=(const AliAODCluster& clus);
64
65 Double_t Chi2() const { return fChi2; }
66
67 virtual Double_t E() const { return fEnergy; }
68
69 // PID
70 virtual const Double_t *PID() const { return fPID; }
71 AODCluPID_t GetMostProbablePID() const;
72
73 template <class T> void GetPID(T *pid) const {
74 for(Int_t i=0; i<13; ++i) pid[i]=fPID[i];}
75
76 template <class T> void SetPID(const T *pid) {
77 if(pid) for(Int_t i=0; i<13; ++i) fPID[i]=pid[i];
78 else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
79
80 template <class T> void SetPIDFromESD(const T *pid) {
81 if(pid) {for(Int_t i=0; i<11; ++i) fPID[i]=pid[i]; fPID[11]=0; fPID[12]=0;}
82 else {for(Int_t i=0; i<13; fPID[i++]=0) ;} fPID[AliAODCluster::kUnknown]=1.;}
83
84 Int_t GetID() const { return fID; }
85 Int_t GetLabel(UInt_t i) const;
86 Int_t * GetLabels() const {return fLabel ; }
87 UInt_t GetNLabel() const { return (UInt_t)fNLabel; }
88 Bool_t TestFilterBit(UInt_t filterBit) const { return (Bool_t) ((filterBit & fFilterMap) != 0); }
89 Char_t GetType() const { return fType; }
90
91 template <class T> Bool_t GetPosition(T *x) const {
92 x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
93 return kTRUE;}
94
95 Bool_t IsEMCALCluster() {if(fType == kEMCALClusterv1) return kTRUE;
96 else return kFALSE;}
97 Bool_t IsPHOSCluster() {if(fType == kPHOSCharged || fType == kPHOSNeutral) return kTRUE;
98 else return kFALSE;}
99
100 // print
101 void Print(const Option_t *opt = "") const;
102
103 // setters
104 void SetE(Double32_t energy) {fEnergy = energy ; }
105 void SetPosition(Int_t ipos, Double32_t pos) {fPosition[ipos] = pos ;}
106 void SetID(Int_t id) { fID = id; }
107 void SetType(AODClu_t ttype) { fType=ttype; }
108 void SetLabel(Int_t *label, UInt_t size);
109 void RemoveLabel();
110
111 template <class T> void SetPosition(const T *x);
112
113 void SetChi2(Double_t chi2) { fChi2 = chi2; }
114
115 private :
116
117 // Energy & position
118 Double32_t fEnergy; // energy
119 Double32_t fPosition[3]; // position of the cluster
120
121 Double32_t fChi2; // chi2 (probably not necessary for PMD)
122 Double32_t fPID[13]; // [0.,1.,8] pointer to PID object
123
124 Int_t fID; // unique cluster ID, points back to the ESD cluster
125 Int_t fNLabel; // number of original track for this cluster
126 Int_t *fLabel; // [fNLabel] particle label, points back to MC tracks
127 UInt_t fFilterMap; // filter information, one bit per set of cuts
128
129 Char_t fType; // cluster type
130
131 ClassDef(AliAODCluster,5);
132};
133
134#endif