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 AliMUONGeometryStore;
29 class AliMUONGeometryDetElement;
30 class AliMUONVGeometryDESegmentation;
31 class AliMUONSegmentManuIndex;
33 class AliMUONGeometrySegmentation : public TObject
36 AliMUONGeometrySegmentation(
37 const AliMUONGeometryModuleTransformer* geometry);
38 AliMUONGeometrySegmentation();
39 virtual ~AliMUONGeometrySegmentation();
43 void Add(Int_t detElemId, const TString& detElemName,
44 AliMUONVGeometryDESegmentation* segmentation);
48 const AliMUONGeometryModuleTransformer* GetTransformer() const;
49 // Geometry transformer
51 const AliMUONVGeometryDESegmentation* GetDESegmentation(
52 Int_t detElemId, Bool_t warn = true) const;
55 AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
56 // Direction with a constant pad size
57 // (Direction or coordinate where the resolution
60 TString GetDEName(Int_t detElemId) const;
63 // Redefined methods from AliSegmentation interface
66 // Set Chamber Segmentation Parameters
68 virtual void SetPadSize(Float_t p1, Float_t p2);
70 virtual void SetDAnod(Float_t D);
73 // Transform from pad (wire) to real coordinates and vice versa
75 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
76 // Anode wire coordinate closest to xhit
77 virtual Bool_t GetPadI(Int_t detElemId,
78 Float_t xg, Float_t yg, Float_t zg,
79 Int_t& ix, Int_t& iy);
80 // Transform from pad to real coordinates
81 virtual Bool_t GetPadC(Int_t detElemId,
83 Float_t& x, Float_t& y, Float_t& z);
84 // Transform from real to pad coordinates
86 virtual Bool_t HasPad(Int_t detElemId,
88 virtual Bool_t HasPad(Int_t detElemId,
89 Float_t& x, Float_t& y, Float_t& z);
93 virtual void Init(Int_t chamber);
97 virtual Float_t Dpx(Int_t detElemId) const;
98 virtual Float_t Dpy(Int_t detElemId) const ;
100 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
101 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
102 // Pad size in x, y by Sector
103 virtual Int_t Npx(Int_t detElemId) const;
104 virtual Int_t Npy(Int_t detElemId) const;
105 // Maximum number of Pads in y
107 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
109 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
114 virtual void FirstPad(Int_t detElemId,
115 Float_t xghit, Float_t yghit, Float_t zghit,
116 Float_t dx, Float_t dy);
117 virtual void NextPad(Int_t detElemId);
118 virtual Int_t MorePads(Int_t detElemId);
120 virtual Float_t Distance2AndOffset(Int_t detElemId,
122 Float_t xg, Float_t yg, Float_t zg,
124 // Distance between 1 pad and a position
125 virtual void GetNParallelAndOffset(Int_t detElemId,
127 Int_t* nparallel, Int_t* offset);
128 // Number of pads read in parallel and offset to add to x
129 // (specific to LYON, but mandatory for display)
130 virtual void Neighbours(Int_t detElemId,
132 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
133 // Get next neighbours
139 virtual Int_t DetElemId();
140 // Current pad cursor during disintegration
142 virtual Int_t ISector();
145 virtual Int_t Sector(Int_t detElemId,
147 virtual Int_t Sector(Int_t detElemId,
148 Float_t xg, Float_t yg, Float_t zg);
149 // calculate sector from pad coordinates
151 virtual void IntegrationLimits(Int_t detElemId,
152 Float_t& x1, Float_t& x2,
153 Float_t& y1, Float_t& y2);
154 // Current integration limits
158 virtual Int_t SigGenCond(Int_t detElemId,
159 Float_t xg, Float_t yg, Float_t zg);
160 // Signal Generation Condition during Stepping
161 virtual void SigGenInit(Int_t detElemId,
162 Float_t xg, Float_t yg, Float_t zg);
163 // Initialise signal generation at coord (x,y,z)
166 virtual void GiveTestPoints(Int_t detElemId,
167 Int_t& n, Float_t* xg, Float_t* yg) const;
168 // Test points for auto calibration
169 virtual void Draw(const char *opt = "");
170 virtual void Draw(Int_t detElemId, const char *opt = "");
171 // Draw the segmentation zones
173 // Function for systematic corrections
175 virtual void SetCorrFunc(Int_t detElemId,
176 Int_t isec, TF1* func);
177 // Set the correction function
178 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
179 // Get the correction Function
182 virtual void Print(Option_t* opt = "") const;
185 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
186 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
190 Bool_t OwnNotify(Int_t detElemId, Bool_t warn = true) const;
192 // static data members
193 static const Float_t fgkMaxDistance; ///< \brief the big value passed to pad coordinates
194 /// if pad does not exist
197 mutable Int_t fCurrentDetElemId; ///< current DE ID
198 mutable AliMUONGeometryDetElement* fCurrentDetElement; ///< current detection element
199 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;///< current DE segmentation
201 const AliMUONGeometryModuleTransformer* fkModuleTransformer; ///< associated geometry transformer
202 AliMUONGeometryStore* fDESegmentations;///< DE segmentations
203 AliMUONGeometryStore* fDENames; ///< DE names
206 ClassDef(AliMUONGeometrySegmentation,3) // Geometry segmentation
211 /// Return associated geometry transformer
213 const AliMUONGeometryModuleTransformer*
214 AliMUONGeometrySegmentation::GetTransformer() const
215 { return fkModuleTransformer; }
217 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H