]>
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 | ||
0422a446 | 6 | #include <TObject.h> //base class |
7 | #include <TVector2.h> //DistTo | |
0fe8fa07 | 8 | #include "AliRICHDigit.h" |
0422a446 | 9 | class TMinuit; |
0fe8fa07 | 10 | |
11 | class AliRICHCluster :public TObject | |
12 | { | |
13 | public: | |
0422a446 | 14 | enum EClusterStatus {kFormed,kCoG,kUnfolded,kEmpty}; |
15 | AliRICHCluster() :TObject(),fCFM(-1),fSize(-1),fShape(-1),fQdc(-1),fChamber(-1),fX(-1),fY(-1),fStatus(kEmpty),fDigits(0) {} //default ctor | |
16 | AliRICHCluster(Int_t cs,Double_t x,Double_t y,Int_t q,Int_t sm):TObject(),fCFM(-1),fSize(sm),fShape(-1),fQdc(q ),fChamber(cs),fX(x ),fY(y ),fStatus(kEmpty),fDigits(0) {} //default ctor | |
17 | virtual ~AliRICHCluster() {} //dtor | |
0fe8fa07 | 18 | // AliRICHcluster(const AliRICHcluster& clus):TObject(clus) {} //copy ctor |
0422a446 | 19 | AliRICHCluster& operator=(const AliRICHCluster&) {return *this;} //copy operator |
0fe8fa07 | 20 | |
0422a446 | 21 | void Print(Option_t *option="")const; // |
0fe8fa07 | 22 | |
23 | ||
0422a446 | 24 | void Reset() {DeleteDigits();fCFM=fSize=fShape=fQdc=fChamber=-1;fX=fY=-1;fStatus=kEmpty;} //cleans the cluster |
0fe8fa07 | 25 | void DeleteDigits() {if(fDigits) {delete fDigits;} fDigits=0;} //deletes the list of digits |
0422a446 | 26 | Int_t Nlocmax() const{return fSize-10000*(fSize/10000);} //number of local maximums |
0fe8fa07 | 27 | Int_t Size() const{return fSize/10000;} //number of digits in cluster |
28 | Int_t Fsize() const{return fSize;} // | |
29 | Int_t Shape() const{return fShape;} //cluster shape rectangulare | |
30 | Int_t C() const{return fChamber/10;} //chamber number | |
31 | Int_t S() const{return fChamber-(fChamber/10)*10;} //sector number | |
32 | Int_t Fchamber() const{return fChamber;} // | |
33 | Int_t Q() const{return fQdc;} //cluster charge in QDC channels | |
34 | Double_t X() const{return fX;} //cluster x position in LRS | |
35 | Double_t Y() const{return fY;} //cluster y position in LRS | |
36 | Int_t Status() const{return fStatus;} // | |
37 | void SetStatus(Int_t status) {fStatus=status;} // | |
38 | Int_t Nmips() const{return fCFM-1000000*Ncerenkovs()-1000*Nfeedbacks();} // | |
39 | Int_t Ncerenkovs() const{return fCFM/1000000;} // | |
40 | Int_t Nfeedbacks() const{return (fCFM-1000000*Ncerenkovs())/1000;} // | |
41 | Bool_t IsPureMip() const{return fCFM<1000;} // | |
42 | Bool_t IsPureCerenkov() const{return Nmips()==0&&Nfeedbacks()==0;} // | |
43 | Bool_t IsPureFeedback() const{return Nmips()==0&&Ncerenkovs()==0;} // | |
44 | Bool_t IsSingleMip() const{return Nmips()==1&&Ncerenkovs()==0&&Nfeedbacks()==0;} // | |
45 | Bool_t IsSingleCerenkov() const{return Nmips()==0&&Ncerenkovs()==1&&Nfeedbacks()==0;} // | |
46 | Bool_t IsSingleFeedback() const{return Nmips()==0&&Ncerenkovs()==0&&Nfeedbacks()==1;} // | |
47 | Bool_t IsMip() const{return Nmips()!=0;} // | |
48 | Bool_t IsCerenkov() const{return Ncerenkovs()!=0;} // | |
49 | Bool_t IsFeedback() const{return Nfeedbacks()!=0;} // | |
50 | Int_t CombiPid() const{return fCFM;} // | |
51 | void CFM(Int_t c,Int_t f,Int_t m) {fCFM=1000000*c+1000*f+m;} //cluster contributors | |
0422a446 | 52 | TObjArray* Digits() const{return fDigits;} // |
53 | ||
54 | inline void AddDigit(AliRICHDigit *pDig); //add new digit ot the cluster | |
55 | AliRICHDigit* Digit (Int_t i )const{return (AliRICHDigit*)fDigits->At(i); }//get pointer to i-th digit without existence check | |
56 | TMinuit* Solve ( ); //calculates cluster position | |
57 | TMinuit* Unfold ( ); //decompose cluster n. loc max clusters | |
58 | void Set (Double_t x,Double_t y,Int_t q) {fX=x;fY=y,fQdc=q; }//set some cluster properties | |
59 | static void FitFunc(Int_t &iNpars, Double_t *, Double_t &chi2, Double_t *aPar, Int_t); //fit function to be used by MINUIT | |
60 | ||
61 | void CoG(Int_t iNlocmax); //calculates center of gravity | |
0fe8fa07 | 62 | void Fill(AliRICHCluster *pRaw,Double_t x,Double_t y,Double_t q,Int_t cfm) //form new resolved cluster from raw one |
0422a446 | 63 | {fCFM=cfm;fChamber=pRaw->Fchamber();fSize=pRaw->Fsize();fQdc=(Int_t)(q*pRaw->Q());fX=x;fY=y;fStatus=kUnfolded;} |
0fe8fa07 | 64 | Double_t DistTo(TVector2 x) const{return TMath::Sqrt((x.X()-fX)*(x.X()-fX)+(x.Y()-fY)*(x.Y()-fY));} //distance to given point |
65 | Double_t DistX(TVector2 x) const{return (x.X()-fX);} //distance in x to given point | |
66 | Double_t DistY(TVector2 x) const{return (x.Y()-fY);} //distance to given point | |
0422a446 | 67 | void Test(const TVector2 &x,Double_t dEloss=0); //test cluster fuctionality by provided hit with energy in eV |
0fe8fa07 | 68 | protected: |
69 | Int_t fCFM; //1000000*Ncerenkovs+1000*Nfeedbacks+Nmips | |
0422a446 | 70 | Int_t fSize; //10000*(N digits) + N maxima |
0fe8fa07 | 71 | Int_t fShape; //100*xdim+ydim box containing the cluster |
72 | Int_t fQdc; //QDC value | |
0422a446 | 73 | Int_t fChamber; //10*chamber number+sector number |
0fe8fa07 | 74 | Double_t fX; //local x postion |
75 | Double_t fY; //local y postion | |
76 | Int_t fStatus; //flag to mark the quality of the cluster | |
77 | TObjArray *fDigits; //! list of digits forming this cluster | |
78 | ClassDef(AliRICHCluster,2) //RICH cluster class | |
79 | };//class AliRICHCluster | |
80 | //__________________________________________________________________________________________________ | |
81 | void AliRICHCluster::AddDigit(AliRICHDigit *pDig) | |
82 | { | |
83 | // Adds a given digit to the list of digits belonging to this cluster | |
0422a446 | 84 | if(!fDigits) {fQdc=fSize=0;fDigits = new TObjArray;} |
85 | fDigits->Add(pDig); | |
86 | fQdc+=(Int_t)pDig->Qdc(); | |
87 | fChamber=10*pDig->Chamber()+pDig->Sector(); | |
0fe8fa07 | 88 | fSize+=10000; |
0422a446 | 89 | fStatus=kFormed; |
0fe8fa07 | 90 | } |
91 | //__________________________________________________________________________________________________ | |
0fe8fa07 | 92 | #endif |