Index fixes and protections added
authorcheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 19:22:53 +0000 (19:22 +0000)
committercheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 19:22:53 +0000 (19:22 +0000)
VZERO/AliVZEROCalibData.cxx
VZERO/AliVZEROCalibData.h
VZERO/AliVZEROTriggerData.cxx
VZERO/AliVZEROTriggerData.h

index 596906d..b8f7427 100644 (file)
@@ -169,7 +169,7 @@ void AliVZEROCalibData::FillDCSData(AliVZERODataDCS * data){
                Float_t val;
                if(aValue) {
                        val = aValue->GetFloat();
-                       //AliInfo(Form("%s : %f",aliasName->String().Data(), val));
+                       AliInfo(Form("%s : %f",aliasName->String().Data(), val));
                        SetParameter(aliasName->String(),val);
                }
        }       
@@ -189,8 +189,8 @@ void AliVZEROCalibData::SetParameter(TString name, Float_t val){
        TObjString * boardName = (TObjString *)nameSplit->At(2);
        sscanf(boardName->String().Data(),"CIU%d",&iBoard);
                
-       if(name.Contains("TimeResolution")) SetTimeResolution((UShort_t) val,iBoard-1);
-       else if(name.Contains("WidthResolution")) SetWidthResolution((UShort_t) val,iBoard-1);
+       if(name.Contains("TimeResolution")) SetTimeResolution((UShort_t) val,iBoard);
+       else if(name.Contains("WidthResolution")) SetWidthResolution((UShort_t) val,iBoard);
        else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));
 }
 
@@ -301,14 +301,14 @@ Float_t AliVZEROCalibData::GetMIPperADC(Int_t channel) const {
 void AliVZEROCalibData::SetTimeResolution(UShort_t *resols){
        // Set Time Resolution of the TDC
        if(resols)  for(int t=0; t<kNCIUBoards; t++) SetTimeResolution(resols[t],t);
-       else AliFatal("Time Resolution not defined.");
+       else AliError("Time Resolution not defined.");
        
 }
 //________________________________________________________________
 void AliVZEROCalibData::SetTimeResolution(UShort_t resol, Int_t board)
 {
        // Set Time Resolution of the TDC
-       if((board<kNCIUBoards)) {
+       if((board>=0) && (board<kNCIUBoards)) {
                switch(resol){
                        case 0:
                                fTimeResolution[board] = 25./256.;
@@ -335,20 +335,21 @@ void AliVZEROCalibData::SetTimeResolution(UShort_t resol, Int_t board)
                                fTimeResolution[board] = 12.5;
                                break;
                }
+               AliInfo(Form("Time Resolution of board %d set to %f",board,fTimeResolution[board]));
        } else AliError(Form("Board %d is not valid",board));
 }
 //________________________________________________________________
 void AliVZEROCalibData::SetWidthResolution(UShort_t *resols){
        // Set Time Width Resolution of the TDC
        if(resols)  for(int t=0; t<kNCIUBoards; t++) SetWidthResolution(resols[t],t);
-       else AliFatal("Width Resolution not defined.");
+       else AliError("Width Resolution not defined.");
        
 }
 //________________________________________________________________
 void AliVZEROCalibData::SetWidthResolution(UShort_t resol, Int_t board)
 {
        // Set Time Width Resolution of the TDC
-       if((board<kNCIUBoards)){
+       if((board>=0) && (board<kNCIUBoards)){
                switch(resol){
                        case 0:
                                fWidthResolution[board] = 25./256.;
@@ -394,6 +395,7 @@ void AliVZEROCalibData::SetWidthResolution(UShort_t resol, Int_t board)
                                break;
                                
                }
+               AliInfo(Form("Width Resolution of board %d set to %f",board,fWidthResolution[board]));
        }else AliError(Form("Board %d is not valid",board));
 }
 
index b132b13..7d577a1 100644 (file)
@@ -50,10 +50,10 @@ class AliVZEROCalibData: public TNamed {
   Float_t* GetTimeGain()   const {return (float*)fTimeGain;}
 
   Float_t* GetTimeResolution() const {return (Float_t*) fTimeResolution;};
-  Float_t  GetTimeResolution(Int_t board ) const  {return (board<kNCIUBoards?fTimeResolution[board]:0);};
+  Float_t  GetTimeResolution(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fTimeResolution[board]:0);};
 
   Float_t* GetWidthResolution() const {return (Float_t*) fWidthResolution;};
-  Float_t  GetWidthResolution(Int_t board ) const  {return (board<kNCIUBoards?fWidthResolution[board]:0);};
+  Float_t  GetWidthResolution(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fWidthResolution[board]:0);};
     
   void     SetPedestal(Float_t val, Int_t channel) {fPedestal[channel]=val;}
   void     SetPedestal(Float_t* Pedestal);
index c9004a7..d48d616 100644 (file)
@@ -118,7 +118,7 @@ void AliVZEROTriggerData::FillData(AliVZERODataFEE * data){
                Float_t val;\r
                if(aValue) {\r
                        val = aValue->GetFloat();\r
-                       //AliInfo(Form("%s : %f",aliasName->String().Data(), val));\r
+                       AliInfo(Form("%s : %f",aliasName->String().Data(), val));\r
                        SetParameter(aliasName->String(),val);\r
                }\r
        }       \r
@@ -140,19 +140,19 @@ void AliVZEROTriggerData::SetParameter(TString name, Float_t val){
        channel[0] = paramName[paramName.Sizeof()-2];\r
        sscanf(channel,"%d",&iChannel);\r
        \r
-       if(name.Contains("DelayClk1Win1")) SetDelayClk1Win1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard-1);\r
-       else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard-1);\r
+       if(name.Contains("DelayClk1Win1")) SetDelayClk1Win1((UShort_t) val,iBoard);\r
+       else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard);\r
+       else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard);\r
+       else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard);\r
+       else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard);\r
+       else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard);\r
+       else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard);\r
+       else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard);\r
+       else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard);\r
+       else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard);\r
+       else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard);\r
+       else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard);\r
+       else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard);\r
        else if(name.Contains("BBAThreshold")) SetBBAThreshold((UShort_t) val);\r
        else if(name.Contains("BBCThreshold")) SetBBCThreshold((UShort_t) val);\r
        else if(name.Contains("BGAThreshold")) SetBGAThreshold((UShort_t) val);\r
@@ -167,22 +167,22 @@ void AliVZEROTriggerData::SetParameter(TString name, Float_t val){
        else if(name.Contains("MultV0AThrHigh")) SetMultV0AThrHigh((UShort_t) val);\r
        else if(name.Contains("MultV0CThrLow")) SetMultV0CThrLow((UShort_t) val);\r
        else if(name.Contains("MultV0CThrHigh")) SetMultV0CThrHigh((UShort_t) val);\r
-       else if(name.Contains("TriggerSelect")) SetTriggerSelected((UShort_t) val, iBoard -1);\r
-       else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard -1, iChannel-1);\r
-       else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard -1, iChannel-1);\r
-       else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard -1, iChannel-1);\r
-       else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard -1, iChannel-1);\r
-       else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard -1, iChannel-1);\r
-       else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard -1, iChannel-1);\r
-       else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard -1, iChannel-1);\r
-       else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard -1, iChannel-1);\r
+       else if(name.Contains("TriggerSelect")) SetTriggerSelected((UShort_t) val, iBoard );\r
+       else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard , iChannel-1);\r
+       else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard , iChannel-1);\r
+       else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard, iChannel-1);\r
+       else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard, iChannel-1);\r
+       else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard, iChannel-1);\r
+       else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard, iChannel-1);\r
+       else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard, iChannel-1);\r
+       else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard, iChannel-1);\r
        else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel)\r
 {\r
        // Set Pedestal Cut of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) {\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {\r
                if(integrator) fPedestalCutOdd[board][channel] = val;\r
                else fPedestalCutEven[board][channel] = val;\r
        } else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
@@ -191,7 +191,7 @@ void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t bo
 UShort_t AliVZEROTriggerData::GetPedestalCut(Int_t integrator, Int_t board, Int_t channel)\r
 {\r
        // Get Pedestal Cut of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) {\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {\r
                if(integrator) return(fPedestalCutOdd[board][channel]);\r
                else return(fPedestalCutEven[board][channel]);\r
        }else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
@@ -201,7 +201,7 @@ UShort_t AliVZEROTriggerData::GetPedestalCut(Int_t integrator, Int_t board, Int_
 void AliVZEROTriggerData::SetPedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel)\r
 {\r
        // Set Pedestal of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) {\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {\r
                if(integrator) fPedestalOdd[board][channel] = val;\r
                else fPedestalEven[board][channel] = val;\r
        } else AliError(Form("Impossible to write at : Board %d ; Channel %d ; Integrator %d ",board,channel,integrator));\r
@@ -210,7 +210,7 @@ void AliVZEROTriggerData::SetPedestal(UShort_t val, Int_t integrator, Int_t boar
 UShort_t AliVZEROTriggerData::GetPedestal(Int_t integrator, Int_t board, Int_t channel)\r
 {\r
        // Get Pedestal of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) {\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) {\r
                if(integrator) return(fPedestalOdd[board][channel]);\r
                else return(fPedestalEven[board][channel]);\r
        } else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
@@ -220,14 +220,14 @@ UShort_t AliVZEROTriggerData::GetPedestal(Int_t integrator, Int_t board, Int_t c
 void AliVZEROTriggerData::SetDelayHit(UShort_t val,Int_t board, Int_t channel)\r
 {\r
        // Set Delay of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) fDelayHit[board][channel] = val;\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fDelayHit[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetDelayHit(Int_t board, Int_t channel)\r
 {\r
        // Get Delay of individual channel \r
-       if(board<kNCIUBoards && channel<kNChannels) return(fDelayHit[board][channel]);\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fDelayHit[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return 0;\r
 }\r
@@ -235,14 +235,14 @@ UShort_t AliVZEROTriggerData::GetDelayHit(Int_t board, Int_t channel)
 void AliVZEROTriggerData::SetDiscriThr(UShort_t val,Int_t board, Int_t channel)\r
 {\r
        // Set discriminator threshold\r
-       if(board<kNCIUBoards && channel<kNChannels) fDiscriThr[board][channel] = val;\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fDiscriThr[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetDiscriThr(Int_t board, Int_t channel)\r
 {\r
        // Get discriminator threshold\r
-       if(board<kNCIUBoards && channel<kNChannels) return(fDiscriThr[board][channel]);\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fDiscriThr[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return 0;\r
 }\r
@@ -250,14 +250,14 @@ UShort_t AliVZEROTriggerData::GetDiscriThr(Int_t board, Int_t channel)
 void AliVZEROTriggerData::SetEnableCharge(Bool_t val,Int_t board, Int_t channel)\r
 {\r
        // Set the channels enabled for Charge triggers\r
-       if(board<kNCIUBoards && channel<kNChannels) fEnableCharge[board][channel] = val;\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fEnableCharge[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 Bool_t AliVZEROTriggerData::GetEnableCharge(Int_t board, Int_t channel)\r
 {\r
        // Get the channels enabled for Charge triggers\r
-       if(board<kNCIUBoards && channel<kNChannels) return(fEnableCharge[board][channel]);\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fEnableCharge[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return kFALSE;\r
 }\r
@@ -265,14 +265,14 @@ Bool_t AliVZEROTriggerData::GetEnableCharge(Int_t board, Int_t channel)
 void AliVZEROTriggerData::SetEnableTiming(Bool_t val,Int_t board, Int_t channel)\r
 {\r
        // Set the channels enabled for Timing triggers\r
-       if(board<kNCIUBoards && channel<kNChannels) fEnableTiming[board][channel] = val;\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) fEnableTiming[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 Bool_t AliVZEROTriggerData::GetEnableTiming(Int_t board, Int_t channel)\r
 {\r
        // Get the channels enabled for Timing triggers\r
-       if(board<kNCIUBoards && channel<kNChannels) return(fEnableTiming[board][channel]);\r
+       if((board>=0 && board<kNCIUBoards) && (channel>=0 && channel<kNChannels)) return(fEnableTiming[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return kFALSE;\r
 }\r
@@ -280,7 +280,7 @@ Bool_t AliVZEROTriggerData::GetEnableTiming(Int_t board, Int_t channel)
 void AliVZEROTriggerData::SetTriggerSelected(UShort_t trigger, Int_t output)\r
 {\r
        // Set the trigger selected on the outputs to CTP\r
-       if(output<kNTriggerOutputs) fTriggerSelected[output] = trigger;\r
+       if(output>=0 && output<kNTriggerOutputs) fTriggerSelected[output] = trigger;\r
        else AliError(Form("Trigger output number %d not valid",output));\r
 }\r
 \r
@@ -289,63 +289,79 @@ void AliVZEROTriggerData::SetClk1Win1(UShort_t* clks)
 {\r
        // Set Win clock of BB\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win1(clks[t],t);\r
-       else AliFatal("Profil Clock1 Win1 Not defined.");\r
+       else AliError("Profil Clock1 Win1 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win1(UShort_t* clks)\r
 {\r
        // Set Win clock of BB\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win1(clks[t],t);\r
-       else AliFatal("Profil Clock2 Win1 Not defined.");\r
+       else AliError("Profil Clock2 Win1 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win1(UShort_t clk, Int_t board)\r
 {\r
        // Set Win clock of BB\r
-       if(IsClkValid(clk) && (board<kNCIUBoards)) fClk1Win1[board] = clk;\r
-       else AliError(Form("Profil Clock1 Win1 of board %d is not valid : %d",board,clk));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fClk1Win1[board] = clk;\r
+               if(!IsClkValid(clk)) AliWarning(Form("Profil Clock1 Win1 of board %d is not valid : %d",board,clk));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win1(UShort_t clk, Int_t board)\r
 {\r
        // Set Win clock of BB\r
-       if(IsClkValid(clk) && (board<kNCIUBoards)) fClk2Win1[board] = clk;\r
-       else AliError(Form("Profil Clock2 Win1 of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fClk2Win1[board] = clk;\r
+               if(!IsClkValid(clk)) AliWarning(Form("Profil Clock2 Win1 of board %d is not valid : %d",board,clk));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win2(UShort_t* clks)\r
 {\r
        // Set Win clock of BG\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win2(clks[t],t);\r
-       else AliFatal("Profil Clock1 Win2 Not defined.");\r
+       else AliError("Profil Clock1 Win2 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win2(UShort_t* clks)\r
 {\r
        // Set Win clock of BG\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win2(clks[t],t);\r
-       else AliFatal("Profil Clock2 Win2 Not defined.");\r
+       else AliError("Profil Clock2 Win2 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win2(UShort_t clk, Int_t board)\r
 {\r
        // Set Win clock of BG\r
-       if(IsClkValid(clk) && (board<kNCIUBoards)) fClk1Win2[board] = clk;\r
-       else AliError(Form("Profil Clock1 Win2 of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fClk1Win2[board] = clk;\r
+               if(!IsClkValid(clk)) AliWarning(Form("Profil Clock1 Win2 of board %d is not valid : %d",board,clk));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win2(UShort_t clk, Int_t board)\r
 {\r
        // Set Win clock of BG\r
-       if(IsClkValid(clk) && (board<kNCIUBoards)) fClk2Win2[board] = clk;\r
-       else AliError(Form("Profil Clock2 Win2 of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fClk2Win2[board] = clk;\r
+               if(!IsClkValid(clk)) AliWarning(Form("Profil Clock2 Win2 of board %d is not valid : %d",board,clk));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t* delays)\r
 {\r
        // Set Delay for Win clock of BB\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win1(delays[t],t);\r
-       else AliFatal("Profil Clock1 Win1 Delays Not defined.");\r
+       else AliError("Profil Clock1 Win1 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t delay, Int_t board)\r
@@ -355,15 +371,15 @@ void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t delay, Int_t board)
                AliWarning(Form("Profil Clock1 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
        }\r
-       if(board<kNCIUBoards)   fDelayClk1Win1[board] = delay;\r
-       else AliError("Trying to write out of the array");\r
+       if((board>=0) && (board<kNCIUBoards))   fDelayClk1Win1[board] = delay;\r
+       else AliError(Form("Trying to write out of the array Board = %d",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t* delays)\r
 {\r
        // Set Delay for Win clock of BB\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win1(delays[t],t);\r
-       else AliFatal("Profil Clock2 Win1 Delays Not defined.");\r
+       else AliError("Profil Clock2 Win1 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t delay, Int_t board)\r
@@ -373,15 +389,15 @@ void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t delay, Int_t board)
                AliWarning(Form("Profil Clock2 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
        }\r
-       if(board<kNCIUBoards)   fDelayClk2Win1[board] = delay;\r
-       else AliError("Trying to write out of the array");\r
+       if((board>=0) && (board<kNCIUBoards))   fDelayClk2Win1[board] = delay;\r
+       else AliError(Form("Trying to write out of the array Board = %d",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t* delays)\r
 {\r
        // Set Delay for Win clock of BG\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win2(delays[t],t);\r
-       else AliFatal("Profil Clock1 Win2 Delays Not defined.");\r
+       else AliError("Profil Clock1 Win2 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t delay, Int_t board)\r
@@ -391,15 +407,15 @@ void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t delay, Int_t board)
                AliWarning(Form("Profil Clock1 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
        }\r
-       if(board<kNCIUBoards)   fDelayClk1Win2[board] = delay;\r
-       else AliError("Trying to write out of the array");\r
+       if((board>=0) && (board<kNCIUBoards))   fDelayClk1Win2[board] = delay;\r
+       else AliError(Form("Trying to write out of the array Board = %d",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t* delays)\r
 {\r
        // Set Delay for Win clock of BG\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win2(delays[t],t);\r
-       else AliFatal("Profil Clock2 Win2 Delays Not defined.");\r
+       else AliError("Profil Clock2 Win2 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t delay, Int_t board)\r
@@ -409,73 +425,89 @@ void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t delay, Int_t board)
                AliWarning(Form("Profil Clock2 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
        }\r
-       if(board<kNCIUBoards)   fDelayClk2Win2[board] = delay;\r
-       else AliError("Trying to write out of the array");\r
+       if((board>=0) && (board<kNCIUBoards))   fDelayClk2Win2[board] = delay;\r
+       else AliError(Form("Trying to write out of the array Board = %d",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin1(UShort_t *latchs){\r
        // Set Latch Win clock for BB\r
        if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin1(latchs[t],t);\r
-       else AliFatal("Latch Win1 profil Not defined.");\r
+       else AliError("Latch Win1 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin1(UShort_t latch, Int_t board)\r
 {\r
        // Set Latch Win clock for BB\r
-       if(IsClkValid(latch) && (board<kNCIUBoards)) fLatchWin1[board] = latch;\r
-       else AliError(Form("Latch Win1 profil of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fLatchWin1[board] = latch;\r
+               if(!IsClkValid(latch)) AliWarning(Form("Latch Win1 of board %d is not valid : %d",board,latch));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin2(UShort_t *latchs){\r
        // Set Latch Win clock for BG\r
        if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin2(latchs[t],t);\r
-       else AliFatal("Latch Win2 profil Not defined.");\r
+       else AliError("Latch Win2 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin2(UShort_t latch, Int_t board)\r
 {\r
        // Set Latch Win clock for BG\r
-       if(IsClkValid(latch) && (board<kNCIUBoards)) fLatchWin2[board] = latch;\r
-       else AliError(Form("Latch Win2 profil of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fLatchWin2[board] = latch;\r
+               if(!IsClkValid(latch)) AliWarning(Form("Latch Win2 of board %d is not valid : %d",board,latch));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin1(UShort_t *resets){\r
        // Set Reset Win clock for BB\r
        if(resets) for(int t=0; t<kNCIUBoards; t++) SetResetWin1(resets[t],t);\r
-       else AliFatal("Reset Win1 profil Not defined.");\r
+       else AliError("Reset Win1 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin1(UShort_t reset, Int_t board)\r
 {\r
        // Set Reset Win clock for BB\r
-       if(IsClkValid(reset) && (board<kNCIUBoards)) fResetWin1[board] = reset;\r
-       else AliError(Form("Reset Win1 profil of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fResetWin1[board] = reset;\r
+               if(!IsClkValid(reset)) AliWarning(Form("Reset Win1 of board %d is not valid : %d",board,reset));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin2(UShort_t *resets){\r
        // Set Reset Win clock for BG\r
        if(resets)  for(int t=0; t<kNCIUBoards; t++) SetResetWin2(resets[t],t);\r
-       else AliFatal("Reset Win2 profil Not defined.");\r
+       else AliError("Reset Win2 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin2(UShort_t reset, Int_t board)\r
 {\r
        // Set Reset Win clock for BG\r
-       if(IsClkValid(reset) && (board<kNCIUBoards)) fResetWin2[board] = reset;\r
-       else AliError(Form("Reset Win2 profil of board %d is not valid",board));\r
+       if((board>=0) && (board<kNCIUBoards)) {\r
+               fResetWin2[board] = reset;\r
+               if(!IsClkValid(reset)) AliWarning(Form("Reset Win2 of board %d is not valid : %d",board,reset));\r
+       }else {\r
+               AliError(Form("Impossible to Write at Board %d",board));\r
+       }\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t *peds){\r
        // Set Pedestal Subtraction Parameter\r
        if(peds)  for(int t=0; t<kNCIUBoards; t++) SetPedestalSubtraction(peds[t],t);\r
-       else AliFatal("Pedestal Subtraction Not defined.");\r
+       else AliError("Pedestal Subtraction Not defined.");\r
        \r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t ped, Int_t board)\r
 {\r
        // Set Pedestal Subtraction Parameter\r
-       if((board<kNCIUBoards)) fPedestalSubtraction[board] = ped;\r
+       if((board>=0) && (board<kNCIUBoards)) fPedestalSubtraction[board] = ped;\r
        else AliError(Form("Board %d is not valid",board));\r
 }\r
 \r
index c83b968..232f258 100644 (file)
@@ -95,37 +95,37 @@ public:
        // ----- Getters -----\r
        \r
        UShort_t * GetClk1Win1() const {return (UShort_t*)fClk1Win1;};\r
-       UShort_t GetClk1Win1(Int_t board ) const {return (board<kNCIUBoards?fClk1Win1[board]:0);};\r
+       UShort_t GetClk1Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk1Win1[board]:0);};\r
        UShort_t * GetClk2Win1() const {return (UShort_t*)fClk2Win1;};\r
-       UShort_t GetClk2Win1(Int_t board ) const {return (board<kNCIUBoards?fClk2Win1[board]:0);};\r
+       UShort_t GetClk2Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk2Win1[board]:0);};\r
 \r
        UShort_t * GetClk1Win2() const {return (UShort_t*)fClk1Win2;};\r
-       UShort_t GetClk1Win2(Int_t board ) const {return (board<kNCIUBoards?fClk1Win2[board]:0);};\r
+       UShort_t GetClk1Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk1Win2[board]:0);};\r
        UShort_t * GetClk2Win2() const {return (UShort_t*)fClk2Win2;};\r
-       UShort_t GetClk2Win2(Int_t board ) const {return (board<kNCIUBoards?fClk2Win2[board]:0);};\r
+       UShort_t GetClk2Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fClk2Win2[board]:0);};\r
 \r
        UShort_t * GetDelayClk1Win1() const {return (UShort_t*)fDelayClk1Win1;};\r
-       UShort_t GetDelayClk1Win1(Int_t board ) const {return (board<kNCIUBoards?fDelayClk1Win1[board]:0);};\r
+       UShort_t GetDelayClk1Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk1Win1[board]:0);};\r
        UShort_t * GetDelayClk2Win1() const {return (UShort_t*)fDelayClk2Win1;};\r
-       UShort_t GetDelayClk2Win1(Int_t board ) const {return (board<kNCIUBoards?fDelayClk2Win1[board]:0);};\r
+       UShort_t GetDelayClk2Win1(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk2Win1[board]:0);};\r
        \r
        UShort_t * GetDelayClk1Win2() const {return (UShort_t*)fDelayClk1Win2;};\r
-       UShort_t GetDelayClk1Win2(Int_t board ) const {return (board<kNCIUBoards?fDelayClk1Win2[board]:0);};\r
+       UShort_t GetDelayClk1Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk1Win2[board]:0);};\r
        UShort_t * GetDelayClk2Win2() const {return (UShort_t*)fDelayClk2Win2;};\r
-       UShort_t GetDelayClk2Win2(Int_t board ) const {return (board<kNCIUBoards?fDelayClk2Win2[board]:0);};\r
+       UShort_t GetDelayClk2Win2(Int_t board ) const {return ((board>=0 && board<kNCIUBoards)?fDelayClk2Win2[board]:0);};\r
        \r
        UShort_t * GetLatchWin1() const {return (UShort_t*)fLatchWin1;};\r
-       UShort_t GetLatchWin1(Int_t board ) const  {return (board<kNCIUBoards?fLatchWin1[board]:0);};\r
+       UShort_t GetLatchWin1(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fLatchWin1[board]:0);};\r
        UShort_t * GetLatchWin2() const {return (UShort_t*)fLatchWin2;};\r
-       UShort_t GetLatchWin2(Int_t board ) const  {return (board<kNCIUBoards?fLatchWin2[board]:0);};\r
+       UShort_t GetLatchWin2(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fLatchWin2[board]:0);};\r
        \r
        UShort_t * GetResetWin1() const {return (UShort_t*)fResetWin1;};\r
-       UShort_t GetResetWin1(Int_t board ) const  {return (board<kNCIUBoards?fResetWin1[board]:0);};\r
+       UShort_t GetResetWin1(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fResetWin1[board]:0);};\r
        UShort_t * GetResetWin2() const {return (UShort_t*)fResetWin2;};\r
-       UShort_t GetResetWin2(Int_t board ) const  {return (board<kNCIUBoards?fResetWin2[board]:0);};\r
+       UShort_t GetResetWin2(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fResetWin2[board]:0);};\r
        \r
        Bool_t * GetPedestalSubtraction() const {return (Bool_t*) fPedestalSubtraction;};\r
-       Bool_t GetPedestalSubtraction(Int_t board ) const  {return (board<kNCIUBoards?fPedestalSubtraction[board]:0);};\r
+       Bool_t GetPedestalSubtraction(Int_t board ) const  {return ((board>=0 && board<kNCIUBoards)?fPedestalSubtraction[board]:0);};\r
 \r
        UShort_t GetBBAThreshold() const {return fBBAThreshold;};\r
        UShort_t GetBBCThreshold() const {return fBBCThreshold;};\r
@@ -148,7 +148,7 @@ public:
        UShort_t GetMultV0CThrLow() const {return fMultV0CThrLow;};\r
        UShort_t GetMultV0CThrHigh() const {return fMultV0CThrHigh;};\r
 \r
-       UShort_t GetTriggerSelected(Int_t output) const {return (output<kNTriggerOutputs?fTriggerSelected[output]:0);};\r
+       UShort_t GetTriggerSelected(Int_t output) const {return ((output>=0 && output<kNTriggerOutputs)?fTriggerSelected[output]:0);};\r
        \r
        Bool_t GetEnableCharge(Int_t board, Int_t channel);\r
        Bool_t GetEnableTiming(Int_t board, Int_t channel);\r