]>
Commit | Line | Data |
---|---|---|
54c3cb53 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ||
17 | /////////////////////////////////////////////////////////////////////////////// | |
18 | // // | |
19 | // TRD calibration class for TRD DCS GTU parameters // | |
20 | // // | |
21 | /////////////////////////////////////////////////////////////////////////////// | |
22 | ||
23 | #include "AliTRDCalDCSGTU.h" | |
24 | ||
25 | ClassImp(AliTRDCalDCSGTU) | |
26 | ||
27 | //_____________________________________________________________________________ | |
28 | AliTRDCalDCSGTU::AliTRDCalDCSGTU() | |
29 | :TNamed() | |
30 | ,fDCSID(0) | |
31 | ,fSMMask() | |
32 | ,fStackMask() | |
33 | ,fLinkMask() | |
34 | { | |
35 | // | |
36 | // AliTRDCalDCSGTU default constructor | |
37 | // | |
38 | ||
39 | // link not active: 0, link active: 1, bit not set: 2 | |
40 | for (Int_t i=0;i<18;i++) { | |
41 | fSMMask[i] = 2; | |
42 | for (Int_t j=0;j<5;j++) { | |
43 | fStackMask[i][j] = 2; | |
44 | for (Int_t k=0;k<12;k++) { | |
45 | fLinkMask[i][j][k] = 2; | |
46 | } | |
47 | } | |
48 | } | |
49 | ||
50 | } | |
51 | ||
52 | //_____________________________________________________________________________ | |
53 | AliTRDCalDCSGTU::AliTRDCalDCSGTU(const char *name, const char *title) | |
54 | :TNamed(name,title) | |
55 | ,fDCSID(0) | |
56 | ,fSMMask() | |
57 | ,fStackMask() | |
58 | ,fLinkMask() | |
59 | { | |
60 | // | |
61 | // AliTRDCalDCSGTU constructor | |
62 | // | |
63 | ||
64 | // link not active: 0, link active: 1, bit not set: 2 | |
65 | for(int i=0;i<18;i++) { | |
66 | fSMMask[i] = 2; | |
67 | for(int j=0;j<5;j++) { | |
68 | fStackMask[i][j] = 2; | |
69 | for(int k=0;k<12;k++) { | |
70 | fLinkMask[i][j][k] = 2; | |
71 | } | |
72 | } | |
73 | } | |
74 | ||
75 | } | |
76 | ||
77 | //_____________________________________________________________________________ | |
78 | Int_t AliTRDCalDCSGTU::SetSMMask(const char* smmask) | |
79 | { | |
80 | // if something goes wrong here, the errorcode is 10x | |
81 | TString smMaskStr = smmask; | |
82 | // return false in case of wrong length | |
83 | if (smMaskStr.Length() != 18) return 101; | |
84 | ||
85 | for (Int_t i=0;i<18;i++) { | |
86 | TString bit = smMaskStr[i]; | |
87 | if (!bit.IsDigit()) return 102; // must be 0 or 1 -> a digit! | |
88 | fSMMask[i] = bit.Atoi(); | |
89 | } | |
90 | return 0; | |
91 | } | |
92 | ||
93 | //_____________________________________________________________________________ | |
94 | Int_t AliTRDCalDCSGTU::SetLinkMask(Int_t smid, Int_t stid, const char* lkmask) | |
95 | { | |
96 | // if something goes wrong here, the errorcode is 11x | |
97 | if (smid == 99 || stid == 99) return 111; // 99: missing assignment | |
98 | ||
99 | TString lkMaskStr = lkmask; | |
100 | // return false in case of wrong length | |
101 | if (lkMaskStr.Length() != 12) return 112; | |
102 | ||
103 | for (Int_t i=0;i<12;i++) { | |
104 | TString bit = lkMaskStr[i]; | |
105 | if (!bit.IsDigit()) return 113; // must be 0 or 1 | |
106 | fLinkMask[smid][stid][i] = bit.Atoi(); | |
107 | } | |
108 | return 0; | |
109 | } | |
110 |