]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDMappingData.cxx
Adding helper functions to define 2012 pp data PS and online trigger selection
[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 {
ab0cde47 51 for(Int_t imod = 0; imod < 48; imod++)
52 {
53 fBeginPatchBus[iddl][imod] = mapda.GetBeginPatchBus(iddl,imod);
54 fEndPatchBus[iddl][imod] = mapda.GetEndPatchBus(iddl,imod);
55 }
c3217637 56 for(Int_t ibus = 0; ibus < kBus; ibus++)
57 {
ab0cde47 58 fModuleNo[iddl][ibus] = mapda.GetModuleNo(iddl,ibus);
59 fMcmperBus[iddl][ibus] = mapda.GetMcmperBus(iddl,ibus);
60 fStartRowBus[iddl][ibus] = mapda.GetStartRowBus(iddl,ibus);
61 fEndRowBus[iddl][ibus] = mapda.GetEndRowBus(iddl,ibus);
62 fStartColBus[iddl][ibus] = mapda.GetStartColBus(iddl,ibus);
63 fEndColBus[iddl][ibus] = mapda.GetEndColBus(iddl,ibus);
c3217637 64 }
65 }
66
67}
68// ----------------------------------------------------------------- //
69AliPMDMappingData &AliPMDMappingData::operator =(const AliPMDMappingData& mapda)
70{
71 //asignment operator
72 SetName(mapda.GetName());
73 SetTitle(mapda.GetName());
74 Reset();
75
76 for(Int_t iddl = 0; iddl < kDdl; iddl++)
77 {
ab0cde47 78 for(Int_t imod = 0; imod < 48; imod++)
79 {
80 fBeginPatchBus[iddl][imod] = mapda.GetBeginPatchBus(iddl,imod);
81 fEndPatchBus[iddl][imod] = mapda.GetEndPatchBus(iddl,imod);
82 }
c3217637 83 for(Int_t ibus = 0; ibus < kBus; ibus++)
84 {
ab0cde47 85 fModuleNo[iddl][ibus] = mapda.GetModuleNo(iddl,ibus);
86 fMcmperBus[iddl][ibus] = mapda.GetMcmperBus(iddl,ibus);
87 fStartRowBus[iddl][ibus] = mapda.GetStartRowBus(iddl,ibus);
88 fEndRowBus[iddl][ibus] = mapda.GetEndRowBus(iddl,ibus);
89 fStartColBus[iddl][ibus] = mapda.GetStartColBus(iddl,ibus);
90 fEndColBus[iddl][ibus] = mapda.GetEndColBus(iddl,ibus);
c3217637 91 }
92 }
93
94 return *this;
95}
96// ----------------------------------------------------------------- //
97AliPMDMappingData::~AliPMDMappingData()
98{
99 //destructor
100}
101// ----------------------------------------------------------------- //
102void AliPMDMappingData::Reset()
103{
ab0cde47 104 for(Int_t i = 0; i < 6; i++)
105 {
106 for(Int_t j = 0; j < 48; j++)
107 {
108 fBeginPatchBus[i][j] = -1;
109 fEndPatchBus[i][j] = -1;
110 }
111 }
c3217637 112
113 for(Int_t iddl = 0; iddl < kDdl; iddl++)
114 {
115 for(Int_t ibus = 0; ibus < kBus; ibus++)
116 {
117 fModuleNo[iddl][ibus] = -1;
118 fMcmperBus[iddl][ibus] = -1;
119 fStartRowBus[iddl][ibus] = -1;
120 fEndRowBus[iddl][ibus] = -1;
121 fStartColBus[iddl][ibus] = -1;
122 fEndColBus[iddl][ibus] = -1;
123 }
124 }
125
126}
127// ----------------------------------------------------------------- //
ab0cde47 128Int_t AliPMDMappingData:: GetBeginPatchBus(Int_t iddl, Int_t imod) const
129{
130 return fBeginPatchBus[iddl][imod];
131}
132// ----------------------------------------------------------------- //
133Int_t AliPMDMappingData:: GetEndPatchBus(Int_t iddl, Int_t imod) const
134{
135 return fEndPatchBus[iddl][imod];
136}
137// ----------------------------------------------------------------- //
c3217637 138Int_t AliPMDMappingData:: GetModuleNo(Int_t iddl, Int_t ibus) const
139{
140 return fModuleNo[iddl][ibus];
141}
142// ----------------------------------------------------------------- //
143Int_t AliPMDMappingData:: GetMcmperBus(Int_t iddl, Int_t ibus) const
144{
145 return fMcmperBus[iddl][ibus];
146}
147// ----------------------------------------------------------------- //
148Int_t AliPMDMappingData:: GetStartRowBus(Int_t iddl, Int_t ibus) const
149{
150 return fStartRowBus[iddl][ibus];
151}
152// ----------------------------------------------------------------- //
153Int_t AliPMDMappingData:: GetEndRowBus(Int_t iddl, Int_t ibus) const
154{
155 return fEndRowBus[iddl][ibus];
156}
157// ----------------------------------------------------------------- //
158Int_t AliPMDMappingData:: GetStartColBus(Int_t iddl, Int_t ibus) const
159{
160 return fStartColBus[iddl][ibus];
161}
162// ----------------------------------------------------------------- //
163Int_t AliPMDMappingData:: GetEndColBus(Int_t iddl, Int_t ibus) const
164{
165 return fEndColBus[iddl][ibus];
166}
167// ----------------------------------------------------------------- //
ab0cde47 168void AliPMDMappingData::SetPatchBus(Int_t iddl, Int_t imod,
169 Int_t bpatchbus, Int_t epatchbus)
170{
171 fBeginPatchBus[iddl][imod] = bpatchbus;
172 fEndPatchBus[iddl][imod] = epatchbus;
173}
174// ----------------------------------------------------------------- //
c3217637 175void AliPMDMappingData::SetModuleNo(Int_t iddl, Int_t ibus, Int_t modno)
176{
177 fModuleNo[iddl][ibus] = modno;
178}
179// ----------------------------------------------------------------- //
180void AliPMDMappingData::SetMcmperBus(Int_t iddl, Int_t ibus, Int_t totmcm)
181{
182 fMcmperBus[iddl][ibus] = totmcm;
183}
184
185// ----------------------------------------------------------------- //
186void AliPMDMappingData::SetRowBus(Int_t iddl,Int_t ibus,Int_t rows,Int_t rowe)
187{
188 fStartRowBus[iddl][ibus] = rows;
189 fEndRowBus[iddl][ibus] = rowe;
190}
191
192// ----------------------------------------------------------------- //
193void AliPMDMappingData::SetColBus(Int_t iddl,Int_t ibus,Int_t cols,Int_t cole)
194{
195 fStartColBus[iddl][ibus] = cols;
196 fEndColBus[iddl][ibus] = cole;
197}
198// ----------------------------------------------------------------- //
199
200void AliPMDMappingData::Print(Option_t *) const
201{
202 printf("\n ######Mapping File for each ddl and patchbus ####\n");
203
204
205 for(Int_t iddl = 0; iddl < kDdl; iddl++)
206 {
ab0cde47 207 for(Int_t imod = 0; imod < 48; imod++)
208 {
209 printf("%d %d %d %d \n",iddl, imod, fBeginPatchBus[iddl][imod],
210 fEndPatchBus[iddl][imod]);
211 }
c3217637 212 for(Int_t ibus = 0; ibus < kBus; ibus++)
213 {
214 printf("%d %d %d %d %d %d %d %d\n",iddl, ibus,
215 fModuleNo[iddl][ibus], fMcmperBus[iddl][ibus],
216 fStartRowBus[iddl][ibus], fEndRowBus[iddl][ibus],
217 fStartColBus[iddl][ibus], fEndColBus[iddl][ibus]);
218 }
219 printf("\n");
220 }
221
222}