]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONVCalibParam.h
STL make_pair fix (see https://savannah.cern.ch/bugs/?102665)
[u/mrichter/AliRoot.git] / MUON / AliMUONVCalibParam.h
CommitLineData
7bda16d5 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2* See cxx source for full Copyright notice */
3
4// $Id$
5
1ee5f2c7 6/// \ingroup calib
7bda16d5 7/// \class AliMUONVCalibParam
8/// \brief Container of calibration values for a given number of channels.
9///
13985652 10// Author Laurent Aphecetche
7bda16d5 11
12#ifndef ALIMUONVCALIBPARAM_H
13#define ALIMUONVCALIBPARAM_H
14
15#ifndef ROOT_TObject
16# include "TObject.h"
17#endif
18
19class AliMUONVCalibParam : public TObject
20{
21public:
85fec35d 22 AliMUONVCalibParam();
a1546c3a 23 //AliMUONVCalibParam(Int_t id0);
24 AliMUONVCalibParam(Int_t id0, Int_t id1);
7bda16d5 25 virtual ~AliMUONVCalibParam();
26
a1546c3a 27 virtual const char* GetName() const;
ff496840 28
29 /// Advertise that we can be sorted in TCollections
30 virtual Bool_t IsSortable() const { return kTRUE; }
a1546c3a 31
32 /// First id of this object
33 virtual Int_t ID0() const;
34
35 /// Second id of this object (might not be required)
36 virtual Int_t ID1() const;
ff496840 37
38 /// method for sorting pedestal values ordered by ID0 and ID1
39 virtual Int_t Compare(const TObject* object) const;
a1546c3a 40
1ee5f2c7 41 /// whether or not the value we store are packed, e.g. as v = a*cste + b
42 virtual Bool_t IsPacked() const { return kFALSE; }
43
7bda16d5 44 /// j indices in following methods are valid from 0 to Dimension()-1.
45 virtual Int_t Dimension() const = 0;
a1546c3a 46
47 /** Set one value, for channel i, dimension j. Consider value is a double.
48 Only ok to use if IsDoublePrecision() is kTRUE.
49 */
50 virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value);
51
4db2bfee 52 /// Same as above but w/o bound checking
53 virtual void SetValueAsDoubleFast(Int_t i, Int_t j, Double_t value);
54
7bda16d5 55 /// Set one value, for channel i, dimension j. Consider value is a float.
56 virtual void SetValueAsFloat(Int_t i, Int_t j, Float_t value) = 0;
4db2bfee 57
58 /** Set one value, for channel i, dimension j. Consider value is a float.
59 Assume (i,j) are valid indices, i.e. do not check them.
60 */
61 virtual void SetValueAsFloatFast(Int_t i, Int_t j, Float_t value) = 0;
62
7bda16d5 63 /// Set one value, for channel i, dimension j. Consider value is an integer.
64 virtual void SetValueAsInt(Int_t i, Int_t j, Int_t value) = 0;
4db2bfee 65
66 /// Same as above but w/o bound checkings.
67 virtual void SetValueAsIntFast(Int_t i, Int_t j, Int_t value) = 0;
68
7bda16d5 69 /// The number of channels handled by this object.
70 virtual Int_t Size() const = 0;
71
a1546c3a 72 /// Whether we can store double precision values
73 virtual Bool_t IsDoublePrecision() const { return kFALSE; }
74
75 /** Retrieve the value for a given (channel,dim) as a double.
76 Only ok if IsDoublePrecision() is kTRUE.
4db2bfee 77 (i,j) are checked to within boundaries
a1546c3a 78 */
79 virtual Double_t ValueAsDouble(Int_t i, Int_t j=0) const;
80
4db2bfee 81 /** Retrieve the value for a given (channel,dim) as a double.
82 Only ok if IsDoublePrecision() is kTRUE.
83 Fast means there's no bound checking on (i,j)
84 */
85 virtual Double_t ValueAsDoubleFast(Int_t i, Int_t j=0) const;
7bda16d5 86
4db2bfee 87 /** Retrieve the value for a given (channel,dim) as a float, with
88 bound checking on (i,j).
89 */
90 virtual Float_t ValueAsFloat(Int_t i, Int_t j=0) const = 0;
91
92 /// Same as above but without bound checking.
93 virtual Float_t ValueAsFloatFast(Int_t i, Int_t j=0) const = 0;
94
95 /** Retrieve the value for a given (channel,dim) as an integer.
96 With bound checking.
97 */
7bda16d5 98 virtual Int_t ValueAsInt(Int_t i, Int_t j=0) const = 0;
99
4db2bfee 100 /// Same as above but w/o bound checking.
101 virtual Int_t ValueAsIntFast(Int_t i, Int_t j=0) const = 0;
102
1ee5f2c7 103 /// Unpack a value into a couple (a,b). Returns false if IsPacked()==kFALSE
104 virtual Bool_t UnpackValue(Int_t /*value*/, Int_t& /*a*/, Int_t& /*b*/) const { return kFALSE; }
105
106 /// Pack (a,b) as a single int. Returns false if IsPacked()==kFALSE
107 virtual Bool_t PackValues(Int_t /*a*/, Int_t /*b*/, Int_t& /*packedValue*/) const { return kFALSE; }
108
71a2d3aa 109 /// Return 1E38 as invalid float value
6c3ec718 110 static Float_t InvalidFloatValue() { return 1E38; }
a1546c3a 111
a1546c3a 112 static UInt_t BuildUniqueID(Int_t id0, Int_t id1);
113 static void DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1);
0045b488 114
115protected:
116
a1546c3a 117 static Int_t ID0(UInt_t uniqueID);
118 static Int_t ID1(UInt_t uniqueID);
6c3ec718 119
a1546c3a 120 ClassDef(AliMUONVCalibParam,0) // Base class for a calibration data holder (usually for 64 channels)
7bda16d5 121};
122
123#endif