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 AliMUONGeometryModule;
27 class AliMUONGeometryStore;
28 class AliMUONGeometryDetElement;
29 class AliMUONVGeometryDESegmentation;
30 class AliMUONSegmentManuIndex;
32 class AliMUONGeometrySegmentation : public TObject
35 AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
36 AliMUONGeometrySegmentation();
37 virtual ~AliMUONGeometrySegmentation();
40 void Add(Int_t detElemId,
41 AliMUONVGeometryDESegmentation* segmentation);
44 AliMUONGeometryModule* GetGeometry() const;
45 virtual const AliMUONVGeometryDESegmentation* GetDESegmentation(Int_t detElemId) const;
47 virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
48 // Direction with a constant pad size
49 // (Direction or coordinate where the resolution is the best)
52 // redefined methods from AliSegmentation interface
55 // Set Chamber Segmentation Parameters
57 virtual void SetPadSize(Float_t p1, Float_t p2);
59 virtual void SetDAnod(Float_t D);
62 // Transform from pad (wire) to real coordinates and vice versa
64 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
65 // Anode wire coordinate closest to xhit
66 virtual Bool_t GetPadI(Int_t detElemId,
67 Float_t xg, Float_t yg, Float_t zg,
68 Int_t& ix, Int_t& iy);
69 // Transform from pad to real coordinates
70 virtual Bool_t GetPadC(Int_t detElemId,
72 Float_t& x, Float_t& y, Float_t& z);
73 // Transform from real to pad coordinates
75 virtual Bool_t HasPad(Int_t detElemId, Int_t ix, Int_t iy);
79 virtual void Init(Int_t chamber);
83 virtual Float_t Dpx(Int_t detElemId) const;
84 virtual Float_t Dpy(Int_t detElemId) const ;
86 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
87 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
88 // Pad size in x, y by Sector
89 virtual Int_t Npx(Int_t detElemId) const;
90 virtual Int_t Npy(Int_t detElemId) const;
91 // Maximum number of Pads in y
93 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
95 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
100 virtual void FirstPad(Int_t detElemId,
101 Float_t xghit, Float_t yghit, Float_t zghit,
102 Float_t dx, Float_t dy);
103 virtual void NextPad(Int_t detElemId);
104 virtual Int_t MorePads(Int_t detElemId);
106 virtual Float_t Distance2AndOffset(Int_t detElemId,
108 Float_t xg, Float_t yg, Float_t zg,
110 // Distance between 1 pad and a position
111 virtual void GetNParallelAndOffset(Int_t detElemId,
113 Int_t* nparallel, Int_t* offset);
114 // Number of pads read in parallel and offset to add to x
115 // (specific to LYON, but mandatory for display)
116 virtual void Neighbours(Int_t detElemId,
118 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
119 // Get next neighbours
125 virtual Int_t DetElemId();
126 // Current pad cursor during disintegration
128 virtual Int_t ISector();
131 virtual Int_t Sector(Int_t detElemId,
133 virtual Int_t Sector(Int_t detElemId,
134 Float_t xg, Float_t yg, Float_t zg);
135 // calculate sector from pad coordinates
137 virtual void IntegrationLimits(Int_t detElemId,
138 Float_t& x1, Float_t& x2,
139 Float_t& y1, Float_t& y2);
140 // Current integration limits
144 virtual Int_t SigGenCond(Int_t detElemId,
145 Float_t xg, Float_t yg, Float_t zg);
146 // Signal Generation Condition during Stepping
147 virtual void SigGenInit(Int_t detElemId,
148 Float_t xg, Float_t yg, Float_t zg);
149 // Initialise signal generation at coord (x,y,z)
152 virtual void GiveTestPoints(Int_t detElemId,
153 Int_t& n, Float_t* xg, Float_t* yg) const;
154 // Test points for auto calibration
155 virtual void Draw(const char *opt = "");
156 virtual void Draw(Int_t detElemId, const char *opt = "");
157 // Draw the segmentation zones
159 // Function for systematic corrections
161 virtual void SetCorrFunc(Int_t detElemId,
162 Int_t isec, TF1* func);
163 // Set the correction function
164 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
165 // Get the correction Function
166 virtual void Print(Option_t* ="") const;
169 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
172 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
176 Bool_t OwnNotify(Int_t detElemId) const;
179 mutable Int_t fCurrentDetElemId;
180 mutable AliMUONGeometryDetElement* fCurrentDetElement;
181 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;
182 AliMUONGeometryModule* fGeometryModule;
183 AliMUONGeometryStore* fDESegmentations;
185 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
190 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
191 { return fGeometryModule; }
193 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H