]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONVCalibParam.cxx
- Reshape the architecture of the Kalman tracking to make it more modular
[u/mrichter/AliRoot.git] / MUON / AliMUONVCalibParam.cxx
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 /// 
23 /// \class AliMUONVCalibParam
24 ///  
25 /// Defines an interface for a calibration container object.
26 ///
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
35
36 /// \cond CLASSIMP
37 ClassImp(AliMUONVCalibParam)
38 /// \endcond
39
40 //_____________________________________________________________________________
41 AliMUONVCalibParam::AliMUONVCalibParam() : TObject()
42 {
43   ///  Default constructor
44 }
45
46 //_____________________________________________________________________________
47 AliMUONVCalibParam::AliMUONVCalibParam(Int_t id0, Int_t id1) : TObject()
48 {
49   ///  constructor for 2D
50   SetUniqueID(BuildUniqueID(id0,id1));
51 }
52
53 //_____________________________________________________________________________
54 AliMUONVCalibParam::~AliMUONVCalibParam()
55 {
56 /// Destructor.
57 }
58
59 //_____________________________________________________________________________
60 UInt_t
61 AliMUONVCalibParam::BuildUniqueID(Int_t id0, Int_t id1)
62 {
63   /// Build a single index from the pair (id0,id1)
64   return ( id0 | ( id1 << 16 ) );
65 }
66
67 //_____________________________________________________________________________
68 void
69 AliMUONVCalibParam::DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1)
70 {
71   /// Convert single integer into a pair (i,j)
72   id0 = ID0(uniqueID);
73   id1 = ID1(uniqueID);
74 }
75
76 //_____________________________________________________________________________
77 Int_t
78 AliMUONVCalibParam::ID0(UInt_t uniqueID)
79 {
80   /// Extract id0 from uniqueID
81   return uniqueID & 0xFFFF;
82 }
83
84 //_____________________________________________________________________________
85 Int_t
86 AliMUONVCalibParam::ID0() const
87 {
88   /// Extract first identifier
89   return ID0(GetUniqueID());
90 }
91
92 //_____________________________________________________________________________
93 Int_t
94 AliMUONVCalibParam::ID1(UInt_t uniqueID)
95 {
96   /// Extract id1 from uniqueID
97   return ( uniqueID & 0xFFFF0000 ) >> 16;
98 }
99
100 //_____________________________________________________________________________
101 Int_t
102 AliMUONVCalibParam::ID1() const
103 {
104   /// Extract second identifier
105   return ID1(GetUniqueID());
106 }
107
108 //_____________________________________________________________________________
109 const char* 
110 AliMUONVCalibParam::GetName() const
111 {
112   /// Build a name for this object
113   return Form("I=%d,J=%d",ID0(),ID1());
114 }
115
116 //_____________________________________________________________________________
117 void 
118 AliMUONVCalibParam::SetValueAsDouble(Int_t, Int_t, Double_t)
119 {
120   /// By default, this one does not exist
121   AliFatal("Not implemented");
122 }
123
124 //_____________________________________________________________________________
125 Double_t 
126 AliMUONVCalibParam::ValueAsDouble(Int_t , Int_t ) const
127 {
128   /// By default, this one does not exist
129   AliFatal("Not implemented");
130   return 0;
131 }
132