Line data Source code
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 "AliPMDMappingData.h"
21 :
22 :
23 12 : ClassImp(AliPMDMappingData)
24 :
25 3 : AliPMDMappingData::AliPMDMappingData()
26 15 : {
27 : // Default constructor
28 3 : Reset();
29 6 : }
30 : // ----------------------------------------------------------------- //
31 0 : AliPMDMappingData::AliPMDMappingData(const char* name)
32 0 : {
33 : //constructor
34 0 : TString namst = "Calib_";
35 0 : namst += name;
36 0 : SetName(namst.Data());
37 0 : SetTitle(namst.Data());
38 0 : Reset();
39 :
40 0 : }
41 : // ----------------------------------------------------------------- //
42 : AliPMDMappingData::AliPMDMappingData(const AliPMDMappingData& mapda) :
43 0 : TNamed(mapda)
44 0 : {
45 : // copy constructor
46 0 : SetName(mapda.GetName());
47 0 : SetTitle(mapda.GetName());
48 0 : Reset();
49 0 : for(Int_t iddl = 0; iddl < kDdl; iddl++)
50 : {
51 0 : for(Int_t imod = 0; imod < 48; imod++)
52 : {
53 0 : fBeginPatchBus[iddl][imod] = mapda.GetBeginPatchBus(iddl,imod);
54 0 : fEndPatchBus[iddl][imod] = mapda.GetEndPatchBus(iddl,imod);
55 : }
56 0 : for(Int_t ibus = 0; ibus < kBus; ibus++)
57 : {
58 0 : fModuleNo[iddl][ibus] = mapda.GetModuleNo(iddl,ibus);
59 0 : fMcmperBus[iddl][ibus] = mapda.GetMcmperBus(iddl,ibus);
60 0 : fStartRowBus[iddl][ibus] = mapda.GetStartRowBus(iddl,ibus);
61 0 : fEndRowBus[iddl][ibus] = mapda.GetEndRowBus(iddl,ibus);
62 0 : fStartColBus[iddl][ibus] = mapda.GetStartColBus(iddl,ibus);
63 0 : fEndColBus[iddl][ibus] = mapda.GetEndColBus(iddl,ibus);
64 : }
65 : }
66 :
67 0 : }
68 : // ----------------------------------------------------------------- //
69 : AliPMDMappingData &AliPMDMappingData::operator =(const AliPMDMappingData& mapda)
70 : {
71 : //asignment operator
72 0 : SetName(mapda.GetName());
73 0 : SetTitle(mapda.GetName());
74 0 : Reset();
75 :
76 0 : for(Int_t iddl = 0; iddl < kDdl; iddl++)
77 : {
78 0 : for(Int_t imod = 0; imod < 48; imod++)
79 : {
80 0 : fBeginPatchBus[iddl][imod] = mapda.GetBeginPatchBus(iddl,imod);
81 0 : fEndPatchBus[iddl][imod] = mapda.GetEndPatchBus(iddl,imod);
82 : }
83 0 : for(Int_t ibus = 0; ibus < kBus; ibus++)
84 : {
85 0 : fModuleNo[iddl][ibus] = mapda.GetModuleNo(iddl,ibus);
86 0 : fMcmperBus[iddl][ibus] = mapda.GetMcmperBus(iddl,ibus);
87 0 : fStartRowBus[iddl][ibus] = mapda.GetStartRowBus(iddl,ibus);
88 0 : fEndRowBus[iddl][ibus] = mapda.GetEndRowBus(iddl,ibus);
89 0 : fStartColBus[iddl][ibus] = mapda.GetStartColBus(iddl,ibus);
90 0 : fEndColBus[iddl][ibus] = mapda.GetEndColBus(iddl,ibus);
91 : }
92 : }
93 :
94 0 : return *this;
95 : }
96 : // ----------------------------------------------------------------- //
97 : AliPMDMappingData::~AliPMDMappingData()
98 0 : {
99 : //destructor
100 0 : }
101 : // ----------------------------------------------------------------- //
102 : void AliPMDMappingData::Reset()
103 : {
104 45 : for(Int_t i = 0; i < 6; i++)
105 : {
106 1764 : for(Int_t j = 0; j < 48; j++)
107 : {
108 864 : fBeginPatchBus[i][j] = -1;
109 864 : fEndPatchBus[i][j] = -1;
110 : }
111 : }
112 :
113 42 : for(Int_t iddl = 0; iddl < kDdl; iddl++)
114 : {
115 1872 : for(Int_t ibus = 0; ibus < kBus; ibus++)
116 : {
117 918 : fModuleNo[iddl][ibus] = -1;
118 918 : fMcmperBus[iddl][ibus] = -1;
119 918 : fStartRowBus[iddl][ibus] = -1;
120 918 : fEndRowBus[iddl][ibus] = -1;
121 918 : fStartColBus[iddl][ibus] = -1;
122 918 : fEndColBus[iddl][ibus] = -1;
123 : }
124 : }
125 :
126 3 : }
127 : // ----------------------------------------------------------------- //
128 : Int_t AliPMDMappingData:: GetBeginPatchBus(Int_t iddl, Int_t imod) const
129 : {
130 384 : return fBeginPatchBus[iddl][imod];
131 : }
132 : // ----------------------------------------------------------------- //
133 : Int_t AliPMDMappingData:: GetEndPatchBus(Int_t iddl, Int_t imod) const
134 : {
135 384 : return fEndPatchBus[iddl][imod];
136 : }
137 : // ----------------------------------------------------------------- //
138 : Int_t AliPMDMappingData:: GetModuleNo(Int_t iddl, Int_t ibus) const
139 : {
140 1600 : return fModuleNo[iddl][ibus];
141 : }
142 : // ----------------------------------------------------------------- //
143 : Int_t AliPMDMappingData:: GetMcmperBus(Int_t iddl, Int_t ibus) const
144 : {
145 3264 : return fMcmperBus[iddl][ibus];
146 : }
147 : // ----------------------------------------------------------------- //
148 : Int_t AliPMDMappingData:: GetStartRowBus(Int_t iddl, Int_t ibus) const
149 : {
150 3264 : return fStartRowBus[iddl][ibus];
151 : }
152 : // ----------------------------------------------------------------- //
153 : Int_t AliPMDMappingData:: GetEndRowBus(Int_t iddl, Int_t ibus) const
154 : {
155 3264 : return fEndRowBus[iddl][ibus];
156 : }
157 : // ----------------------------------------------------------------- //
158 : Int_t AliPMDMappingData:: GetStartColBus(Int_t iddl, Int_t ibus) const
159 : {
160 3264 : return fStartColBus[iddl][ibus];
161 : }
162 : // ----------------------------------------------------------------- //
163 : Int_t AliPMDMappingData:: GetEndColBus(Int_t iddl, Int_t ibus) const
164 : {
165 3264 : return fEndColBus[iddl][ibus];
166 : }
167 : // ----------------------------------------------------------------- //
168 : void AliPMDMappingData::SetPatchBus(Int_t iddl, Int_t imod,
169 : Int_t bpatchbus, Int_t epatchbus)
170 : {
171 0 : fBeginPatchBus[iddl][imod] = bpatchbus;
172 0 : fEndPatchBus[iddl][imod] = epatchbus;
173 0 : }
174 : // ----------------------------------------------------------------- //
175 : void AliPMDMappingData::SetModuleNo(Int_t iddl, Int_t ibus, Int_t modno)
176 : {
177 0 : fModuleNo[iddl][ibus] = modno;
178 0 : }
179 : // ----------------------------------------------------------------- //
180 : void AliPMDMappingData::SetMcmperBus(Int_t iddl, Int_t ibus, Int_t totmcm)
181 : {
182 0 : fMcmperBus[iddl][ibus] = totmcm;
183 0 : }
184 :
185 : // ----------------------------------------------------------------- //
186 : void AliPMDMappingData::SetRowBus(Int_t iddl,Int_t ibus,Int_t rows,Int_t rowe)
187 : {
188 0 : fStartRowBus[iddl][ibus] = rows;
189 0 : fEndRowBus[iddl][ibus] = rowe;
190 0 : }
191 :
192 : // ----------------------------------------------------------------- //
193 : void AliPMDMappingData::SetColBus(Int_t iddl,Int_t ibus,Int_t cols,Int_t cole)
194 : {
195 0 : fStartColBus[iddl][ibus] = cols;
196 0 : fEndColBus[iddl][ibus] = cole;
197 0 : }
198 : // ----------------------------------------------------------------- //
199 :
200 : void AliPMDMappingData::Print(Option_t *) const
201 : {
202 0 : printf("\n ######Mapping File for each ddl and patchbus ####\n");
203 :
204 :
205 0 : for(Int_t iddl = 0; iddl < kDdl; iddl++)
206 : {
207 0 : for(Int_t imod = 0; imod < 48; imod++)
208 : {
209 0 : printf("%d %d %d %d \n",iddl, imod, fBeginPatchBus[iddl][imod],
210 0 : fEndPatchBus[iddl][imod]);
211 : }
212 0 : for(Int_t ibus = 0; ibus < kBus; ibus++)
213 : {
214 0 : printf("%d %d %d %d %d %d %d %d\n",iddl, ibus,
215 0 : fModuleNo[iddl][ibus], fMcmperBus[iddl][ibus],
216 0 : fStartRowBus[iddl][ibus], fEndRowBus[iddl][ibus],
217 0 : fStartColBus[iddl][ibus], fEndColBus[iddl][ibus]);
218 : }
219 0 : printf("\n");
220 : }
221 :
222 0 : }
|