]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALBiasAPD.h
intermediate calibration class commit: struct changed to classes and added root i/o
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALBiasAPD.h
1 #ifndef ALIEMCALBIASAPD_H
2 #define ALIEMCALBIASAPD_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id: $ */
8
9 #include <TObject.h>
10 #include "AliEMCALGeoParams.h"
11 class TString;
12 class TTree;
13
14 /*
15   Objects of this class contain info on APD bias settings/voltages
16 */
17
18 // ******* internal class definition *************
19 // 1 SuperModule's worth of info
20 class AliEMCALSuperModuleBiasAPD : public TObject {
21  public:
22   AliEMCALSuperModuleBiasAPD() : TObject(), // just init values
23     fSuperModuleNum(0)
24     {
25       for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
26         for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
27           fElecId[icol][irow] = 0;
28           fDAC[icol][irow] = 0;
29           fVoltage[icol][irow] = 0;
30         }
31       }
32     }
33
34  public:
35   Int_t fSuperModuleNum; // SM index
36   Int_t fElecId[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // ElectronicsIndex/Address - we keep this to help ensure that the column/row info matches with electronics indices
37   Int_t fDAC[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // 0-0x3ff register
38   Float_t fVoltage[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // 210 to ca 417 V. (function of DAC setting)
39
40   ClassDef(AliEMCALSuperModuleBiasAPD, 1) // help class
41 };
42 // ******* end of internal class definition *************
43
44 class AliEMCALBiasAPD : public TObject {
45 public:
46   AliEMCALBiasAPD();
47
48   // Read and Write txt I/O methods are normally not used, but are useful for 
49   // filling the object before it is saved in OCDB 
50   void ReadTextBiasAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
51   void WriteTextBiasAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
52   void ReadRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
53   void ReadTreeBiasAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
54   void WriteRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to 12 SuperModules
55
56   virtual ~AliEMCALBiasAPD();
57
58   // pointer to stored info.
59   Int_t GetNSuperModule() const { return fNSuperModule; }; 
60   AliEMCALSuperModuleBiasAPD * GetSuperModuleData() const { return fSuperModuleData; };
61
62   // - via the index in the stored array:
63   virtual AliEMCALSuperModuleBiasAPD GetSuperModuleBiasAPDId(Int_t smIndex) const;
64   // - or via the actual SM number
65   virtual AliEMCALSuperModuleBiasAPD GetSuperModuleBiasAPDNum(Int_t smNum) const;
66
67 protected:
68
69   Int_t           fNSuperModule; // Number of supermodules.
70   AliEMCALSuperModuleBiasAPD *fSuperModuleData; // SuperModule data
71
72 private:
73
74   AliEMCALBiasAPD(const AliEMCALBiasAPD &);
75   AliEMCALBiasAPD &operator = (const AliEMCALBiasAPD &);
76
77   ClassDef(AliEMCALBiasAPD, 2) //BiasAPD data reader
78 };
79
80 #endif