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