]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHRawCluster.cxx
Using new for arrays with undefined size
[u/mrichter/AliRoot.git] / RICH / AliRICHRawCluster.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 #include "AliRICHRawCluster.h"
17 #include <Riostream.h>
18
19
20 ClassImp(AliRICHRawCluster)
21 //__________________________________________________________________________________________________
22
23 AliRICHRawCluster :: AliRICHRawCluster() 
24 {//default ctor
25   fTracks[0]=fTracks[1]=fTracks[2]=-1; 
26   fX=fY=0;
27   fQ=fMultiplicity=0;
28   for (int k=0;k<50;k++) {
29     fIndexMap[k]=-1;
30     fContMap[k]=0;
31     fPhysicsMap[k]=-1;
32     fCtype=-1;
33   }
34   fNcluster[0]=fNcluster[1]=-1;
35 }//ctor
36 //__________________________________________________________________________________________________
37 Int_t AliRICHRawCluster::Compare(const TObject *obj) const
38 {//Compare two clusters
39   AliRICHRawCluster *raw=(AliRICHRawCluster *)obj;
40   Float_t y=fY;
41   Float_t yo=raw->fY;
42   if(y>yo)      return  1;
43   else if(y<yo) return -1;
44   else          return  0;
45 }//Compare()
46 //__________________________________________________________________________________________________
47 Int_t AliRICHRawCluster::PhysicsContribution()
48 {//Type of physics processes
49   Int_t iPhys=0;
50   Int_t iBg=0;
51   Int_t iMixed=0;
52   for (Int_t i=0; i<fMultiplicity; i++){
53     if(fPhysicsMap[i]==2) iPhys++;
54     if(fPhysicsMap[i]==1) iMixed++;
55     if(fPhysicsMap[i]==0) iBg++;
56   }
57   if(iMixed==0 && iBg==0)                         return 2;
58   else if((iPhys != 0 && iBg !=0) || iMixed != 0) return 1;
59   else                                            return 0;
60 }//PhysicsContribution
61 //__________________________________________________________________________________________________
62 void AliRICHRawCluster::Print(Option_t*)const
63 {
64   Info("","X=%7.2f, Y=%7.2f, Qdc=%4i, Peak=%4i, Multip=%2i,      T0=%5i T1=%5i T2=%5i",
65            fX,      fY,      fQ,      fPeakSignal,fMultiplicity, fTracks[0], fTracks[1], fTracks[2]);
66   
67   for(int i=0;i<fMultiplicity;i++)
68     cout<<"D"<<i<<"="<<fIndexMap[i]<<" C="<<fContMap[i]<<endl;
69 }//void AliRICHRawCluster::Print(Option_t *option)const