initialisation warning fixed
[u/mrichter/AliRoot.git] / PMD / AliPMDMappingData.cxx
CommitLineData
c3217637 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
23ClassImp(AliPMDMappingData)
24
25AliPMDMappingData::AliPMDMappingData()
26{
27 // Default constructor
28 Reset();
29}
30// ----------------------------------------------------------------- //
31AliPMDMappingData::AliPMDMappingData(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// ----------------------------------------------------------------- //
42AliPMDMappingData::AliPMDMappingData(const AliPMDMappingData& mapda) :
43 TNamed(mapda)
44{
45 // copy constructor
46 SetName(mapda.GetName());
47 SetTitle(mapda.GetName());
48 Reset();
49 for(Int_t iddl = 0; iddl < kDdl; iddl++)
50 {
51 for(Int_t ibus = 0; ibus < kBus; ibus++)
52 {
53 fModuleNo[iddl][ibus]=
54 mapda.GetModuleNo(iddl,ibus);
55 }
56 }
57
58}
59// ----------------------------------------------------------------- //
60AliPMDMappingData &AliPMDMappingData::operator =(const AliPMDMappingData& mapda)
61{
62 //asignment operator
63 SetName(mapda.GetName());
64 SetTitle(mapda.GetName());
65 Reset();
66
67 for(Int_t iddl = 0; iddl < kDdl; iddl++)
68 {
69 for(Int_t ibus = 0; ibus < kBus; ibus++)
70 {
71 fModuleNo[iddl][ibus]=
72 mapda.GetModuleNo(iddl,ibus);
73 }
74 }
75
76 return *this;
77}
78// ----------------------------------------------------------------- //
79AliPMDMappingData::~AliPMDMappingData()
80{
81 //destructor
82}
83// ----------------------------------------------------------------- //
84void AliPMDMappingData::Reset()
85{
86
87 for(Int_t iddl = 0; iddl < kDdl; iddl++)
88 {
89 for(Int_t ibus = 0; ibus < kBus; ibus++)
90 {
91 fModuleNo[iddl][ibus] = -1;
92 fMcmperBus[iddl][ibus] = -1;
93 fStartRowBus[iddl][ibus] = -1;
94 fEndRowBus[iddl][ibus] = -1;
95 fStartColBus[iddl][ibus] = -1;
96 fEndColBus[iddl][ibus] = -1;
97 }
98 }
99
100}
101// ----------------------------------------------------------------- //
102Int_t AliPMDMappingData:: GetModuleNo(Int_t iddl, Int_t ibus) const
103{
104 return fModuleNo[iddl][ibus];
105}
106// ----------------------------------------------------------------- //
107Int_t AliPMDMappingData:: GetMcmperBus(Int_t iddl, Int_t ibus) const
108{
109 return fMcmperBus[iddl][ibus];
110}
111// ----------------------------------------------------------------- //
112Int_t AliPMDMappingData:: GetStartRowBus(Int_t iddl, Int_t ibus) const
113{
114 return fStartRowBus[iddl][ibus];
115}
116// ----------------------------------------------------------------- //
117Int_t AliPMDMappingData:: GetEndRowBus(Int_t iddl, Int_t ibus) const
118{
119 return fEndRowBus[iddl][ibus];
120}
121// ----------------------------------------------------------------- //
122Int_t AliPMDMappingData:: GetStartColBus(Int_t iddl, Int_t ibus) const
123{
124 return fStartColBus[iddl][ibus];
125}
126// ----------------------------------------------------------------- //
127Int_t AliPMDMappingData:: GetEndColBus(Int_t iddl, Int_t ibus) const
128{
129 return fEndColBus[iddl][ibus];
130}
131// ----------------------------------------------------------------- //
132void AliPMDMappingData::SetModuleNo(Int_t iddl, Int_t ibus, Int_t modno)
133{
134 fModuleNo[iddl][ibus] = modno;
135}
136// ----------------------------------------------------------------- //
137void AliPMDMappingData::SetMcmperBus(Int_t iddl, Int_t ibus, Int_t totmcm)
138{
139 fMcmperBus[iddl][ibus] = totmcm;
140}
141
142// ----------------------------------------------------------------- //
143void AliPMDMappingData::SetRowBus(Int_t iddl,Int_t ibus,Int_t rows,Int_t rowe)
144{
145 fStartRowBus[iddl][ibus] = rows;
146 fEndRowBus[iddl][ibus] = rowe;
147}
148
149// ----------------------------------------------------------------- //
150void AliPMDMappingData::SetColBus(Int_t iddl,Int_t ibus,Int_t cols,Int_t cole)
151{
152 fStartColBus[iddl][ibus] = cols;
153 fEndColBus[iddl][ibus] = cole;
154}
155// ----------------------------------------------------------------- //
156
157void AliPMDMappingData::Print(Option_t *) const
158{
159 printf("\n ######Mapping File for each ddl and patchbus ####\n");
160
161
162 for(Int_t iddl = 0; iddl < kDdl; iddl++)
163 {
164 for(Int_t ibus = 0; ibus < kBus; ibus++)
165 {
166 printf("%d %d %d %d %d %d %d %d\n",iddl, ibus,
167 fModuleNo[iddl][ibus], fMcmperBus[iddl][ibus],
168 fStartRowBus[iddl][ibus], fEndRowBus[iddl][ibus],
169 fStartColBus[iddl][ibus], fEndColBus[iddl][ibus]);
170 }
171 printf("\n");
172 }
173
174}