]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/AliRICHChamber.h
Use AliSegmentation and AliHit abstract base classes.
[u/mrichter/AliRoot.git] / RICH / AliRICHChamber.h
1 #ifndef ALIRICHCHAMBER_H
2 #define ALIRICHCHAMBER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 #include <TObjArray.h>
10 #include <TRotMatrix.h>
11
12 #include "AliRICHTresholdMap.h"
13 #include "AliSegmentation.h"
14 #include "AliRICHGeometry.h"
15 #include "AliRICHResponse.h"
16
17 class AliRICHClusterFinder;
18
19 typedef enum {kMip, kCerenkov} ResponseType;
20
21 class AliRICHChamber : public TObject
22 {
23  public:
24     
25   Int_t                fIndexMap[50];   //indeces of tresholds
26   AliRICHTresholdMap*  fTresh;          //map of tresholds
27
28  public:
29     AliRICHChamber();
30     AliRICHChamber(const AliRICHChamber & Chamber);
31     ~AliRICHChamber(){}
32 //
33 // Set and get GEANT id  
34     Int_t   GetGid()         {return fGid;}
35     void    SetGid(Int_t id) {fGid=id;}
36 //  
37 // Initialisation and z-Position
38     void    Init(Int_t id);
39     // Set inner radius of sensitive volume 
40     void SetRInner(Float_t rmin) {frMin=rmin;}
41 // Set outer radius of sensitive volum  
42     void SetROuter(Float_t rmax) {frMax=rmax;}  
43     
44 // Return inner radius of sensitive volume 
45     Float_t RInner()            {return frMin;}
46 // Return outer radius of sensitive volum  
47     Float_t ROuter()            {return frMax;}
48
49     void    SetZPOS(Float_t p1) {fzPos=p1;}
50     Float_t ZPosition()         {return fzPos;}
51
52 //
53 //Transformation from Global to local coordinates, chamber-dependant
54     void LocaltoGlobal(Float_t pos[3],Float_t Localpos[3]);
55     void GlobaltoLocal(Float_t pos[3],Float_t localpos[3]); 
56
57 //Generate pad dependent tresholds
58
59     void GenerateTresholds();
60
61     
62 //Setting chamber specific rotation matrices
63     
64     void SetChamberTransform(Float_t Trans1,Float_t Trans2,Float_t Trans3,TRotMatrix *Matrix)
65         
66         {
67             fChamberMatrix=Matrix;
68             fChamberTrans[0]=Trans1;
69             fChamberTrans[1]=Trans2;
70             fChamberTrans[2]=Trans3;
71         }
72     
73     TRotMatrix * GetRotMatrix() {return fChamberMatrix;}
74     
75 //Configure geometry model
76     void    GeometryModel(AliRICHGeometry* thisGeometry){
77       fGeometry=thisGeometry;
78     }
79     
80     
81 // Configure response model
82     void    ResponseModel(AliRICHResponse* thisResponse);
83     
84     //  
85 // Configure segmentation model
86     void    SetSegmentationModel(AliSegmentation* thisSegmentation) {
87         fSegmentation = thisSegmentation;
88     }
89     void    SetReconstructionModel(AliRICHClusterFinder *thisReconstruction) {
90         fReconstruction = thisReconstruction;
91     }
92
93 //  
94 //  Get reference to response model
95     AliRICHResponse* GetResponseModel();
96 //  
97 //  Get reference to segmentation model
98     AliSegmentation*  GetSegmentationModel() {
99         return fSegmentation;
100     }
101
102 //  Get reference to geometry model
103     AliRICHGeometry*  GetGeometryModel() {
104         return fGeometry;
105     }
106     
107
108     AliSegmentation*  GetSegmentationModel(Int_t i) {
109         return fSegmentation;
110     }
111     
112     //
113     AliRICHClusterFinder* &GetReconstructionModel() {return fReconstruction;}
114
115     Int_t Nsec()              {return fnsec;}
116     void  SetNsec(Int_t nsec) {fnsec=nsec;}
117 //
118 // Member function forwarding to the segmentation and response models
119 //
120 // Calculate pulse height from energy loss  
121     Float_t IntPH(Float_t eloss) {return fResponse->IntPH(eloss);}
122     Float_t IntPH()              {return fResponse->IntPH();}
123 //  
124 // Ask segmentation if signal should be generated  
125     Int_t   SigGenCond(Float_t x, Float_t y, Float_t z)
126         {
127             return fSegmentation->SigGenCond(x, y, z);
128         }
129
130 // Ask segmentation sector 
131     Int_t   Sector(Float_t x, Float_t y)
132         {
133             return fSegmentation->Sector(x, y);
134         }   
135     
136 //
137 // Initialisation of segmentation for hit  
138     void   SigGenInit(Float_t x, Float_t y, Float_t z)
139         {
140             fSegmentation->SigGenInit(x, y, z) ;
141         }
142 // Configuration forwarding
143 //
144     void   SetSigmaIntegration(Float_t p)
145         {
146             fResponse->SetSigmaIntegration(p);
147         }
148     void   SetChargeSlope(Float_t p)
149         {
150             fResponse->SetChargeSlope(p);
151         }
152     void   SetChargeSpread(Float_t p1, Float_t p2)
153         {
154             fResponse->SetChargeSpread(p1,p2);
155         }
156     void   SetMaxAdc(Float_t p)
157         {
158             fResponse->SetMaxAdc(p);
159         }
160     void   SetSqrtKx3(Float_t p)
161         {
162             fResponse->SetSqrtKx3(p);
163         }
164     void   SetKx2(Float_t p)
165         {
166             fResponse->SetKx2(p);
167         }
168     void   SetKx4(Float_t p)
169         {
170             fResponse->SetKx4(p);
171         }
172     void   SetSqrtKy3(Float_t p)
173         {
174             fResponse->SetSqrtKy3(p);
175         }
176     void   SetKy2(Float_t p)
177         {
178             fResponse->SetKy2(p);
179         }
180     void   SetKy4(Float_t p)
181         {
182             fResponse->SetKy4(p);
183         }
184     
185     void   SetPitch(Float_t p)
186         {
187             fResponse->SetPitch(p);
188         }
189     
190     void   SetPadSize(Float_t p1, Float_t p2)
191         {
192             fSegmentation->SetPadSize(p1,p2);
193         }
194     void   SetGapThickness(Float_t thickness)
195       {
196         fGeometry->SetGapThickness(thickness);
197       } 
198     void   SetProximityGapThickness(Float_t thickness)
199       {
200         fGeometry->SetProximityGapThickness(thickness);
201       }
202     void   SetQuartzLength(Float_t length)
203       {
204         fGeometry->SetQuartzLength(length);
205       }
206     void   SetQuartzWidth(Float_t width)
207       {
208         fGeometry->SetQuartzWidth(width);
209       }
210     void   SetQuartzThickness(Float_t thickness) 
211       {
212         fGeometry->SetQuartzThickness(thickness);
213       }
214     void   SetOuterFreonLength(Float_t length)
215       {
216         fGeometry->SetOuterFreonLength(length);
217       }
218     void   SetOuterFreonWidth(Float_t width)
219       {
220         fGeometry->SetOuterFreonWidth(width);
221       }
222     void   SetInnerFreonLength(Float_t length)
223       {
224         fGeometry->SetInnerFreonLength(length);
225       }
226     void   SetInnerFreonWidth(Float_t width) 
227       {
228         fGeometry->SetInnerFreonWidth(width);
229       }
230     void   SetFreonThickness(Float_t thickness)
231       {
232         fGeometry->SetFreonThickness(thickness);
233       }
234
235     AliRICHChamber& operator=(const AliRICHChamber& rhs);
236     
237 //  
238 // Cluster formation method
239     void   DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit, Int_t&x, Float_t newclust[6][500], ResponseType res);
240  private:
241 // GEANT volume if for sensitive volume of this
242     Float_t frMin;                 // Minimum Chamber size
243     Float_t frMax;                 // Maximum Chamber size 
244     Int_t   fGid;                  // Id tag 
245     Float_t fzPos;                 // z-position of this chamber
246 // The segmentation models for the cathode planes
247     Int_t   fnsec;                 // fnsec=1: one plane segmented, fnsec=2: both planes are segmented.
248     
249     TRotMatrix *fChamberMatrix;          //Rotation matrices for each chamber
250     Float_t fChamberTrans[3];            //Translaction vectors for each chamber
251
252     AliSegmentation               *fSegmentation;          //Segmentation model for each chamber
253     AliRICHResponse               *fResponse;              //Response model for each chamber
254     AliRICHGeometry               *fGeometry;              //Geometry model for each chamber
255     AliRICHClusterFinder          *fReconstruction;        //Reconstruction model for each chamber
256     ClassDef(AliRICHChamber,1)
257 };
258 #endif
259
260
261
262