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