1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMpHVUID.h"
22 /// A utility class to assign a unique ID to a given HV channel
24 /// \author: Laurent Aphecetche, Subatech
30 //_____________________________________________________________________________
31 AliMpHVUID::AliMpHVUID() : TObject()
36 //_____________________________________________________________________________
37 AliMpHVUID::~AliMpHVUID()
42 //_____________________________________________________________________________
44 AliMpHVUID::BuildUniqueID(Int_t detElemId, Int_t index)
46 /// Build a single index from the pair (de,index)
47 return ( index | ( detElemId << 16 ) );
50 //_____________________________________________________________________________
52 AliMpHVUID::Index(UInt_t uniqueID)
54 /// Extract index from uniqueID
55 return uniqueID & 0xFFFF;
58 //_____________________________________________________________________________
60 AliMpHVUID::DetElemId(UInt_t uniqueID)
62 /// Extract detElemId from uniqueID
63 return ( uniqueID & 0xFFFF0000 ) >> 16;