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