]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSTriggerParameters.cxx
Coverity fix.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTriggerParameters.cxx
CommitLineData
0a9de6d1 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/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19//. //
20// class for PHOS Trigger Parameters //
21//. //
22///////////////////////////////////////////////////////////////////////////////
23
24#include "AliPHOSTriggerParameters.h"
25#include "TString.h"
26
27ClassImp(AliPHOSTriggerParameters)
28
29//________________________________________________________________
30AliPHOSTriggerParameters::AliPHOSTriggerParameters()
31 : TNamed()
32{
33 // default constructor. Initialises with Reset().
34 Reset();
35}
36
37//________________________________________________________________
38AliPHOSTriggerParameters::AliPHOSTriggerParameters(const char* name)
39 : TNamed(name, name)
40{
41 // Specific constructor, passes name to TNamed base. Initialises with Reset().
42
43 Reset();
44}
45
46//________________________________________________________________
47AliPHOSTriggerParameters::AliPHOSTriggerParameters(const AliPHOSTriggerParameters& other)
48 : TNamed(other)
49{
50 // copy constructor
51
52 for(Int_t mod = 0; mod < kNMods; ++mod) {
53 for(Int_t TRURow = 0; TRURow < kNTRURows; TRURow++) {
54 for(Int_t branch = 0; branch < kNBranches; branch++) {
55 for(Int_t xIdx = 0; xIdx < kNTRUX; xIdx++) {
56 for(Int_t zIdx = 0; zIdx < kNTRUZ; zIdx++) {
57 fTRUPedestals[mod][TRURow][branch][xIdx][zIdx] = other.fTRUPedestals[mod][TRURow][branch][xIdx][zIdx];
58 } // end zIdx
59 } // end xIdx
60 fTRUTriggerBitReadoutOn[mod][TRURow][branch] = other.fTRUTriggerBitReadoutOn[mod][TRURow][branch];
61 fTRUSignalReadoutOn[mod][TRURow][branch] = other.fTRUSignalReadoutOn[mod][TRURow][branch];
62 fTRUSignalTimeBinFrom[mod][TRURow][branch] = other.fTRUSignalTimeBinFrom[mod][TRURow][branch];
63 fTRUSignalTimeBinTo[mod][TRURow][branch] = other.fTRUSignalTimeBinTo[mod][TRURow][branch];
64 fTRUThreshold[mod][TRURow][branch] = other.fTRUThreshold[mod][TRURow][branch];
65 fTRUMaskChannel[mod][TRURow][branch] = other.fTRUMaskChannel[mod][TRURow][branch];
66 } // end branch
67 } // end tru
68 // for(int tor = 0; tor < kNTORs; tor++) {
69 // fTORMaskArray[mod][tor] = other.fTORMaskArray[mod][tor] ;
70 // fTORReadoutMask[mod][tor] = other.fTORReadoutMask[mod][tor];
71 // }
72 } // end mod
73}
74
75
76//________________________________________________________________
77AliPHOSTriggerParameters& AliPHOSTriggerParameters::operator= (const AliPHOSTriggerParameters& other)
78{
79 // assignement
80
81 SetName(other.GetName());
82 SetTitle(other.GetTitle());
83
84 for(Int_t mod = 0; mod < kNMods; ++mod) {
85 for(Int_t TRURow = 0; TRURow < kNTRURows; TRURow++) {
86 for(Int_t branch = 0; branch < kNBranches; branch++) {
87 for(Int_t xIdx = 0; xIdx < kNTRUX; xIdx++) {
88 for(Int_t zIdx = 0; zIdx < kNTRUZ; zIdx++) {
89 fTRUPedestals[mod][TRURow][branch][xIdx][zIdx] = other.fTRUPedestals[mod][TRURow][branch][xIdx][zIdx];
90 }
91 }
92 fTRUTriggerBitReadoutOn[mod][TRURow][branch] = other.fTRUTriggerBitReadoutOn[mod][TRURow][branch];
93 fTRUSignalReadoutOn[mod][TRURow][branch] = other.fTRUSignalReadoutOn[mod][TRURow][branch];
94 fTRUSignalTimeBinFrom[mod][TRURow][branch] = other.fTRUSignalTimeBinFrom[mod][TRURow][branch];
95 fTRUSignalTimeBinTo[mod][TRURow][branch] = other.fTRUSignalTimeBinTo[mod][TRURow][branch];
96 fTRUThreshold[mod][TRURow][branch] = other.fTRUThreshold[mod][TRURow][branch];
97 fTRUMaskChannel[mod][TRURow][branch] = other.fTRUMaskChannel[mod][TRURow][branch];
98 }
99 }
100 // for(Int_t tor = 0; tor < kNTORs; tor++) {
101 // fTORMaskArray[mod][tor] = other.fTORMaskArray[mod][tor] ;
102 // fTORReadoutMask[mod][tor] = other.fTORReadoutMask[mod][tor];
103 // }
104 }
105 return *this;
106}
107
108//________________________________________________________________
109AliPHOSTriggerParameters::~AliPHOSTriggerParameters()
110{
111 // destructor
112}
113
114
115//________________________________________________________________
116UShort_t AliPHOSTriggerParameters::GetTRUPedestal(Int_t mod, Int_t TRURow, Int_t branch, Int_t xIdx, Int_t zIdx) const
117{
118 // Returns the pedestals of the TRU FakeALTRO Trigger signal, is in the range
119 // spanned by 10 bits, i.e. [0,1023]. Ideal value is is given by.
120 //
121 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
122 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
123 // branch: [0,1], branch, indexed in rising number in z direction
124 // xIdx: [0,7], TRU 2x2 cell x index, indexed in rising number in PHOS x direction
125 // zIdx: [0,13], TRU 2x2 cell z index, indexed in rising number in PHOS z direction
126
127 return fTRUPedestals[mod][TRURow][branch][xIdx][zIdx];
128}
129//________________________________________________________________
130Bool_t AliPHOSTriggerParameters::GetTRUReadoutOn(Int_t mod, Int_t TRURow, Int_t branch) const
131{
132 // Returns the TRU specific flag that specifies for the TRU whether
133 // or not it should be read out.
134 //
135 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
136 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
137 // branch: [0,1], branch, indexed in rising number in z direction
138
139 return fTRUTriggerBitReadoutOn[mod][TRURow][branch];
140}
141//________________________________________________________________
142Bool_t AliPHOSTriggerParameters::GetTRUSignalReadoutOn(Int_t mod, Int_t TRURow, Int_t branch) const
143{
144 // Returns the TRU specific flag that specifies for the TRU whether
145 // or not it readout should include full FakeALTRO Trigger Signal.
146 //
147 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
148 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
149 // branch: [0,1], branch, indexed in rising number in z direction
150
151 return fTRUSignalReadoutOn[mod][TRURow][branch];
152}
153//________________________________________________________________
154UShort_t AliPHOSTriggerParameters::GetTRUSignalTimeBinFrom(Int_t mod, Int_t TRURow, Int_t branch) const
155{
156 // Returns the TRU specific value that specifies from (including),
157 // which timebin TRU should read out.
158 //
159 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
160 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
161 // branch: [0,1], branch, indexed in rising number in z direction
162
163 return fTRUSignalTimeBinFrom[mod][TRURow][branch];
164}
165//________________________________________________________________
166UShort_t AliPHOSTriggerParameters::GetTRUSignalTimeBinTo(Int_t mod, Int_t TRURow, Int_t branch) const
167{
168 // Returns the TRU specific value that specifies to (including),
169 // which timebin TRU should read out.
170 //
171 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
172 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
173 // branch: [0,1], branch, indexed in rising number in z direction
174
175 return fTRUSignalTimeBinTo[mod][TRURow][branch];
176}
177//________________________________________________________________
178UShort_t AliPHOSTriggerParameters::GetTRUThreshold(Int_t mod, Int_t TRURow, Int_t branch) const
179{
180 // Returns the TRU specific value that specifies the trigger threshold,
181 // the 4x4 Sliding Window (signal - pedestal) value to which the tru
182 // sends a L0.
183 //
184 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
185 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
186 // branch: [0,1], branch, indexed in rising number in z direction
187
188 return fTRUThreshold[mod][TRURow][branch];
189}
190//________________________________________________________________
191UShort_t AliPHOSTriggerParameters::GetTRUMaskChannel(Int_t mod, Int_t TRURow, Int_t branch) const
192{
193 // TODO: description
194 //
195 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
196 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
197 // branch: [0,1], branch, indexed in rising number in z direction
198
199 return fTRUMaskChannel[mod][TRURow][branch];
200}
201//________________________________________________________________
202const UShort_t* AliPHOSTriggerParameters::GetTORMaskArray(Int_t mod, Int_t tor) const
203{
204 // TODO: description
205 //
206 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
207 // tor: [0,1], TOR index, rising in PHOS x direction
208 //
209 // returns a array of UShort_t of size 3.
210
211 return fTORMaskArray[mod][tor];
212}
213//________________________________________________________________
214const UShort_t* AliPHOSTriggerParameters::GetTORReadoutMask(Int_t mod, Int_t tor) const
215{
216 // TODO: description
217 //
218 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
219 // tor: [0,1], TOR index, rising in PHOS x direction
220 //
221 // returns a array of UShort_t of size 2.
222
223 return fTORReadoutMask[mod][tor];
224}
225
226
227//________________________________________________________________
228void AliPHOSTriggerParameters::SetTRUPedestal(UShort_t pedestal, Int_t mod, Int_t TRURow, Int_t branch, Int_t xIdx, Int_t zIdx)
229{
230 // Returns the pedestals of the TRU FakeALTRO Trigger signal,
231 // is in the range spanned by 10 bits
232 // , i.e. [0,1023]. Ideal value is is given by.
233 //
234 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
235 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
236 // branch: [0,1], branch, indexed in rising number in z direction
237 // xIdx: [0,7], TRU 2x2 cell x index, indexed in rising number in PHOS x direction
238 // zIdx: [0,7], TRU 2x2 cell z index, indexed in rising number in PHOS z direction
239
240 fTRUPedestals[mod][TRURow][branch][xIdx][zIdx] = pedestal;
241}
242//________________________________________________________________
243void AliPHOSTriggerParameters::SetTRUReadoutOn(Bool_t isOn, Int_t mod, Int_t TRURow, Int_t branch)
244{
245 // Returns the TRU specific flag that specifies for the TRU
246 // whether or not it should be read out.
247 //
248 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
249 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
250 // branch: [0,1], branch, indexed in rising number in z direction
251
252 fTRUTriggerBitReadoutOn[mod][TRURow][branch] = isOn;
253}
254//________________________________________________________________
255void AliPHOSTriggerParameters::SetTRUSignalReadoutOn(Bool_t isOn, Int_t mod, Int_t TRURow, Int_t branch)
256{
257 // Returns the TRU specific flag that specifies for the TRU whether or not it
258 // readout should include full FakeALTRO Trigger Signal.
259 //
260 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
261 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
262 // branch: [0,1], branch, indexed in rising number in z direction
263
264 fTRUSignalReadoutOn[mod][TRURow][branch] = isOn;
265}
266//________________________________________________________________
267void AliPHOSTriggerParameters::SetTRUSignalTimeBinFrom(UShort_t fromBin, Int_t mod, Int_t TRURow, Int_t branch)
268{
269 // Returns the TRU specific value that specifies from (including),
270 // which timebin TRU should read out.
271 //
272 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
273 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
274 // branch: [0,1], branch, indexed in rising number in z direction
275
276 fTRUSignalTimeBinFrom[mod][TRURow][branch] = fromBin;
277}
278//________________________________________________________________
279void AliPHOSTriggerParameters::SetTRUSignalTimeBinTo(UShort_t toBin, Int_t mod, Int_t TRURow, Int_t branch)
280{
281 // Returns the TRU specific value that specifies to (including),
282 // which timebin TRU should read out.
283 //
284 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
285 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
286 // branch: [0,1], branch, indexed in rising number in z direction
287
288 fTRUSignalTimeBinTo[mod][TRURow][branch] = toBin;
289}
290//________________________________________________________________
291void AliPHOSTriggerParameters::SetTRUThreshold(UShort_t threshold, Int_t mod, Int_t TRURow, Int_t branch)
292{
293 // Returns the TRU specific value that specifies the trigger threshold,
294 // the (signal - pedestal) value to which the tru sends a L0.
295 //
296 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
297 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
298 // branch: [0,1], branch, indexed in rising number in z direction
299
300 fTRUThreshold[mod][TRURow][branch] = threshold;
301}
302//________________________________________________________________
303void AliPHOSTriggerParameters::SetTRUMaskChannel(UShort_t mask, Int_t mod, Int_t TRURow, Int_t branch)
304{
305 // TODO: description
306 //
307 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
308 // TRURow: [0,3], TRU Row, indexed in rising number in PHOS x direction
309 // branch: [0,1], branch, indexed in rising number in z direction
310
311 fTRUMaskChannel[mod][TRURow][branch] = mask;
312}
313//________________________________________________________________
314void AliPHOSTriggerParameters::SetTORMaskArray(const UShort_t ma[3], Int_t mod, Int_t tor)
315{
316 // TODO: description
317 //
318 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
319 // tor: [0,1], TOR index, rising in PHOS x direction
320
321 fTORMaskArray[mod][tor][0] = ma[0];
322 fTORMaskArray[mod][tor][1] = ma[1];
323 fTORMaskArray[mod][tor][2] = ma[2];
324}
325//________________________________________________________________
326void AliPHOSTriggerParameters::SetTORReadoutMask(const UShort_t rm[2], Int_t mod, Int_t tor)
327{
328 // TODO: description
329 //
330 // mod: [0,4], module index, clockwise, as of 2011 only 2:4 exists
331 // tor: [0,1], TOR index, rising in PHOS x direction
332
333 fTORReadoutMask[mod][tor][0] = rm[0];
334 fTORReadoutMask[mod][tor][1] = rm[1];
335}
336
337
338//________________________________________________________________
339void AliPHOSTriggerParameters::Print(Option_t *option) const
340{
341 // Will Write uppon request (Henrik Qvigstad <henrik.qvigstad@cern.ch>)
342 if(option)
343 Printf("AliPHOSTriggerParameters::Print is not implemented.");
344}
345
346//________________________________________________________________
347void AliPHOSTriggerParameters::Reset()
348{
349 // Resets the values to Null/Ideal
350
351 for(Int_t mod = 0; mod < kNMods; ++mod) {
352 for(Int_t TRURow = 0; TRURow < kNTRURows; TRURow++) {
353 for(Int_t branch = 0; branch < kNBranches; branch++) {
354 fTRUTriggerBitReadoutOn[mod][TRURow][branch] = 0;
355 fTRUSignalReadoutOn[mod][TRURow][branch] = 0;
356 fTRUSignalTimeBinFrom[mod][TRURow][branch] = 0;
357 fTRUSignalTimeBinTo[mod][TRURow][branch] = kDefaultNTRUTimeBins-1;
358 fTRUThreshold[mod][TRURow][branch] = 0;
359 fTRUMaskChannel[mod][TRURow][branch] = 0;
360 for(Int_t xIdx = 0; xIdx < kNTRUX; xIdx++) {
361 for(Int_t zIdx = 0; zIdx < kNTRUZ; zIdx++) {
362 fTRUPedestals[mod][TRURow][branch][xIdx][zIdx] = kIdealTRUPedestal;
363 }
364 }
365 }
366 }
367 for(Int_t tor = 0; tor < kNTORs; tor++) {
368 fTORMaskArray[mod][tor][0] = 0;
369 fTORMaskArray[mod][tor][1] = 0;
370 fTORMaskArray[mod][tor][2] = 0;
371 fTORReadoutMask[mod][tor][0] = 0;
372 fTORReadoutMask[mod][tor][1] = 0;
373 }
374 }
375}
376