]>
Commit | Line | Data |
---|---|---|
7bda16d5 | 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 | ||
a1546c3a | 20 | #include "AliLog.h" |
21 | ||
3d1463c8 | 22 | //----------------------------------------------------------------------------- |
85fec35d | 23 | /// \class AliMUONVCalibParam |
24 | /// | |
25 | /// Defines an interface for a calibration container object. | |
26 | /// | |
a1546c3a | 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. | |
30 | /// | |
31 | /// id1 might be left to zero if not required (e.g. for calibparam which | |
32 | /// can be identified by a single integer) | |
33 | /// | |
34 | /// \author Laurent Aphecetche, Subatech | |
3d1463c8 | 35 | //----------------------------------------------------------------------------- |
7bda16d5 | 36 | |
5398f946 | 37 | /// \cond CLASSIMP |
7bda16d5 | 38 | ClassImp(AliMUONVCalibParam) |
5398f946 | 39 | /// \endcond |
7bda16d5 | 40 | |
85fec35d | 41 | //_____________________________________________________________________________ |
a1546c3a | 42 | AliMUONVCalibParam::AliMUONVCalibParam() : TObject() |
85fec35d | 43 | { |
a1546c3a | 44 | /// Default constructor |
45 | } | |
46 | ||
47 | //_____________________________________________________________________________ | |
48 | AliMUONVCalibParam::AliMUONVCalibParam(Int_t id0, Int_t id1) : TObject() | |
49 | { | |
50 | /// constructor for 2D | |
51 | SetUniqueID(BuildUniqueID(id0,id1)); | |
85fec35d | 52 | } |
53 | ||
7bda16d5 | 54 | //_____________________________________________________________________________ |
55 | AliMUONVCalibParam::~AliMUONVCalibParam() | |
56 | { | |
5398f946 | 57 | /// Destructor. |
7bda16d5 | 58 | } |
a1546c3a | 59 | |
60 | //_____________________________________________________________________________ | |
61 | UInt_t | |
62 | AliMUONVCalibParam::BuildUniqueID(Int_t id0, Int_t id1) | |
63 | { | |
64 | /// Build a single index from the pair (id0,id1) | |
65 | return ( id0 | ( id1 << 16 ) ); | |
66 | } | |
67 | ||
68 | //_____________________________________________________________________________ | |
69 | void | |
70 | AliMUONVCalibParam::DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1) | |
71 | { | |
72 | /// Convert single integer into a pair (i,j) | |
73 | id0 = ID0(uniqueID); | |
74 | id1 = ID1(uniqueID); | |
75 | } | |
76 | ||
77 | //_____________________________________________________________________________ | |
78 | Int_t | |
79 | AliMUONVCalibParam::ID0(UInt_t uniqueID) | |
80 | { | |
81 | /// Extract id0 from uniqueID | |
82 | return uniqueID & 0xFFFF; | |
83 | } | |
84 | ||
85 | //_____________________________________________________________________________ | |
86 | Int_t | |
87 | AliMUONVCalibParam::ID0() const | |
88 | { | |
89 | /// Extract first identifier | |
90 | return ID0(GetUniqueID()); | |
91 | } | |
92 | ||
93 | //_____________________________________________________________________________ | |
94 | Int_t | |
95 | AliMUONVCalibParam::ID1(UInt_t uniqueID) | |
96 | { | |
97 | /// Extract id1 from uniqueID | |
98 | return ( uniqueID & 0xFFFF0000 ) >> 16; | |
99 | } | |
100 | ||
101 | //_____________________________________________________________________________ | |
102 | Int_t | |
103 | AliMUONVCalibParam::ID1() const | |
104 | { | |
105 | /// Extract second identifier | |
106 | return ID1(GetUniqueID()); | |
107 | } | |
108 | ||
109 | //_____________________________________________________________________________ | |
110 | const char* | |
111 | AliMUONVCalibParam::GetName() const | |
112 | { | |
113 | /// Build a name for this object | |
114 | return Form("I=%d,J=%d",ID0(),ID1()); | |
115 | } | |
116 | ||
117 | //_____________________________________________________________________________ | |
118 | void | |
119 | AliMUONVCalibParam::SetValueAsDouble(Int_t, Int_t, Double_t) | |
120 | { | |
121 | /// By default, this one does not exist | |
122 | AliFatal("Not implemented"); | |
123 | } | |
124 | ||
125 | //_____________________________________________________________________________ | |
126 | Double_t | |
127 | AliMUONVCalibParam::ValueAsDouble(Int_t , Int_t ) const | |
128 | { | |
129 | /// By default, this one does not exist | |
130 | AliFatal("Not implemented"); | |
131 | return 0; | |
132 | } | |
133 |