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;
57 //____________________________________________________
58 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
61 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
62 Float_t r=GetRadius();
63 Float_t ro=raw->GetRadius();
65 else if (r<ro) return -1;
68 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
70 Float_t yo=raw->fY[0];
72 else if (y<yo) return -1;
76 //____________________________________________________
77 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
79 // Find object using a binary search. Array must first have been sorted.
80 // Search can be limited by setting upto to desired index.
82 Int_t low=from, high=upto-1, half;
85 if(y>coord[half]) low=half;
90 //____________________________________________________
91 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
94 // Get the 3 closest points(cog) one can find on the second cathode
95 // starting from a given cog on first cathode
99 // Loop over deltax, only 3 times
104 Int_t id[3] = {-2,-2,-2};
105 Float_t jx[3] = {0.,0.,0.};
106 Float_t jy[3] = {0.,0.,0.};
107 Float_t jq[3] = {0.,0.,0.};
108 Int_t jid[3] = {-2,-2,-2};
118 if ((i == 1 && j == id[i-1])
119 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
120 if (TMath::Abs(xdarray[j]) < xmin) {
121 xmin = TMath::Abs(xdarray[j]);
151 //____________________________________________________
152 Int_t AliMUONRawCluster::PhysicsContribution() const
154 // Evaluate physics contribution to cluster
158 for (Int_t i=0; i<fMultiplicity[0]; i++) {
159 if (fPhysicsMap[i]==2) iPhys++;
160 if (fPhysicsMap[i]==1) iMixed++;
161 if (fPhysicsMap[i]==0) iBg++;
163 if (iMixed==0 && iBg==0) {
165 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
171 //____________________________________________________
172 void AliMUONRawCluster::DumpIndex(void)
174 // Dumping IdexMap of the cluster
176 for (Int_t icat=0;icat<2;icat++) {
177 printf ("Mult %d\n",fMultiplicity[icat]);
178 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
179 printf("Index %d",fIndexMap[idig][icat]);
184 //____________________________________________________
185 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
187 // Adding Q to the fQ value
194 //____________________________________________________
195 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
197 // Adding X to the fX value
204 //____________________________________________________
205 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
207 // Adding Y to the fY value
214 //____________________________________________________
215 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
217 // Adding Z to the fZ value
224 //____________________________________________________
225 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
227 // Getting the charge of the cluster
228 if (i==0 || i==1) return fQ[i];
231 //____________________________________________________
232 Float_t AliMUONRawCluster::GetX(Int_t i) const
234 // Getting X value of the cluster
235 if (i==0 || i==1) return fX[i];
238 //____________________________________________________
239 Float_t AliMUONRawCluster::GetY(Int_t i) const
241 // Getting Y value of the cluster
242 if (i==0 || i==1) return fY[i];
245 //____________________________________________________
246 Float_t AliMUONRawCluster::GetZ(Int_t i) const
248 // Getting Z value of the cluster
249 if (i==0 || i==1) return fZ[i];
252 //____________________________________________________
253 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
255 // Getting track i contributing to the cluster
256 if (i==0 || i==1 || i==2) return fTracks[i];
259 //____________________________________________________
260 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
262 // Getting cluster peaksignal
263 if (i==0 || i==1 ) return fPeakSignal[i];
266 //____________________________________________________
267 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
269 // Getting cluster multiplicity
270 if (i==0 || i==1 ) return fMultiplicity[i];
273 //____________________________________________________
274 Int_t AliMUONRawCluster::GetClusterType() const
276 // Getting Cluster Type
279 //____________________________________________________
280 Int_t AliMUONRawCluster::GetGhost() const
285 //____________________________________________________
286 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
288 // Getting number of clusters
289 if (i==0 || i==1 ) return fNcluster[i];
292 //____________________________________________________
293 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
295 // Getting chi2 value of the cluster
296 if (i==0 || i==1) return fChi2[i];
299 //____________________________________________________
300 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
302 // Setting Charge of the cluster
309 //____________________________________________________
310 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
312 // Setting X value of the cluster
319 //____________________________________________________
320 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
322 // Setting Y value of the cluster
329 //____________________________________________________
330 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
332 // Setting Z value of the cluste
339 //____________________________________________________
340 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
342 // Setting tracks contributing to the cluster
343 if (i==0 || i==1 || i==2) {
349 //____________________________________________________
350 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
352 // Setting PeakSignal of the cluster
354 fPeakSignal[i]=peaksignal;
359 //____________________________________________________
360 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
362 // Setting multiplicity of the cluster
364 fMultiplicity[i]=mul;
369 //____________________________________________________
370 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
372 // Setting the cluster type
376 //____________________________________________________
377 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
383 //____________________________________________________
384 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
386 // Setting number the cluster
388 fNcluster[i]=ncluster;
393 //____________________________________________________
394 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
396 // Setting chi2 of the cluster