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