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