Completely Updated (Mario Sitta)
[u/mrichter/AliRoot.git] / STEER / AliAODCluster.h
CommitLineData
a9255000 1#ifndef AliAODCluster_H
2#define AliAODCluster_H
df9db588 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//-------------------------------------------------------------------------
a9255000 9// AOD cluster base class
df9db588 10// Author: Markus Oldenburg, CERN
11//-------------------------------------------------------------------------
12
4cfedff1 13#include <TObject.h>
df9db588 14
4cfedff1 15class AliAODCluster : public TObject {
df9db588 16
17 public:
18
14d55e62 19 enum AODClu_t {kUndef = -1,
20 kPHOSNeutral,
21 kPHOSCharged,
14d55e62 22 kEMCALClusterv1,
23 kPMDNeutral,
24 kPMDCharged};
df9db588 25
a9255000 26 enum AODCluPID_t {
14d55e62 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};
df9db588 36
a9255000 37 AliAODCluster();
38 AliAODCluster(Int_t id,
4cfedff1 39 UInt_t nLabel,
40 Int_t *label,
df9db588 41 Double_t energy,
42 Double_t x[3],
14d55e62 43 Double_t pid[9],
4cfedff1 44 Char_t ttype=kUndef,
45 UInt_t selectInfo=0);
df9db588 46
a9255000 47 AliAODCluster(Int_t id,
4cfedff1 48 UInt_t nLabel,
49 Int_t *label,
df9db588 50 Float_t energy,
51 Float_t x[3],
14d55e62 52 Float_t pid[9],
4cfedff1 53 Char_t ttype=kUndef,
54 UInt_t selectInfo=0);
df9db588 55
a9255000 56 virtual ~AliAODCluster();
4cfedff1 57 AliAODCluster(const AliAODCluster& clus);
58 AliAODCluster& operator=(const AliAODCluster& clus);
df9db588 59
60 Double_t Chi2() const { return fChi2; }
61
62 virtual Double_t E() const { return fEnergy; }
df9db588 63
64 // PID
65 virtual const Double_t *PID() const { return fPID; }
14d55e62 66 AODCluPID_t GetMostProbablePID() const;
67
df9db588 68 template <class T> void GetPID(T *pid) const {
14d55e62 69 for(Int_t i=0; i<9; ++i) pid[i]=fPID[i];}
df9db588 70
71 template <class T> void SetPID(const T *pid) {
14d55e62 72 if(pid) for(Int_t i=0; i<9; ++i) fPID[i]=pid[i];
cc9ce439 73 else {for(Int_t i=0; i<9; fPID[i++]=0);} fPID[AliAODCluster::kUnknown]=1.;}
df9db588 74
4cfedff1 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; }
df9db588 80
81 template <class T> Bool_t GetPosition(T *x) const {
82 x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
01afc3fc 83 return kTRUE;}
df9db588 84
4cfedff1 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;}
df9db588 89
df9db588 90 // print
91 void Print(const Option_t *opt = "") const;
92
93 // setters
14b34be5 94 void SetID(Int_t id) { fID = id; }
4cfedff1 95 void SetType(AODClu_t ttype) { fType=ttype; }
96 void SetLabel(Int_t *label, UInt_t size);
97 void RemoveLabel();
98
01afc3fc 99 template <class T> void SetPosition(const T *x);
df9db588 100
14b34be5 101 void SetChi2(Double_t chi2) { fChi2 = chi2; }
df9db588 102
df9db588 103 private :
104
105 // Energy & position
106 Double32_t fEnergy; // energy
01afc3fc 107 Double32_t fPosition[3]; // position of the cluster
df9db588 108
1e2eced6 109 Double32_t fChi2; // chi2 (probably not necessary for PMD)
9333290e 110 Double32_t fPID[9]; // [0.,1.,8] pointer to PID object
df9db588 111
1e2eced6 112 Int_t fID; // unique cluster ID, points back to the ESD cluster
4cfedff1 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
df9db588 116
9333290e 117 Char_t fType; // cluster type
118
4cfedff1 119 ClassDef(AliAODCluster,4);
df9db588 120};
121
122#endif