]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONVCalibParam.h
Generation of generic AOD by the test script of MUON
[u/mrichter/AliRoot.git] / MUON / AliMUONVCalibParam.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice                               */
3
4 // $Id$
5
6 /// \ingroup calib
7 /// \class AliMUONVCalibParam
8 /// \brief Container of calibration values for a given number of channels.
9 /// 
10 //  Author Laurent Aphecetche
11
12 #ifndef ALIMUONVCALIBPARAM_H
13 #define ALIMUONVCALIBPARAM_H
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18
19 class AliMUONVCalibParam : public TObject
20 {
21 public:
22   AliMUONVCalibParam();
23   //AliMUONVCalibParam(Int_t id0);
24   AliMUONVCalibParam(Int_t id0, Int_t id1);
25   virtual ~AliMUONVCalibParam();
26
27   virtual const char* GetName() const;
28   
29   /// First id of this object
30   virtual Int_t ID0() const;
31   
32   /// Second id of this object (might not be required)
33   virtual Int_t ID1() const;
34   
35   /// whether or not the value we store are packed, e.g. as v = a*cste + b
36   virtual Bool_t IsPacked() const { return kFALSE; }
37   
38   /// j indices in following methods are valid from 0 to Dimension()-1.
39   virtual Int_t Dimension() const = 0;
40
41   /** Set one value, for channel i, dimension j. Consider value is a double.
42     Only ok to use if IsDoublePrecision() is kTRUE.
43     */
44   virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value);
45
46   /// Set one value, for channel i, dimension j. Consider value is a float.
47   virtual void SetValueAsFloat(Int_t i, Int_t j, Float_t value) = 0;
48   
49   /// Set one value, for channel i, dimension j. Consider value is an integer.
50   virtual void SetValueAsInt(Int_t i, Int_t j, Int_t value) = 0;
51   
52   /// The number of channels handled by this object.
53   virtual Int_t Size() const = 0;
54
55   /// Whether we can store double precision values   
56   virtual Bool_t IsDoublePrecision() const { return kFALSE; }
57   
58   /** Retrieve the value for a given (channel,dim) as a double.
59       Only ok if IsDoublePrecision() is kTRUE.
60     */
61   virtual Double_t ValueAsDouble(Int_t i, Int_t j=0) const;
62
63   /// Retrieve the value for a given (channel,dim) as a float.
64   virtual Float_t ValueAsFloat(Int_t i, Int_t j=0) const = 0;
65   
66   /// Retrieve the value for a given (channel,dim) as an integer.
67   virtual Int_t ValueAsInt(Int_t i, Int_t j=0) const = 0;
68
69   /// Unpack a value into a couple (a,b). Returns false if IsPacked()==kFALSE
70   virtual Bool_t UnpackValue(Int_t /*value*/, Int_t& /*a*/, Int_t& /*b*/) const { return kFALSE; }
71   
72   /// Pack (a,b) as a single int. Returns false if IsPacked()==kFALSE
73   virtual Bool_t PackValues(Int_t /*a*/, Int_t /*b*/, Int_t& /*packedValue*/) const { return kFALSE; }
74   
75   /// Return 1E38 as invalid float value
76   static Float_t InvalidFloatValue() { return 1E38; }
77
78 protected:
79     
80   static UInt_t BuildUniqueID(Int_t id0, Int_t id1);
81   static void DecodeUniqueID(UInt_t uniqueID, Int_t& id0, Int_t& id1);
82   static Int_t ID0(UInt_t uniqueID);
83   static Int_t ID1(UInt_t uniqueID);
84   
85   ClassDef(AliMUONVCalibParam,0) // Base class for a calibration data holder (usually for 64 channels)
86 };
87
88 #endif