]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCalDCSGTU.cxx
Include informations from rstate module
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalDCSGTU.cxx
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 /* $Id: AliTRDCalDCSGTU.cxx 18952 2007-06-08 11:36:12Z cblume $ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  TRD calibration class for TRD DCS GTU parameters                         //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliTRDCalDCSGTU.h"
25
26 ClassImp(AliTRDCalDCSGTU)
27
28 //_____________________________________________________________________________
29 AliTRDCalDCSGTU::AliTRDCalDCSGTU()
30   :TNamed()
31   ,fDCSID(0)
32   ,fSMMask()
33   ,fStackMask()
34   ,fLinkMask()
35 {
36   //
37   // AliTRDCalDCSGTU default constructor
38   //
39
40   // link not active: 0, link active: 1, bit not set: 2
41   for (Int_t i=0;i<18;i++) {
42     fSMMask[i] = 2;
43     for (Int_t j=0;j<5;j++) {
44       fStackMask[i][j] = 2;
45       for (Int_t k=0;k<12;k++) {
46         fLinkMask[i][j][k] = 2;
47       }
48     }
49   }
50
51 }
52
53 //_____________________________________________________________________________
54 AliTRDCalDCSGTU::AliTRDCalDCSGTU(const char *name, const char *title)
55   :TNamed(name,title)
56   ,fDCSID(0)
57   ,fSMMask()
58   ,fStackMask()
59   ,fLinkMask()
60 {
61   //
62   // AliTRDCalDCSGTU constructor
63   //
64
65   // link not active: 0, link active: 1, bit not set: 2
66   for(int i=0;i<18;i++) {
67     fSMMask[i] = 2;
68     for(int j=0;j<5;j++) {
69       fStackMask[i][j] = 2;
70       for(int k=0;k<12;k++) {
71         fLinkMask[i][j][k] = 2;
72       }
73     }
74   }
75
76 }
77
78 //_____________________________________________________________________________
79 Int_t AliTRDCalDCSGTU::SetSMMask(const char* smmask)
80 {
81   // if something goes wrong here, the errorcode is 10x
82   TString smMaskStr = smmask;
83   // return false in case of wrong length
84   if (smMaskStr.Length() != 18) return 101;
85
86   for (Int_t i=0;i<18;i++) {
87     TString bit = smMaskStr[i];
88     if (!bit.IsDigit()) return 102; // must be 0 or 1 -> a digit!
89     fSMMask[i] = bit.Atoi();
90   }
91   return 0;
92 }
93
94 //_____________________________________________________________________________
95 Int_t AliTRDCalDCSGTU::SetLinkMask(Int_t smid, Int_t stid, const char* lkmask)
96 {
97   // if something goes wrong here, the errorcode is 11x
98   if (smid == 99 || stid == 99) return 111; // 99: missing assignment
99
100   TString lkMaskStr = lkmask;
101   // return false in case of wrong length
102   if (lkMaskStr.Length() != 12) return 112;
103
104   for (Int_t i=0;i<12;i++) {
105     TString bit = lkMaskStr[i];
106     if (!bit.IsDigit()) return 113; // must be 0 or 1
107     fLinkMask[smid][stid][i] = bit.Atoi();
108   }
109   return 0;
110 }
111