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, Bool_t warn = true) const;
54 AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
55 // Direction with a constant pad size
56 // (Direction or coordinate where the resolution
59 TString GetDEName(Int_t detElemId) const;
62 // Redefined methods from AliSegmentation interface
65 // Set Chamber Segmentation Parameters
67 virtual void SetPadSize(Float_t p1, Float_t p2);
69 virtual void SetDAnod(Float_t D);
72 // Transform from pad (wire) to real coordinates and vice versa
74 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
75 // Anode wire coordinate closest to xhit
76 virtual Bool_t GetPadI(Int_t detElemId,
77 Float_t xg, Float_t yg, Float_t zg,
78 Int_t& ix, Int_t& iy);
79 // Transform from pad to real coordinates
80 virtual Bool_t GetPadC(Int_t detElemId,
82 Float_t& x, Float_t& y, Float_t& z);
83 // Transform from real to pad coordinates
85 virtual Bool_t HasPad(Int_t detElemId, Int_t ix, Int_t iy);
89 virtual void Init(Int_t chamber);
93 virtual Float_t Dpx(Int_t detElemId) const;
94 virtual Float_t Dpy(Int_t detElemId) const ;
96 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
97 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
98 // Pad size in x, y by Sector
99 virtual Int_t Npx(Int_t detElemId) const;
100 virtual Int_t Npy(Int_t detElemId) const;
101 // Maximum number of Pads in y
103 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
105 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
110 virtual void FirstPad(Int_t detElemId,
111 Float_t xghit, Float_t yghit, Float_t zghit,
112 Float_t dx, Float_t dy);
113 virtual void NextPad(Int_t detElemId);
114 virtual Int_t MorePads(Int_t detElemId);
116 virtual Float_t Distance2AndOffset(Int_t detElemId,
118 Float_t xg, Float_t yg, Float_t zg,
120 // Distance between 1 pad and a position
121 virtual void GetNParallelAndOffset(Int_t detElemId,
123 Int_t* nparallel, Int_t* offset);
124 // Number of pads read in parallel and offset to add to x
125 // (specific to LYON, but mandatory for display)
126 virtual void Neighbours(Int_t detElemId,
128 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
129 // Get next neighbours
135 virtual Int_t DetElemId();
136 // Current pad cursor during disintegration
138 virtual Int_t ISector();
141 virtual Int_t Sector(Int_t detElemId,
143 virtual Int_t Sector(Int_t detElemId,
144 Float_t xg, Float_t yg, Float_t zg);
145 // calculate sector from pad coordinates
147 virtual void IntegrationLimits(Int_t detElemId,
148 Float_t& x1, Float_t& x2,
149 Float_t& y1, Float_t& y2);
150 // Current integration limits
154 virtual Int_t SigGenCond(Int_t detElemId,
155 Float_t xg, Float_t yg, Float_t zg);
156 // Signal Generation Condition during Stepping
157 virtual void SigGenInit(Int_t detElemId,
158 Float_t xg, Float_t yg, Float_t zg);
159 // Initialise signal generation at coord (x,y,z)
162 virtual void GiveTestPoints(Int_t detElemId,
163 Int_t& n, Float_t* xg, Float_t* yg) const;
164 // Test points for auto calibration
165 virtual void Draw(const char *opt = "");
166 virtual void Draw(Int_t detElemId, const char *opt = "");
167 // Draw the segmentation zones
169 // Function for systematic corrections
171 virtual void SetCorrFunc(Int_t detElemId,
172 Int_t isec, TF1* func);
173 // Set the correction function
174 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
175 // Get the correction Function
178 virtual void Print(Option_t* opt = "") const;
181 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
184 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
188 Bool_t OwnNotify(Int_t detElemId, Bool_t warn = true) const;
190 // static data members
191 static const Float_t fgkMaxDistance; // the big value passed to pad coordinates
192 // if pad does not exist
195 mutable Int_t fCurrentDetElemId; // current DE ID
196 mutable AliMUONGeometryDetElement* fCurrentDetElement; // current detection element
197 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;// current DE segmentation
199 const AliMUONGeometryModuleTransformer* fkModuleTransformer; // associated geometry transformer
200 AliMUONGeometryStore* fDESegmentations;// DE segmentations
201 AliMUONGeometryStore* fDENames; // DE names
204 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
210 const AliMUONGeometryModuleTransformer*
211 AliMUONGeometrySegmentation::GetTransformer() const
212 { return fkModuleTransformer; }
214 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H