1 #ifndef ALIMUONSEGMENTATIONDETECTIONELEMENT_H
2 #define ALIMUONSEGMENTATIONDETECTIONELEMENT_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 //===========================================================
9 // Segmentation classes for MUON Detection Elements
10 // Gines MARTINEZ, SUBATECH July 04
11 // This class interfaces with the mapping and segmentation
13 // This files are placed by default in
14 // $ALICE_ROOT/MUON/mapping/data/Stationxxx/yyy_plane/
15 // There are in tracking 23 types of detection elements
16 // 8 SectorSt1, 8 SectorSt2, 2 122000SR1, 2 122000NR1, 4 112200SR2, 4 112200NR2
17 // 4 122200S, 4 122200N, 8 222000N,8 220000N, 8 330000N, 4 122300N, 8 112230NR3
18 // 8 112230N, 8 222330N, 8 223300N, 16 333000N, 4 122330N, 8 112233NR3, 8 112233N
19 // 8 222333N, 8 223330N, 8 333300N
20 // Detailed information in Alice Technical Note xxxxxxxx (2004)
21 //===========================================================
22 #include <Riostream.h>
26 #include "AliSegmentation.h"
31 class AliMUONSegmentManuIndex;
32 class AliMUONSegmentPosition;
33 class AliMUONSegmentIndex;
35 class AliMUONSegmentationDetectionElement : public TObject {
37 AliMUONSegmentationDetectionElement();
38 //AliMUONSegmentationDetectionElement(const char* ElementType="");
39 virtual ~AliMUONSegmentationDetectionElement();
41 // User common functions
43 AliMUONSegmentIndex * FindIndexFromPosition(Float_t x, Float_t y, Int_t cathode);
44 AliMUONSegmentIndex * GetIndex(Int_t manu, Int_t channel) const;
45 AliMUONSegmentIndex * GetIndexFromPosition(Float_t x, Float_t y, Int_t cathode) const;
46 AliMUONSegmentManuIndex * GetManuIndex( Int_t padx, Int_t pady, Int_t cathode) const ;
47 AliMUONSegmentPosition * GetPosition(Int_t padx, Int_t pady, Int_t cathode) const ;
48 TObjArray * ListOfIndexes() {return fListOfIndexes;}
49 TObjArray * ListOfManuIndexes() {return fListOfManuIndexes;}
50 TObjArray * ListOfPositions() {return fListOfPositions;}
52 void Init(const char * DetectionElementType="slat220000N");
53 void ReadingSegmentationMappingFile(TString infile, Int_t cathode);
55 // virtual functions from AliSegmentation. In future this class should derive from AliSegmentation
56 Float_t GetAnod(Float_t xhit) const; // Anod wire coordinate closest to xhit
57 void SetDAnod(Float_t D) {fWireD = D;}; // Wire Pitch
58 void GetPadI(Float_t x, Float_t y , Int_t cathode, Int_t &padx, Int_t &pady); // Transform from Position to closest Index
59 void GetPadC(Int_t ix, Int_t iy, Int_t cathode, Float_t &x, Float_t &y ); // Transform from Index to Position
60 /* void FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy);// Initialiser */
61 /* void NextPad(); // Stepper */
62 /* Int_t MorePads(); // Condition */
63 /* void Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]); // Get next neighbours */
66 AliMUONSegmentIndex * GetIndex( const char * SegmentManuIndexName)const;
67 AliMUONSegmentIndex * GetIndexFromPosition( const char * PositionName)const;
68 AliMUONSegmentManuIndex * GetManuIndex( const char * SegmentIndexName) const;
69 AliMUONSegmentPosition * GetPosition( const char * SegmentIndexName) const;
70 AliMUONSegmentManuIndex * FindManuIndex(const char* ManuIndexName="") const;
71 AliMUONSegmentIndex * FindIndex(const char* IndexName="") const;
73 AliMUONSegmentationDetectionElement(const AliMUONSegmentationDetectionElement& rhs);
76 // static data members
77 static const TString fgkDefaultTop; // Top directory of $Alice_ROOT/MUON/mapping
78 static const TString fgkStationDir; // Directory for station station1, station2, station345
79 static const TString fgkBendingDir; //bending plane directory
80 static const TString fgkNonBendingDir; //non-bending plane directory
81 static const TString fgkFileExt; // File extention
82 static const TString fgkBendingExt; // bending file extention
83 static const TString fgkNonBendingExt; // bending file extention
86 Float_t fWireD; // Wire pitch in cm
87 Float_t fWireX0; // Initial X0 position in local coordinates of the first wire
88 Int_t fCurrentSegment;// Index of the current segment
89 TString fDetectionElementType; // Type of detection element St1Sector, slat220000N, etc ....
90 TString fSegmentationMappingFileBending; // Segmentation & mapping file for bending plane
91 TString fSegmentationMappingFileNonBending; // Segmentation & mapping file for non bending plane
92 TObjArray * fListOfIndexes; // TObject Array fo AliMUONSegmentIndex
93 TObjArray * fListOfManuIndexes; // TObject Array fo AliMUONSegmentManuIndex
94 TObjArray * fListOfPositions; // TObject Array fo AliMUONSegmentPositions
95 TMap * fMapManuIndexIndex; // Map with key ManuIndex and value = Index
96 TMap * fMapIndexManuIndex;// Map with key ManuIndexIndex and value = ManuIndex
97 TMap * fMapIndexPosition;// Map with key Index and value = Position
98 TMap * fMapPositionIndex;// Map with key Index and value = Position
100 ClassDef(AliMUONSegmentationDetectionElement,1) // Segmentation for MUON detection elements