2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 // Class AliVZEROTriggerData
18 // -------------------------
19 // Retrieves and hold the FEE parameters
20 // The parameters are recieved from the shuttle
21 // AliVZEROTriggerData is then used in the AliVZEROTriggerSimulator
24 #include <TObjString.h>
28 #include "AliDCSValue.h"
29 #include "AliVZEROTriggerData.h"
31 ClassImp(AliVZEROTriggerData)
32 //________________________________________________________________
34 AliVZEROTriggerData::AliVZEROTriggerData() :
40 fBBAForBGThreshold(0) ,
41 fBBCForBGThreshold(0) ,
42 fCentralityVOAThrLow(0) ,
43 fCentralityVOAThrHigh(0) ,
44 fCentralityVOCThrLow(0) ,
45 fCentralityVOCThrHigh(0) ,
56 // default constructor
57 for(int i=0; i<kNCIUBoards ;i++) {
58 fClk1Win1[i] = fClk1Win2[i] = 0;
59 fDelayClk1Win1[i] = fDelayClk1Win2[i] = 0;
60 fClk2Win1[i] = fClk2Win2[i] = 0;
61 fDelayClk2Win1[i] = fDelayClk2Win2[i] = 0;
62 fLatchWin1[i] = fLatchWin2[i] = 0;
63 fResetWin1[i] = fResetWin2[i] = 0;
64 fPedestalSubtraction[i] = kFALSE;
65 for(Int_t j = 0; j < kNChannels; ++j) {
66 fEnableCharge[i][j] = fEnableTiming[i][j] = kFALSE;
67 fDiscriThr[i][j] = fDelayHit[i][j] = 0;
68 fPedestalOdd[i][j] = fPedestalEven[i][j] = 0;
69 fPedestalCutOdd[i][j] = fPedestalCutEven[i][j] = 0;
72 for(Int_t i = 0; i < kNTriggerOutputs; ++i) fTriggerSelected[i] = 0;
74 //________________________________________________________________
75 AliVZEROTriggerData::AliVZEROTriggerData(Int_t nRun, UInt_t startTime, UInt_t endTime) :
81 fBBAForBGThreshold(0) ,
82 fBBCForBGThreshold(0) ,
83 fCentralityVOAThrLow(0) ,
84 fCentralityVOAThrHigh(0) ,
85 fCentralityVOCThrLow(0) ,
86 fCentralityVOCThrHigh(0) ,
92 fStartTime(startTime),
97 for(int i=0; i<kNCIUBoards ;i++) {
98 fClk1Win1[i] = fClk1Win2[i] = 0;
99 fDelayClk1Win1[i] = fDelayClk1Win2[i] = 0;
100 fClk2Win1[i] = fClk2Win2[i] = 0;
101 fDelayClk2Win1[i] = fDelayClk2Win2[i] = 0;
102 fLatchWin1[i] = fLatchWin2[i] = 0;
103 fResetWin1[i] = fResetWin2[i] = 0;
104 fPedestalSubtraction[i] = kFALSE;
105 for(Int_t j = 0; j < kNChannels; ++j) {
106 fEnableCharge[i][j] = fEnableTiming[i][j] = kFALSE;
107 fDiscriThr[i][j] = fDelayHit[i][j] = 0;
108 fPedestalOdd[i][j] = fPedestalEven[i][j] = 0;
109 fPedestalCutOdd[i][j] = fPedestalCutEven[i][j] = 0;
112 for(Int_t i = 0; i < kNTriggerOutputs; ++i) fTriggerSelected[i] = 0;
114 TString namst = "VZERO_Trigger_FEE";
115 SetName(namst.Data());
116 SetTitle(namst.Data());
120 //________________________________________________________________
121 AliVZEROTriggerData::~AliVZEROTriggerData(){
124 //_____________________________________________________________________________
125 void AliVZEROTriggerData::FillData(AliVZERODataFEE * data){
126 // Set all parameters from the data get by the shuttle
127 TMap * params = data->GetParameters();
129 TObjString* aliasName;
131 while (( aliasName = (TObjString*) iter.Next() )) {
132 AliDCSValue* aValue = (AliDCSValue*) params->GetValue(aliasName);
135 val = aValue->GetUInt();
136 AliInfo(Form("%s : %d",aliasName->String().Data(), val));
137 SetParameter(aliasName->String(),val);
142 //_____________________________________________________________________________
143 void AliVZEROTriggerData::SetParameter(TString name, Int_t val){
144 // Set given parameter
149 TSeqCollection* nameSplit = name.Tokenize("/");
150 TObjString * boardName = (TObjString *)nameSplit->At(2);
151 if(!boardName->String().Contains("CCIU")) sscanf(boardName->String().Data(),"CIU%d",&iBoard);
153 TString paramName = ((TObjString *)nameSplit->At(3))->String();
154 Char_t channel[2] ; channel[1] = '\0';
155 channel[0] = paramName[paramName.Sizeof()-2];
156 sscanf(channel,"%d",&iChannel);
158 if(name.Contains("DelayClk1Win1")) SetDelayClk1Win1((UShort_t) val,iBoard);
159 else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard);
160 else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard);
161 else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard);
162 else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard);
163 else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard);
164 else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard);
165 else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard);
166 else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard);
167 else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard);
168 else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard);
169 else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard);
170 else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard);
171 else if(name.Contains("BBAThreshold")) SetBBAThreshold((UShort_t) val);
172 else if(name.Contains("BBCThreshold")) SetBBCThreshold((UShort_t) val);
173 else if(name.Contains("BGAThreshold")) SetBGAThreshold((UShort_t) val);
174 else if(name.Contains("BGCThreshold")) SetBGCThreshold((UShort_t) val);
175 else if(name.Contains("BBAForBGThreshold")) SetBBAForBGThreshold((UShort_t) val);
176 else if(name.Contains("BBCForBGThreshold")) SetBBCForBGThreshold((UShort_t) val);
177 else if(name.Contains("CentralityV0AThrLow")) SetCentralityV0AThrLow((UShort_t) val);
178 else if(name.Contains("CentralityV0AThrHigh")) SetCentralityV0AThrHigh((UShort_t) val);
179 else if(name.Contains("CentralityV0CThrLow")) SetCentralityV0CThrLow((UShort_t) val);
180 else if(name.Contains("CentralityV0CThrHigh")) SetCentralityV0CThrHigh((UShort_t) val);
181 else if(name.Contains("MultV0AThrLow")) SetMultV0AThrLow((UShort_t) val);
182 else if(name.Contains("MultV0AThrHigh")) SetMultV0AThrHigh((UShort_t) val);
183 else if(name.Contains("MultV0CThrLow")) SetMultV0CThrLow((UShort_t) val);
184 else if(name.Contains("MultV0CThrHigh")) SetMultV0CThrHigh((UShort_t) val);
185 else if(name.Contains("TriggerSelect")) SetTriggerSelected((UShort_t) val, iChannel-1 );
186 else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard , iChannel-1);
187 else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard , iChannel-1);
188 else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard, iChannel-1);
189 else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard, iChannel-1);
190 else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard, iChannel-1);
191 else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard, iChannel-1);
192 else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard, iChannel-1);
193 else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard, iChannel-1);
194 else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));
198 //________________________________________________________________
199 void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel)
201 // Set Pedestal Cut of individual channel
202 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {
203 if(integrator) fPedestalCutOdd[board][channel] = val;
204 else fPedestalCutEven[board][channel] = val;
205 } else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));
207 //________________________________________________________________
208 UShort_t AliVZEROTriggerData::GetPedestalCut(Int_t integrator, Int_t board, Int_t channel)
210 // Get Pedestal Cut of individual channel
211 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {
212 if(integrator) return(fPedestalCutOdd[board][channel]);
213 else return(fPedestalCutEven[board][channel]);
214 }else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
217 //________________________________________________________________
218 void AliVZEROTriggerData::SetPedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel)
220 // Set Pedestal of individual channel
221 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {
222 if(integrator) fPedestalOdd[board][channel] = val;
223 else fPedestalEven[board][channel] = val;
224 } else AliError(Form("Impossible to write at : Board %d ; Channel %d ; Integrator %d ",board,channel,integrator));
226 //________________________________________________________________
227 UShort_t AliVZEROTriggerData::GetPedestal(Int_t integrator, Int_t board, Int_t channel)
229 // Get Pedestal of individual channel
230 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {
231 if(integrator) return(fPedestalOdd[board][channel]);
232 else return(fPedestalEven[board][channel]);
233 } else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
236 //________________________________________________________________
237 void AliVZEROTriggerData::SetDelayHit(UShort_t val,Int_t board, Int_t channel)
239 // Set Delay of individual channel
240 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fDelayHit[board][channel] = val;
241 else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));
243 //________________________________________________________________
244 UShort_t AliVZEROTriggerData::GetDelayHit(Int_t board, Int_t channel)
246 // Get Delay of individual channel
247 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fDelayHit[board][channel]);
248 else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
251 //________________________________________________________________
252 void AliVZEROTriggerData::SetDiscriThr(UShort_t val,Int_t board, Int_t channel)
254 // Set discriminator threshold
255 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fDiscriThr[board][channel] = val;
256 else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));
258 //________________________________________________________________
259 UShort_t AliVZEROTriggerData::GetDiscriThr(Int_t board, Int_t channel)
261 // Get discriminator threshold
262 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fDiscriThr[board][channel]);
263 else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
266 //________________________________________________________________
267 void AliVZEROTriggerData::SetEnableCharge(Bool_t val,Int_t board, Int_t channel)
269 // Set the channels enabled for Charge triggers
270 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fEnableCharge[board][channel] = val;
271 else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));
273 //________________________________________________________________
274 Bool_t AliVZEROTriggerData::GetEnableCharge(Int_t board, Int_t channel)
276 // Get the channels enabled for Charge triggers
277 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fEnableCharge[board][channel]);
278 else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
281 //________________________________________________________________
282 void AliVZEROTriggerData::SetEnableTiming(Bool_t val,Int_t board, Int_t channel)
284 // Set the channels enabled for Timing triggers
285 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fEnableTiming[board][channel] = val;
286 else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));
288 //________________________________________________________________
289 Bool_t AliVZEROTriggerData::GetEnableTiming(Int_t board, Int_t channel)
291 // Get the channels enabled for Timing triggers
292 if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fEnableTiming[board][channel]);
293 else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));
296 //________________________________________________________________
297 void AliVZEROTriggerData::SetTriggerSelected(UShort_t trigger, Int_t output)
299 // Set the trigger selected on the outputs to CTP
300 if(output>=0 && output<kNTriggerOutputs) fTriggerSelected[output] = trigger;
301 else AliError(Form("Trigger output number %d not valid",output));
304 //________________________________________________________________
305 void AliVZEROTriggerData::SetClk1Win1(UShort_t* clks)
307 // Set Win clock of BB
308 if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win1(clks[t],t);
309 else AliError("Profil Clock1 Win1 Not defined.");
311 //________________________________________________________________
312 void AliVZEROTriggerData::SetClk2Win1(UShort_t* clks)
314 // Set Win clock of BB
315 if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win1(clks[t],t);
316 else AliError("Profil Clock2 Win1 Not defined.");
318 //________________________________________________________________
319 void AliVZEROTriggerData::SetClk1Win1(UShort_t clk, Int_t board)
321 // Set Win clock of BB
322 if((board>=0) && (board<kNCIUBoards)) {
323 fClk1Win1[board] = clk;
324 if(!IsClkValid(clk)) AliWarning(Form("Profil Clock1 Win1 of board %d is not valid : %d",board,clk));
326 AliError(Form("Impossible to Write at Board %d",board));
329 //________________________________________________________________
330 void AliVZEROTriggerData::SetClk2Win1(UShort_t clk, Int_t board)
332 // Set Win clock of BB
333 if((board>=0) && (board<kNCIUBoards)) {
334 fClk2Win1[board] = clk;
335 if(!IsClkValid(clk)) AliWarning(Form("Profil Clock2 Win1 of board %d is not valid : %d",board,clk));
337 AliError(Form("Impossible to Write at Board %d",board));
340 //________________________________________________________________
341 void AliVZEROTriggerData::SetClk1Win2(UShort_t* clks)
343 // Set Win clock of BG
344 if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win2(clks[t],t);
345 else AliError("Profil Clock1 Win2 Not defined.");
347 //________________________________________________________________
348 void AliVZEROTriggerData::SetClk2Win2(UShort_t* clks)
350 // Set Win clock of BG
351 if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win2(clks[t],t);
352 else AliError("Profil Clock2 Win2 Not defined.");
354 //________________________________________________________________
355 void AliVZEROTriggerData::SetClk1Win2(UShort_t clk, Int_t board)
357 // Set Win clock of BG
358 if((board>=0) && (board<kNCIUBoards)) {
359 fClk1Win2[board] = clk;
360 if(!IsClkValid(clk)) AliWarning(Form("Profil Clock1 Win2 of board %d is not valid : %d",board,clk));
362 AliError(Form("Impossible to Write at Board %d",board));
365 //________________________________________________________________
366 void AliVZEROTriggerData::SetClk2Win2(UShort_t clk, Int_t board)
368 // Set Win clock of BG
369 if((board>=0) && (board<kNCIUBoards)) {
370 fClk2Win2[board] = clk;
371 if(!IsClkValid(clk)) AliWarning(Form("Profil Clock2 Win2 of board %d is not valid : %d",board,clk));
373 AliError(Form("Impossible to Write at Board %d",board));
376 //________________________________________________________________
377 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t* delays)
379 // Set Delay for Win clock of BB
380 if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win1(delays[t],t);
381 else AliError("Profil Clock1 Win1 Delays Not defined.");
383 //________________________________________________________________
384 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t delay, Int_t board)
386 // Set Delay for Win clock of BB
388 AliWarning(Form("Profil Clock1 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));
389 delay = delay & 0x3FF;
391 if((board>=0) && (board<kNCIUBoards)) fDelayClk1Win1[board] = delay;
392 else AliError(Form("Trying to write out of the array Board = %d",board));
394 //________________________________________________________________
395 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t* delays)
397 // Set Delay for Win clock of BB
398 if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win1(delays[t],t);
399 else AliError("Profil Clock2 Win1 Delays Not defined.");
401 //________________________________________________________________
402 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t delay, Int_t board)
404 // Set Delay for Win clock of BB
406 AliWarning(Form("Profil Clock2 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));
407 delay = delay & 0x3FF;
409 if((board>=0) && (board<kNCIUBoards)) fDelayClk2Win1[board] = delay;
410 else AliError(Form("Trying to write out of the array Board = %d",board));
412 //________________________________________________________________
413 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t* delays)
415 // Set Delay for Win clock of BG
416 if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win2(delays[t],t);
417 else AliError("Profil Clock1 Win2 Delays Not defined.");
419 //________________________________________________________________
420 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t delay, Int_t board)
422 // Set Delay for Win clock of BG
424 AliWarning(Form("Profil Clock1 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));
425 delay = delay & 0x3FF;
427 if((board>=0) && (board<kNCIUBoards)) fDelayClk1Win2[board] = delay;
428 else AliError(Form("Trying to write out of the array Board = %d",board));
430 //________________________________________________________________
431 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t* delays)
433 // Set Delay for Win clock of BG
434 if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win2(delays[t],t);
435 else AliError("Profil Clock2 Win2 Delays Not defined.");
437 //________________________________________________________________
438 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t delay, Int_t board)
440 // Set Delay for Win clock of BG
442 AliWarning(Form("Profil Clock2 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));
443 delay = delay & 0x3FF;
445 if((board>=0) && (board<kNCIUBoards)) fDelayClk2Win2[board] = delay;
446 else AliError(Form("Trying to write out of the array Board = %d",board));
448 //________________________________________________________________
449 void AliVZEROTriggerData::SetLatchWin1(UShort_t *latchs){
450 // Set Latch Win clock for BB
451 if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin1(latchs[t],t);
452 else AliError("Latch Win1 profil Not defined.");
454 //________________________________________________________________
455 void AliVZEROTriggerData::SetLatchWin1(UShort_t latch, Int_t board)
457 // Set Latch Win clock for BB
458 if((board>=0) && (board<kNCIUBoards)) {
459 fLatchWin1[board] = latch;
460 if(!IsClkValid(latch)) AliWarning(Form("Latch Win1 of board %d is not valid : %d",board,latch));
462 AliError(Form("Impossible to Write at Board %d",board));
465 //________________________________________________________________
466 void AliVZEROTriggerData::SetLatchWin2(UShort_t *latchs){
467 // Set Latch Win clock for BG
468 if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin2(latchs[t],t);
469 else AliError("Latch Win2 profil Not defined.");
471 //________________________________________________________________
472 void AliVZEROTriggerData::SetLatchWin2(UShort_t latch, Int_t board)
474 // Set Latch Win clock for BG
475 if((board>=0) && (board<kNCIUBoards)) {
476 fLatchWin2[board] = latch;
477 if(!IsClkValid(latch)) AliWarning(Form("Latch Win2 of board %d is not valid : %d",board,latch));
479 AliError(Form("Impossible to Write at Board %d",board));
482 //________________________________________________________________
483 void AliVZEROTriggerData::SetResetWin1(UShort_t *resets){
484 // Set Reset Win clock for BB
485 if(resets) for(int t=0; t<kNCIUBoards; t++) SetResetWin1(resets[t],t);
486 else AliError("Reset Win1 profil Not defined.");
488 //________________________________________________________________
489 void AliVZEROTriggerData::SetResetWin1(UShort_t reset, Int_t board)
491 // Set Reset Win clock for BB
492 if((board>=0) && (board<kNCIUBoards)) {
493 fResetWin1[board] = reset;
494 if(!IsClkValid(reset)) AliWarning(Form("Reset Win1 of board %d is not valid : %d",board,reset));
496 AliError(Form("Impossible to Write at Board %d",board));
499 //________________________________________________________________
500 void AliVZEROTriggerData::SetResetWin2(UShort_t *resets){
501 // Set Reset Win clock for BG
502 if(resets) for(int t=0; t<kNCIUBoards; t++) SetResetWin2(resets[t],t);
503 else AliError("Reset Win2 profil Not defined.");
505 //________________________________________________________________
506 void AliVZEROTriggerData::SetResetWin2(UShort_t reset, Int_t board)
508 // Set Reset Win clock for BG
509 if((board>=0) && (board<kNCIUBoards)) {
510 fResetWin2[board] = reset;
511 if(!IsClkValid(reset)) AliWarning(Form("Reset Win2 of board %d is not valid : %d",board,reset));
513 AliError(Form("Impossible to Write at Board %d",board));
516 //________________________________________________________________
517 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t *peds){
518 // Set Pedestal Subtraction Parameter
519 if(peds) for(int t=0; t<kNCIUBoards; t++) SetPedestalSubtraction(peds[t],t);
520 else AliError("Pedestal Subtraction Not defined.");
523 //________________________________________________________________
524 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t ped, Int_t board)
526 // Set Pedestal Subtraction Parameter
527 if((board>=0) && (board<kNCIUBoards)) fPedestalSubtraction[board] = ped;
528 else AliError(Form("Board %d is not valid",board));
531 //________________________________________________________________
532 Bool_t AliVZEROTriggerData::IsClkValid(UShort_t clock) const {
533 // Check if the given clock has a valid profil.
535 Bool_t isValid = kTRUE;
536 Short_t risingEdge = 0;
537 Short_t fallingEdge = 0;
538 for(int i=0 ; i<5 ; i++) word[i] = (clock >> i) & 0x1;
540 if(word[0] != word[4]){
541 if(word[4]) fallingEdge++;
544 for(int i=1 ; i<5 ; i++){
545 if(word[i] != word[i-1]) {
546 if(word[i-1]) fallingEdge++;
550 if((fallingEdge>1)||(risingEdge>1)) isValid = kFALSE;
551 if(((risingEdge==0)&&(fallingEdge==0)) &&(!word[0])) isValid = kFALSE;