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 // -------------------------
19 // Class AliMUONRawCluster
20 // -------------------------
21 // Class for the MUON RecPoint
22 // It contains the properties of the physics cluters found in the tracking chambers
23 // RawCluster contains also the information from the both cathode of the chambers.
26 #include "Riostream.h"
31 #include "AliMUONRawCluster.h"
34 ClassImp(AliMUONRawCluster)
37 //____________________________________________________
38 AliMUONRawCluster::AliMUONRawCluster()
45 fTracks[0]=fTracks[1]=fTracks[2]=-1;
46 for (int j=0;j<2;j++) {
54 for (int k=0;k<50;k++) {
61 fNcluster[0]=fNcluster[1]=-1;
66 //____________________________________________________
67 AliMUONRawCluster::~AliMUONRawCluster()
72 //____________________________________________________
73 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
78 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
79 Float_t r=GetRadius();
80 Float_t ro=raw->GetRadius();
82 else if (r<ro) return -1;
85 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
87 Float_t yo=raw->fY[0];
89 else if (y<yo) return -1;
93 //____________________________________________________
94 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
96 /// Find object using a binary search. Array must first have been sorted.
97 /// Search can be limited by setting upto to desired index.
99 Int_t low=from, high=upto-1, half;
102 if(y>coord[half]) low=half;
107 //____________________________________________________
108 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
110 /// Get the 3 closest points(cog) one can find on the second cathode
111 /// starting from a given cog on first cathode
114 // Loop over deltax, only 3 times
119 Int_t id[3] = {-2,-2,-2};
120 Float_t jx[3] = {0.,0.,0.};
121 Float_t jy[3] = {0.,0.,0.};
122 Float_t jq[3] = {0.,0.,0.};
123 Int_t jid[3] = {-2,-2,-2};
133 if ((i == 1 && j == id[i-1])
134 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
135 if (TMath::Abs(xdarray[j]) < xmin) {
136 xmin = TMath::Abs(xdarray[j]);
166 //____________________________________________________
167 Int_t AliMUONRawCluster::PhysicsContribution() const
169 /// Evaluate physics contribution to cluster
173 for (Int_t i=0; i<fMultiplicity[0]; i++) {
174 if (fPhysicsMap[i]==2) iPhys++;
175 if (fPhysicsMap[i]==1) iMixed++;
176 if (fPhysicsMap[i]==0) iBg++;
178 if (iMixed==0 && iBg==0) {
180 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
187 //____________________________________________________
188 void AliMUONRawCluster::Print(Option_t* opt) const
191 /// Printing Raw Cluster (Rec Point) information
192 /// "full" option for printing all the information about the raw cluster
197 if ( sopt.Contains("FULL") ) {
198 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
199 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ() <<
200 ") cm, Chi2=" << setw(8) << setprecision(3) << GetChi2() <<
201 ", Q=" << setw(4) << GetCharge() <<
202 ", Hit=" << setw(4) << GetTrack(0) <<
203 ", Track1=" << setw(4) << GetTrack(1) <<
204 ", Track2=" << setw(4) << GetTrack(2) <<endl;
207 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
208 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ()
212 //____________________________________________________
213 void AliMUONRawCluster::DumpIndex(void)
215 /// Dumping IdexMap of the cluster
217 for (Int_t icat=0;icat<2;icat++) {
218 printf ("Mult %d\n",fMultiplicity[icat]);
219 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
220 printf("Index %d",fIndexMap[idig][icat]);
225 //____________________________________________________
226 Int_t AliMUONRawCluster::AddCharge(Int_t i, Float_t Q)
228 /// Adding Q to the fQ value
235 //____________________________________________________
236 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
238 /// Adding X to the fX value
245 //____________________________________________________
246 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
248 /// Adding Y to the fY value
255 //____________________________________________________
256 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
258 /// Adding Z to the fZ value
265 //____________________________________________________
266 Float_t AliMUONRawCluster::GetCharge(Int_t i) const
268 /// Getting the charge of the cluster
269 if (i==0 || i==1) return fQ[i];
272 //____________________________________________________
273 Float_t AliMUONRawCluster::GetX(Int_t i) const
275 /// Getting X value of the cluster
276 if (i==0 || i==1) return fX[i];
279 //____________________________________________________
280 Float_t AliMUONRawCluster::GetY(Int_t i) const
282 /// Getting Y value of the cluster
283 if (i==0 || i==1) return fY[i];
286 //____________________________________________________
287 Float_t AliMUONRawCluster::GetZ(Int_t i) const
289 /// Getting Z value of the cluster
290 if (i==0 || i==1) return fZ[i];
293 //____________________________________________________
294 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
296 /// Getting track i contributing to the cluster
297 if (i==0 || i==1 || i==2) return fTracks[i];
300 //____________________________________________________
301 Float_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
303 /// Getting cluster peaksignal
304 if (i==0 || i==1 ) return fPeakSignal[i];
307 //____________________________________________________
308 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
310 /// Getting cluster multiplicity
311 if (i==0 || i==1 ) return fMultiplicity[i];
314 //____________________________________________________
315 Int_t AliMUONRawCluster::GetClusterType() const
317 /// Getting Cluster Type
320 //____________________________________________________
321 Int_t AliMUONRawCluster::GetGhost() const
326 //____________________________________________________
327 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
329 /// Getting number of clusters
330 if (i==0 || i==1 ) return fNcluster[i];
333 //____________________________________________________
334 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
336 /// Getting chi2 value of the cluster
337 if (i==0 || i==1) return fChi2[i];
340 //____________________________________________________
341 Int_t AliMUONRawCluster::SetCharge(Int_t i, Float_t Q)
343 /// Setting Charge of the cluster
350 //____________________________________________________
351 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
353 /// Setting X value of the cluster
360 //____________________________________________________
361 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
363 /// Setting Y value of the cluster
370 //____________________________________________________
371 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
373 /// Setting Z value of the cluste
380 //____________________________________________________
381 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
383 /// Setting tracks contributing to the cluster
384 if (i==0 || i==1 || i==2) {
390 //____________________________________________________
391 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Float_t peaksignal)
393 /// Setting PeakSignal of the cluster
395 fPeakSignal[i]=peaksignal;
400 //____________________________________________________
401 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
403 /// Setting multiplicity of the cluster
405 fMultiplicity[i]=mul;
410 //____________________________________________________
411 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
413 /// Setting the cluster type
417 //____________________________________________________
418 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
420 /// Setting the ghost
424 //____________________________________________________
425 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
427 /// Setting number the cluster
429 fNcluster[i]=ncluster;
434 //____________________________________________________
435 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
437 /// Setting chi2 of the cluster