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 const AliMUONVGeometryDESegmentation* GetDESegmentation(Int_t detElemId) const;
46 virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
47 // Direction with a constant pad size
48 // (Direction or coordinate where the resolution is the best)
51 // redefined methods from AliSegmentation interface
54 // Set Chamber Segmentation Parameters
56 virtual void SetPadSize(Float_t p1, Float_t p2);
58 virtual void SetDAnod(Float_t D);
61 // Transform from pad (wire) to real coordinates and vice versa
63 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
64 // Anode wire coordinate closest to xhit
65 virtual Bool_t GetPadI(Int_t detElemId,
66 Float_t xg, Float_t yg, Float_t zg,
67 Int_t& ix, Int_t& iy);
68 // Transform from pad to real coordinates
69 virtual Bool_t GetPadC(Int_t detElemId,
71 Float_t& x, Float_t& y, Float_t& z);
72 // Transform from real to pad coordinates
73 // get pad for a given connection
74 virtual Bool_t GetPadE(Int_t detElemId, Int_t &ix, Int_t &iy, AliMUONSegmentManuIndex* connect);
75 virtual AliMUONSegmentManuIndex* GetMpConnection(Int_t detElemId, Int_t ix, Int_t iy);
76 // get electronics connection for given pad
79 virtual void Init(Int_t chamber);
83 virtual Float_t Dpx(Int_t detElemId) const;
84 virtual Float_t Dpy(Int_t detElemId) const ;
86 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
87 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
88 // Pad size in x, y by Sector
89 virtual Int_t Npx(Int_t detElemId) const;
90 virtual Int_t Npy(Int_t detElemId) const;
91 // Maximum number of Pads in y
93 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
95 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
100 virtual void FirstPad(Int_t detElemId,
101 Float_t xghit, Float_t yghit, Float_t zghit,
102 Float_t dx, Float_t dy);
103 virtual void NextPad(Int_t detElemId);
104 virtual Int_t MorePads(Int_t detElemId);
106 virtual Float_t Distance2AndOffset(Int_t detElemId,
108 Float_t xg, Float_t yg, Float_t zg,
110 // Distance between 1 pad and a position
111 virtual void GetNParallelAndOffset(Int_t detElemId,
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 detElemId,
118 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
119 // Get next neighbours
125 virtual Int_t DetElemId();
126 // Current pad cursor during disintegration
128 virtual Int_t ISector();
131 virtual Int_t Sector(Int_t detElemId,
133 virtual Int_t Sector(Int_t detElemId,
134 Float_t xg, Float_t yg, Float_t zg);
135 // calculate sector from pad coordinates
137 virtual void IntegrationLimits(Int_t detElemId,
138 Float_t& x1, Float_t& x2,
139 Float_t& y1, Float_t& y2);
140 // Current integration limits
144 virtual Int_t SigGenCond(Int_t detElemId,
145 Float_t xg, Float_t yg, Float_t zg);
146 // Signal Generation Condition during Stepping
147 virtual void SigGenInit(Int_t detElemId,
148 Float_t xg, Float_t yg, Float_t zg);
149 // Initialise signal generation at coord (x,y,z)
152 virtual void GiveTestPoints(Int_t detElemId,
153 Int_t& n, Float_t* xg, Float_t* yg) const;
154 // Test points for auto calibration
155 virtual void Draw(const char *opt = "");
156 virtual void Draw(Int_t detElemId, const char *opt = "");
157 // Draw the segmentation zones
159 // Function for systematic corrections
161 virtual void SetCorrFunc(Int_t detElemId,
162 Int_t isec, TF1* func);
163 // Set the correction function
164 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
165 // Get the correction Function
168 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
171 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
175 Bool_t OwnNotify(Int_t detElemId) const;
178 mutable Int_t fCurrentDetElemId;
179 mutable AliMUONGeometryDetElement* fCurrentDetElement;
180 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;
181 AliMUONGeometryModule* fGeometryModule;
182 AliMUONGeometryStore* fDESegmentations;
184 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
189 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
190 { return fGeometryModule; }
192 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H