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