]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometrySegmentation.h
- New virtual function in AliMUONVGeometryDESegmentation and in the daughters GetDire...
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometrySegmentation.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 /* $Id$ */
5
6 //
7 // Class AliMUONGeometrySegmentation
8 // ----------------------------------
9 // New class for the geometry segmentation 
10 // composed of the segmentations of detection elements.
11 // Applies transformations defined in geometry.
12 //
13 // Author:Ivana Hrivnacova, IPN Orsay
14
15 #ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
16 #define ALI_MUON_GEOMETRY_SEGMENTATION_H
17
18 #include <TObject.h>
19
20 #include "AliMUONGeometryDirection.h"
21
22 class TObjArray;
23 class TF1;
24
25 class AliMUONGeometryModule;
26 class AliMUONGeometryStore;
27 class AliMUONGeometryDetElement;
28 class AliMUONVGeometryDESegmentation;
29
30 class AliMUONGeometrySegmentation : public TObject
31 {
32   public:
33     AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
34     AliMUONGeometrySegmentation();
35     virtual ~AliMUONGeometrySegmentation();
36
37     // methods
38     void Add(Int_t detElemId, 
39              AliMUONVGeometryDESegmentation* segmentation); 
40  
41     // get methods
42     AliMUONGeometryModule* GetGeometry() const;       
43     virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
44                        // Direction with a constant pad size  (Direction or coordinate where the resolution is the best)
45     
46     //    
47     // redefined methods from AliSegmentation interface
48     // 
49
50     // Set Chamber Segmentation Parameters
51     //
52     virtual void SetPadSize(Float_t p1, Float_t p2);
53                        // Pad size Dx*Dy 
54     virtual void SetDAnod(Float_t D);
55                        // Anode Pitch
56
57     // Transform from pad (wire) to real coordinates and vice versa
58     //
59     virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
60                        // Anode wire coordinate closest to xhit
61     virtual Bool_t  GetPadI(Int_t detElemId,
62                           Float_t xg, Float_t yg, Float_t  zg, 
63                           Int_t& ix, Int_t& iy);
64                        // Transform from pad to real coordinates
65     virtual Bool_t  GetPadC(Int_t detElemId,
66                           Int_t ix, Int_t iy,
67                           Float_t& x, Float_t& y, Float_t& z);
68                        // Transform from real to pad coordinates
69
70     // Initialisation
71     //
72     virtual void Init(Int_t chamber);
73  
74     // Get member data
75     //
76     virtual Float_t Dpx(Int_t detElemId) const;
77     virtual Float_t Dpy(Int_t detElemId) const ;
78                       // Pad size in x, y 
79     virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
80     virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
81                       // Pad size in x, y by Sector 
82     virtual Int_t   Npx(Int_t detElemId) const;
83     virtual Int_t   Npy(Int_t detElemId) const;
84                       // Maximum number of Pads in y
85
86     virtual void  SetPad(Int_t detElemId, Int_t ix, Int_t iy);
87                       // Set pad position
88     virtual void  SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
89                       // Set hit position
90     
91     // Iterate over pads
92     //    
93     virtual void  FirstPad(Int_t detElemId, 
94                            Float_t xghit, Float_t yghit, Float_t zghit, 
95                            Float_t dx, Float_t dy);
96     virtual void  NextPad(Int_t detElemId);
97     virtual Int_t MorePads(Int_t detElemId);
98
99     virtual Float_t Distance2AndOffset(Int_t detElemId,
100                            Int_t ix, Int_t iy, 
101                            Float_t xg, Float_t yg, Float_t zg, 
102                            Int_t* dummy);
103                       // Distance between 1 pad and a position
104     virtual void GetNParallelAndOffset(Int_t detElemId,
105                            Int_t ix, Int_t iy,
106                            Int_t* nparallel, Int_t* offset);
107                       // Number of pads read in parallel and offset to add to x 
108                       // (specific to LYON, but mandatory for display)
109     virtual void Neighbours(Int_t detElemId,
110                             Int_t ix, Int_t iy,
111                             Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
112                       // Get next neighbours 
113
114     // Current values
115     //
116     virtual Int_t  Ix();
117     virtual Int_t  Iy();
118     virtual Int_t  DetElemId();
119                      // Current pad cursor during disintegration
120                      // x, y-coordinate
121     virtual Int_t  ISector();
122                     // current sector
123
124     virtual Int_t  Sector(Int_t detElemId,
125                           Int_t ix, Int_t iy);
126     virtual Int_t  Sector(Int_t detElemId,
127                           Float_t xg, Float_t yg, Float_t zg);
128                     // calculate sector from pad coordinates
129
130     virtual void  IntegrationLimits(Int_t detElemId,
131                           Float_t& x1, Float_t& x2,
132                           Float_t& y1, Float_t& y2);
133                    // Current integration limits 
134
135     // Signal Generation
136     //
137     virtual Int_t SigGenCond(Int_t detElemId,
138                           Float_t xg, Float_t yg, Float_t zg);
139                     // Signal Generation Condition during Stepping
140     virtual void  SigGenInit(Int_t detElemId,
141                           Float_t xg, Float_t yg, Float_t zg);
142                     // Initialise signal generation at coord (x,y,z)
143                     
144     
145     virtual void GiveTestPoints(Int_t detElemId,
146                           Int_t& n, Float_t* xg, Float_t* yg) const;
147                    // Test points for auto calibration
148     virtual void Draw(Int_t detElemId,
149                           const char *opt = "") const;
150                    // Draw the segmentation zones
151
152     // Function for systematic corrections
153     //
154     virtual void SetCorrFunc(Int_t detElemId,
155                           Int_t isec,  TF1* func);
156                    // Set the correction function
157     virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
158                    // Get the correction Function
159  
160   protected:
161     AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
162   
163     // operators
164     AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
165
166   private:
167     // methods
168     Bool_t Notify(Int_t detElemId) const;
169   
170     // data members
171     mutable  Int_t                           fCurrentDetElemId;  
172     mutable  AliMUONGeometryDetElement*      fCurrentDetElement;  
173     mutable  AliMUONVGeometryDESegmentation* fCurrentSegmentation;
174     AliMUONGeometryModule*    fGeometryModule;
175     AliMUONGeometryStore*     fDESegmentations;
176  
177    ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
178 };
179
180 // inline functions
181
182 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
183 { return fGeometryModule; }           
184
185 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H
186
187
188
189
190
191
192
193