]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliAODCluster.h
Removal of AliAODTowers (will appear as AliAODCaloCells again).
[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
13#include <TRef.h>
14
ff7c57dd 15#include "AliVParticle.h"
df9db588 16#include "AliAODVertex.h"
17#include "AliAODTrack.h"
18
ff7c57dd 19class AliAODCluster : public AliVParticle {
df9db588 20
21 public:
22
14d55e62 23 enum AODClu_t {kUndef = -1,
24 kPHOSNeutral,
25 kPHOSCharged,
26 kEMCALPseudoCluster,
27 kEMCALClusterv1,
28 kPMDNeutral,
29 kPMDCharged};
df9db588 30
a9255000 31 enum AODCluPID_t {
14d55e62 32 kUnknown = 0,
33 kPhoton = 1,
34 kPi0 = 2,
35 kNeutron = 3,
36 kKaon0 = 4,
37 kEleCon = 5,
38 kCharged = 6,
39 kNeutral = 7 ,
40 kOther = 8};
df9db588 41
a9255000 42 AliAODCluster();
43 AliAODCluster(Int_t id,
df9db588 44 Int_t label,
45 Double_t energy,
46 Double_t x[3],
01afc3fc 47 Double_t covMatrix[10],
14d55e62 48 Double_t pid[9],
1e2eced6 49 AliAODVertex *prodVertex, // not necessary for PMD
df9db588 50 AliAODTrack *primTrack,
51 Char_t ttype=kUndef);
52
a9255000 53 AliAODCluster(Int_t id,
df9db588 54 Int_t label,
55 Float_t energy,
56 Float_t x[3],
01afc3fc 57 Float_t covMatrix[10],
14d55e62 58 Float_t pid[9],
df9db588 59 AliAODVertex *prodVertex,
60 AliAODTrack *primTrack,
61 Char_t ttype=kUndef);
62
a9255000 63 virtual ~AliAODCluster();
64 AliAODCluster(const AliAODCluster& trk);
65 AliAODCluster& operator=(const AliAODCluster& trk);
df9db588 66
67 Double_t Chi2() const { return fChi2; }
68
69 virtual Double_t E() const { return fEnergy; }
70 // make a connection to the PID object, here!!!
1e2eced6 71 virtual Double_t M() const { return (fType==AliAODCluster::kPHOSNeutral) ? 0. : -999.; }
df9db588 72
73 // make a connection to the PID object, here!!!
1e2eced6 74 virtual Double_t Y() const { return (fType==AliAODCluster::kPHOSNeutral) ? Eta() : -999.; }
df9db588 75
76 // PID
77 virtual const Double_t *PID() const { return fPID; }
14d55e62 78 AODCluPID_t GetMostProbablePID() const;
79
df9db588 80 template <class T> void GetPID(T *pid) const {
14d55e62 81 for(Int_t i=0; i<9; ++i) pid[i]=fPID[i];}
df9db588 82
83 template <class T> void SetPID(const T *pid) {
14d55e62 84 if(pid) for(Int_t i=0; i<9; ++i) fPID[i]=pid[i];
cc9ce439 85 else {for(Int_t i=0; i<9; fPID[i++]=0);} fPID[AliAODCluster::kUnknown]=1.;}
df9db588 86
87 Int_t GetID() const { return fID; }
88 Int_t GetLabel() const { return fLabel; }
89
90 template <class T> Bool_t GetPosition(T *x) const {
91 x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
01afc3fc 92 return kTRUE;}
df9db588 93
94 template <class T> void SetCovMatrix(const T *covMatrix) {
5d62ce04 95 if(!fCovMatrix) fCovMatrix=new AliAODRedCov<4>();
df9db588 96 fCovMatrix->SetCovMatrix(covMatrix);}
97
98 template <class T> Bool_t GetCovMatrix(T *covMatrix) const {
99 if(!fCovMatrix) return kFALSE;
100 fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
101
102 void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
103
104 AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
105 AliAODTrack *GetPrimTrack() const { return (AliAODTrack*)fPrimTrack.GetObject(); }
106
107 // print
108 void Print(const Option_t *opt = "") const;
109
110 // setters
14b34be5 111 void SetID(Int_t id) { fID = id; }
112 void SetLabel(Int_t label) {fLabel = label; }
df9db588 113
01afc3fc 114 template <class T> void SetPosition(const T *x);
df9db588 115
14b34be5 116 void SetChi2(Double_t chi2) { fChi2 = chi2; }
df9db588 117
118 void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
119 void SetPrimTrack(TObject *ptrack) { fPrimTrack = ptrack; }
120
1e2eced6 121 virtual Double_t Px() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[0] : 0.;}
122 virtual Double_t Py() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[1] : 0.;}
123 virtual Double_t Pz() const {return (fType==AliAODCluster::kPHOSNeutral) ? fEnergy*fPosition[2] : 0.;}
124 virtual Double_t Pt() const {return TMath::Sqrt(Px()*Px() + Py()*Py()); }
125 virtual Double_t P() const {return TMath::Sqrt(Px()*Px() + Py()*Py() + Pz()*Pz()); }
126 virtual Double_t OneOverPt() const {return Pt() ? 1./Pt(): -999.;}
1eab4b5c 127 virtual Double_t Phi() const {return (fType==AliAODCluster::kPHOSNeutral) ? TMath::Pi()+TMath::ATan2(-fPosition[1], -fPosition[0]) : 0.;}
1e2eced6 128 virtual Double_t Theta() const {return (fType==AliAODCluster::kPHOSNeutral) ? TMath::ATan2(Pt(), fPosition[2]) : 0.;}
129 virtual Double_t Eta() const {return (fType==AliAODCluster::kPHOSNeutral) ? -TMath::Log(TMath::Tan(0.5 * Theta())) : 0.;}
130 virtual Short_t Charge() const {return (fType==AliAODCluster::kPHOSNeutral) ? 0 : -999;}
df9db588 131
df9db588 132 private :
133
134 // Energy & position
135 Double32_t fEnergy; // energy
01afc3fc 136 Double32_t fPosition[3]; // position of the cluster
df9db588 137
1e2eced6 138 Double32_t fChi2; // chi2 (probably not necessary for PMD)
9333290e 139 Double32_t fPID[9]; // [0.,1.,8] pointer to PID object
df9db588 140
1e2eced6 141 Int_t fID; // unique cluster ID, points back to the ESD cluster
df9db588 142 Int_t fLabel; // particle label, points back to MC track
143
9333290e 144 Char_t fType; // cluster type
145
31fd97b2 146 AliAODRedCov<4> *fCovMatrix; // covariance matrix (x, y, z, E)
1e2eced6 147 TRef fProdVertex; // vertex of origin (not necessary for PMD)
148 TRef fPrimTrack; // primary track associated with this cluster (not necessary for PMD)
df9db588 149
9333290e 150 // TRef fAssocCluster; // for PMD: cluster of other layer associated with this cluster
df9db588 151
9333290e 152 ClassDef(AliAODCluster,3);
df9db588 153};
154
155#endif