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"
33 ClassImp(AliMUONRawCluster)
36 AliMUONRawCluster::AliMUONRawCluster()
40 fTracks[0]=fTracks[1]=fTracks[2]=-1;
41 for (int j=0;j<2;j++) {
49 for (int k=0;k<50;k++) {
56 fNcluster[0]=fNcluster[1]=-1;
62 //____________________________________________________
63 Int_t AliMUONRawCluster::Compare(const TObject *obj) const
68 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
69 Float_t r=GetRadius();
70 Float_t ro=raw->GetRadius();
72 else if (r<ro) return -1;
75 AliMUONRawCluster *raw=(AliMUONRawCluster *)obj;
77 Float_t yo=raw->fY[0];
79 else if (y<yo) return -1;
83 //____________________________________________________
84 Int_t AliMUONRawCluster::BinarySearch(Float_t y, TArrayF coord, Int_t from, Int_t upto)
86 /// Find object using a binary search. Array must first have been sorted.
87 /// Search can be limited by setting upto to desired index.
89 Int_t low=from, high=upto-1, half;
92 if(y>coord[half]) low=half;
97 //____________________________________________________
98 void AliMUONRawCluster::SortMin(Int_t *idx,Float_t *xdarray,Float_t *xarray,Float_t *yarray,Float_t *qarray, Int_t ntr)
100 /// Get the 3 closest points(cog) one can find on the second cathode
101 /// starting from a given cog on first cathode
104 // Loop over deltax, only 3 times
109 Int_t id[3] = {-2,-2,-2};
110 Float_t jx[3] = {0.,0.,0.};
111 Float_t jy[3] = {0.,0.,0.};
112 Float_t jq[3] = {0.,0.,0.};
113 Int_t jid[3] = {-2,-2,-2};
123 if ((i == 1 && j == id[i-1])
124 ||(i == 2 && (j == id[i-1] || j == id[i-2]))) continue;
125 if (TMath::Abs(xdarray[j]) < xmin) {
126 xmin = TMath::Abs(xdarray[j]);
156 //____________________________________________________
157 Int_t AliMUONRawCluster::PhysicsContribution() const
159 /// Evaluate physics contribution to cluster
163 for (Int_t i=0; i<fMultiplicity[0]; i++) {
164 if (fPhysicsMap[i]==2) iPhys++;
165 if (fPhysicsMap[i]==1) iMixed++;
166 if (fPhysicsMap[i]==0) iBg++;
168 if (iMixed==0 && iBg==0) {
170 } else if ((iPhys != 0 && iBg !=0) || iMixed != 0) {
177 //____________________________________________________
178 void AliMUONRawCluster::Print(Option_t* opt) const
181 // Printing Raw Cluster (Rec Point) information
182 // "full" option for printing all the information about the raw cluster
187 if ( sopt.Contains("FULL") ) {
188 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
189 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ() <<
190 ") cm, Chi2=" << setw(8) << setprecision(3) << GetChi2() <<
191 ", Q=" << setw(4) << GetCharge() <<
192 ", Hit=" << setw(4) << GetTrack(0) <<
193 ", Track1=" << setw(4) << GetTrack(1) <<
194 ", Track2=" << setw(4) << GetTrack(2) <<endl;
197 cout << "<AliMUONRawCluster>: DetEle=" << setw(4) << GetDetElemId() <<
198 ", (x,y,z)=(" << setw(8) << setprecision(5) << GetX() << "," << setw(8) << setprecision(5) << GetY() << "," << setw(8) << setprecision(5) << GetZ()
202 //____________________________________________________
203 void AliMUONRawCluster::DumpIndex(void)
205 /// Dumping IdexMap of the cluster
207 for (Int_t icat=0;icat<2;icat++) {
208 printf ("Mult %d\n",fMultiplicity[icat]);
209 for (Int_t idig=0;idig<fMultiplicity[icat];idig++){
210 printf("Index %d",fIndexMap[idig][icat]);
215 //____________________________________________________
216 Int_t AliMUONRawCluster::AddCharge(Int_t i, Int_t Q)
218 /// Adding Q to the fQ value
225 //____________________________________________________
226 Int_t AliMUONRawCluster::AddX(Int_t i, Float_t X)
228 /// Adding X to the fX value
235 //____________________________________________________
236 Int_t AliMUONRawCluster::AddY(Int_t i, Float_t Y)
238 /// Adding Y to the fY value
245 //____________________________________________________
246 Int_t AliMUONRawCluster::AddZ(Int_t i, Float_t Z)
248 /// Adding Z to the fZ value
255 //____________________________________________________
256 Int_t AliMUONRawCluster::GetCharge(Int_t i) const
258 /// Getting the charge of the cluster
259 if (i==0 || i==1) return fQ[i];
262 //____________________________________________________
263 Float_t AliMUONRawCluster::GetX(Int_t i) const
265 /// Getting X value of the cluster
266 if (i==0 || i==1) return fX[i];
269 //____________________________________________________
270 Float_t AliMUONRawCluster::GetY(Int_t i) const
272 /// Getting Y value of the cluster
273 if (i==0 || i==1) return fY[i];
276 //____________________________________________________
277 Float_t AliMUONRawCluster::GetZ(Int_t i) const
279 /// Getting Z value of the cluster
280 if (i==0 || i==1) return fZ[i];
283 //____________________________________________________
284 Int_t AliMUONRawCluster::GetTrack(Int_t i) const
286 /// Getting track i contributing to the cluster
287 if (i==0 || i==1 || i==2) return fTracks[i];
290 //____________________________________________________
291 Int_t AliMUONRawCluster::GetPeakSignal(Int_t i) const
293 /// Getting cluster peaksignal
294 if (i==0 || i==1 ) return fPeakSignal[i];
297 //____________________________________________________
298 Int_t AliMUONRawCluster::GetMultiplicity(Int_t i) const
300 /// Getting cluster multiplicity
301 if (i==0 || i==1 ) return fMultiplicity[i];
304 //____________________________________________________
305 Int_t AliMUONRawCluster::GetClusterType() const
307 /// Getting Cluster Type
310 //____________________________________________________
311 Int_t AliMUONRawCluster::GetGhost() const
316 //____________________________________________________
317 Int_t AliMUONRawCluster::GetNcluster(Int_t i) const
319 /// Getting number of clusters
320 if (i==0 || i==1 ) return fNcluster[i];
323 //____________________________________________________
324 Float_t AliMUONRawCluster::GetChi2(Int_t i) const
326 /// Getting chi2 value of the cluster
327 if (i==0 || i==1) return fChi2[i];
330 //____________________________________________________
331 Int_t AliMUONRawCluster::SetCharge(Int_t i, Int_t Q)
333 /// Setting Charge of the cluster
340 //____________________________________________________
341 Int_t AliMUONRawCluster::SetX(Int_t i, Float_t X)
343 /// Setting X value of the cluster
350 //____________________________________________________
351 Int_t AliMUONRawCluster::SetY(Int_t i, Float_t Y)
353 /// Setting Y value of the cluster
360 //____________________________________________________
361 Int_t AliMUONRawCluster::SetZ(Int_t i, Float_t Z)
363 /// Setting Z value of the cluste
370 //____________________________________________________
371 Int_t AliMUONRawCluster::SetTrack(Int_t i, Int_t track)
373 /// Setting tracks contributing to the cluster
374 if (i==0 || i==1 || i==2) {
380 //____________________________________________________
381 Int_t AliMUONRawCluster::SetPeakSignal(Int_t i, Int_t peaksignal)
383 /// Setting PeakSignal of the cluster
385 fPeakSignal[i]=peaksignal;
390 //____________________________________________________
391 Int_t AliMUONRawCluster::SetMultiplicity(Int_t i, Int_t mul)
393 /// Setting multiplicity of the cluster
395 fMultiplicity[i]=mul;
400 //____________________________________________________
401 Int_t AliMUONRawCluster::SetClusterType(Int_t type)
403 /// Setting the cluster type
407 //____________________________________________________
408 Int_t AliMUONRawCluster::SetGhost(Int_t ghost)
410 /// Setting the ghost
414 //____________________________________________________
415 Int_t AliMUONRawCluster::SetNcluster(Int_t i, Int_t ncluster)
417 /// Setting number the cluster
419 fNcluster[i]=ncluster;
424 //____________________________________________________
425 Int_t AliMUONRawCluster::SetChi2(Int_t i, Float_t chi2)
427 /// Setting chi2 of the cluster