]>
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}; |
6b5dbc51 | 12 | AliRICHCluster(): |
13 | TObject(), | |
14 | fQdc(-1), | |
15 | fCham(-1), | |
16 | fX(-1), | |
17 | fY(-1), | |
18 | fStatus(kEmpty), | |
19 | fDigs(0) { | |
20 | // Default constructor | |
21 | } | |
22 | AliRICHCluster(Int_t c,Double_t x,Double_t y,Int_t q): | |
23 | TObject(), | |
24 | fQdc(q ), | |
25 | fCham(c) , | |
26 | fX(x), | |
27 | fY(y), | |
28 | fStatus(kUnfolded), | |
29 | fDigs(0x0) { | |
30 | // Constructor | |
31 | } | |
32 | AliRICHCluster(const AliRICHCluster & src) : | |
33 | TObject(src), | |
34 | fQdc(src.fQdc), | |
35 | fCham(src.fCham), | |
36 | fX(src.fX), | |
37 | fY(src.fY), | |
38 | fStatus(src.fStatus), | |
39 | fDigs(src.fDigs ? new TObjArray(*src.fDigs) : 0x0) { | |
40 | // Copy constructor | |
41 | } | |
42 | AliRICHCluster & operator=(const AliRICHCluster & src) { | |
43 | // Assigment operator | |
44 | if ( this == &src ) return *this; | |
45 | ||
46 | // Base class assignment | |
47 | TObject::operator=(src); | |
48 | ||
49 | fQdc = src.fQdc; | |
50 | fCham = src.fCham; | |
51 | fX = src.fX; | |
52 | fY = src.fY; | |
53 | fStatus = src.fStatus; | |
54 | fDigs = src.fDigs ? new TObjArray(*src.fDigs) : 0x0; | |
55 | return *this; | |
56 | } | |
92830e91 | 57 | virtual ~AliRICHCluster( ) {DigDel();} |
db910db9 | 58 | //framework part |
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 | |
61 | //private part | |
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 | |
03eee7a8 | 65 | void DigDel ( ) {if(fDigs) {delete fDigs;fDigs=0;} } //deletes the list of digits (not digits!) |
db910db9 | 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 | |
76 | //test part | |
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 | |
0fe8fa07 | 79 | protected: |
0fe8fa07 | 80 | Int_t fQdc; //QDC value |
db910db9 | 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 | |
0fe8fa07 | 84 | Int_t fStatus; //flag to mark the quality of the cluster |
db910db9 | 85 | TObjArray *fDigs; //! list of digits forming this cluster |
86 | ClassDef(AliRICHCluster,3) //RICH cluster class | |
0fe8fa07 | 87 | };//class AliRICHCluster |
db910db9 | 88 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
89 | void AliRICHCluster::DigAdd(AliRICHDigit *pDig) | |
0fe8fa07 | 90 | { |
91 | // Adds a given digit to the list of digits belonging to this cluster | |
db910db9 | 92 | if(!fDigs) {fQdc=0;fDigs = new TObjArray;} |
93 | fDigs->Add(pDig); | |
0422a446 | 94 | fQdc+=(Int_t)pDig->Qdc(); |
db910db9 | 95 | fCham=pDig->C(); |
0422a446 | 96 | fStatus=kFormed; |
0fe8fa07 | 97 | } |
db910db9 | 98 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
0fe8fa07 | 99 | #endif |