From Laurent:
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationDetectionElement.h
CommitLineData
74f8c8e3 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 */
5
6/* $Id$ */
7
8//===========================================================
9// Segmentation classes for MUON Detection Elements
10// Gines MARTINEZ, SUBATECH July 04
11// This class interfaces with the mapping and segmentation
12// files MUON.
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>
23
74f8c8e3 24#include <TString.h>
6b74910d 25
26#include "AliSegmentation.h"
74f8c8e3 27
28class TClonesArray;
29class TMap;
30
31class AliMUONSegmentManuIndex;
32class AliMUONSegmentPosition;
33class AliMUONSegmentIndex;
34
35class AliMUONSegmentationDetectionElement : public TObject {
36 public:
37 AliMUONSegmentationDetectionElement();
38 //AliMUONSegmentationDetectionElement(const char* ElementType="");
39 virtual ~AliMUONSegmentationDetectionElement();
212bb69d 40
6b74910d 41 // User common functions
42
43 AliMUONSegmentIndex * FindIndexFromPosition(Float_t x, Float_t y, Int_t cathode);
212bb69d 44 AliMUONSegmentIndex * GetIndex(Int_t manu, Int_t channel) const;
6b74910d 45 AliMUONSegmentIndex * GetIndexFromPosition(Float_t x, Float_t y, Int_t cathode) const;
212bb69d 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 ;
6b74910d 48 TObjArray * ListOfIndexes() {return fListOfIndexes;}
49 TObjArray * ListOfManuIndexes() {return fListOfManuIndexes;}
50 TObjArray * ListOfPositions() {return fListOfPositions;}
74f8c8e3 51
6b74910d 52 void Init(const char * DetectionElementType="slat220000N");
53 void ReadingSegmentationMappingFile(TString infile, Int_t cathode);
54
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 */
64
65 protected:
212bb69d 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;
212bb69d 70 AliMUONSegmentManuIndex * FindManuIndex(const char* ManuIndexName="") const;
6b74910d 71 AliMUONSegmentIndex * FindIndex(const char* IndexName="") const;
212bb69d 72
74f8c8e3 73 AliMUONSegmentationDetectionElement(const AliMUONSegmentationDetectionElement& rhs);
74
75 private:
76 // static data members
212bb69d 77 static const TString fgkDefaultTop; // Top directory of $Alice_ROOT/MUON/mapping
78 static const TString fgkStationDir; // Directory for station station1, station2, station345
74f8c8e3 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
84
85 // data members
6b74910d 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
212bb69d 92 TObjArray * fListOfIndexes; // TObject Array fo AliMUONSegmentIndex
93 TObjArray * fListOfManuIndexes; // TObject Array fo AliMUONSegmentManuIndex
94 TObjArray * fListOfPositions; // TObject Array fo AliMUONSegmentPositions
6b74910d 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
74f8c8e3 99
100 ClassDef(AliMUONSegmentationDetectionElement,1) // Segmentation for MUON detection elements
101
102 };
103#endif
104
105
106
107
108
109