AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONVCalibParam.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 "AliMUONVCalibParam.h"
19 
20 #include "AliLog.h"
21 
22 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 
44 
45 //_____________________________________________________________________________
47 {
49 }
50 
51 //_____________________________________________________________________________
52 AliMUONVCalibParam::AliMUONVCalibParam(Int_t id0, Int_t id1) : TObject()
53 {
55  SetUniqueID(BuildUniqueID(id0,id1));
56 }
57 
58 //_____________________________________________________________________________
60 {
62 }
63 
64 //_____________________________________________________________________________
65 UInt_t
66 AliMUONVCalibParam::BuildUniqueID(Int_t id0, Int_t id1)
67 {
69  return ( id0 | ( id1 << 16 ) );
70 }
71 
72 //_____________________________________________________________________________
73 void
74 AliMUONVCalibParam::DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1)
75 {
77  id0 = ID0(uniqueID);
78  id1 = ID1(uniqueID);
79 }
80 
81 //_____________________________________________________________________________
82 Int_t
83 AliMUONVCalibParam::ID0(UInt_t uniqueID)
84 {
86  return uniqueID & 0xFFFF;
87 }
88 
89 //_____________________________________________________________________________
90 Int_t
92 {
94  return ID0(GetUniqueID());
95 }
96 
97 //_____________________________________________________________________________
98 Int_t
99 AliMUONVCalibParam::ID1(UInt_t uniqueID)
100 {
102  return ( uniqueID & 0xFFFF0000 ) >> 16;
103 }
104 
105 //_____________________________________________________________________________
106 Int_t
108 {
110  return ID1(GetUniqueID());
111 }
112 
113 //_____________________________________________________________________________
114 const char*
116 {
118  return Form("I=%d,J=%d",ID0(),ID1());
119 }
120 
121 //_____________________________________________________________________________
122 void
124 {
126  AliFatal("Not implemented");
127 }
128 
129 //_____________________________________________________________________________
130 void
132 {
134  AliFatal("Not implemented");
135 }
136 
137 //_____________________________________________________________________________
138 Double_t
140 {
142  AliFatal("Not implemented");
143  return 0;
144 }
145 
146 //_____________________________________________________________________________
147 Double_t
149 {
151  AliFatal("Not implemented");
152  return 0;
153 }
154 
155 //_____________________________________________________________________________
156 Int_t
157 AliMUONVCalibParam::Compare(const TObject* object) const
158 {
162  const AliMUONVCalibParam* param = static_cast<const AliMUONVCalibParam*>(object);
163 
164  if ( ID0() == param->ID0() )
165  {
166  if ( ID1() == param->ID1() )
167  {
168  return 0;
169  }
170  else
171  return (ID1() >= param->ID1()) ? 1 : -1;
172  }
173  else
174  return ( ID0() >= param->ID0()) ? 1 : -1;
175 }
176 
177 
virtual void SetValueAsDoubleFast(Int_t i, Int_t j, Double_t value)
Same as above but w/o bound checking.
static UInt_t BuildUniqueID(Int_t id0, Int_t id1)
virtual Double_t ValueAsDouble(Int_t i, Int_t j=0) const
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Container of calibration values for a given number of channels.
virtual const char * GetName() const
virtual Int_t ID0() const
First id of this object.
virtual Int_t ID1() const
Second id of this object (might not be required)
static void DecodeUniqueID(UInt_t uniqueID, Int_t &id0, Int_t &id1)
virtual Int_t Compare(const TObject *object) const
method for sorting pedestal values ordered by ID0 and ID1
virtual Double_t ValueAsDoubleFast(Int_t i, Int_t j=0) const
virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value)