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;
30 class AliMUONGeometrySegmentation : public TObject
33 AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
34 AliMUONGeometrySegmentation();
35 virtual ~AliMUONGeometrySegmentation();
38 void Add(Int_t detElemId,
39 AliMUONVGeometryDESegmentation* segmentation);
42 AliMUONGeometryModule* GetGeometry() const;
43 virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
44 // Direction with a constant pad size
45 // (Direction or coordinate where the resolution is the best)
48 // redefined methods from AliSegmentation interface
51 // Set Chamber Segmentation Parameters
53 virtual void SetPadSize(Float_t p1, Float_t p2);
55 virtual void SetDAnod(Float_t D);
58 // Transform from pad (wire) to real coordinates and vice versa
60 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
61 // Anode wire coordinate closest to xhit
62 virtual Bool_t GetPadI(Int_t detElemId,
63 Float_t xg, Float_t yg, Float_t zg,
64 Int_t& ix, Int_t& iy);
65 // Transform from pad to real coordinates
66 virtual Bool_t GetPadC(Int_t detElemId,
68 Float_t& x, Float_t& y, Float_t& z);
69 // Transform from real to pad coordinates
73 virtual void Init(Int_t chamber);
77 virtual Float_t Dpx(Int_t detElemId) const;
78 virtual Float_t Dpy(Int_t detElemId) const ;
80 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
81 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
82 // Pad size in x, y by Sector
83 virtual Int_t Npx(Int_t detElemId) const;
84 virtual Int_t Npy(Int_t detElemId) const;
85 // Maximum number of Pads in y
87 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
89 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
94 virtual void FirstPad(Int_t detElemId,
95 Float_t xghit, Float_t yghit, Float_t zghit,
96 Float_t dx, Float_t dy);
97 virtual void NextPad(Int_t detElemId);
98 virtual Int_t MorePads(Int_t detElemId);
100 virtual Float_t Distance2AndOffset(Int_t detElemId,
102 Float_t xg, Float_t yg, Float_t zg,
104 // Distance between 1 pad and a position
105 virtual void GetNParallelAndOffset(Int_t detElemId,
107 Int_t* nparallel, Int_t* offset);
108 // Number of pads read in parallel and offset to add to x
109 // (specific to LYON, but mandatory for display)
110 virtual void Neighbours(Int_t detElemId,
112 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
113 // Get next neighbours
119 virtual Int_t DetElemId();
120 // Current pad cursor during disintegration
122 virtual Int_t ISector();
125 virtual Int_t Sector(Int_t detElemId,
127 virtual Int_t Sector(Int_t detElemId,
128 Float_t xg, Float_t yg, Float_t zg);
129 // calculate sector from pad coordinates
131 virtual void IntegrationLimits(Int_t detElemId,
132 Float_t& x1, Float_t& x2,
133 Float_t& y1, Float_t& y2);
134 // Current integration limits
138 virtual Int_t SigGenCond(Int_t detElemId,
139 Float_t xg, Float_t yg, Float_t zg);
140 // Signal Generation Condition during Stepping
141 virtual void SigGenInit(Int_t detElemId,
142 Float_t xg, Float_t yg, Float_t zg);
143 // Initialise signal generation at coord (x,y,z)
146 virtual void GiveTestPoints(Int_t detElemId,
147 Int_t& n, Float_t* xg, Float_t* yg) const;
148 // Test points for auto calibration
149 virtual void Draw(Int_t detElemId,
150 const char *opt = "") const;
151 // Draw the segmentation zones
153 // Function for systematic corrections
155 virtual void SetCorrFunc(Int_t detElemId,
156 Int_t isec, TF1* func);
157 // Set the correction function
158 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
159 // Get the correction Function
162 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
165 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
169 Bool_t Notify(Int_t detElemId) const;
172 mutable Int_t fCurrentDetElemId;
173 mutable AliMUONGeometryDetElement* fCurrentDetElement;
174 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;
175 AliMUONGeometryModule* fGeometryModule;
176 AliMUONGeometryStore* fDESegmentations;
178 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
183 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
184 { return fGeometryModule; }
186 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H