1 #ifndef AliRICHCluster_h
2 #define AliRICHCluster_h
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 #include "AliRICHParam.h" //DigAdd(), Dig()
8 class AliRICHCluster :public TObject
11 enum EClusterStatus {kFormed,kCoG,kUnfolded,kEmpty=-1};
20 // Default constructor
22 AliRICHCluster(Int_t c,Double_t x,Double_t y,Int_t q):
32 AliRICHCluster(const AliRICHCluster & src) :
39 fDigs(src.fDigs ? new TObjArray(*src.fDigs) : 0x0) {
42 AliRICHCluster & operator=(const AliRICHCluster & src) {
44 if ( this == &src ) return *this;
46 // Base class assignment
47 TObject::operator=(src);
53 fStatus = src.fStatus;
54 fDigs = src.fDigs ? new TObjArray(*src.fDigs) : 0x0;
57 virtual ~AliRICHCluster( ) {DigDel();}
59 void Print (Option_t *opt="" )const; //overloaded TObject::Print() to print cluster info
60 static void FitFunc(Int_t &, Double_t *, Double_t &, Double_t *, Int_t); //fit function to be used by MINUIT
62 void CoG ( ); //calculates center of gravity
63 Int_t C ( )const{return fCham; } //chamber number
64 inline void DigAdd (AliRICHDigit *pDig ); //add new digit ot the cluster
65 void DigDel ( ) {if(fDigs) {delete fDigs;fDigs=0;} } //deletes the list of digits (not digits!)
66 void DistXY (const TVector2 &p,Double_t &x,Double_t &y)const{ x=p.X()-fX; y=p.Y()-fY; } //distance in x to given point
67 AliRICHDigit* Dig (Int_t i )const{return (AliRICHDigit*)fDigs->At(i); } //pointer to i-th digit
68 TObjArray* Digits ( )const{return fDigs; } //list of digits
69 TVector3 Lors2Mars() const{return AliRICHParam::Instance()->Lors2Mars(fCham,fX,fY); } //cluster position in MARS
70 void Reset ( ) {DigDel();fQdc=fCham=-1;fX=fY=-1;fStatus=kEmpty;} //cleans the cluster
71 Int_t Solve (TClonesArray *pCluLst,Bool_t isUnfold ); //solve cluster: MINUIT fit or CoG
72 Int_t Size ( )const{return (fDigs)?fDigs->GetEntriesFast():0; } //number of pads in cluster
73 Int_t Q ( )const{return fQdc; } //cluster charge in QDC channels
74 Double_t X ( )const{return fX; } //cluster x position in LRS
75 Double_t Y ( )const{return fY; } //cluster y position in LRS
77 static void Test (Double_t x,Double_t y,Double_t e=0,Bool_t isUnfold=kTRUE); //test by hit (x [cm] , y [cm] , e [GeV])
78 static void Test ( ); //test by predifined patterns
80 Int_t fQdc; //QDC value
81 Int_t fCham; //10*chamber number+sector number
82 Double_t fX; //local x postion, cm
83 Double_t fY; //local y postion, cm
84 Int_t fStatus; //flag to mark the quality of the cluster
85 TObjArray *fDigs; //! list of digits forming this cluster
86 ClassDef(AliRICHCluster,3) //RICH cluster class
87 };//class AliRICHCluster
88 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
89 void AliRICHCluster::DigAdd(AliRICHDigit *pDig)
91 // Adds a given digit to the list of digits belonging to this cluster
92 if(!fDigs) {fQdc=0;fDigs = new TObjArray;}
94 fQdc+=(Int_t)pDig->Qdc();
98 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++