]>
Commit | Line | Data |
---|---|---|
1ef5468a | 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 | #include "AliMpManuUID.h" | |
19 | ||
20 | /// \class AliMpManuUID | |
21 | /// | |
22 | /// Unique ID for manus | |
23 | /// | |
24 | /// \author Laurent Aphecetche, Subatech | |
25 | ||
26 | /// \cond CLASSIMP | |
27 | ClassImp(AliMpManuUID) | |
28 | /// \endcond | |
29 | ||
30 | //_____________________________________________________________________________ | |
31 | AliMpManuUID::AliMpManuUID() | |
630711ed | 32 | : TObject() |
1ef5468a | 33 | { |
34 | /// default ctor | |
35 | } | |
36 | ||
37 | //_____________________________________________________________________________ | |
630711ed | 38 | AliMpManuUID::AliMpManuUID(Int_t detElemId, Int_t manuId) |
39 | : TObject() | |
1ef5468a | 40 | { |
41 | /// normal ctor | |
42 | SetUniqueID(BuildUniqueID(detElemId,manuId)); | |
43 | } | |
44 | ||
45 | //_____________________________________________________________________________ | |
46 | AliMpManuUID::~AliMpManuUID() | |
47 | { | |
48 | /// dtor | |
49 | } | |
50 | ||
51 | //_____________________________________________________________________________ | |
52 | UInt_t | |
53 | AliMpManuUID::BuildUniqueID(Int_t detElemId, Int_t manuId) | |
54 | { | |
55 | /// Build a unique id from (de,manu) pair | |
56 | ||
57 | return ( ( detElemId ) | ( manuId << 12 ) ); | |
58 | } | |
59 | ||
60 | //_____________________________________________________________________________ | |
61 | Int_t AliMpManuUID::DetElemId(UInt_t uniqueID) | |
62 | { | |
63 | /// Return detection element id part of the uniqueID | |
64 | return uniqueID & 0xFFF; | |
65 | } | |
66 | ||
67 | //_____________________________________________________________________________ | |
68 | Int_t AliMpManuUID::ManuId(UInt_t uniqueID) | |
69 | { | |
70 | /// Return manuId part of the uniqueID | |
71 | return ( uniqueID & 0xFFF000 ) >> 12; | |
72 | } | |
73 |