]>
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 | ||
e30ca504 | 6 | #include "AliRICHDigit.h" //DigAdd() |
7 | #include <TObjArray.h> //DigAdd() | |
8 | class TClonesArray; //Solve() | |
0fe8fa07 | 9 | |
10 | class AliRICHCluster :public TObject | |
11 | { | |
12 | public: | |
e30ca504 | 13 | enum EClusterStatus {kFor,kCoG,kUnf,kEmp=-1}; //status flags |
14 | AliRICHCluster( ):TObject( ),fSt(kEmp ),fCh(-1 ),fQ(-1 ),fX(-1 ),fY(-1 ),fDigs(0 ) {} | |
15 | AliRICHCluster(Int_t c,Float_t x,Float_t y,Int_t q):TObject( ),fSt(kUnf ),fCh(c ),fQ(q ),fX(x ),fY(y ),fDigs(0 ) {} | |
16 | AliRICHCluster(const AliRICHCluster &c ):TObject(c),fSt(c.fSt),fCh(c.fCh),fQ(c.fQ),fX(c.fX),fY(c.fY),fDigs(c.fDigs ? new TObjArray(*c.fDigs):0) {} | |
17 | AliRICHCluster &operator=(const AliRICHCluster &c) { | |
18 | if(this == &c)return *this;TObject::operator=(c); fSt=c.fSt; fCh=c.fCh; fQ=c.fQ; fX=c.fX; fY=c.fY; fDigs=c.fDigs ? new TObjArray(*c.fDigs):0; return *this;} | |
19 | ||
20 | virtual ~AliRICHCluster( ) {DigDel();} | |
db910db9 | 21 | //framework part |
22 | void Print (Option_t *opt="" )const; //overloaded TObject::Print() to print cluster info | |
23 | static void FitFunc(Int_t &, Double_t *, Double_t &, Double_t *, Int_t); //fit function to be used by MINUIT | |
24 | //private part | |
25 | void CoG ( ); //calculates center of gravity | |
e30ca504 | 26 | void CorrSin ( ); //sinoidal correction |
27 | Int_t Ch ( )const{return fCh; } //chamber number | |
db910db9 | 28 | inline void DigAdd (AliRICHDigit *pDig ); //add new digit ot the cluster |
03eee7a8 | 29 | void DigDel ( ) {if(fDigs) {delete fDigs;fDigs=0;} } //deletes the list of digits (not digits!) |
db910db9 | 30 | AliRICHDigit* Dig (Int_t i )const{return (AliRICHDigit*)fDigs->At(i); } //pointer to i-th digit |
e30ca504 | 31 | TObjArray* DigLst ( )const{return fDigs; } //list of digits |
32 | void Reset ( ) {DigDel();fQ=fCh=-1;fX=fY=-1;fSt=kEmp; } //cleans the cluster | |
db910db9 | 33 | Int_t Solve (TClonesArray *pCluLst,Bool_t isUnfold ); //solve cluster: MINUIT fit or CoG |
34 | Int_t Size ( )const{return (fDigs)?fDigs->GetEntriesFast():0; } //number of pads in cluster | |
e30ca504 | 35 | Int_t Q ( )const{return fQ; } //cluster charge in QDC channels |
36 | Float_t X ( )const{return fX; } //cluster x position in LRS | |
37 | Float_t Y ( )const{return fY; } //cluster y position in LRS | |
0fe8fa07 | 38 | protected: |
e30ca504 | 39 | Int_t fSt; //flag to mark the quality of the cluster |
40 | Int_t fCh; //chamber number | |
41 | Int_t fQ; //QDC value | |
42 | Float_t fX; //local x postion, [cm] | |
43 | Float_t fY; //local y postion, [cm] | |
db910db9 | 44 | TObjArray *fDigs; //! list of digits forming this cluster |
e30ca504 | 45 | ClassDef(AliRICHCluster,5) //RICH cluster class |
0fe8fa07 | 46 | };//class AliRICHCluster |
db910db9 | 47 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
48 | void AliRICHCluster::DigAdd(AliRICHDigit *pDig) | |
0fe8fa07 | 49 | { |
e30ca504 | 50 | // Adds a given digit to the list of digits belonging to this cluster, cluster is not owner of digits |
51 | // Arguments: pDig - pointer to digit to be added | |
52 | // Returns: none | |
53 | if(!fDigs) {fQ=0;fDigs = new TObjArray;} | |
db910db9 | 54 | fDigs->Add(pDig); |
e30ca504 | 55 | fQ+=(Int_t)pDig->Q(); |
56 | fCh=pDig->Ch(); | |
57 | fSt=kFor; | |
0fe8fa07 | 58 | } |
db910db9 | 59 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
0fe8fa07 | 60 | #endif |