AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpManuUID.cxx
Go to the documentation of this file.
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 
25 
29 
30 //_____________________________________________________________________________
32  : TObject()
33 {
35 }
36 
37 //_____________________________________________________________________________
38 AliMpManuUID::AliMpManuUID(Int_t detElemId, Int_t manuId)
39 : TObject()
40 {
42  SetUniqueID(BuildUniqueID(detElemId,manuId));
43 }
44 
45 //_____________________________________________________________________________
47 {
49 }
50 
51 //_____________________________________________________________________________
52 UInt_t
53 AliMpManuUID::BuildUniqueID(Int_t detElemId, Int_t manuId)
54 {
56 
57  return ( ( detElemId ) | ( manuId << 12 ) );
58 }
59 
60 //_____________________________________________________________________________
61 Int_t AliMpManuUID::DetElemId(UInt_t uniqueID)
62 {
64  return uniqueID & 0xFFF;
65 }
66 
67 //_____________________________________________________________________________
68 Int_t AliMpManuUID::ManuId(UInt_t uniqueID)
69 {
71  return ( uniqueID & 0xFFF000 ) >> 12;
72 }
73 
static UInt_t BuildUniqueID(Int_t detElemId, Int_t manuId)
Int_t DetElemId() const
Get detection element.
Definition: AliMpManuUID.h:27
Unique ID for manus.
Definition: AliMpManuUID.h:19
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual ~AliMpManuUID()
Int_t ManuId() const
Get manu identifier.
Definition: AliMpManuUID.h:30