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.
26 #include "AliMUONRawCluster.h"
28 ClassImp(AliMUONRawCluster)
31 AliMUONRawCluster::AliMUONRawCluster()
35 fTracks[0]=fTracks[1]=fTracks[2]=-1;
36 for (int j=0;j<2;j++) {
44 for (int k=0;k<50;k++) {
51 fNcluster[0]=fNcluster[1]=-1;
55 //____________________________________________________
56 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
59 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
60 Float_t r=GetRadius();
61 Float_t ro=raw->GetRadius();
63 else if (r<ro) return -1;
66 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
68 Float_t yo=raw->fY[0];
70 else if (y<yo) return -1;
74 //____________________________________________________
75 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
77 // Find object using a binary search. Array must first have been sorted.
78 // Search can be limited by setting upto to desired index.
80 Int_t low=from, high=upto-1, half;
83 if(y>coord[half]) low=half;
88 //____________________________________________________
89 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
92 // Get the 3 closest points(cog) one can find on the second cathode
93 // starting from a given cog on first cathode
97 // Loop over deltax, only 3 times
102 Int_t id[3] = {-2,-2,-2};
103 Float_t jx[3] = {0.,0.,0.};
104 Float_t jy[3] = {0.,0.,0.};
105 Float_t jq[3] = {0.,0.,0.};
106 Int_t jid[3] = {-2,-2,-2};
116 if ((i == 1 && j == id[i-1])
117 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
118 if (TMath::Abs(xdarray[j]) < xmin) {
119 xmin = TMath::Abs(xdarray[j]);
149 //____________________________________________________
150 Int_t AliMUONRawCluster::PhysicsContribution() const
152 // Evaluate physics contribution to cluster
156 for (Int_t i=0; i<fMultiplicity[0]; i++) {
157 if (fPhysicsMap[i]==2) iPhys++;
158 if (fPhysicsMap[i]==1) iMixed++;
159 if (fPhysicsMap[i]==0) iBg++;
161 if (iMixed==0 && iBg==0) {
163 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
169 //____________________________________________________
170 void AliMUONRawCluster::DumpIndex(void)
172 // Dumping IdexMap of the cluster
174 for (Int_t icat=0;icat<2;icat++) {
175 printf ("Mult %d\n",fMultiplicity[icat]);
176 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
177 printf("Index %d",fIndexMap[idig][icat]);
182 //____________________________________________________
183 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
185 // Adding Q to the fQ value
192 //____________________________________________________
193 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
195 // Adding X to the fX value
202 //____________________________________________________
203 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
205 // Adding Y to the fY value
212 //____________________________________________________
213 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
215 // Adding Z to the fZ value
222 //____________________________________________________
223 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
225 // Getting the charge of the cluster
226 if (i==0 || i==1) return fQ[i];
229 //____________________________________________________
230 Float_t AliMUONRawCluster::GetX(Int_t i) const
232 // Getting X value of the cluster
233 if (i==0 || i==1) return fX[i];
236 //____________________________________________________
237 Float_t AliMUONRawCluster::GetY(Int_t i) const
239 // Getting Y value of the cluster
240 if (i==0 || i==1) return fY[i];
243 //____________________________________________________
244 Float_t AliMUONRawCluster::GetZ(Int_t i) const
246 // Getting Z value of the cluster
247 if (i==0 || i==1) return fZ[i];
250 //____________________________________________________
251 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
253 // Getting track i contributing to the cluster
254 if (i==0 || i==1 || i==2) return fTracks[i];
257 //____________________________________________________
258 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
260 // Getting cluster peaksignal
261 if (i==0 || i==1 ) return fPeakSignal[i];
264 //____________________________________________________
265 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
267 // Getting cluster multiplicity
268 if (i==0 || i==1 ) return fMultiplicity[i];
271 //____________________________________________________
272 Int_t AliMUONRawCluster::GetClusterType() const
274 // Getting Cluster Type
277 //____________________________________________________
278 Int_t AliMUONRawCluster::GetGhost() const
283 //____________________________________________________
284 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
286 // Getting number of clusters
287 if (i==0 || i==1 ) return fNcluster[i];
290 //____________________________________________________
291 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
293 // Getting chi2 value of the cluster
294 if (i==0 || i==1) return fChi2[i];
297 //____________________________________________________
298 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
300 // Setting Charge of the cluster
307 //____________________________________________________
308 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
310 // Setting X value of the cluster
317 //____________________________________________________
318 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
320 // Setting Y value of the cluster
327 //____________________________________________________
328 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
330 // Setting Z value of the cluste
337 //____________________________________________________
338 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
340 // Setting tracks contributing to the cluster
341 if (i==0 || i==1 || i==2) {
347 //____________________________________________________
348 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
350 // Setting PeakSignal of the cluster
352 fPeakSignal[i]=peaksignal;
357 //____________________________________________________
358 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
360 // Setting multiplicity of the cluster
362 fMultiplicity[i]=mul;
367 //____________________________________________________
368 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
370 // Setting the cluster type
374 //____________________________________________________
375 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
381 //____________________________________________________
382 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
384 // Setting number the cluster
386 fNcluster[i]=ncluster;
391 //____________________________________________________
392 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
394 // Setting chi2 of the cluster