1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // Class for the MUON RecPoint
19 // It contains the properties of the physics cluters found in the tracking chambers
20 // RawCluster contains also the information from the both cathode of the chambers.
24 #include "AliMUONRawCluster.h"
27 ClassImp(AliMUONRawCluster);
30 AliMUONRawCluster::AliMUONRawCluster() {
32 fTracks[0]=fTracks[1]=fTracks[2]=-1;
33 for (int j=0;j<2;j++) {
41 for (int k=0;k<50;k++) {
48 fNcluster[0]=fNcluster[1]=-1;
51 //____________________________________________________
52 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
55 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
56 Float_t r=GetRadius();
57 Float_t ro=raw->GetRadius();
59 else if (r<ro) return -1;
62 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
64 Float_t yo=raw->fY[0];
66 else if (y<yo) return -1;
70 //____________________________________________________
71 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
73 // Find object using a binary search. Array must first have been sorted.
74 // Search can be limited by setting upto to desired index.
76 Int_t low=from, high=upto-1, half;
79 if(y>coord[half]) low=half;
84 //____________________________________________________
85 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
88 // Get the 3 closest points(cog) one can find on the second cathode
89 // starting from a given cog on first cathode
93 // Loop over deltax, only 3 times
98 Int_t id[3] = {-2,-2,-2};
99 Float_t jx[3] = {0.,0.,0.};
100 Float_t jy[3] = {0.,0.,0.};
101 Float_t jq[3] = {0.,0.,0.};
102 Int_t jid[3] = {-2,-2,-2};
112 if ((i == 1 && j == id[i-1])
113 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
114 if (TMath::Abs(xdarray[j]) < xmin) {
115 xmin = TMath::Abs(xdarray[j]);
145 //____________________________________________________
146 Int_t AliMUONRawCluster::PhysicsContribution() const
148 // Evaluate physics contribution to cluster
152 for (Int_t i=0; i<fMultiplicity[0]; i++) {
153 if (fPhysicsMap[i]==2) iPhys++;
154 if (fPhysicsMap[i]==1) iMixed++;
155 if (fPhysicsMap[i]==0) iBg++;
157 if (iMixed==0 && iBg==0) {
159 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
165 //____________________________________________________
166 void AliMUONRawCluster::DumpIndex(void)
168 // Dumping IdexMap of the cluster
170 for (Int_t icat=0;icat<2;icat++) {
171 printf ("Mult %d\n",fMultiplicity[icat]);
172 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
173 printf("Index %d",fIndexMap[idig][icat]);
178 //____________________________________________________
179 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
181 // Adding Q to the fQ value
188 //____________________________________________________
189 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
191 // Adding X to the fX value
198 //____________________________________________________
199 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
201 // Adding Y to the fY value
208 //____________________________________________________
209 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
211 // Adding Z to the fZ value
218 //____________________________________________________
219 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
221 // Getting the charge of the cluster
222 if (i==0 || i==1) return fQ[i];
225 //____________________________________________________
226 Float_t AliMUONRawCluster::GetX(Int_t i) const
228 // Getting X value of the cluster
229 if (i==0 || i==1) return fX[i];
232 //____________________________________________________
233 Float_t AliMUONRawCluster::GetY(Int_t i) const
235 // Getting Y value of the cluster
236 if (i==0 || i==1) return fY[i];
239 //____________________________________________________
240 Float_t AliMUONRawCluster::GetZ(Int_t i) const
242 // Getting Z value of the cluster
243 if (i==0 || i==1) return fZ[i];
246 //____________________________________________________
247 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
249 // Getting track i contributing to the cluster
250 if (i==0 || i==1 || i==2) return fTracks[i];
253 //____________________________________________________
254 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
256 // Getting cluster peaksignal
257 if (i==0 || i==1 ) return fPeakSignal[i];
260 //____________________________________________________
261 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
263 // Getting cluster multiplicity
264 if (i==0 || i==1 ) return fMultiplicity[i];
267 //____________________________________________________
268 Int_t AliMUONRawCluster::GetClusterType() const
270 // Getting Cluster Type
273 //____________________________________________________
274 Int_t AliMUONRawCluster::GetGhost() const
279 //____________________________________________________
280 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
282 // Getting number of clusters
283 if (i==0 || i==1 ) return fNcluster[i];
286 //____________________________________________________
287 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
289 // Getting chi2 value of the cluster
290 if (i==0 || i==1) return fChi2[i];
293 //____________________________________________________
294 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
296 // Setting Charge of the cluster
303 //____________________________________________________
304 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
306 // Setting X value of the cluster
313 //____________________________________________________
314 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
316 // Setting Y value of the cluster
323 //____________________________________________________
324 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
326 // Setting Z value of the cluste
333 //____________________________________________________
334 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
336 // Setting tracks contributing to the cluster
337 if (i==0 || i==1 || i==2) {
343 //____________________________________________________
344 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
346 // Setting PeakSignal of the cluster
348 fPeakSignal[i]=peaksignal;
353 //____________________________________________________
354 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
356 // Setting multiplicity of the cluster
358 fMultiplicity[i]=mul;
363 //____________________________________________________
364 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
366 // Setting the cluster type
370 //____________________________________________________
371 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
377 //____________________________________________________
378 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
380 // Setting number the cluster
382 fNcluster[i]=ncluster;
387 //____________________________________________________
388 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
390 // Setting chi2 of the cluster