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