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 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
198 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8)
199 << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ() <<
200 ") cm, Chi2=" << setw(8) << setprecision(3) << GetChi2() <<
201 ", Q=" << setw(4) << GetCharge();
202 if ( sopt.Contains("FULL") )
204 cout << ", Hit=" << setw(4) << GetTrack(0) <<
205 ", Track1=" << setw(4) << GetTrack(1) <<
206 ", Track2=" << setw(4) << GetTrack(2);
211 //____________________________________________________
212 void AliMUONRawCluster::DumpIndex(void)
214 /// Dumping IdexMap of the cluster
216 for (Int_t icat=0;icat<2;icat++) {
217 printf ("Mult %d\n",fMultiplicity[icat]);
218 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
219 printf("Index %d",fIndexMap[idig][icat]);
224 //____________________________________________________
225 Int_t AliMUONRawCluster::AddCharge(Int_t i, Float_t Q)
227 /// Adding Q to the fQ value
234 //____________________________________________________
235 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
237 /// Adding X to the fX value
244 //____________________________________________________
245 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
247 /// Adding Y to the fY value
254 //____________________________________________________
255 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
257 /// Adding Z to the fZ value
264 //____________________________________________________
265 Float_t AliMUONRawCluster::GetCharge(Int_t i) const
267 /// Getting the charge of the cluster
268 if (i==0 || i==1) return fQ[i];
271 //____________________________________________________
272 Float_t AliMUONRawCluster::GetX(Int_t i) const
274 /// Getting X value of the cluster
275 if (i==0 || i==1) return fX[i];
278 //____________________________________________________
279 Float_t AliMUONRawCluster::GetY(Int_t i) const
281 /// Getting Y value of the cluster
282 if (i==0 || i==1) return fY[i];
285 //____________________________________________________
286 Float_t AliMUONRawCluster::GetZ(Int_t i) const
288 /// Getting Z value of the cluster
289 if (i==0 || i==1) return fZ[i];
292 //____________________________________________________
293 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
295 /// Getting track i contributing to the cluster
296 if (i==0 || i==1 || i==2) return fTracks[i];
299 //____________________________________________________
300 Float_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
302 /// Getting cluster peaksignal
303 if (i==0 || i==1 ) return fPeakSignal[i];
306 //____________________________________________________
307 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
309 /// Getting cluster multiplicity
310 if (i==0 || i==1 ) return fMultiplicity[i];
313 //____________________________________________________
314 Int_t AliMUONRawCluster::GetClusterType() const
316 /// Getting Cluster Type
319 //____________________________________________________
320 Int_t AliMUONRawCluster::GetGhost() const
325 //____________________________________________________
326 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
328 /// Getting number of clusters
329 if (i==0 || i==1 ) return fNcluster[i];
332 //____________________________________________________
333 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
335 /// Getting chi2 value of the cluster
336 if (i==0 || i==1) return fChi2[i];
339 //____________________________________________________
340 Int_t AliMUONRawCluster::SetCharge(Int_t i, Float_t Q)
342 /// Setting Charge of the cluster
349 //____________________________________________________
350 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
352 /// Setting X value of the cluster
359 //____________________________________________________
360 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
362 /// Setting Y value of the cluster
369 //____________________________________________________
370 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
372 /// Setting Z value of the cluste
379 //____________________________________________________
380 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
382 /// Setting tracks contributing to the cluster
383 if (i==0 || i==1 || i==2) {
389 //____________________________________________________
390 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Float_t peaksignal)
392 /// Setting PeakSignal of the cluster
394 fPeakSignal[i]=peaksignal;
399 //____________________________________________________
400 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
402 /// Setting multiplicity of the cluster
404 fMultiplicity[i]=mul;
409 //____________________________________________________
410 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
412 /// Setting the cluster type
416 //____________________________________________________
417 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
419 /// Setting the ghost
423 //____________________________________________________
424 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
426 /// Setting number the cluster
428 fNcluster[i]=ncluster;
433 //____________________________________________________
434 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
436 /// Setting chi2 of the cluster