]>
Commit | Line | Data |
---|---|---|
0fe8fa07 | 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 */ | |
5 | ||
db910db9 | 6 | #include "AliRICHParam.h" //DigAdd(), Dig() |
0fe8fa07 | 7 | |
8 | class AliRICHCluster :public TObject | |
9 | { | |
10 | public: | |
db910db9 | 11 | enum EClusterStatus {kFormed,kCoG,kUnfolded,kEmpty=-1}; |
12 | AliRICHCluster( ):TObject(),fQdc(-1),fCham(-1),fX(-1),fY(-1),fStatus(kEmpty ),fDigs(0) {} | |
13 | AliRICHCluster(Int_t c,Double_t x,Double_t y,Int_t q):TObject(),fQdc(q ),fCham(c) ,fX(x ),fY(y ),fStatus(kUnfolded),fDigs(0) {} | |
92830e91 | 14 | virtual ~AliRICHCluster( ) {DigDel();} |
db910db9 | 15 | //framework part |
16 | void Print (Option_t *opt="" )const; //overloaded TObject::Print() to print cluster info | |
17 | static void FitFunc(Int_t &, Double_t *, Double_t &, Double_t *, Int_t); //fit function to be used by MINUIT | |
18 | //private part | |
19 | void CoG ( ); //calculates center of gravity | |
20 | Int_t C ( )const{return fCham; } //chamber number | |
21 | inline void DigAdd (AliRICHDigit *pDig ); //add new digit ot the cluster | |
03eee7a8 | 22 | void DigDel ( ) {if(fDigs) {delete fDigs;fDigs=0;} } //deletes the list of digits (not digits!) |
db910db9 | 23 | 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 |
24 | AliRICHDigit* Dig (Int_t i )const{return (AliRICHDigit*)fDigs->At(i); } //pointer to i-th digit | |
25 | TObjArray* Digits ( )const{return fDigs; } //list of digits | |
26 | TVector3 Lors2Mars() const{return AliRICHParam::Instance()->Lors2Mars(fCham,fX,fY); } //cluster position in MARS | |
27 | void Reset ( ) {DigDel();fQdc=fCham=-1;fX=fY=-1;fStatus=kEmpty;} //cleans the cluster | |
28 | Int_t Solve (TClonesArray *pCluLst,Bool_t isUnfold ); //solve cluster: MINUIT fit or CoG | |
29 | Int_t Size ( )const{return (fDigs)?fDigs->GetEntriesFast():0; } //number of pads in cluster | |
30 | Int_t Q ( )const{return fQdc; } //cluster charge in QDC channels | |
31 | Double_t X ( )const{return fX; } //cluster x position in LRS | |
32 | Double_t Y ( )const{return fY; } //cluster y position in LRS | |
33 | //test part | |
34 | 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]) | |
35 | static void Test ( ); //test by predifined patterns | |
0fe8fa07 | 36 | protected: |
0fe8fa07 | 37 | Int_t fQdc; //QDC value |
db910db9 | 38 | Int_t fCham; //10*chamber number+sector number |
39 | Double_t fX; //local x postion, cm | |
40 | Double_t fY; //local y postion, cm | |
0fe8fa07 | 41 | Int_t fStatus; //flag to mark the quality of the cluster |
db910db9 | 42 | TObjArray *fDigs; //! list of digits forming this cluster |
43 | ClassDef(AliRICHCluster,3) //RICH cluster class | |
0fe8fa07 | 44 | };//class AliRICHCluster |
db910db9 | 45 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
46 | void AliRICHCluster::DigAdd(AliRICHDigit *pDig) | |
0fe8fa07 | 47 | { |
48 | // Adds a given digit to the list of digits belonging to this cluster | |
db910db9 | 49 | if(!fDigs) {fQdc=0;fDigs = new TObjArray;} |
50 | fDigs->Add(pDig); | |
0422a446 | 51 | fQdc+=(Int_t)pDig->Qdc(); |
db910db9 | 52 | fCham=pDig->C(); |
0422a446 | 53 | fStatus=kFormed; |
0fe8fa07 | 54 | } |
db910db9 | 55 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
0fe8fa07 | 56 | #endif |