AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpPadUID.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 "AliMpPadUID.h"
19 
25 
29 
30 //_____________________________________________________________________________
32 : TObject()
33 {
35  SetUniqueID(uid);
36 }
37 
38 //_____________________________________________________________________________
39 AliMpPadUID::AliMpPadUID(Int_t detElemId, Int_t manuId, Int_t manuChannel)
40 : TObject()
41 {
43  SetUniqueID(BuildUniqueID(detElemId,manuId,manuChannel));
44 }
45 
46 //_____________________________________________________________________________
48 {
50 }
51 
52 //_____________________________________________________________________________
53 UInt_t
54 AliMpPadUID::BuildUniqueID(Int_t detElemId, Int_t manuId,
55  Int_t manuChannel)
56 {
58  return ( ( detElemId ) | ( manuId << 12 ) | ( manuChannel << 24 ) );
59 }
60 
61 //_____________________________________________________________________________
62 Int_t
63 AliMpPadUID::DetElemId(UInt_t uniqueID)
64 {
66  return uniqueID & 0xFFF;
67 }
68 
69 //_____________________________________________________________________________
70 Int_t
71 AliMpPadUID::ManuChannel(UInt_t uniqueID)
72 {
74  return ( uniqueID & 0x3F000000 ) >> 24;
75 }
76 
77 //_____________________________________________________________________________
78 Int_t
79 AliMpPadUID::ManuId(UInt_t uniqueID)
80 {
82  return ( uniqueID & 0xFFF000 ) >> 12;
83 }
Int_t ManuChannel() const
Get manu channel.
Definition: AliMpPadUID.h:33
Int_t ManuId() const
Get manuId.
Definition: AliMpPadUID.h:30
virtual ~AliMpPadUID()
Definition: AliMpPadUID.cxx:47
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t DetElemId() const
Get detection element.
Definition: AliMpPadUID.h:27
AliMpPadUID(UInt_t uid=0)
Definition: AliMpPadUID.cxx:31
static UInt_t BuildUniqueID(Int_t detElemId, Int_t manuId, Int_t manuChannel)
Definition: AliMpPadUID.cxx:54
Unique ID for pads.
Definition: AliMpPadUID.h:19