1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
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.
13 // Author:Ivana Hrivnacova, IPN Orsay
15 #ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
16 #define ALI_MUON_GEOMETRY_SEGMENTATION_H
20 #include "AliMUONGeometryDirection.h"
25 class AliMUONGeometryModule;
26 class AliMUONGeometryStore;
27 class AliMUONGeometryDetElement;
28 class AliMUONVGeometryDESegmentation;
29 class AliMUONSegmentManuIndex;
31 class AliMUONGeometrySegmentation : public TObject
34 AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
35 AliMUONGeometrySegmentation();
36 virtual ~AliMUONGeometrySegmentation();
39 void Add(Int_t detElemId,
40 AliMUONVGeometryDESegmentation* segmentation);
43 AliMUONGeometryModule* GetGeometry() const;
44 virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
45 // Direction with a constant pad size
46 // (Direction or coordinate where the resolution is the best)
49 // redefined methods from AliSegmentation interface
52 // Set Chamber Segmentation Parameters
54 virtual void SetPadSize(Float_t p1, Float_t p2);
56 virtual void SetDAnod(Float_t D);
59 // Transform from pad (wire) to real coordinates and vice versa
61 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
62 // Anode wire coordinate closest to xhit
63 virtual Bool_t GetPadI(Int_t detElemId,
64 Float_t xg, Float_t yg, Float_t zg,
65 Int_t& ix, Int_t& iy);
66 // Transform from pad to real coordinates
67 virtual Bool_t GetPadC(Int_t detElemId,
69 Float_t& x, Float_t& y, Float_t& z);
70 // Transform from real to pad coordinates
71 // get pad for a given connection
72 virtual Bool_t GetPadE(Int_t detElemId, Int_t &ix, Int_t &iy, AliMUONSegmentManuIndex* connect);
73 virtual AliMUONSegmentManuIndex* GetMpConnection(Int_t detElemId, Int_t ix, Int_t iy);
74 // get electronics connection for given pad
77 virtual void Init(Int_t chamber);
81 virtual Float_t Dpx(Int_t detElemId) const;
82 virtual Float_t Dpy(Int_t detElemId) const ;
84 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
85 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
86 // Pad size in x, y by Sector
87 virtual Int_t Npx(Int_t detElemId) const;
88 virtual Int_t Npy(Int_t detElemId) const;
89 // Maximum number of Pads in y
91 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
93 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
98 virtual void FirstPad(Int_t detElemId,
99 Float_t xghit, Float_t yghit, Float_t zghit,
100 Float_t dx, Float_t dy);
101 virtual void NextPad(Int_t detElemId);
102 virtual Int_t MorePads(Int_t detElemId);
104 virtual Float_t Distance2AndOffset(Int_t detElemId,
106 Float_t xg, Float_t yg, Float_t zg,
108 // Distance between 1 pad and a position
109 virtual void GetNParallelAndOffset(Int_t detElemId,
111 Int_t* nparallel, Int_t* offset);
112 // Number of pads read in parallel and offset to add to x
113 // (specific to LYON, but mandatory for display)
114 virtual void Neighbours(Int_t detElemId,
116 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
117 // Get next neighbours
123 virtual Int_t DetElemId();
124 // Current pad cursor during disintegration
126 virtual Int_t ISector();
129 virtual Int_t Sector(Int_t detElemId,
131 virtual Int_t Sector(Int_t detElemId,
132 Float_t xg, Float_t yg, Float_t zg);
133 // calculate sector from pad coordinates
135 virtual void IntegrationLimits(Int_t detElemId,
136 Float_t& x1, Float_t& x2,
137 Float_t& y1, Float_t& y2);
138 // Current integration limits
142 virtual Int_t SigGenCond(Int_t detElemId,
143 Float_t xg, Float_t yg, Float_t zg);
144 // Signal Generation Condition during Stepping
145 virtual void SigGenInit(Int_t detElemId,
146 Float_t xg, Float_t yg, Float_t zg);
147 // Initialise signal generation at coord (x,y,z)
150 virtual void GiveTestPoints(Int_t detElemId,
151 Int_t& n, Float_t* xg, Float_t* yg) const;
152 // Test points for auto calibration
153 virtual void Draw(const char *opt = "");
154 virtual void Draw(Int_t detElemId, const char *opt = "");
155 // Draw the segmentation zones
157 // Function for systematic corrections
159 virtual void SetCorrFunc(Int_t detElemId,
160 Int_t isec, TF1* func);
161 // Set the correction function
162 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
163 // Get the correction Function
166 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
169 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
173 Bool_t OwnNotify(Int_t detElemId) const;
176 mutable Int_t fCurrentDetElemId;
177 mutable AliMUONGeometryDetElement* fCurrentDetElement;
178 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;
179 AliMUONGeometryModule* fGeometryModule;
180 AliMUONGeometryStore* fDESegmentations;
182 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
187 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
188 { return fGeometryModule; }
190 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H