]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryDEIndexing.h
Optimization of code (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryDEIndexing.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 //
6 // Class AliMUONGeometryDEIndexing
7 // -------------------------------
8 // The class that provides conversion between the detection element Id
9 // and the index in the array.
10 // Used in storing DE transformations and segmentations.
11 // The detection elements numbering:
12 //    DetElemId = chamberId*100 + [50] + detElemNum
13 //                where  chamberId  = 1, 2, ..., 14
14 //                       detElemNum = 0, 1, ...
15 // The number 50 is added to distinguish detector elements 
16 // in the left and the right hemispheres.
17 //
18 // Author: Ivana Hrivnacova, IPN Orsay
19
20 #ifndef ALI_MUON_GEOMETRY_DE_INDEXING_H
21 #define ALI_MUON_GEOMETRY_DE_INDEXING_H
22
23 #include "AliMUONVGeometryDEIndexing.h"
24
25 class AliMUONGeometryDEIndexing : public AliMUONVGeometryDEIndexing
26 {
27   public:
28     AliMUONGeometryDEIndexing(Int_t moduleId, Int_t nofDetElements);
29     AliMUONGeometryDEIndexing();
30     virtual ~AliMUONGeometryDEIndexing();
31     
32     // methods for conversion between det element Id and index
33     virtual Int_t GetDetElementIndex(Int_t detElemId) const;
34     virtual Int_t GetDetElementId(Int_t detElemIndex) const;
35
36     // set method
37     virtual Int_t GetNofDetElements() const ;
38     virtual void  SetNofDetElements(Int_t  nofDetElements);  
39
40   private:
41     Int_t GetFirstDetElemId() const;
42
43     // static data members
44     static const Int_t  fgkHemisphere;   // The constant to distinguish 
45                                          // the left/right hemispere  
46                                          
47     // data members
48     Int_t  fModuleId;       // module Id                                                   
49     Int_t  fNofDetElements; // number of detection elements in the module                                                  
50
51   ClassDef(AliMUONGeometryDEIndexing,1) // MUON transformations store
52 };
53
54 // inline functions
55
56 inline Int_t AliMUONGeometryDEIndexing::GetNofDetElements() const
57 { return fNofDetElements; }
58
59 inline void AliMUONGeometryDEIndexing::SetNofDetElements(Int_t nofDetElements)
60 { fNofDetElements =  nofDetElements; }
61
62 #endif //ALI_MUON_GEOMETRY_DE_INDEXING_H