]>
Commit | Line | Data |
---|---|---|
d81e6423 | 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> | |
2f17a269 | 10 | #include <TObjArray.h> |
d81e6423 | 11 | #include "AliEMCALGeoParams.h" |
12 | class TString; | |
61917ab3 | 13 | class TTree; |
d81e6423 | 14 | |
15 | /* | |
61917ab3 | 16 | Objects of this class contain info on APD bias settings/voltages |
d81e6423 | 17 | */ |
18 | ||
61917ab3 | 19 | // ******* internal class definition ************* |
20 | // 1 SuperModule's worth of info | |
21 | class AliEMCALSuperModuleBiasAPD : public TObject { | |
22 | public: | |
2f17a269 | 23 | AliEMCALSuperModuleBiasAPD(const int smNum=0) : TObject(), // just init values |
24 | fSuperModuleNum(smNum) | |
61917ab3 | 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: | |
2f17a269 | 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: | |
61917ab3 | 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 | ||
2f17a269 | 51 | ClassDef(AliEMCALSuperModuleBiasAPD, 2) // help class |
61917ab3 | 52 | }; |
53 | // ******* end of internal class definition ************* | |
54 | ||
d81e6423 | 55 | class AliEMCALBiasAPD : public TObject { |
56 | public: | |
2f17a269 | 57 | AliEMCALBiasAPD(const int nSM = AliEMCALGeoParams::fgkEMCALModules); |
d81e6423 | 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 | |
c0625581 | 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 | |
d81e6423 | 66 | |
67 | virtual ~AliEMCALBiasAPD(); | |
68 | ||
d81e6423 | 69 | // pointer to stored info. |
70 | Int_t GetNSuperModule() const { return fNSuperModule; }; | |
d81e6423 | 71 | |
72 | // - via the index in the stored array: | |
2f17a269 | 73 | virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDId(Int_t smIndex) const |
74 | { return (AliEMCALSuperModuleBiasAPD*) fSuperModuleData[smIndex]; }; | |
75 | ||
d81e6423 | 76 | // - or via the actual SM number |
2f17a269 | 77 | virtual AliEMCALSuperModuleBiasAPD * GetSuperModuleBiasAPDNum(Int_t smNum) const; |
d81e6423 | 78 | |
79 | protected: | |
80 | ||
81 | Int_t fNSuperModule; // Number of supermodules. | |
2f17a269 | 82 | TObjArray fSuperModuleData; // SuperModule data |
d81e6423 | 83 | |
84 | private: | |
85 | ||
86 | AliEMCALBiasAPD(const AliEMCALBiasAPD &); | |
87 | AliEMCALBiasAPD &operator = (const AliEMCALBiasAPD &); | |
88 | ||
2f17a269 | 89 | ClassDef(AliEMCALBiasAPD, 3) //BiasAPD data info |
d81e6423 | 90 | }; |
91 | ||
92 | #endif |