]>
Commit | Line | Data |
---|---|---|
2f614988 | 1 | #ifndef AliRICH_h |
2 | #define AliRICH_h | |
3da30618 | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
db910db9 | 6 | #include <AliDetector.h> //base class |
7 | #include <TClonesArray.h> | |
1c349ae5 | 8 | #include <TObjArray.h> |
9 | #include <TVector.h> | |
d4c94996 | 10 | #include <TVector3.h> |
1c349ae5 | 11 | |
0fe8fa07 | 12 | #include "AliRICHCluster.h" |
13 | #include "AliRICHHit.h" | |
d4c94996 | 14 | |
c021cb15 | 15 | //__________________AliRICH_________________________________________________________________________ |
e42a7b46 | 16 | class AliESD; |
3ea9cb08 | 17 | |
db910db9 | 18 | class AliRICH : public AliDetector //TObject-TNamed-AliModule-AliDetector-AliRICH |
2f614988 | 19 | { |
2f614988 | 20 | public: |
a25b3368 | 21 | //ctor & dtor |
853634d3 | 22 | AliRICH(); |
af3d25a6 | 23 | AliRICH(const char *name, const char *title); |
4c3a1f92 | 24 | AliRICH(const AliRICH& RICH ):AliDetector(RICH),fSdig(0),fSdigCnt(0),fDig(0),fClu(0),fCounters(0),fNcham(0) {;} //copy ctor not implemented |
853634d3 | 25 | virtual ~AliRICH(); |
dfb4e77d | 26 | |
942194a4 | 27 | AliRICH& operator=(const AliRICH&) {return *this;} |
d4c94996 | 28 | //framework part |
db910db9 | 29 | void BuildGeometry ( ); //from AliModule invoked from AliMC::InitGeometry() to build geometry for event display |
30 | virtual void CreateMaterials ( )=0; //from AliModule invoked from AliMC::ConstructGeometry() to define detector materials | |
31 | virtual void CreateGeometry ( )=0; //from AliModule invoked from AliMC::ConstructGeometry() to build detector for simulation | |
32 | virtual Int_t IsVersion ( )const=0; //from AliModule not used | |
33 | virtual void Init ( )=0; //from AliModule invoked from AliMC::InitGeometry() after CreateGeometry() to do VolID initialization | |
34 | void MakeBranch (Option_t *opt="" ); //from AliModule invokde from AliRun::Tree2Tree() to make requested RICH branch | |
35 | // virtual void Print (const Option_t *opt)const=0; //from TObject | |
36 | virtual void StepManager ( )=0; //from AliModule invoked from AliMC | |
37 | void SetTreeAddress ( ); //from AliModule invoked from AliRun::GetEvent(), AliLoader::SetTAddrInDet() | |
0fe8fa07 | 38 | //private part |
db910db9 | 39 | void HitAdd (Int_t c,Int_t tid,Int_t pid,TVector3 in,TVector3 out,Double_t e=0 ){new((*fHits)[fNhits++])AliRICHHit(c,tid,in,out,e,pid); } |
40 | void HitAdd (Int_t tid,Double_t e,Int_t pad,Double_t x,Double_t y,Double_t z,Int_t pid){new((*fHits)[fNhits++])AliRICHHit(tid,e,pad,x,y,z,pid); } | |
41 | void HitCreate ( ){if(fHits)return; fHits=new TClonesArray("AliRICHHit"); fNhits=0;} | |
42 | void HitPrint (Int_t iEvent=0 )const; | |
43 | void HitQA (Double_t cut=0,Double_t cutele=0,Double_t cutR=999 ); | |
0fe8fa07 | 44 | |
db910db9 | 45 | TClonesArray* SDigs ( )const{return fSdig;} //pointer to sdigits list |
46 | inline void SDigAdd (Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid ) ; //add new sdigit | |
47 | void SDigCreate ( ) {if(fSdig) return; fSdig=new TClonesArray("AliRICHDigit"); fSdigCnt=0;} | |
48 | void SDigReset ( ) {fSdigCnt=0; if(fSdig) fSdig ->Clear();} //clean a list of sdigits | |
49 | void SDigPrint (Int_t iEvent=0 )const; //prints sdigits | |
0fe8fa07 | 50 | |
db910db9 | 51 | TClonesArray* Digs (Int_t iC )const{return fDig ? (TClonesArray *)fDig->At(iC-1):0;} |
52 | inline void DigAdd (Int_t c,TVector pad,int q,int cfm,int *tid ) ; //add new digit | |
53 | inline void DigAdd (AliRICHDigit &dif ) ; //add new digit | |
54 | inline void DigCreate ( ) ; //create digits | |
55 | void DigReset ( ) {if(fDig)for(int i=0;i<fNcham;i++){fDig->At(i)->Clear();fDigCnt[i]=0;}} | |
56 | void DigPrint (Int_t iEvent=0 )const; //prints digits | |
0fe8fa07 | 57 | |
db910db9 | 58 | TClonesArray* Clus (Int_t iC )const{return fClu ? (TClonesArray *)fClu->At(iC-1):0;} |
59 | inline void CluCreate ( ) ; //create clusters container | |
60 | void CluReset ( ) {if(fClu)for(int i=0;i<fNcham;i++){fClu->At(i)->Clear();fCluCnt[i]=0;}} | |
61 | void CluPrint (Int_t iEvent=0 )const; //prints a list of clusters for a given event | |
0fe8fa07 | 62 | |
db910db9 | 63 | void Display ( )const; //Display event |
64 | void DisplayEvent (Int_t,Int_t )const; //Display event | |
65 | void DrawRing (TVector3 entrance,TVector3 vectorTrack,Double_t thetaCer)const; | |
66 | void OccupancyPrint(Int_t iEvent=-1 )const; //print chambers occupancy | |
67 | void ReadESD (Int_t iEventN, Int_t iChamber )const; | |
68 | void SummaryOfEvent(Int_t iEvent=0 )const; | |
56030c8d | 69 | |
c60862bf | 70 | protected: |
db910db9 | 71 | TClonesArray *fSdig; //! list of sdigits |
72 | Int_t fSdigCnt; //! current number of sdigits | |
84365c70 | 73 | |
db910db9 | 74 | TObjArray *fDig; //! each chamber holds it's one list of digits |
75 | Int_t fDigCnt[7]; //! array of current numbers of digits | |
84365c70 | 76 | |
db910db9 | 77 | TObjArray *fClu; //! each chamber holds it's one list of clusters |
78 | Int_t fCluCnt[7]; //! array of current numbers of raw clusters | |
84365c70 | 79 | |
db910db9 | 80 | TVector fCounters; // Particle history counters, explanation in StepManager() |
81 | Int_t fNcham; // Number of RICH chambers during simulation | |
a25b3368 | 82 | |
db910db9 | 83 | ClassDef(AliRICH,11) //Main RICH class |
c60862bf | 84 | };//class AliRICH |
ed3ceb24 | 85 | |
c1863e3c | 86 | //__________________________________________________________________________________________________ |
db910db9 | 87 | void AliRICH::SDigAdd(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid) |
e42a7b46 | 88 | { |
89 | Int_t cfm; | |
ed3ceb24 | 90 | switch(pid){ |
e42a7b46 | 91 | case 50000050: cfm=1000000;break;//cerenkov |
92 | case 50000051: cfm=1000; break;//feedback | |
93 | default: cfm=1; break;//mip | |
ed3ceb24 | 94 | } |
db910db9 | 95 | new((*fSdig)[fSdigCnt++])AliRICHDigit(c,pad,q,cfm,tid,-1,-1); |
e42a7b46 | 96 | } |
d4c94996 | 97 | //__________________________________________________________________________________________________ |
db910db9 | 98 | void AliRICH::DigCreate() |
a25b3368 | 99 | { |
db910db9 | 100 | if(fDig) return; |
101 | fDig = new TObjArray(fNcham); | |
102 | for(Int_t i=0;i<fNcham;i++) {fDig->AddAt(new TClonesArray("AliRICHDigit"), i); fDigCnt[i]=0;} | |
0fe8fa07 | 103 | } |
104 | //__________________________________________________________________________________________________ | |
db910db9 | 105 | void AliRICH::DigAdd(AliRICHDigit &dig) |
0422a446 | 106 | { |
107 | //special for digit formed from raw | |
db910db9 | 108 | TClonesArray &tmp=*((TClonesArray*)fDig->At(dig.C()-1)); |
109 | new(tmp[fDigCnt[dig.C()-1]++])AliRICHDigit(dig); | |
0422a446 | 110 | } |
111 | //__________________________________________________________________________________________________ | |
db910db9 | 112 | void AliRICH::DigAdd(int c,TVector pad,int q,int cfm,int *tid) |
0fe8fa07 | 113 | { |
db910db9 | 114 | TClonesArray &tmp=*((TClonesArray*)fDig->At(c-1)); |
115 | new(tmp[fDigCnt[c-1]++])AliRICHDigit(c,pad,q,cfm,tid[0],tid[1],tid[2]); | |
a25b3368 | 116 | } |
117 | //__________________________________________________________________________________________________ | |
db910db9 | 118 | void AliRICH::CluCreate() |
0fe8fa07 | 119 | { |
db910db9 | 120 | if(fClu) return; |
121 | fClu = new TObjArray(fNcham); | |
122 | for(Int_t i=0;i<fNcham;i++) {fClu->AddAt(new TClonesArray("AliRICHCluster"), i); fCluCnt[i]=0;} | |
0fe8fa07 | 123 | } |
c60862bf | 124 | #endif//#ifndef AliRICH_h |