]>
Commit | Line | Data |
---|---|---|
e118b27e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | // | |
18 | // Class AliMUONGeometryDEIndexing | |
19 | // ------------------------------- | |
20 | // The class that provides conversion between the detection element Id | |
21 | // and the index in the array. | |
22 | // Used in storing DE transformations and segmentations. | |
23 | // (See more in the header file.) | |
24 | // | |
25 | // Author: Ivana Hrivnacova, IPN Orsay | |
26 | ||
27 | #include <Riostream.h> | |
28 | #include <TGeoMatrix.h> | |
29 | #include <TObjString.h> | |
30 | ||
31 | #include "AliLog.h" | |
32 | ||
33 | #include "AliMUONGeometryDEIndexing.h" | |
34 | #include "AliMUONConstants.h" | |
35 | ||
e5d01c02 | 36 | Int_t const AliMUONGeometryDEIndexing::fgkSeparator = 100; |
e118b27e | 37 | |
38 | // | |
e5d01c02 | 39 | // static methods |
e118b27e | 40 | // |
41 | ||
42 | //______________________________________________________________________________ | |
e5d01c02 | 43 | Int_t AliMUONGeometryDEIndexing::GetModuleId(Int_t detElemId) |
e118b27e | 44 | { |
e5d01c02 | 45 | // Get module Id from detection element Id |
46 | // --- | |
e118b27e | 47 | |
e5d01c02 | 48 | return detElemId/fgkSeparator - 1; |
e118b27e | 49 | } |
50 | ||
e118b27e | 51 | //______________________________________________________________________________ |
e5d01c02 | 52 | Int_t AliMUONGeometryDEIndexing::GetDEIndex(Int_t detElemId) |
e118b27e | 53 | { |
692de412 | 54 | /// Returns the index of detector element specified by detElemId |
e118b27e | 55 | |
e5d01c02 | 56 | return detElemId - detElemId/fgkSeparator*fgkSeparator; |
57 | } | |
e118b27e | 58 | |
59 | //______________________________________________________________________________ | |
e5d01c02 | 60 | Int_t AliMUONGeometryDEIndexing::GetDEId(Int_t moduleId, Int_t detElemIndex) |
e118b27e | 61 | { |
692de412 | 62 | /// Returns the ID of detector element specified by index |
e118b27e | 63 | |
e5d01c02 | 64 | return ( moduleId + 1 ) * fgkSeparator + detElemIndex; |
e118b27e | 65 | } |