]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt345SlatSegmentation.h
Revived the geometry that Alla did orginally. The code is in the classes
[u/mrichter/AliRoot.git] / MUON / AliMUONSt345SlatSegmentation.h
1 #ifndef ALIMUONST345SLATSEGMENTATION_H
2 #define ALIMUONST345SLATSEGMENTATION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /// \ingroup base
9 /// \class AliMUONSt345SlatSegmentation
10 /// \brief Segmentation for slat modules
11 ///
12 ///*********************************************************
13 ///  Segmentation classes for slat modules          
14 ///  This class works with local coordinates
15 ///  of the slats via the class AliMUONGeometrySegmentation
16 ///  This class contains the size of the slats and the
17 ///  and the differents PCB densities. 
18 ///*********************************************************
19
20 #include  "AliMUONVGeometryDESegmentation.h"
21
22 class TArrayF;
23 class TArrayI;
24
25
26 class AliMUONSt345SlatSegmentation : public AliMUONVGeometryDESegmentation 
27 {
28  public:
29     AliMUONSt345SlatSegmentation();
30     AliMUONSt345SlatSegmentation(Bool_t bending);
31     virtual ~AliMUONSt345SlatSegmentation();
32       
33     virtual Float_t  Distance2AndOffset(Int_t iX, Int_t iY, Float_t X, Float_t Y, Int_t * dummy);  // Distance between 1 pad and a position
34     virtual Float_t  Dpx() const {return fDpx;}  // Pad size in x   
35     virtual Float_t  Dpy() const {return fDpy;}  // Pad size in y   
36     virtual Float_t  Dpx(Int_t isec) const;       // Pad size in x by Sector
37     virtual Float_t  Dpy(Int_t isec) const;       // Pad size in y by Sector
38     virtual void     Draw(const char */*opt*/ = "") {}  // Not implemented
39     virtual void     FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy);  // Initialisation for pad iteration
40     virtual void     FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy);
41
42     virtual Bool_t   HasPad(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/) { return true; }
43     virtual Bool_t   HasPad(Int_t ix, Int_t iy);
44     virtual AliMUONGeometryDirection  GetDirection() { return kDirUndefined; } 
45
46     virtual Float_t  GetAnod(Float_t xhit) const;  // Anod wire coordinate closest to xhit
47     virtual void     GetPadI(Float_t x ,Float_t y ,Int_t   &ix,Int_t &iy);  // Transform from pad to real coordinates
48     virtual void     GetPadI(Float_t x, Float_t y , Float_t z, Int_t &ix, Int_t &iy);
49     virtual void     GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y);
50     virtual void     GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z) {z=0; GetPadC(ix, iy, x , y);}
51
52     virtual void     IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& y1, Float_t& y2); //Current integration limits
53     virtual Int_t    ISector()  {return fSector;} // Current Pad during Integration (current sector)
54     virtual Int_t    Ix() {return fIx;} // x-coordinate
55     virtual Int_t    Iy() {return fIy;} // y-coordinate
56   
57     virtual Int_t    MorePads();  // Condition
58  
59     virtual void     Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]);  // Get next neighbours
60     virtual void     NextPad(); // Stepper
61     virtual Int_t    Npx() const {return fNpx;} // Maximum number of Pads in x
62     virtual Int_t    Npy() const {return fNpy;} // Maximum number of Pads in y
63
64     virtual void     SetDAnod(Float_t D) {fWireD = D;};  // Anod pitch
65     virtual Int_t    Sector(Int_t ix, Int_t iy);         // Calculate sector from pad coordinates
66     virtual void     SetHit(Float_t xhit, Float_t yhit); // Set hit position
67     virtual void     SetHit(Float_t xhit, Float_t yhit, Float_t zhit);
68     virtual void     SetId(Int_t id) {fId=id;}  // Setting detection element
69     virtual void     SetPad(Int_t ix, Int_t iy);         // Set pad position
70     virtual void     SetPadDivision(Int_t ndiv[4]);      // Set Slat Segmentation Parameters
71     virtual void     SetPadSize(Float_t p1, Float_t p2); // Pad size Dx*Dy 
72     virtual void     SetPcbBoards(Int_t n[4]);           // Set Segmentation Zones (PCB Boards)
73  
74     // The following function could be obsolet for this class, but they are pure virtual in AliSegmentation
75     virtual void     GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t */*Nparallel*/, Int_t */*Offset*/) {};
76     virtual Int_t    SigGenCond(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/){return 0;} ;  // Signal Generation Condition during Stepping
77     virtual void     SigGenInit(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/){};  // Initialise signal gneration at coord (x,y,z)
78     virtual void     GiveTestPoints(Int_t &/*n*/, Float_t * /*x*/, Float_t */*y*/) const{};   // Test points for auto calibration
79     virtual void     SetCorrFunc(Int_t /*dum*/, TF1* /*func*/){}; // Function for systematic corrections, Set the correction function
80     virtual TF1*     CorrFunc(Int_t) const {return 0x0;} // Get the correction Function
81     virtual Int_t    Sector(Float_t /*x*/, Float_t /*y*/) {return 1;}
82
83     virtual void     Init(Int_t detectionElementId); // Initialisation
84     // Current integration limits
85
86  protected:
87
88     AliMUONSt345SlatSegmentation(const AliMUONSt345SlatSegmentation& rhs);
89     AliMUONSt345SlatSegmentation& operator=(const AliMUONSt345SlatSegmentation& rhs);
90
91  private:
92     //  Internal geometry of the slat 
93     Bool_t      fBending;        // 0: Bending or 1:Non Bending segmentation
94     Int_t       fId;             // Identifier of detection element
95     Int_t       fNsec;           // Number of density sectors (should be 4, if not not warranty about the output
96     TArrayI*    fNDiv;           // Densities (d1, d2, d3, d4). It should be (4, 4, 2, 1) which goes from beam to out-beam
97     TArrayF*    fDpxD;           // x pad width per density sector
98     TArrayF*    fDpyD;           // x pad width per density sector
99     Float_t     fDpx;            // x pad base width  
100     Float_t     fDpy;            // y pad base width
101     Int_t       fNpx;            // Number of pads in x
102     Int_t       fNpy;            // Number of pads in y
103     Float_t     fWireD;          // wire pitch
104     Int_t       fRtype;          // type of the slat: rounded R=1,2,3, rounded short R=-1,-2,-3, short R=4, normal R=0
105     // 
106     Int_t       fSector;         // Current density sector
107     Float_t     fDxPCB;          // x-size of PCB board
108     Float_t     fDyPCB;          // y-size of PCB board
109     Int_t       fPcbBoards[4];   // number of PCB boards per density sector n1,n2,n3,n4 
110     // n1 PcbBoard with density d1, n2 PcbBoards with density d2, etc ....
111    
112     // Segmentation map
113     Int_t       fNpxS[10];       // Number of pads per sector in x
114     Int_t       fNpyS[10];       // Number of pads per sector in y    
115     Float_t     fCx[10];         // pad-sector contour x vs y      
116     Float_t     fCy;             // y offset      
117
118     // Current pad and wire during tracking (cursor at hit centre)
119     Float_t     fXhit;  // ! x-position of hit
120     Float_t     fYhit;  // ! y-position of hit
121
122     // Current pad and wire during tracking (cursor at hit centre)
123     Int_t       fIx;   // ! pad coord.  x 
124     Int_t       fIy;   // ! pad coord.  y 
125     Float_t     fX;    // ! real coord. x
126     Float_t     fY;    // ! real ccord. y
127     
128     // Chamber region consideres during disintegration   
129     Int_t       fIxmin; // ! lower left  x
130     Int_t       fIxmax; // ! lower left  y
131     Int_t       fIymin; // ! upper right x
132     Int_t       fIymax; // ! upper right y 
133
134     // Chamber region consideres during disintegration  (lower left and upper right corner)
135     Float_t     fXmin;           // lower left  x
136     Float_t     fXmax;           // lower left  y
137     Float_t     fYmin;           // upper right x
138     Float_t     fYmax;           // upper right y 
139
140     Bool_t      fInitDone;       // flag for initialization
141
142     ClassDef(AliMUONSt345SlatSegmentation,3) 
143 };
144 #endif
145
146
147
148
149
150