]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONRawCluster.h
Updated list of MUON libraries
[u/mrichter/AliRoot.git] / MUON / AliMUONRawCluster.h
1 #ifndef ALIMUONRAWCLUSTER_H
2 #define ALIMUONRAWCLUSTER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8 // Revision of includes 07/05/2004
9
10 /// \ingroup base
11 /// \class AliMUONRawCluster
12 /// \brief MUON raw cluster
13 ///
14 /// Class for the MUON RecPoint
15 /// It contains the properties of the physics cluters found in the tracking chambers
16 /// RawCluster contains also the information from the both cathode of the chambers.
17
18
19 #include <TObject.h>
20 #include <TMath.h> // because of inline funtion GetRadius
21 #include <TArrayF.h>
22 class AliMUONRawCluster : public TObject {
23
24 public:
25    AliMUONRawCluster();
26    virtual ~AliMUONRawCluster();
27    
28    /// Return radius
29    Float_t      GetRadius(Int_t i) {return TMath::Sqrt(fX[i]*fX[i]+fY[i]*fY[i]);}
30    /// Return true as the function Compare() is implemented
31    Bool_t       IsSortable() const {return kTRUE;}
32    Int_t        Compare(const TObject *obj) const;
33    Int_t        PhysicsContribution() const;
34    virtual void Print(Option_t* opt="") const;
35    static Int_t BinarySearch(Float_t r, TArrayF ccord, Int_t from, Int_t upto);
36    static void  SortMin(Int_t *idx,Float_t *xdarray, Float_t *xarray, Float_t *yarray, Float_t *qarray,Int_t ntr);
37    void         DumpIndex();
38
39    Int_t        AddCharge(Int_t i, Float_t Q);
40    Int_t        AddX(Int_t i, Float_t X);
41    Int_t        AddY(Int_t i, Float_t Y);
42    Int_t        AddZ(Int_t i, Float_t Z);
43
44    Float_t        GetCharge(Int_t i=0) const;
45    Float_t      GetX(Int_t i=0) const;
46    Float_t      GetY(Int_t i=0) const;
47    Float_t      GetZ(Int_t i=0) const;
48    Int_t        GetTrack(Int_t i=0) const;
49    Float_t        GetPeakSignal(Int_t i=0) const;
50    Int_t        GetMultiplicity(Int_t i=0) const;
51    Int_t        GetClusterType() const;
52    Int_t        GetGhost() const;
53    Int_t        GetNcluster(Int_t i=0) const;
54    Float_t      GetChi2(Int_t i=0) const;
55    Int_t        GetIndex(Int_t i, Int_t j) const;
56    Int_t        GetOffset(Int_t i, Int_t j) const;
57    Float_t      GetContrib(Int_t i, Int_t j) const;
58    Int_t        GetPhysics(Int_t i) const;
59    Int_t        GetDetElemId() const ; 
60    Float_t      GetError(Int_t iXY) const;
61    Float_t      GetErrX() const;
62    Float_t      GetErrY() const;
63
64    Int_t        SetCharge(Int_t i, Float_t Q);
65    Int_t        SetX(Int_t i, Float_t X);
66    Int_t        SetY(Int_t i, Float_t Y);
67    Int_t        SetZ(Int_t i, Float_t Z);
68    void         SetDetElemId(Int_t Id); 
69    Int_t        SetTrack(Int_t i, Int_t track);
70    Int_t        SetPeakSignal(Int_t i, Float_t peaksignal);
71    Int_t        SetMultiplicity(Int_t i, Int_t mul);
72    Int_t        SetClusterType(Int_t type);
73    Int_t        SetGhost(Int_t ghost);
74    Int_t        SetNcluster(Int_t i, Int_t ncluster);
75    Int_t        SetChi2(Int_t i, Float_t chi2);
76    void         SetIndex(Int_t i, Int_t j, Int_t index);
77    void         SetOffset(Int_t i, Int_t j, Int_t offset);
78    void         SetContrib(Int_t i, Int_t j, Float_t contrib);
79    void         SetPhysics(Int_t i, Int_t physics);
80    void         SetError(Int_t iXY, Float_t err);
81    void         SetErrX(Float_t err);
82    void         SetErrY(Float_t err);
83
84 private:
85    Int_t       fIndexMap[50][2];  ///< Indices of digits
86    Int_t       fOffsetMap[50][2]; ///< Emmanuel special
87    Float_t     fContMap[50][2];   ///< Contribution from digit
88    Int_t     fPhysicsMap[50];   ///< Distinguish signal and background contr.
89   
90    Float_t     fQ[2]  ;           ///< Q of cluster (in ADC counts)     
91    Float_t     fX[2]  ;           ///< X of cluster
92    Float_t     fY[2]  ;           ///< Y of cluster
93    Float_t     fZ[2]  ;           ///< Z of cluster
94    Int_t       fTracks[3];        ///< Labels of overlapped tracks
95    Float_t     fPeakSignal[2];    ///< Peak signal 
96    Int_t       fMultiplicity[2];  ///< Cluster multiplicity
97    Int_t       fClusterType;      ///< Cluster type
98    Int_t       fGhost;            ///< Ghost info
99                                   // 0 if not a ghost or ghost problem solved
100                                   // >0 if ghost problem remains because
101                                   // 1 both (true and ghost) satify 
102                                   //   charge chi2 compatibility
103                                   // 2 none give satisfactory chi2
104    Int_t       fNcluster[2];      ///< Number of clusters
105    Float_t     fChi2[2];          ///< Chi**2 of fit
106    Int_t       fDetElemId;        ///< ID number of the detection element (slat) on which the cluster is found. 
107    Float_t     fErrXY[2];         ///< coordinate errors
108    ClassDef(AliMUONRawCluster,2)  //Cluster class for MUON
109 };
110
111 // inline functions
112
113 /// Return Indices of digits
114 inline  Int_t  AliMUONRawCluster::GetIndex(Int_t i, Int_t j) const
115 { return fIndexMap[i][j]; }
116
117 /// Return Emmanuel special offset map
118 inline  Int_t  AliMUONRawCluster::GetOffset(Int_t i, Int_t j) const
119 { return fOffsetMap[i][j]; }
120
121 /// Return Contribution from digit
122 inline  Float_t  AliMUONRawCluster::GetContrib(Int_t i, Int_t j) const
123 { return fContMap[i][j]; }
124
125 /// Return Distinguish signal and background contr.
126 inline  Int_t  AliMUONRawCluster::GetPhysics(Int_t i) const
127 { return fPhysicsMap[i]; }
128
129 /// Set Indices of digits
130 inline  void  AliMUONRawCluster::SetIndex(Int_t i, Int_t j, Int_t index)
131 { fIndexMap[i][j] = index; }
132
133 /// Set Emmanuel special offset map
134 inline  void  AliMUONRawCluster::SetOffset(Int_t i, Int_t j, Int_t offset)
135 { fOffsetMap[i][j] = offset; }
136
137 /// Set Contribution from digit
138 inline  void  AliMUONRawCluster::SetContrib(Int_t i, Int_t j, Float_t contrib)
139 { fContMap[i][j] = contrib; }
140
141 /// Set Distinguish signal and background contr.
142 inline  void  AliMUONRawCluster::SetPhysics(Int_t i, Int_t physics)
143 { fPhysicsMap[i] = physics; }
144
145 /// Set ID number of the detection element (slat) on which the cluster is found.
146 inline void AliMUONRawCluster::SetDetElemId(Int_t Id)
147 { fDetElemId = Id; }
148
149 /// Return ID number of the detection element (slat) on which the cluster is found.
150 inline Int_t AliMUONRawCluster::GetDetElemId() const
151 { return fDetElemId;}
152
153 /// Set coordinate errors
154 inline void AliMUONRawCluster::SetError(Int_t iXY, Float_t err)
155 { fErrXY[iXY] = err; }
156
157 /// Set x coordinate error
158 inline void AliMUONRawCluster::SetErrX(Float_t err)
159 { SetError(0, err); }
160
161 /// Set y coordinate error
162 inline void AliMUONRawCluster::SetErrY(Float_t err)
163 { SetError(1, err); }
164
165 /// Return coordinate errors
166 inline Float_t AliMUONRawCluster::GetError(Int_t iXY) const
167 { return fErrXY[iXY]; }
168
169 /// Return x coordinate error
170 inline Float_t AliMUONRawCluster::GetErrX() const
171 { return GetError(0); }
172
173 /// Return y coordinate error
174 inline Float_t AliMUONRawCluster::GetErrY() const
175 { return GetError(1); }
176
177 #endif
178
179
180
181
182
183