1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
7 /// \class AliMUONGeometrySegmentation
8 /// \brief Segmentation for a geometry module
10 /// New class for the geometry segmentation
11 /// composed of the segmentations of detection elements.
12 /// Applies transformations defined in geometry.
14 /// Author:Ivana Hrivnacova, IPN Orsay
16 #ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
17 #define ALI_MUON_GEOMETRY_SEGMENTATION_H
21 #include "AliMUONGeometryDirection.h"
26 class AliMUONGeometryModuleTransformer;
27 class AliMUONGeometryStore;
28 class AliMUONGeometryDetElement;
29 class AliMUONVGeometryDESegmentation;
30 class AliMUONSegmentManuIndex;
32 class AliMUONGeometrySegmentation : public TObject
35 AliMUONGeometrySegmentation(
36 const AliMUONGeometryModuleTransformer* geometry);
37 AliMUONGeometrySegmentation();
38 virtual ~AliMUONGeometrySegmentation();
42 void Add(Int_t detElemId, const TString& detElemName,
43 AliMUONVGeometryDESegmentation* segmentation);
47 const AliMUONGeometryModuleTransformer* GetTransformer() const;
48 // Geometry transformer
50 const AliMUONVGeometryDESegmentation* GetDESegmentation(
51 Int_t detElemId) const;
54 AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
55 // Direction with a constant pad size
56 // (Direction or coordinate where the resolution is the best)
58 TString GetDEName(Int_t detElemId) const;
61 // Redefined methods from AliSegmentation interface
64 // Set Chamber Segmentation Parameters
66 virtual void SetPadSize(Float_t p1, Float_t p2);
68 virtual void SetDAnod(Float_t D);
71 // Transform from pad (wire) to real coordinates and vice versa
73 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
74 // Anode wire coordinate closest to xhit
75 virtual Bool_t GetPadI(Int_t detElemId,
76 Float_t xg, Float_t yg, Float_t zg,
77 Int_t& ix, Int_t& iy);
78 // Transform from pad to real coordinates
79 virtual Bool_t GetPadC(Int_t detElemId,
81 Float_t& x, Float_t& y, Float_t& z);
82 // Transform from real to pad coordinates
84 virtual Bool_t HasPad(Int_t detElemId, Int_t ix, Int_t iy);
88 virtual void Init(Int_t chamber);
92 virtual Float_t Dpx(Int_t detElemId) const;
93 virtual Float_t Dpy(Int_t detElemId) const ;
95 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
96 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
97 // Pad size in x, y by Sector
98 virtual Int_t Npx(Int_t detElemId) const;
99 virtual Int_t Npy(Int_t detElemId) const;
100 // Maximum number of Pads in y
102 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
104 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
109 virtual void FirstPad(Int_t detElemId,
110 Float_t xghit, Float_t yghit, Float_t zghit,
111 Float_t dx, Float_t dy);
112 virtual void NextPad(Int_t detElemId);
113 virtual Int_t MorePads(Int_t detElemId);
115 virtual Float_t Distance2AndOffset(Int_t detElemId,
117 Float_t xg, Float_t yg, Float_t zg,
119 // Distance between 1 pad and a position
120 virtual void GetNParallelAndOffset(Int_t detElemId,
122 Int_t* nparallel, Int_t* offset);
123 // Number of pads read in parallel and offset to add to x
124 // (specific to LYON, but mandatory for display)
125 virtual void Neighbours(Int_t detElemId,
127 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
128 // Get next neighbours
134 virtual Int_t DetElemId();
135 // Current pad cursor during disintegration
137 virtual Int_t ISector();
140 virtual Int_t Sector(Int_t detElemId,
142 virtual Int_t Sector(Int_t detElemId,
143 Float_t xg, Float_t yg, Float_t zg);
144 // calculate sector from pad coordinates
146 virtual void IntegrationLimits(Int_t detElemId,
147 Float_t& x1, Float_t& x2,
148 Float_t& y1, Float_t& y2);
149 // Current integration limits
153 virtual Int_t SigGenCond(Int_t detElemId,
154 Float_t xg, Float_t yg, Float_t zg);
155 // Signal Generation Condition during Stepping
156 virtual void SigGenInit(Int_t detElemId,
157 Float_t xg, Float_t yg, Float_t zg);
158 // Initialise signal generation at coord (x,y,z)
161 virtual void GiveTestPoints(Int_t detElemId,
162 Int_t& n, Float_t* xg, Float_t* yg) const;
163 // Test points for auto calibration
164 virtual void Draw(const char *opt = "");
165 virtual void Draw(Int_t detElemId, const char *opt = "");
166 // Draw the segmentation zones
168 // Function for systematic corrections
170 virtual void SetCorrFunc(Int_t detElemId,
171 Int_t isec, TF1* func);
172 // Set the correction function
173 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
174 // Get the correction Function
177 virtual void Print(Option_t* opt = "") const;
180 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
183 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
187 Bool_t OwnNotify(Int_t detElemId) const;
189 // static data members
190 static const Float_t fgkMaxDistance; // the big value passed to pad coordinates
191 // if pad does not exist
194 mutable Int_t fCurrentDetElemId; // current DE ID
195 mutable AliMUONGeometryDetElement* fCurrentDetElement; // current detection element
196 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;// current DE segmentation
198 const AliMUONGeometryModuleTransformer* fkModuleTransformer; // associated geometry transformer
199 AliMUONGeometryStore* fDESegmentations;// DE segmentations
200 AliMUONGeometryStore* fDENames; // DE names
203 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
209 const AliMUONGeometryModuleTransformer*
210 AliMUONGeometrySegmentation::GetTransformer() const
211 { return fkModuleTransformer; }
213 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H