]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliAODCaloCluster.h
Adding AliVAODHeader
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODCaloCluster.h
1 #ifndef AliAODCaloCluster_H
2 #define AliAODCaloCluster_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 calorimeter cluster class (for PHOS and EMCAL)
10 //     Author: Markus Oldenburg, CERN, 
11 //             Gustavo Conesa, INFN
12 //-------------------------------------------------------------------------
13
14 #include "AliAODCluster.h"
15
16 #include <TRefArray.h>
17 #include <TArrayS.h>
18
19 class TLorentzVector;
20
21 class AliAODCaloCluster : public AliAODCluster {
22
23  public:
24   
25   AliAODCaloCluster();
26   AliAODCaloCluster(Int_t id,
27                     UInt_t nLabel,
28                     Int_t *label,
29                     Double_t energy,
30                     Double_t x[3],
31                     Double_t pid[13],
32                     Char_t ttype=kUndef,
33                     UInt_t selectInfo=0);
34   
35   AliAODCaloCluster(Int_t id,
36                     UInt_t nLabel,
37                     Int_t *label,
38                     Float_t energy,
39                     Float_t x[3],
40                     Float_t pid[13],
41                     Char_t ttype=kUndef,
42                     UInt_t selectInfo=0);
43   
44   virtual ~AliAODCaloCluster();
45   AliAODCaloCluster(const AliAODCaloCluster& clus); 
46   AliAODCaloCluster& operator=(const AliAODCaloCluster& clus);
47   void Clear(const Option_t*);
48   
49   // getters
50   Double_t GetDistanceToBadChannel() const { return fDistToBadChannel; }
51   Double_t GetDispersion() const { return fDispersion; }
52   Double_t GetM20() const { return fM20; }
53   Double_t GetM02() const { return fM02; }
54   Double_t GetEmcCpvDistance() const { return fEmcCpvDistance; }
55   Double_t GetTrackDx(void)const {return fTrackDx;}
56   Double_t GetTrackDz(void)const {return fTrackDz;}
57   UChar_t  GetNExMax() const { return fNExMax; }
58   Double_t GetTOF() const { return fTOF; }
59   Double_t GetCoreEnergy() const           {return fCoreEnergy ; }
60  
61  
62
63   Int_t    GetNTracksMatched() const { return fTracksMatched.GetEntriesFast(); }
64   TObject *GetTrackMatched(Int_t i) const { return fTracksMatched.At(i); }
65  
66   void  SetNCells(Int_t n) { fNCells = n;}
67   Int_t GetNCells() const   { return fNCells;}
68   
69   void SetCellsAbsId(UShort_t *array);
70   UShort_t *GetCellsAbsId() {return  fCellsAbsId;}
71   
72   void SetCellsAmplitudeFraction(Double32_t *array);
73   Double32_t *GetCellsAmplitudeFraction() {return  fCellsAmpFraction;}
74   
75   Int_t GetCellAbsId(Int_t i) const {  
76     if (fCellsAbsId && i >=0 && i < fNCells ) return fCellsAbsId[i];    
77     else return -1;}
78   
79   Double_t GetCellAmplitudeFraction(Int_t i) const {  
80     if (fCellsAmpFraction && i >=0 && i < fNCells ) return fCellsAmpFraction[i];    
81     else return -1;}
82         
83   
84   // setters
85   void SetDistanceToBadChannel(Double_t dist) { fDistToBadChannel = dist; }
86   void SetDispersion(Double_t disp) { fDispersion = disp; }
87   void SetM20(Double_t m20) { fM20 = m20; }
88   void SetM02(Double_t m02) { fM02 = m02; }
89   void SetEmcCpvDistance(Double_t emcCpvDist) { fEmcCpvDistance = emcCpvDist; }
90   void SetNExMax(UChar_t nExMax) { fNExMax = nExMax; }
91   void SetTOF(Double_t tof) { fTOF = tof; }
92   void SetTrackDistance(Double_t dx, Double_t dz){fTrackDx=dx; fTrackDz=dz;}
93   void SetCoreEnergy(Double_t e)         { fCoreEnergy=e; }
94
95   void SetCaloCluster(Double_t dist = -999., 
96                       Double_t disp = -1., 
97                       Double_t m20 = 0., 
98                       Double_t m02 = 0., 
99                       Double_t emcCpvDist = -999., 
100                       UShort_t nExMax = 0, 
101                       Double_t tof = 0.) 
102   {
103     fDistToBadChannel = dist;
104     fDispersion = disp;
105     fM20 = m20;
106     fM02 = m02;
107     fEmcCpvDistance = emcCpvDist;
108     fNExMax = nExMax;
109     fTOF = tof ;
110   }
111   
112   void GetMomentum(TLorentzVector& p, Double_t * vertexPosition );
113
114   void AddTrackMatched(TObject *trk) { 
115     //Make sure we attach the object to correct process number
116     if(fTracksMatched.GetEntries()==0) { TRefArray ref(TProcessID::GetProcessWithUID(trk)) ; fTracksMatched = ref ; }
117     fTracksMatched.Add(trk) ; }
118   
119   void RemoveTrackMatched(TObject *trk) { fTracksMatched.Remove(trk); }
120   Bool_t HasTrackMatched(TObject *trk) const;
121
122  private :
123
124   Double32_t   fDistToBadChannel; // Distance to nearest bad channel
125   Double32_t   fDispersion;       // cluster dispersion, for shape analysis
126   Double32_t   fM20;              // 2-nd moment along the main eigen axis
127   Double32_t   fM02;              // 2-nd moment along the second eigen axis
128   Double32_t   fEmcCpvDistance;   // the distance from PHOS EMC rec.point to the closest CPV rec.point
129   Double32_t   fTrackDx ;         // Distance to closest track in phi
130   Double32_t   fTrackDz ;         // Distance to closest track in z (eta)
131   UShort_t     fNExMax;           // number of (Ex-)maxima before unfolding
132   Double32_t   fTOF;              ////[0,0,12] time-of-flight
133   Double32_t   fCoreEnergy;       // energy of the core of cluster
134
135   TRefArray    fTracksMatched;    // references to tracks close to cluster. First entry is the most likely match.
136
137   Int_t       fNCells ;
138   UShort_t   *fCellsAbsId;        //[fNCells] array of cell absId numbers
139   Double32_t *fCellsAmpFraction;  //[fNCells][0.,1.,16] array with cell amplitudes fraction.
140
141   ClassDef(AliAODCaloCluster,8);
142 };
143
144 #endif