New macro to keep track of timing performances of the segmentation methods (Laurent)
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpHVUID.cxx
CommitLineData
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 "AliMpHVUID.h"
19
20/// \class AliMpHVUID
21///
22/// A utility class to assign a unique ID to a given HV channel
23///
24/// \author: Laurent Aphecetche, Subatech
25
26/// \cond CLASSIMP
27ClassImp(AliMpHVUID)
28/// \endcond
29
30//_____________________________________________________________________________
31AliMpHVUID::AliMpHVUID() : TObject()
32{
33 /// ctor
34}
35
36//_____________________________________________________________________________
37AliMpHVUID::~AliMpHVUID()
38{
39 /// dtor
40}
41
42//_____________________________________________________________________________
43UInt_t
44AliMpHVUID::BuildUniqueID(Int_t detElemId, Int_t index)
45{
46 /// Build a single index from the pair (de,index)
47 return ( index | ( detElemId << 16 ) );
48}
49
50//_____________________________________________________________________________
51Int_t
52AliMpHVUID::Index(UInt_t uniqueID)
53{
54 /// Extract index from uniqueID
55 return uniqueID & 0xFFFF;
56}
57
58//_____________________________________________________________________________
59Int_t
60AliMpHVUID::DetElemId(UInt_t uniqueID)
61{
62 /// Extract detElemId from uniqueID
63 return ( uniqueID & 0xFFFF0000 ) >> 16;
64}
65