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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for PHOS Trigger Parameters //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliPHOSTriggerParameters.h"
27 ClassImp(AliPHOSTriggerParameters)
29 //________________________________________________________________
30 AliPHOSTriggerParameters::AliPHOSTriggerParameters()
33 // default constructor. Initialises with Reset().
37 //________________________________________________________________
38 AliPHOSTriggerParameters::AliPHOSTriggerParameters(const char* name)
41 // Specific constructor, passes name to TNamed base. Initialises with Reset().
46 //________________________________________________________________
47 AliPHOSTriggerParameters::AliPHOSTriggerParameters(const AliPHOSTriggerParameters& other)
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];
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];
68 // for(int tor = 0; tor < kNTORs; tor++) {
69 // fTORMaskArray[mod][tor] = other.fTORMaskArray[mod][tor] ;
70 // fTORReadoutMask[mod][tor] = other.fTORReadoutMask[mod][tor];
76 //________________________________________________________________
77 AliPHOSTriggerParameters& AliPHOSTriggerParameters::operator= (const AliPHOSTriggerParameters& other)
81 SetName(other.GetName());
82 SetTitle(other.GetTitle());
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];
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];
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];
108 //________________________________________________________________
109 AliPHOSTriggerParameters::~AliPHOSTriggerParameters()
115 //________________________________________________________________
116 UShort_t AliPHOSTriggerParameters::GetTRUPedestal(Int_t mod, Int_t TRURow, Int_t branch, Int_t xIdx, Int_t zIdx) const
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.
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
127 return fTRUPedestals[mod][TRURow][branch][xIdx][zIdx];
129 //________________________________________________________________
130 Bool_t AliPHOSTriggerParameters::GetTRUReadoutOn(Int_t mod, Int_t TRURow, Int_t branch) const
132 // Returns the TRU specific flag that specifies for the TRU whether
133 // or not it should be read out.
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
139 return fTRUTriggerBitReadoutOn[mod][TRURow][branch];
141 //________________________________________________________________
142 Bool_t AliPHOSTriggerParameters::GetTRUSignalReadoutOn(Int_t mod, Int_t TRURow, Int_t branch) const
144 // Returns the TRU specific flag that specifies for the TRU whether
145 // or not it readout should include full FakeALTRO Trigger Signal.
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
151 return fTRUSignalReadoutOn[mod][TRURow][branch];
153 //________________________________________________________________
154 UShort_t AliPHOSTriggerParameters::GetTRUSignalTimeBinFrom(Int_t mod, Int_t TRURow, Int_t branch) const
156 // Returns the TRU specific value that specifies from (including),
157 // which timebin TRU should read out.
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
163 return fTRUSignalTimeBinFrom[mod][TRURow][branch];
165 //________________________________________________________________
166 UShort_t AliPHOSTriggerParameters::GetTRUSignalTimeBinTo(Int_t mod, Int_t TRURow, Int_t branch) const
168 // Returns the TRU specific value that specifies to (including),
169 // which timebin TRU should read out.
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
175 return fTRUSignalTimeBinTo[mod][TRURow][branch];
177 //________________________________________________________________
178 UShort_t AliPHOSTriggerParameters::GetTRUThreshold(Int_t mod, Int_t TRURow, Int_t branch) const
180 // Returns the TRU specific value that specifies the trigger threshold,
181 // the 4x4 Sliding Window (signal - pedestal) value to which the tru
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
188 return fTRUThreshold[mod][TRURow][branch];
190 //________________________________________________________________
191 UShort_t AliPHOSTriggerParameters::GetTRUMaskChannel(Int_t mod, Int_t TRURow, Int_t branch) const
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
199 return fTRUMaskChannel[mod][TRURow][branch];
201 //________________________________________________________________
202 const UShort_t* AliPHOSTriggerParameters::GetTORMaskArray(Int_t mod, Int_t tor) const
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
209 // returns a array of UShort_t of size 3.
211 return fTORMaskArray[mod][tor];
213 //________________________________________________________________
214 const UShort_t* AliPHOSTriggerParameters::GetTORReadoutMask(Int_t mod, Int_t tor) const
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
221 // returns a array of UShort_t of size 2.
223 return fTORReadoutMask[mod][tor];
227 //________________________________________________________________
228 void AliPHOSTriggerParameters::SetTRUPedestal(UShort_t pedestal, Int_t mod, Int_t TRURow, Int_t branch, Int_t xIdx, Int_t zIdx)
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.
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
240 fTRUPedestals[mod][TRURow][branch][xIdx][zIdx] = pedestal;
242 //________________________________________________________________
243 void AliPHOSTriggerParameters::SetTRUReadoutOn(Bool_t isOn, Int_t mod, Int_t TRURow, Int_t branch)
245 // Returns the TRU specific flag that specifies for the TRU
246 // whether or not it should be read out.
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
252 fTRUTriggerBitReadoutOn[mod][TRURow][branch] = isOn;
254 //________________________________________________________________
255 void AliPHOSTriggerParameters::SetTRUSignalReadoutOn(Bool_t isOn, Int_t mod, Int_t TRURow, Int_t branch)
257 // Returns the TRU specific flag that specifies for the TRU whether or not it
258 // readout should include full FakeALTRO Trigger Signal.
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
264 fTRUSignalReadoutOn[mod][TRURow][branch] = isOn;
266 //________________________________________________________________
267 void AliPHOSTriggerParameters::SetTRUSignalTimeBinFrom(UShort_t fromBin, Int_t mod, Int_t TRURow, Int_t branch)
269 // Returns the TRU specific value that specifies from (including),
270 // which timebin TRU should read out.
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
276 fTRUSignalTimeBinFrom[mod][TRURow][branch] = fromBin;
278 //________________________________________________________________
279 void AliPHOSTriggerParameters::SetTRUSignalTimeBinTo(UShort_t toBin, Int_t mod, Int_t TRURow, Int_t branch)
281 // Returns the TRU specific value that specifies to (including),
282 // which timebin TRU should read out.
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
288 fTRUSignalTimeBinTo[mod][TRURow][branch] = toBin;
290 //________________________________________________________________
291 void AliPHOSTriggerParameters::SetTRUThreshold(UShort_t threshold, Int_t mod, Int_t TRURow, Int_t branch)
293 // Returns the TRU specific value that specifies the trigger threshold,
294 // the (signal - pedestal) value to which the tru sends a L0.
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
300 fTRUThreshold[mod][TRURow][branch] = threshold;
302 //________________________________________________________________
303 void AliPHOSTriggerParameters::SetTRUMaskChannel(UShort_t mask, Int_t mod, Int_t TRURow, Int_t branch)
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
311 fTRUMaskChannel[mod][TRURow][branch] = mask;
313 //________________________________________________________________
314 void AliPHOSTriggerParameters::SetTORMaskArray(const UShort_t ma[3], Int_t mod, Int_t tor)
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
321 fTORMaskArray[mod][tor][0] = ma[0];
322 fTORMaskArray[mod][tor][1] = ma[1];
323 fTORMaskArray[mod][tor][2] = ma[2];
325 //________________________________________________________________
326 void AliPHOSTriggerParameters::SetTORReadoutMask(const UShort_t rm[2], Int_t mod, Int_t tor)
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
333 fTORReadoutMask[mod][tor][0] = rm[0];
334 fTORReadoutMask[mod][tor][1] = rm[1];
338 //________________________________________________________________
339 void AliPHOSTriggerParameters::Print(Option_t *option) const
341 // Will Write uppon request (Henrik Qvigstad <henrik.qvigstad@cern.ch>)
343 Printf("AliPHOSTriggerParameters::Print is not implemented.");
346 //________________________________________________________________
347 void AliPHOSTriggerParameters::Reset()
349 // Resets the values to Null/Ideal
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;
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;