variables initialized in the constructor
[u/mrichter/AliRoot.git] / PMD / AliPMDddlinfoData.cxx
CommitLineData
dc6dc1ff 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// Author :
17//
18#include "TNamed.h"
19#include "AliCDBEntry.h"
20#include "AliPMDddlinfoData.h"
21
22
23ClassImp(AliPMDddlinfoData)
24
25AliPMDddlinfoData::AliPMDddlinfoData()
26{
27 // Default constructor
28 Reset();
29}
30// ----------------------------------------------------------------- //
31AliPMDddlinfoData::AliPMDddlinfoData(const char* name)
32{
33 //constructor
34 TString namst = "Calib_";
35 namst += name;
36 SetName(namst.Data());
37 SetTitle(namst.Data());
38 Reset();
39
40}
41// ----------------------------------------------------------------- //
42AliPMDddlinfoData::AliPMDddlinfoData(const AliPMDddlinfoData& ddlinfoda) :
43 TNamed(ddlinfoda)
44{
45 // copy constructor
46 SetName(ddlinfoda.GetName());
47 SetTitle(ddlinfoda.GetName());
48 Reset();
49
50 for(Int_t iddl = 0; iddl < 6; iddl++)
51 {
52 fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
53 for(Int_t imod = 0; imod < 12; imod++)
54 {
55 fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
56 }
57 }
58 for(Int_t idet = 0; idet < 2; idet++)
59 {
60 for(Int_t ismn = 0; ismn < 24; ismn++)
61 {
62 fStartRowA[idet][ismn] = ddlinfoda.GetStartRowA(idet,ismn);
63 fStartRowB[idet][ismn] = ddlinfoda.GetStartRowB(idet,ismn);
64 fEndRowA[idet][ismn] = ddlinfoda.GetEndRowA(idet,ismn);
65 fEndRowB[idet][ismn] = ddlinfoda.GetEndRowB(idet,ismn);
66 fStartColA[idet][ismn] = ddlinfoda.GetStartColA(idet,ismn);
67 fStartColB[idet][ismn] = ddlinfoda.GetStartColB(idet,ismn);
68 fEndColA[idet][ismn] = ddlinfoda.GetEndColA(idet,ismn);
69 fEndColB[idet][ismn] = ddlinfoda.GetEndColB(idet,ismn);
70 }
71 }
72
73}
74// ----------------------------------------------------------------- //
75AliPMDddlinfoData &AliPMDddlinfoData::operator =(const AliPMDddlinfoData& ddlinfoda)
76{
77 //asignment operator
78 SetName(ddlinfoda.GetName());
79 SetTitle(ddlinfoda.GetName());
80 Reset();
81
82 for(Int_t iddl = 0; iddl < 6; iddl++)
83 {
84 fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
85 for(Int_t imod = 0; imod < 12; imod++)
86 {
87 fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
88 }
89 }
90 for(Int_t idet = 0; idet < 2; idet++)
91 {
92 for(Int_t ismn = 0; ismn < 24; ismn++)
93 {
94 fStartRowA[idet][ismn] = ddlinfoda.GetStartRowA(idet,ismn);
95 fStartRowB[idet][ismn] = ddlinfoda.GetStartRowB(idet,ismn);
96 fEndRowA[idet][ismn] = ddlinfoda.GetEndRowA(idet,ismn);
97 fEndRowB[idet][ismn] = ddlinfoda.GetEndRowB(idet,ismn);
98 fStartColA[idet][ismn] = ddlinfoda.GetStartColA(idet,ismn);
99 fStartColB[idet][ismn] = ddlinfoda.GetStartColB(idet,ismn);
100 fEndColA[idet][ismn] = ddlinfoda.GetEndColA(idet,ismn);
101 fEndColB[idet][ismn] = ddlinfoda.GetEndColB(idet,ismn);
102 }
103 }
104
105 return *this;
106}
107// ----------------------------------------------------------------- //
108AliPMDddlinfoData::~AliPMDddlinfoData()
109{
110 //destructor
111}
112// ----------------------------------------------------------------- //
113void AliPMDddlinfoData::Reset()
114{
115
116 for(Int_t iddl = 0; iddl < 6; iddl++)
117 {
118 fModules[iddl] = -1;
119 for(Int_t imod = 0; imod < 12; imod++)
120 {
121 fModuleNo[iddl][imod] = -1;
122 }
123 }
124 for(Int_t idet = 0; idet < 2; idet++)
125 {
126 for(Int_t ismn = 0; ismn < 24; ismn++)
127 {
128 fStartRowA[idet][ismn] = -1;
129 fStartRowB[idet][ismn] = -1;
130 fEndRowA[idet][ismn] = -1;
131 fEndRowB[idet][ismn] = -1;
132 fStartColA[idet][ismn] = -1;
133 fStartColB[idet][ismn] = -1;
134 fEndColA[idet][ismn] = -1;
135 fEndColB[idet][ismn] = -1;
136 }
137 }
138
139}
140// ----------------------------------------------------------------- //
141Int_t AliPMDddlinfoData:: GetNoOfModulePerDdl(Int_t iddl) const
142{
143 return fModules[iddl];
144}
145// ----------------------------------------------------------------- //
146Int_t AliPMDddlinfoData:: GetModulesPerDdl(Int_t iddl, Int_t imod) const
147{
148 return fModuleNo[iddl][imod];
149}
150// ----------------------------------------------------------------- //
151Int_t AliPMDddlinfoData:: GetStartRowA(Int_t idet, Int_t ismn) const
152{
153 return fStartRowA[idet][ismn];
154}
155// ----------------------------------------------------------------- //
156Int_t AliPMDddlinfoData:: GetStartRowB(Int_t idet, Int_t ismn) const
157{
158 return fStartRowB[idet][ismn];
159}
160// ----------------------------------------------------------------- //
161Int_t AliPMDddlinfoData:: GetEndRowA(Int_t idet, Int_t ismn) const
162{
163 return fEndRowA[idet][ismn];
164}
165// ----------------------------------------------------------------- //
166Int_t AliPMDddlinfoData:: GetEndRowB(Int_t idet, Int_t ismn) const
167{
168 return fEndRowB[idet][ismn];
169}
170// ----------------------------------------------------------------- //
171Int_t AliPMDddlinfoData:: GetStartColA(Int_t idet, Int_t ismn) const
172{
173 return fStartColA[idet][ismn];
174}
175// ----------------------------------------------------------------- //
176Int_t AliPMDddlinfoData:: GetStartColB(Int_t idet, Int_t ismn) const
177{
178 return fStartColB[idet][ismn];
179}
180// ----------------------------------------------------------------- //
181Int_t AliPMDddlinfoData:: GetEndColA(Int_t idet, Int_t ismn) const
182{
183 return fEndColA[idet][ismn];
184}
185// ----------------------------------------------------------------- //
186Int_t AliPMDddlinfoData:: GetEndColB(Int_t idet, Int_t ismn) const
187{
188 return fEndColB[idet][ismn];
189}
190// ----------------------------------------------------------------- //
191void AliPMDddlinfoData:: SetNoOfModulePerDdl(Int_t iddl, Int_t nmod)
192{
193 fModules[iddl] = nmod;
194}
195// ----------------------------------------------------------------- //
196void AliPMDddlinfoData:: SetModuleNoPerDdl(Int_t iddl, Int_t mod[])
197{
198 for(Int_t i = 0; i < 12; i++) fModuleNo[iddl][i] = mod[i];
199}
200// ----------------------------------------------------------------- //
201void AliPMDddlinfoData:: SetStartRowA(Int_t srowa[][24])
202{
203 for(Int_t idet = 0; idet < 2; idet++)
204 {
205 for(Int_t ismn = 0; ismn < 24; ismn++)
206 {
207 fStartRowA[idet][ismn] = srowa[idet][ismn];
208 }
209 }
210}
211// ----------------------------------------------------------------- //
212void AliPMDddlinfoData:: SetStartRowB(Int_t srowb[][24])
213{
214 for(Int_t idet = 0; idet < 2; idet++)
215 {
216 for(Int_t ismn = 0; ismn < 24; ismn++)
217 {
218 fStartRowB[idet][ismn] = srowb[idet][ismn];
219 }
220 }
221}
222// ----------------------------------------------------------------- //
223void AliPMDddlinfoData:: SetEndRowA(Int_t erowa[][24])
224{
225 for(Int_t idet = 0; idet < 2; idet++)
226 {
227 for(Int_t ismn = 0; ismn < 24; ismn++)
228 {
229 fEndRowA[idet][ismn] = erowa[idet][ismn];
230 }
231 }
232}
233// ----------------------------------------------------------------- //
234void AliPMDddlinfoData:: SetEndRowB(Int_t erowb[][24])
235{
236 for(Int_t idet = 0; idet < 2; idet++)
237 {
238 for(Int_t ismn = 0; ismn < 24; ismn++)
239 {
240 fEndRowB[idet][ismn] = erowb[idet][ismn];
241 }
242 }
243}
244// ----------------------------------------------------------------- //
245void AliPMDddlinfoData:: SetStartColA(Int_t scola[][24])
246{
247 for(Int_t idet = 0; idet < 2; idet++)
248 {
249 for(Int_t ismn = 0; ismn < 24; ismn++)
250 {
251 fStartColA[idet][ismn] = scola[idet][ismn];
252 }
253 }
254}
255// ----------------------------------------------------------------- //
256void AliPMDddlinfoData:: SetStartColB(Int_t scolb[][24])
257{
258 for(Int_t idet = 0; idet < 2; idet++)
259 {
260 for(Int_t ismn = 0; ismn < 24; ismn++)
261 {
262 fStartColB[idet][ismn] = scolb[idet][ismn];
263 }
264 }
265}
266// ----------------------------------------------------------------- //
267void AliPMDddlinfoData:: SetEndColA(Int_t ecola[][24])
268{
269 for(Int_t idet = 0; idet < 2; idet++)
270 {
271 for(Int_t ismn = 0; ismn < 24; ismn++)
272 {
273 fEndColA[idet][ismn] = ecola[idet][ismn];
274 }
275 }
276}
277// ----------------------------------------------------------------- //
278void AliPMDddlinfoData:: SetEndColB(Int_t ecolb[][24])
279{
280 for(Int_t idet = 0; idet < 2; idet++)
281 {
282 for(Int_t ismn = 0; ismn < 24; ismn++)
283 {
284 fEndColB[idet][ismn] = ecolb[idet][ismn];
285 }
286 }
287}
288// ----------------------------------------------------------------- //
289
290void AliPMDddlinfoData::Print(Option_t *) const
291{
292 printf("\n ######ddlinfo File for each ddl and patchbus ####\n");
293
294 for(Int_t iddl=0; iddl<6; iddl++)
295 {
296 printf("%d %d \n",iddl, fModules[iddl]);
297 for(Int_t imod = 0; imod < 12; imod++)
298 {
299 printf("%d \n",fModuleNo[iddl][imod]);
300 }
301 }
302
303 for(Int_t idet = 0; idet < 2; idet++)
304 {
305 for(Int_t ismn = 0; ismn < 24; ismn++)
306 {
307 printf("%d %d %d %d %d %d %d %d %d %d \n",idet, ismn,
308 fStartRowA[idet][ismn], fEndRowA[idet][ismn],
309 fStartColA[idet][ismn], fEndColA[idet][ismn],
310 fStartRowB[idet][ismn], fEndRowB[idet][ismn],
311 fStartColB[idet][ismn], fEndColB[idet][ismn]);
312 }
313 printf("\n");
314 }
315
316}