]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALBiasAPD.h
fix typo and cosmetics, indentations
[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 <TObjArray.h>
11 #include "AliEMCALGeoParams.h"
12 class TString;
13 class TTree;
14
15 /*
16   Objects of this class contain info on APD bias settings/voltages
17 */
18
19 // ******* internal class definition *************
20 // 1 SuperModule's worth of info
21 class AliEMCALSuperModuleBiasAPD : public TObject {
22  public:
23   AliEMCALSuperModuleBiasAPD(const int smNum=0) : TObject(), // just init values
24     fSuperModuleNum(smNum)
25     {
26       for (int icol=0; icol<AliEMCALGeoParams::fgkEMCALCols; icol++) {
27         for (int irow=0; irow<AliEMCALGeoParams::fgkEMCALRows; irow++) {
28           fElecId[icol][irow] = 0;
29           fDAC[icol][irow] = 0;
30           fVoltage[icol][irow] = 0;
31         }
32       }
33     }
34
35  public:
36   void SetSuperModuleNum(Int_t i) { fSuperModuleNum = i;}; // 
37   Int_t GetSuperModuleNum() const { return fSuperModuleNum;}; // 
38   void SetElecId(int icol, int irow, Int_t i) { fElecId[icol][irow] = i; }; //
39   Int_t GetElecId(int icol, int irow) const { return fElecId[icol][irow]; }; //
40   void SetDAC(int icol, int irow, Int_t i) { fDAC[icol][irow] = i; }; //
41   Int_t GetDAC(int icol, int irow) const { return fDAC[icol][irow]; }; //
42   void SetVoltage(int icol, int irow, Float_t f) { fVoltage[icol][irow] = f; }; //
43   Float_t GetVoltage(int icol, int irow) const { return fVoltage[icol][irow]; }; //
44
45  private:
46   Int_t fSuperModuleNum; // SM index
47   Int_t fElecId[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // ElectronicsIndex/Address - we keep this to help ensure that the column/row info matches with electronics indices
48   Int_t fDAC[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // 0-0x3ff register
49   Float_t fVoltage[AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]; // 210 to ca 417 V. (function of DAC setting)
50
51   ClassDef(AliEMCALSuperModuleBiasAPD, 2) // help class
52 };
53 // ******* end of internal class definition *************
54
55 class AliEMCALBiasAPD : public TObject {
56 public:
57   AliEMCALBiasAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules);
58
59   // Read and Write txt I/O methods are normally not used, but are useful for 
60   // filling the object before it is saved in OCDB 
61   void ReadTextBiasAPDInfo(Int_t nSM, const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
62   void WriteTextBiasAPDInfo(const TString &txtFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
63   void ReadRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
64   void ReadTreeBiasAPDInfo(TTree *tree, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
65   void WriteRootBiasAPDInfo(const TString &rootFileName, Bool_t swapSides=kFALSE); // info file is for nSm=1 to fgkEMCALModules
66
67   virtual ~AliEMCALBiasAPD();
68
69   // pointer to stored info.
70   Int_t GetNSuperModule() const { return fNSuperModule; }; 
71
72   // - via the index in the stored array:
73   virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDId(Int_t smIndex) const
74     { return (AliEMCALSuperModuleBiasAPD*) fSuperModuleData[smIndex]; };
75
76   // - or via the actual SM number
77   virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDNum(Int_t smNum) const;
78
79 protected:
80
81   Int_t           fNSuperModule; // Number of supermodules.
82   TObjArray fSuperModuleData; // SuperModule data
83
84 private:
85
86   AliEMCALBiasAPD(const AliEMCALBiasAPD &);
87   AliEMCALBiasAPD &operator = (const AliEMCALBiasAPD &);
88
89   ClassDef(AliEMCALBiasAPD, 3) //BiasAPD data info
90 };
91
92 #endif