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
19 #include "AliMUONGeometryDirection.h"
27 class AliMUONGeometryModuleTransformer;
28 class AliMUONGeometryDetElement;
29 class AliMUONVGeometryDESegmentation;
30 class AliMUONSegmentManuIndex;
34 class AliMUONGeometrySegmentation : public TObject
37 AliMUONGeometrySegmentation(
38 const AliMUONGeometryModuleTransformer* geometry);
39 AliMUONGeometrySegmentation();
40 virtual ~AliMUONGeometrySegmentation();
44 void Add(Int_t detElemId, const TString& detElemName,
45 AliMUONVGeometryDESegmentation* segmentation);
49 const AliMUONGeometryModuleTransformer* GetTransformer() const;
50 // Geometry transformer
52 const AliMUONVGeometryDESegmentation* GetDESegmentation(
53 Int_t detElemId, Bool_t warn = true) const;
56 AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
57 // Direction with a constant pad size
58 // (Direction or coordinate where the resolution
61 TString GetDEName(Int_t detElemId) const;
64 // Redefined methods from AliSegmentation interface
67 // Set Chamber Segmentation Parameters
69 virtual void SetPadSize(Float_t p1, Float_t p2);
71 virtual void SetDAnod(Float_t D);
74 // Transform from pad (wire) to real coordinates and vice versa
76 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
77 // Anode wire coordinate closest to xhit
78 virtual Bool_t GetPadI(Int_t detElemId,
79 Float_t xg, Float_t yg, Float_t zg,
80 Int_t& ix, Int_t& iy);
81 // Transform from pad to real coordinates
82 virtual Bool_t GetPadC(Int_t detElemId,
84 Float_t& x, Float_t& y, Float_t& z);
85 // Transform from real to pad coordinates
87 virtual Bool_t HasPad(Int_t detElemId,
89 virtual Bool_t HasPad(Int_t detElemId,
90 Float_t& x, Float_t& y, Float_t& z);
94 virtual void Init(Int_t chamber);
98 virtual Float_t Dpx(Int_t detElemId) const;
99 virtual Float_t Dpy(Int_t detElemId) const ;
101 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
102 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
103 // Pad size in x, y by Sector
104 virtual Int_t Npx(Int_t detElemId) const;
105 virtual Int_t Npy(Int_t detElemId) const;
106 // Maximum number of Pads in y
108 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
110 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
115 virtual void FirstPad(Int_t detElemId,
116 Float_t xghit, Float_t yghit, Float_t zghit,
117 Float_t dx, Float_t dy);
118 virtual void NextPad(Int_t detElemId);
119 virtual Int_t MorePads(Int_t detElemId);
121 virtual Float_t Distance2AndOffset(Int_t detElemId,
123 Float_t xg, Float_t yg, Float_t zg,
125 // Distance between 1 pad and a position
126 virtual void GetNParallelAndOffset(Int_t detElemId,
128 Int_t* nparallel, Int_t* offset);
129 // Number of pads read in parallel and offset to add to x
130 // (specific to LYON, but mandatory for display)
131 virtual void Neighbours(Int_t detElemId,
133 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
134 // Get next neighbours
140 virtual Int_t DetElemId();
141 // Current pad cursor during disintegration
143 virtual Int_t ISector();
146 virtual Int_t Sector(Int_t detElemId,
148 virtual Int_t Sector(Int_t detElemId,
149 Float_t xg, Float_t yg, Float_t zg);
150 // calculate sector from pad coordinates
152 virtual void IntegrationLimits(Int_t detElemId,
153 Float_t& x1, Float_t& x2,
154 Float_t& y1, Float_t& y2);
155 // Current integration limits
159 virtual Int_t SigGenCond(Int_t detElemId,
160 Float_t xg, Float_t yg, Float_t zg);
161 // Signal Generation Condition during Stepping
162 virtual void SigGenInit(Int_t detElemId,
163 Float_t xg, Float_t yg, Float_t zg);
164 // Initialise signal generation at coord (x,y,z)
167 virtual void GiveTestPoints(Int_t detElemId,
168 Int_t& n, Float_t* xg, Float_t* yg) const;
169 // Test points for auto calibration
170 virtual void Draw(const char *opt = "");
171 virtual void Draw(Int_t detElemId, const char *opt = "");
172 // Draw the segmentation zones
174 // Function for systematic corrections
176 virtual void SetCorrFunc(Int_t detElemId,
177 Int_t isec, TF1* func);
178 // Set the correction function
179 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
180 // Get the correction Function
183 virtual void Print(Option_t* opt = "") const;
186 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
187 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
191 Bool_t OwnNotify(Int_t detElemId, Bool_t warn = true) const;
193 // static data members
194 static const Float_t fgkMaxDistance; ///< \brief the big value passed to pad coordinates
195 /// if pad does not exist
198 mutable Int_t fCurrentDetElemId; ///< current DE ID
199 mutable AliMUONGeometryDetElement* fCurrentDetElement; ///< current detection element
200 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;///< current DE segmentation
202 const AliMUONGeometryModuleTransformer* fkModuleTransformer; ///< associated geometry transformer
203 AliMpExMap* fDESegmentations; ///< DE segmentations
204 AliMpExMap* fDENames; ///< DE names
207 ClassDef(AliMUONGeometrySegmentation,3) // Geometry segmentation
212 /// Return associated geometry transformer
214 const AliMUONGeometryModuleTransformer*
215 AliMUONGeometrySegmentation::GetTransformer() const
216 { return fkModuleTransformer; }
218 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H