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 "AliMUONVCalibParam.h"
22 //-----------------------------------------------------------------------------
23 /// \class AliMUONVCalibParam
25 /// Defines an interface for a calibration container object.
27 /// Note that a VCalibParam object is identified by a pair (id0,id1),
28 /// where each member of the pair is a 16 bits word, so that id0 and id1
29 /// can be packed into a single 32 bits word.
31 /// id1 might be left to zero if not required (e.g. for calibparam which
32 /// can be identified by a single integer)
34 /// Note that the ValueAsXXX methods have 2 versions : with or without bound
35 /// checking. The latter is to be used in e.g. loops, where you know for
36 /// sure the indices are ok, in order to gain some time.
38 /// \author Laurent Aphecetche, Subatech
39 //-----------------------------------------------------------------------------
42 ClassImp(AliMUONVCalibParam)
45 //_____________________________________________________________________________
46 AliMUONVCalibParam::AliMUONVCalibParam() : TObject()
48 /// Default constructor
51 //_____________________________________________________________________________
52 AliMUONVCalibParam::AliMUONVCalibParam(Int_t id0, Int_t id1) : TObject()
54 /// constructor for 2D
55 SetUniqueID(BuildUniqueID(id0,id1));
58 //_____________________________________________________________________________
59 AliMUONVCalibParam::~AliMUONVCalibParam()
64 //_____________________________________________________________________________
66 AliMUONVCalibParam::BuildUniqueID(Int_t id0, Int_t id1)
68 /// Build a single index from the pair (id0,id1)
69 return ( id0 | ( id1 << 16 ) );
72 //_____________________________________________________________________________
74 AliMUONVCalibParam::DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1)
76 /// Convert single integer into a pair (i,j)
81 //_____________________________________________________________________________
83 AliMUONVCalibParam::ID0(UInt_t uniqueID)
85 /// Extract id0 from uniqueID
86 return uniqueID & 0xFFFF;
89 //_____________________________________________________________________________
91 AliMUONVCalibParam::ID0() const
93 /// Extract first identifier
94 return ID0(GetUniqueID());
97 //_____________________________________________________________________________
99 AliMUONVCalibParam::ID1(UInt_t uniqueID)
101 /// Extract id1 from uniqueID
102 return ( uniqueID & 0xFFFF0000 ) >> 16;
105 //_____________________________________________________________________________
107 AliMUONVCalibParam::ID1() const
109 /// Extract second identifier
110 return ID1(GetUniqueID());
113 //_____________________________________________________________________________
115 AliMUONVCalibParam::GetName() const
117 /// Build a name for this object
118 return Form("I=%d,J=%d",ID0(),ID1());
121 //_____________________________________________________________________________
123 AliMUONVCalibParam::SetValueAsDouble(Int_t, Int_t, Double_t)
125 /// By default, this one does not exist
126 AliFatal("Not implemented");
129 //_____________________________________________________________________________
131 AliMUONVCalibParam::SetValueAsDoubleFast(Int_t, Int_t, Double_t)
133 /// By default, this one does not exist
134 AliFatal("Not implemented");
137 //_____________________________________________________________________________
139 AliMUONVCalibParam::ValueAsDouble(Int_t , Int_t ) const
141 /// By default, this one does not exist
142 AliFatal("Not implemented");
146 //_____________________________________________________________________________
148 AliMUONVCalibParam::ValueAsDoubleFast(Int_t , Int_t ) const
150 /// By default, this one does not exist
151 AliFatal("Not implemented");