]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt345SlatSegmentationV2.h
Addes script to compare Naiive, Poisson to Hits, Primaries
[u/mrichter/AliRoot.git] / MUON / AliMUONSt345SlatSegmentationV2.h
1 #ifndef ALIMUONST345SLATSEGMENTATIONV2_H
2 #define ALIMUONST345SLATSEGMENTATIONV2_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
9 /// \ingroup base
10 /// \class AliMUONSt345SlatSegmentationV2
11 /// \brief Segmentation for slat modules
12
13 #ifndef ALIMUONVGEOMETRYDESEGMENTATION_H
14 #include "AliMUONVGeometryDESegmentation.h"
15 #endif
16
17 #ifndef ALI_MP_PLANE_TYPE_H
18 #include "AliMpPlaneType.h"
19 #endif
20
21 #ifndef ALI_MP_PAD_H
22 #include "AliMpPad.h"
23 #endif
24
25 class AliMpSlat;
26 class AliMpSlatSegmentation;
27 class AliMpVPadIterator;
28
29 class AliMUONSt345SlatSegmentationV2 : public AliMUONVGeometryDESegmentation
30 {
31  public:
32
33   AliMUONSt345SlatSegmentationV2();
34   AliMUONSt345SlatSegmentationV2(Int_t detElemId,
35                                  AliMpPlaneType bendingOrNonBending);
36   virtual ~AliMUONSt345SlatSegmentationV2();
37
38   void FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, 
39                 Float_t dx, Float_t dy);
40
41   void  NextPad();
42
43   Int_t MorePads();
44
45   Int_t  Ix();
46   Int_t  Iy();
47   Int_t  ISector();
48
49   Float_t Distance2AndOffset(Int_t ix, Int_t iy, 
50                              Float_t X, Float_t Y, 
51                              Int_t* dummy);
52
53   void GetNParallelAndOffset(Int_t iX, Int_t iY,
54                              Int_t* Nparallel, Int_t* Offset);
55
56   void Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, 
57                   Int_t Xlist[10], Int_t Ylist[10]);
58
59   Int_t  Sector(Int_t ix, Int_t iy);
60   Int_t  Sector(Float_t x, Float_t y);
61
62   void  IntegrationLimits(Float_t& x1, Float_t& x2, 
63                           Float_t& y1, Float_t& y2);
64
65   void GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const;
66
67   Int_t SigGenCond(Float_t x, Float_t y, Float_t z);
68   void SigGenInit(Float_t x, Float_t y, Float_t z);
69
70   void SetCorrFunc(Int_t,  TF1*);
71
72   TF1* CorrFunc(Int_t) const;
73
74   void SetPadSize(float,float);
75
76   void SetDAnod(float);
77
78   void Init(int);
79   void Draw(Option_t * = "");
80
81   Float_t Dpx() const;
82   Float_t Dpy() const;
83   
84   Float_t Dpx(int) const;
85   Float_t Dpy(int) const;
86   
87   Float_t GetAnod(Float_t xhit) const;
88
89   Int_t Npx() const;
90   Int_t Npy() const;
91
92   /// Sets the current pad.
93   void SetPad(Int_t ix,Int_t iy);
94   
95   /// Sets the current hit.
96   void SetHit(Float_t x, Float_t y, Float_t z_is_not_used);
97  
98   AliMUONGeometryDirection GetDirection();// { return kDirUndefined; }
99
100   /// to be deprecated. Use the one below w/o z instead.
101   void GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y, Float_t& z);
102
103   /// From pad indices to coordinates (cm).
104   void GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y);
105
106   // Transform from pad to real coordinates
107   void GetPadI(Float_t x ,Float_t y ,Int_t   &ix,Int_t &iy);
108
109   // to be deprecated. Use the one above w/o z instead.
110   void GetPadI(Float_t x, Float_t y , Float_t z, Int_t &ix, Int_t &iy);
111
112
113   /// Whether a pad exists at a given position.
114   Bool_t HasPad(Float_t x, Float_t y, Float_t z);
115
116   /// Whether a pad exists, given its indices.
117   Bool_t HasPad(Int_t ix, Int_t iy);
118   
119   /// Print.
120   void Print(Option_t* opt = "") const;
121
122  private:
123
124    void ReadMappingData();
125          
126  private:
127
128   Int_t fDetElemId;
129         AliMpPlaneType fPlaneType;
130   const AliMpSlat* fSlat; //!
131   AliMpSlatSegmentation* fSlatSegmentation; //!
132   AliMpVPadIterator* fPadIterator; //!
133   AliMpPad fCurrentPad; //!FIXME: should not be needed, if we externalise the SetPad, SetHit, IntegrationLimits methods which have nothing to do here anyway, together with the iteration methods FirstPad, NextPad, MorePads, which have nothing to do here either.
134   Float_t fXhit; //!
135   Float_t fYhit; //!
136   ClassDef(AliMUONSt345SlatSegmentationV2,1)
137 };
138
139 #endif