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 "AliMpEncodePair.h"
20 #include <Riostream.h>
22 //_______________________________________________________________________
23 MpPair_t AliMp::Pair(Int_t first, Int_t second)
25 /// See also AliMp::PairFirst(), AliMp::PairSecond()
26 /// \author L. Aphecetche, SUBATECH
28 return (( first << 16 ) | second);
31 //_______________________________________________________________________
32 Int_t AliMp::PairFirst(MpPair_t pair )
34 /// See also AliMp::Pair(), AliMp::PairSecond()
35 /// \author L. Aphecetche, SUBATECH
37 return ( pair & 0xFFFF0000 ) >> 16;
40 //_______________________________________________________________________
41 Int_t AliMp::PairSecond(MpPair_t pair)
43 /// See also AliMp::Pair(), AliMp::PairFirst()
44 /// \author L. Aphecetche, SUBATECH
49 //_______________________________________________________________________
50 ostream& AliMp::PairPut(ostream& stream, MpPair_t pair)
53 stream << '(' << AliMp::PairFirst(pair)
54 << ',' << AliMp::PairSecond(pair) << ')';
58 stream << "AliMpIntPair::Invalid";