1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 #include "AliCDBEntry.h"
20 #include "AliPMDddlinfoData.h"
23 ClassImp(AliPMDddlinfoData)
25 AliPMDddlinfoData::AliPMDddlinfoData()
27 // Default constructor
30 // ----------------------------------------------------------------- //
31 AliPMDddlinfoData::AliPMDddlinfoData(const char* name)
34 TString namst = "Calib_";
36 SetName(namst.Data());
37 SetTitle(namst.Data());
41 // ----------------------------------------------------------------- //
42 AliPMDddlinfoData::AliPMDddlinfoData(const AliPMDddlinfoData& ddlinfoda) :
46 SetName(ddlinfoda.GetName());
47 SetTitle(ddlinfoda.GetName());
50 for(Int_t iddl = 0; iddl < 6; iddl++)
52 fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
53 for(Int_t imod = 0; imod < 12; imod++)
55 fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
58 for(Int_t idet = 0; idet < 2; idet++)
60 for(Int_t ismn = 0; ismn < 24; ismn++)
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);
74 // ----------------------------------------------------------------- //
75 AliPMDddlinfoData &AliPMDddlinfoData::operator =(const AliPMDddlinfoData& ddlinfoda)
78 SetName(ddlinfoda.GetName());
79 SetTitle(ddlinfoda.GetName());
82 for(Int_t iddl = 0; iddl < 6; iddl++)
84 fModules[iddl] = ddlinfoda.GetNoOfModulePerDdl(iddl);
85 for(Int_t imod = 0; imod < 12; imod++)
87 fModuleNo[iddl][imod] = ddlinfoda.GetModulesPerDdl(iddl,imod);
90 for(Int_t idet = 0; idet < 2; idet++)
92 for(Int_t ismn = 0; ismn < 24; ismn++)
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);
107 // ----------------------------------------------------------------- //
108 AliPMDddlinfoData::~AliPMDddlinfoData()
112 // ----------------------------------------------------------------- //
113 void AliPMDddlinfoData::Reset()
116 for(Int_t iddl = 0; iddl < 6; iddl++)
119 for(Int_t imod = 0; imod < 12; imod++)
121 fModuleNo[iddl][imod] = -1;
124 for(Int_t idet = 0; idet < 2; idet++)
126 for(Int_t ismn = 0; ismn < 24; ismn++)
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;
140 // ----------------------------------------------------------------- //
141 Int_t AliPMDddlinfoData:: GetNoOfModulePerDdl(Int_t iddl) const
143 return fModules[iddl];
145 // ----------------------------------------------------------------- //
146 Int_t AliPMDddlinfoData:: GetModulesPerDdl(Int_t iddl, Int_t imod) const
148 return fModuleNo[iddl][imod];
150 // ----------------------------------------------------------------- //
151 Int_t AliPMDddlinfoData:: GetStartRowA(Int_t idet, Int_t ismn) const
153 return fStartRowA[idet][ismn];
155 // ----------------------------------------------------------------- //
156 Int_t AliPMDddlinfoData:: GetStartRowB(Int_t idet, Int_t ismn) const
158 return fStartRowB[idet][ismn];
160 // ----------------------------------------------------------------- //
161 Int_t AliPMDddlinfoData:: GetEndRowA(Int_t idet, Int_t ismn) const
163 return fEndRowA[idet][ismn];
165 // ----------------------------------------------------------------- //
166 Int_t AliPMDddlinfoData:: GetEndRowB(Int_t idet, Int_t ismn) const
168 return fEndRowB[idet][ismn];
170 // ----------------------------------------------------------------- //
171 Int_t AliPMDddlinfoData:: GetStartColA(Int_t idet, Int_t ismn) const
173 return fStartColA[idet][ismn];
175 // ----------------------------------------------------------------- //
176 Int_t AliPMDddlinfoData:: GetStartColB(Int_t idet, Int_t ismn) const
178 return fStartColB[idet][ismn];
180 // ----------------------------------------------------------------- //
181 Int_t AliPMDddlinfoData:: GetEndColA(Int_t idet, Int_t ismn) const
183 return fEndColA[idet][ismn];
185 // ----------------------------------------------------------------- //
186 Int_t AliPMDddlinfoData:: GetEndColB(Int_t idet, Int_t ismn) const
188 return fEndColB[idet][ismn];
190 // ----------------------------------------------------------------- //
191 void AliPMDddlinfoData:: SetNoOfModulePerDdl(Int_t iddl, Int_t nmod)
193 fModules[iddl] = nmod;
195 // ----------------------------------------------------------------- //
196 void AliPMDddlinfoData:: SetModuleNoPerDdl(Int_t iddl, Int_t mod[])
198 for(Int_t i = 0; i < 12; i++) fModuleNo[iddl][i] = mod[i];
200 // ----------------------------------------------------------------- //
201 void AliPMDddlinfoData:: SetStartRowA(Int_t srowa[][24])
203 for(Int_t idet = 0; idet < 2; idet++)
205 for(Int_t ismn = 0; ismn < 24; ismn++)
207 fStartRowA[idet][ismn] = srowa[idet][ismn];
211 // ----------------------------------------------------------------- //
212 void AliPMDddlinfoData:: SetStartRowB(Int_t srowb[][24])
214 for(Int_t idet = 0; idet < 2; idet++)
216 for(Int_t ismn = 0; ismn < 24; ismn++)
218 fStartRowB[idet][ismn] = srowb[idet][ismn];
222 // ----------------------------------------------------------------- //
223 void AliPMDddlinfoData:: SetEndRowA(Int_t erowa[][24])
225 for(Int_t idet = 0; idet < 2; idet++)
227 for(Int_t ismn = 0; ismn < 24; ismn++)
229 fEndRowA[idet][ismn] = erowa[idet][ismn];
233 // ----------------------------------------------------------------- //
234 void AliPMDddlinfoData:: SetEndRowB(Int_t erowb[][24])
236 for(Int_t idet = 0; idet < 2; idet++)
238 for(Int_t ismn = 0; ismn < 24; ismn++)
240 fEndRowB[idet][ismn] = erowb[idet][ismn];
244 // ----------------------------------------------------------------- //
245 void AliPMDddlinfoData:: SetStartColA(Int_t scola[][24])
247 for(Int_t idet = 0; idet < 2; idet++)
249 for(Int_t ismn = 0; ismn < 24; ismn++)
251 fStartColA[idet][ismn] = scola[idet][ismn];
255 // ----------------------------------------------------------------- //
256 void AliPMDddlinfoData:: SetStartColB(Int_t scolb[][24])
258 for(Int_t idet = 0; idet < 2; idet++)
260 for(Int_t ismn = 0; ismn < 24; ismn++)
262 fStartColB[idet][ismn] = scolb[idet][ismn];
266 // ----------------------------------------------------------------- //
267 void AliPMDddlinfoData:: SetEndColA(Int_t ecola[][24])
269 for(Int_t idet = 0; idet < 2; idet++)
271 for(Int_t ismn = 0; ismn < 24; ismn++)
273 fEndColA[idet][ismn] = ecola[idet][ismn];
277 // ----------------------------------------------------------------- //
278 void AliPMDddlinfoData:: SetEndColB(Int_t ecolb[][24])
280 for(Int_t idet = 0; idet < 2; idet++)
282 for(Int_t ismn = 0; ismn < 24; ismn++)
284 fEndColB[idet][ismn] = ecolb[idet][ismn];
288 // ----------------------------------------------------------------- //
290 void AliPMDddlinfoData::Print(Option_t *) const
292 printf("\n ######ddlinfo File for each ddl and patchbus ####\n");
294 for(Int_t iddl=0; iddl<6; iddl++)
296 printf("%d %d \n",iddl, fModules[iddl]);
297 for(Int_t imod = 0; imod < 12; imod++)
299 printf("%d \n",fModuleNo[iddl][imod]);
303 for(Int_t idet = 0; idet < 2; idet++)
305 for(Int_t ismn = 0; ismn < 24; ismn++)
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]);