]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt12QuadrantSegmentation.h
Using TGeo as default transport package
[u/mrichter/AliRoot.git] / MUON / AliMUONSt12QuadrantSegmentation.h
1 #ifndef ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
2 #define ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8 // Revision of includes 07/05/2004
9
10 // Class AliMUONSt12QuadrantSegmentation
11 // -------------------------------------
12 // Segmentation for MUON quadrants of stations 1 and 2 using 
13 // the mapping package
14 //
15 // Author: Ivana Hrivnacova, IPN Orsay
16
17 #include "AliMpStationType.h"
18 #include "AliMpPlaneType.h"
19
20 #include "AliMUONVGeometryDESegmentation.h"
21
22 class TObjArray;
23
24 class AliMpSector;
25 class AliMpSectorSegmentation;
26 class AliMpVPadIterator;
27 class AliMpPad;
28 class AliMUONSegmentManuIndex;
29
30 class AliMUONChamber;
31
32 class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation 
33 {
34   public:
35     AliMUONSt12QuadrantSegmentation(AliMpStationType stationType,
36                                     AliMpPlaneType planeType);
37     AliMUONSt12QuadrantSegmentation();
38     
39     virtual ~AliMUONSt12QuadrantSegmentation();
40     
41     //    
42     // methods derived from base class    
43     // 
44
45     // Set Chamber Segmentation Parameters
46     //
47     virtual void SetPadSize(Float_t p1, Float_t p2);
48                        // Pad size Dx*Dy 
49     virtual void SetDAnod(Float_t D);
50                        // Anode Pitch
51
52     // Check if pad exists
53     //
54     virtual Bool_t  HasPad(Float_t x, Float_t y, Float_t z); 
55                        // Returns true if a pad exists in the given position
56     virtual Bool_t  HasPad(Int_t ix, Int_t iy);
57                        // Returns true if a pad with given indices exists
58
59     // Quadrant type
60     //
61     virtual AliMUONGeometryDirection  GetDirection();
62                        // Returns the direction with a constant pad size
63
64     // Transform from pad (wire) to real coordinates and vice versa
65     //
66     virtual Float_t GetAnod(Float_t xhit) const;
67                        // Anode wire coordinate closest to xhit
68     virtual void  GetPadI(Float_t x, Float_t y, Float_t  z, Int_t& ix, Int_t& iy);
69     virtual void  GetPadI(Float_t x, Float_t y , Int_t &ix, Int_t &iy) ;
70                        // Transform from pad to real coordinates
71     virtual void  GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y, Float_t& z);
72     virtual void  GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y);
73                        // Transform from real to pad coordinates
74                        // get pad for a given connection
75     virtual void  GetPadE(Int_t &/*ix*/, Int_t &/*iy*/,  AliMUONSegmentManuIndex* /*connect*/) {return;}
76     virtual AliMUONSegmentManuIndex*     GetMpConnection(Int_t /*ix*/, Int_t /*iy*/) {return 0x0;}
77                        // get electronics connection for given pad
78     // Initialisation
79     //
80     virtual void Init(Int_t chamber);
81  
82     // Get member data
83     //
84     virtual Float_t Dpx() const;
85     virtual Float_t Dpy() const;
86                       // Pad size in x, y 
87     virtual Float_t Dpx(Int_t isector) const;
88     virtual Float_t Dpy(Int_t isector) const;
89                       // Pad size in x, y by Sector 
90     virtual Int_t   Npx() const;
91     virtual Int_t   Npy() const;
92                       // Maximum number of Pads in y
93
94     virtual void  SetPad(Int_t ix, Int_t iy);
95                       // Set pad position
96     virtual void  SetHit(Float_t xhit, Float_t yhit, Float_t zhit);
97                       // Set hit position
98     
99     // Iterate over pads
100     //
101     virtual void  FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, 
102                            Float_t dx, Float_t dy);
103     virtual void  NextPad();
104     virtual Int_t MorePads();
105
106     virtual Float_t Distance2AndOffset(Int_t iX, Int_t iY, 
107                                        Float_t X, Float_t Y, Int_t* dummy) ;
108                       // Distance between 1 pad and a position
109     virtual void GetNParallelAndOffset(Int_t iX, Int_t iY,
110                                        Int_t* Nparallel, Int_t* Offset);
111                       // Number of pads read in parallel and offset to add to x 
112                       // (specific to LYON, but mandatory for display)
113     virtual void Neighbours(Int_t iX, Int_t iY, 
114                             Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]);
115                       // Get next neighbours 
116
117     // Current values
118     //
119     virtual Int_t  Ix();
120     virtual Int_t  Iy();
121                      // Current pad cursor during disintegration
122                      // x, y-coordinate
123     virtual Int_t  ISector();
124                     // current sector
125
126     virtual Int_t  Sector(Int_t ix, Int_t iy);
127     virtual Int_t  Sector(Float_t x, Float_t y);
128                     // calculate sector from pad coordinates
129
130     virtual void  IntegrationLimits(Float_t& x1, Float_t& x2,
131                                     Float_t& y1, Float_t& y2);
132                    // Current integration limits 
133
134     // Signal Generation
135     //
136     virtual Int_t SigGenCond(Float_t x, Float_t y, Float_t z);
137                     // Signal Generation Condition during Stepping
138     virtual void  SigGenInit(Float_t x, Float_t y, Float_t z);
139                     // Initialise signal generation at coord (x,y,z)
140                     
141     
142     virtual void GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const;
143                    // Test points for auto calibration
144     virtual void Draw(const char *opt = "");
145                    // Draw the segmentation zones
146
147     // Function for systematic corrections
148     //
149     virtual void SetCorrFunc(Int_t isec,  TF1* func);
150                    // Set the correction function
151     virtual TF1* CorrFunc(Int_t isec)  const;
152                    // Get the correction Function
153  
154   protected:
155     AliMUONSt12QuadrantSegmentation(const AliMUONSt12QuadrantSegmentation& rhs);
156   
157     // operators
158     AliMUONSt12QuadrantSegmentation& operator=(const AliMUONSt12QuadrantSegmentation & rhs);
159
160   private:
161     // methods
162     void UpdateCurrentPadValues(const AliMpPad& pad);
163     void ReadMappingData();
164   
165     // constants
166     static const Float_t  fgkWireD;     // default wire pitch
167     static const Float_t  fgkLengthUnit;// conversion between length units
168                                         // from mapping (mm) to AliRoot (cm)
169     // data members
170
171     // From mapping
172     //
173     AliMpStationType         fStationType;       // station type
174     AliMpPlaneType           fPlaneType;         // plane type
175     AliMpSector*             fSector;            // ! sector (from mapping)
176     AliMpSectorSegmentation* fSectorSegmentation;// ! sector segmentation (from mapping)
177     AliMpVPadIterator*       fSectorIterator;    // ! iterator over pads
178
179     // Wire pitch
180     //
181     Float_t         fWireD;  // wire pitch
182                              // (smaller distance between anode wires)
183     
184     // Reference to mother chamber
185     //
186     AliMUONChamber* fChamber; // ! Reference to mother chamber
187     Int_t           fId;      // Identifier
188     Float_t         fRmin;    // inner radius
189     Float_t         fRmax;    // outer radius
190     Float_t         fZ;       // z-position of chamber
191
192     // Current pad during integration (cursor for disintegration)
193     //
194     Int_t   fIx;     // ! pad coord.  x 
195     Int_t   fIy;     // ! pad coord.  y 
196     Float_t fX;      // ! real coord. x
197     Float_t fY;      // ! real ccord. y
198     Int_t   fZone;   // ! Current zone (sector in AliSegmentation naming)
199     
200     // Current pad and wire during tracking (cursor at hit centre)
201     //
202     Float_t fXhit;  // ! x-position of hit
203     Float_t fYhit;  // ! y-position of hit
204
205     // Reference point to define signal generation condition
206     //
207     Int_t   fIxt;   // ! pad coord. x
208     Int_t   fIyt;   // ! pad coord. y
209     Int_t   fIwt;   // ! wire number
210     Float_t fXt;    // ! x
211     Float_t fYt;    // ! y
212
213     TObjArray* fCorrA; // ! Array of correction functions
214
215   ClassDef(AliMUONSt12QuadrantSegmentation,1) // Station1 segmentation
216 };
217
218 #endif //ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
219
220
221
222
223
224
225
226