1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
7 // Class AliMUONGeometrySegmentation
8 // ----------------------------------
9 // New class for the geometry segmentation
10 // composed of the segmentations of detection elements.
11 // Applies transformations defined in geometry.
13 // Author:Ivana Hrivnacova, IPN Orsay
15 #ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
16 #define ALI_MUON_GEOMETRY_SEGMENTATION_H
20 #include "AliMUONGeometryDirection.h"
25 class AliMUONGeometryModule;
26 class AliMUONGeometryStore;
27 class AliMUONGeometryDetElement;
28 class AliMUONVGeometryDESegmentation;
30 class AliMUONGeometrySegmentation : public TObject
33 AliMUONGeometrySegmentation(AliMUONGeometryModule* geometry);
34 AliMUONGeometrySegmentation();
35 virtual ~AliMUONGeometrySegmentation();
38 void Add(Int_t detElemId,
39 AliMUONVGeometryDESegmentation* segmentation);
42 AliMUONGeometryModule* GetGeometry() const;
43 virtual AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
44 // Direction with a constant pad size (Direction or coordinate where the resolution is the best)
47 // redefined methods from AliSegmentation interface
50 // Set Chamber Segmentation Parameters
52 virtual void SetPadSize(Float_t p1, Float_t p2);
54 virtual void SetDAnod(Float_t D);
57 // Transform from pad (wire) to real coordinates and vice versa
59 virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
60 // Anode wire coordinate closest to xhit
61 virtual Bool_t GetPadI(Int_t detElemId,
62 Float_t xg, Float_t yg, Float_t zg,
63 Int_t& ix, Int_t& iy);
64 // Transform from pad to real coordinates
65 virtual Bool_t GetPadC(Int_t detElemId,
67 Float_t& x, Float_t& y, Float_t& z);
68 // Transform from real to pad coordinates
72 virtual void Init(Int_t chamber);
76 virtual Float_t Dpx(Int_t detElemId) const;
77 virtual Float_t Dpy(Int_t detElemId) const ;
79 virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
80 virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
81 // Pad size in x, y by Sector
82 virtual Int_t Npx(Int_t detElemId) const;
83 virtual Int_t Npy(Int_t detElemId) const;
84 // Maximum number of Pads in y
86 virtual void SetPad(Int_t detElemId, Int_t ix, Int_t iy);
88 virtual void SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
93 virtual void FirstPad(Int_t detElemId,
94 Float_t xghit, Float_t yghit, Float_t zghit,
95 Float_t dx, Float_t dy);
96 virtual void NextPad(Int_t detElemId);
97 virtual Int_t MorePads(Int_t detElemId);
99 virtual Float_t Distance2AndOffset(Int_t detElemId,
101 Float_t xg, Float_t yg, Float_t zg,
103 // Distance between 1 pad and a position
104 virtual void GetNParallelAndOffset(Int_t detElemId,
106 Int_t* nparallel, Int_t* offset);
107 // Number of pads read in parallel and offset to add to x
108 // (specific to LYON, but mandatory for display)
109 virtual void Neighbours(Int_t detElemId,
111 Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
112 // Get next neighbours
118 virtual Int_t DetElemId();
119 // Current pad cursor during disintegration
121 virtual Int_t ISector();
124 virtual Int_t Sector(Int_t detElemId,
126 virtual Int_t Sector(Int_t detElemId,
127 Float_t xg, Float_t yg, Float_t zg);
128 // calculate sector from pad coordinates
130 virtual void IntegrationLimits(Int_t detElemId,
131 Float_t& x1, Float_t& x2,
132 Float_t& y1, Float_t& y2);
133 // Current integration limits
137 virtual Int_t SigGenCond(Int_t detElemId,
138 Float_t xg, Float_t yg, Float_t zg);
139 // Signal Generation Condition during Stepping
140 virtual void SigGenInit(Int_t detElemId,
141 Float_t xg, Float_t yg, Float_t zg);
142 // Initialise signal generation at coord (x,y,z)
145 virtual void GiveTestPoints(Int_t detElemId,
146 Int_t& n, Float_t* xg, Float_t* yg) const;
147 // Test points for auto calibration
148 virtual void Draw(Int_t detElemId,
149 const char *opt = "") const;
150 // Draw the segmentation zones
152 // Function for systematic corrections
154 virtual void SetCorrFunc(Int_t detElemId,
155 Int_t isec, TF1* func);
156 // Set the correction function
157 virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
158 // Get the correction Function
161 AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
164 AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
168 Bool_t Notify(Int_t detElemId) const;
171 mutable Int_t fCurrentDetElemId;
172 mutable AliMUONGeometryDetElement* fCurrentDetElement;
173 mutable AliMUONVGeometryDESegmentation* fCurrentSegmentation;
174 AliMUONGeometryModule* fGeometryModule;
175 AliMUONGeometryStore* fDESegmentations;
177 ClassDef(AliMUONGeometrySegmentation,2) // Geometry segmentation
182 inline AliMUONGeometryModule* AliMUONGeometrySegmentation::GetGeometry() const
183 { return fGeometryModule; }
185 #endif //ALI_MUON_GEOMETRY_SEGMENTATION_H