]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDCaloCluster.h
Modifications in AliESDMuonTrack:
[u/mrichter/AliRoot.git] / STEER / AliESDCaloCluster.h
1 #ifndef ALIESDCALOCLUSTER_H
2 #define ALIESDCALOCLUSTER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 /* $Log $ */
8
9 //-------------------------------------------------------------------------
10 //                          Class AliESDCaloCluster
11 //   This is the class to deal with during the physics analysis of data
12 //
13 //   New container for calorimeter clusters, which are the effective 
14 //   "tracks" for calorimeter detectors.  Can be used by PHOS and EMCAL
15 //
16 //     J.L. Klay (LLNL)
17 //-------------------------------------------------------------------------
18
19 #include <TObject.h>
20 #include "AliPID.h"
21 #include "TArrayS.h"
22
23 class TLorentzVector;
24
25 class AliESDCaloCluster : public TObject {
26
27 public:
28
29   AliESDCaloCluster();
30   AliESDCaloCluster(const AliESDCaloCluster& clus);
31   AliESDCaloCluster & operator=(const AliESDCaloCluster& source);
32   virtual ~AliESDCaloCluster();
33
34   void SetID(Int_t id) {fID = id;}
35   Int_t GetID() const {return fID;}
36
37   enum ClusterType {kPseudoCluster, kClusterv1};//Two types of clusters stored
38                                                 //in EMCAL.
39   void SetClusterType(Int_t type) { fClusterType = type; }
40   Int_t GetClusterType() const {return fClusterType; }
41
42   void SetEMCAL(Bool_t emc) { fEMCALCluster = emc;}
43   Bool_t IsEMCAL() const {return fEMCALCluster;}
44
45   void SetPHOS(Bool_t phos) { fPHOSCluster = phos;}
46   Bool_t IsPHOS() const {return fPHOSCluster;}
47
48   void SetPosition(const Float_t *pos) {
49     fGlobalPos[0] = pos[0]; fGlobalPos[1] = pos[1]; fGlobalPos[2] = pos[2];
50   }
51   void GetPosition(Float_t *pos) const {
52     pos[0] = fGlobalPos[0]; pos[1] = fGlobalPos[1]; pos[2] = fGlobalPos[2];
53   }
54
55   void SetE(Float_t ene) { fEnergy = ene;}
56   Float_t E() const   { return fEnergy;}
57
58   void SetClusterDisp(Float_t disp)  { fDispersion = disp; }
59   Float_t GetClusterDisp() const     { return fDispersion; }
60
61   void SetClusterChi2(Float_t chi2)  { fChi2 = chi2; }
62   Float_t GetClusterChi2() const     { return fChi2; }
63
64   void SetPid(const Float_t *p);
65   Float_t *GetPid() {return fPID;}
66
67   void SetM20(Float_t m20)                { fM20 = m20; }
68   Float_t GetM20() const                  { return fM20; }
69
70   void SetM02(Float_t m02)                { fM02 = m02; }
71   Float_t GetM02() const                  { return fM02; }
72
73   void SetM11(Float_t m11)                { fM11 = m11; }
74   Float_t GetM11() const                  { return fM11; }
75
76   void SetNExMax(UShort_t nExMax)         { fNExMax = nExMax; }
77   UShort_t GetNExMax() const              { return fNExMax; }
78
79   void SetEmcCpvDistance(Float_t dEmcCpv) { fEmcCpvDistance = dEmcCpv; }
80   Float_t GetEmcCpvDistance() const       { return fEmcCpvDistance; }
81
82   void SetDistanceToBadChannel(Float_t dist) {fDistToBadChannel=dist;}
83   Float_t GetDistanceToBadChannel() const {return fDistToBadChannel;}
84
85   void AddTracksMatched(TArrayS & array)  { fTracksMatched   = new TArrayS(array) ; }
86   void AddLabels(TArrayS & array)         { fLabels = new TArrayS(array) ; }
87   void AddDigitAmplitude(TArrayS & array) { fDigitAmplitude   = new TArrayS(array) ; }
88   void AddDigitTime(TArrayS & array)      { fDigitTime = new TArrayS(array) ; }
89   void AddDigitIndex(TArrayS & array)     { fDigitIndex   = new TArrayS(array) ; }
90
91   TArrayS * GetTracksMatched() const  {return  fTracksMatched;}
92   TArrayS * GetLabels() const         {return  fLabels;}
93   TArrayS * GetDigitAmplitude() const {return  fDigitAmplitude;}
94   TArrayS * GetDigitTime() const      {return  fDigitTime;}
95   TArrayS * GetDigitIndex() const     {return  fDigitIndex;}
96  
97   Int_t GetTrackMatched() const   
98   {if( fTracksMatched &&  fTracksMatched->GetSize() >0)  return  fTracksMatched->At(0); 
99     else return -1;} //Most likely the track associated to the cluster
100   Int_t GetLabel() const   
101   {if( fLabels &&  fLabels->GetSize() >0)  return  fLabels->At(0); 
102     else return -1;} //Most likely the track associated to the cluster
103
104
105   Int_t GetNTracksMatched() const {if (fTracksMatched) return  fTracksMatched->GetSize(); 
106     else return -1;}
107   Int_t GetNLabels() const        { if (fLabels) return  fLabels->GetSize(); 
108     else return -1;}
109   Int_t GetNumberOfDigits() const        { if (fDigitAmplitude) return  fDigitAmplitude->GetSize(); 
110     else return -1;}
111  
112   void GetMomentum(TLorentzVector& p, Double_t * vertexPosition );
113   // Sep 7, 2007
114   Int_t    GetTrueDigitAmplitude(Int_t i, Double_t cc);
115   Double_t GetTrueDigitEnergy(Int_t i, Double_t cc);
116   Double_t GetRecalibratedDigitEnergy(Int_t i, Double_t ccOld, Double_t ccNew);
117
118 protected:
119
120   Int_t     fID;               // Unique Id of the cluster
121   Int_t     fClusterType;      // Flag for different clustering versions
122   Bool_t    fEMCALCluster;     // Is this is an EMCAL cluster?
123   Bool_t    fPHOSCluster;      // Is this is a PHOS cluster?
124   Float_t   fGlobalPos[3];     // position in global coordinate system
125   Float_t   fEnergy;           // energy measured by calorimeter
126   Float_t   fDispersion;       // cluster dispersion, for shape analysis
127   Float_t   fChi2;             // chi2 of cluster fit
128   Float_t   fPID[AliPID::kSPECIESN]; //"detector response probabilities" (for the PID)
129   Float_t   fM20;              // 2-nd moment along the main eigen axis
130   Float_t   fM02;              // 2-nd moment along the second eigen axis
131   Float_t   fM11;              // 2-nd mixed moment Mxy
132   UShort_t  fNExMax ;          // number of (Ex-)maxima before unfolding
133   Float_t   fEmcCpvDistance;   // the distance from PHOS EMC rec.point to the closest CPV rec.point
134  Float_t   fDistToBadChannel; // Distance to nearest bad channel
135
136   TArrayS * fTracksMatched; //Index of tracks close to cluster. First entry is the most likely match.
137   TArrayS * fLabels;   //list of primaries that generated the cluster, ordered in deposited energy.
138   TArrayS * fDigitAmplitude;   //digit energy (integer units) 
139   TArrayS * fDigitTime;        //time of this digit (integer units) 
140   TArrayS * fDigitIndex;       //calorimeter digit index 
141
142   ClassDef(AliESDCaloCluster,4)  //ESDCaloCluster 
143 };
144
145 #endif 
146