X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=VZERO%2FAliVZEROTriggerData.cxx;h=4bf1e1198345611f7a2b98cadd9a6c6bbe458209;hb=6b0d4ad5288c5698b74986c4c3f11f92a773d8df;hp=ba837c4b0bae48187f9c882783f313a7a67402ca;hpb=e311315a02efe50012a69d04d046f285d5434946;p=u%2Fmrichter%2FAliRoot.git diff --git a/VZERO/AliVZEROTriggerData.cxx b/VZERO/AliVZEROTriggerData.cxx index ba837c4b0ba..4bf1e119834 100644 --- a/VZERO/AliVZEROTriggerData.cxx +++ b/VZERO/AliVZEROTriggerData.cxx @@ -1,452 +1,505 @@ - -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ - - -// -// -// -#include - -#include "AliLog.h" -#include "AliDCSValue.h" -#include "AliVZEROTriggerData.h" - -ClassImp(AliVZEROTriggerData) -//________________________________________________________________ - -AliVZEROTriggerData::AliVZEROTriggerData() : - TNamed(), - fBBAThreshold(0), - fBBCThreshold(0) , - fBGAThreshold(0) , - fBGCThreshold(0) , - fBBAForBGThreshold(0) , - fBBCForBGThreshold(0) , - fCentralityVOAThrLow(0) , - fCentralityVOAThrHigh(0) , - fCentralityVOCThrLow(0) , - fCentralityVOCThrHigh(0) , - fMultV0AThrLow(0) , - fMultV0AThrHigh(0) , - fMultV0CThrLow(0) , - fMultV0CThrHigh(0), - fRun(0), - fStartTime(0), - fEndTime(0), - fIsProcessed(kFALSE) - -{ - for(int i=0; iGetParameters(); - TIter iter(params); - TObjString* aliasName; - - while (( aliasName = (TObjString*) iter.Next() )) { - AliDCSValue* aValue = (AliDCSValue*) params->GetValue(aliasName); - Float_t val = aValue->GetFloat(); - //AliInfo(Form("%s : %f",aliasName->String().Data(), val)); - SetParameter(aliasName->String(),val); - - } -} - -//_____________________________________________________________________________ -void AliVZEROTriggerData::SetParameter(TString name, Float_t val){ - Int_t iBoard = -1; - Int_t iChannel = -1; - - TSeqCollection* nameSplit = name.Tokenize("/"); - TObjString * boardName = (TObjString *)nameSplit->At(2); - if(!boardName->String().Contains("CCIU")) sscanf(boardName->String().Data(),"CIU%d",&iBoard); - - TString paramName = ((TObjString *)nameSplit->At(3))->String(); - Char_t channel[2] ; channel[1] = '\0'; - channel[0] = paramName[paramName.Sizeof()-2]; - sscanf(channel,"%d",&iChannel); - - if(name.Contains("DelayClk1Win1")) SetDelayClk1Win1((UShort_t) val,iBoard-1); - else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard-1); - else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard-1); - else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard-1); - else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard-1); - else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard-1); - else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard-1); - else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard-1); - else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard-1); - else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard-1); - else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard-1); - else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard-1); - else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard-1); - else if(name.Contains("BBAThreshold")) SetBBAThreshold((UShort_t) val); - else if(name.Contains("BBCThreshold")) SetBBCThreshold((UShort_t) val); - else if(name.Contains("BGAThreshold")) SetBGAThreshold((UShort_t) val); - else if(name.Contains("BGCThreshold")) SetBGCThreshold((UShort_t) val); - else if(name.Contains("BBAForBGThreshold")) SetBBAForBGThreshold((UShort_t) val); - else if(name.Contains("BBCForBGThreshold")) SetBBCForBGThreshold((UShort_t) val); - else if(name.Contains("CentralityV0AThrLow")) SetCentralityV0AThrLow((UShort_t) val); - else if(name.Contains("CentralityV0AThrHigh")) SetCentralityV0AThrHigh((UShort_t) val); - else if(name.Contains("CentralityV0CThrLow")) SetCentralityV0CThrLow((UShort_t) val); - else if(name.Contains("CentralityV0CThrHigh")) SetCentralityV0CThrHigh((UShort_t) val); - else if(name.Contains("MultV0AThrLow")) SetMultV0AThrLow((UShort_t) val); - else if(name.Contains("MultV0AThrHigh")) SetMultV0AThrHigh((UShort_t) val); - else if(name.Contains("MultV0CThrLow")) SetMultV0CThrLow((UShort_t) val); - else if(name.Contains("MultV0CThrHigh")) SetMultV0CThrHigh((UShort_t) val); - else if(name.Contains("TriggerSelect")) SetTriggerSelected((UShort_t) val, iBoard -1); - else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard -1, iChannel-1); - else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard -1, iChannel-1); - else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard -1, iChannel-1); - else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard -1, iChannel-1); - else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard -1, iChannel-1); - else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard -1, iChannel-1); - else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard -1, iChannel-1); - else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard -1, iChannel-1); - else AliError(Form("No Setter found for FEE parameter : %s",name.Data())); -} -//________________________________________________________________ -void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel) -{ - if(board1023){ - AliWarning(Form("Profil Clock1 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); - delay = delay & 0x3FF; - } - if(board1023){ - AliWarning(Form("Profil Clock2 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); - delay = delay & 0x3FF; - } - if(board1023){ - AliWarning(Form("Profil Clock1 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); - delay = delay & 0x3FF; - } - if(board1023){ - AliWarning(Form("Profil Clock2 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); - delay = delay & 0x3FF; - } - if(board> i) & 0x1; - - if(word[0] != word[4]){ - if(word[4]) FallingEdge++; - else RisingEdge++; - } - for(int i=1 ; i<5 ; i++){ - if(word[i] != word[i-1]) { - if(word[i-1]) FallingEdge++; - else RisingEdge++; - } - } - if((FallingEdge>1)||(RisingEdge>1)) isValid = kFALSE; - if(((RisingEdge==0)&&(FallingEdge==0)) &&(!word[0])) isValid = kFALSE; - return isValid; -} + +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +// Class AliVZEROTriggerData +// ------------------------- +// Retrieves and hold the FEE parameters +// The parameters are recieved from the shuttle +// AliVZEROTriggerData is then used in the AliVZEROTriggerSimulator +// + +#include +#include + +#include "AliLog.h" +#include "AliDCSValue.h" +#include "AliVZEROTriggerData.h" + +ClassImp(AliVZEROTriggerData) +//________________________________________________________________ + +AliVZEROTriggerData::AliVZEROTriggerData() : + TNamed(), + fBBAThreshold(0), + fBBCThreshold(0) , + fBGAThreshold(0) , + fBGCThreshold(0) , + fBBAForBGThreshold(0) , + fBBCForBGThreshold(0) , + fCentralityVOAThrLow(0) , + fCentralityVOAThrHigh(0) , + fCentralityVOCThrLow(0) , + fCentralityVOCThrHigh(0) , + fMultV0AThrLow(0) , + fMultV0AThrHigh(0) , + fMultV0CThrLow(0) , + fMultV0CThrHigh(0), + fRun(0), + fStartTime(0), + fEndTime(0), + fIsProcessed(kFALSE) + +{ + // default constructor + for(int i=0; iGetParameters(); + TIter iter(params); + TObjString* aliasName; + + while (( aliasName = (TObjString*) iter.Next() )) { + AliDCSValue* aValue = (AliDCSValue*) params->GetValue(aliasName); + Float_t val = aValue->GetFloat(); + //AliInfo(Form("%s : %f",aliasName->String().Data(), val)); + SetParameter(aliasName->String(),val); + + } +} + +//_____________________________________________________________________________ +void AliVZEROTriggerData::SetParameter(TString name, Float_t val){ + // Set given parameter + + Int_t iBoard = -1; + Int_t iChannel = -1; + + TSeqCollection* nameSplit = name.Tokenize("/"); + TObjString * boardName = (TObjString *)nameSplit->At(2); + if(!boardName->String().Contains("CCIU")) sscanf(boardName->String().Data(),"CIU%d",&iBoard); + + TString paramName = ((TObjString *)nameSplit->At(3))->String(); + Char_t channel[2] ; channel[1] = '\0'; + channel[0] = paramName[paramName.Sizeof()-2]; + sscanf(channel,"%d",&iChannel); + + if(name.Contains("DelayClk1Win1")) SetDelayClk1Win1((UShort_t) val,iBoard-1); + else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard-1); + else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard-1); + else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard-1); + else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard-1); + else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard-1); + else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard-1); + else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard-1); + else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard-1); + else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard-1); + else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard-1); + else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard-1); + else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard-1); + else if(name.Contains("BBAThreshold")) SetBBAThreshold((UShort_t) val); + else if(name.Contains("BBCThreshold")) SetBBCThreshold((UShort_t) val); + else if(name.Contains("BGAThreshold")) SetBGAThreshold((UShort_t) val); + else if(name.Contains("BGCThreshold")) SetBGCThreshold((UShort_t) val); + else if(name.Contains("BBAForBGThreshold")) SetBBAForBGThreshold((UShort_t) val); + else if(name.Contains("BBCForBGThreshold")) SetBBCForBGThreshold((UShort_t) val); + else if(name.Contains("CentralityV0AThrLow")) SetCentralityV0AThrLow((UShort_t) val); + else if(name.Contains("CentralityV0AThrHigh")) SetCentralityV0AThrHigh((UShort_t) val); + else if(name.Contains("CentralityV0CThrLow")) SetCentralityV0CThrLow((UShort_t) val); + else if(name.Contains("CentralityV0CThrHigh")) SetCentralityV0CThrHigh((UShort_t) val); + else if(name.Contains("MultV0AThrLow")) SetMultV0AThrLow((UShort_t) val); + else if(name.Contains("MultV0AThrHigh")) SetMultV0AThrHigh((UShort_t) val); + else if(name.Contains("MultV0CThrLow")) SetMultV0CThrLow((UShort_t) val); + else if(name.Contains("MultV0CThrHigh")) SetMultV0CThrHigh((UShort_t) val); + else if(name.Contains("TriggerSelect")) SetTriggerSelected((UShort_t) val, iBoard -1); + else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard -1, iChannel-1); + else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard -1, iChannel-1); + else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard -1, iChannel-1); + else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard -1, iChannel-1); + else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard -1, iChannel-1); + else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard -1, iChannel-1); + else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard -1, iChannel-1); + else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard -1, iChannel-1); + else AliError(Form("No Setter found for FEE parameter : %s",name.Data())); +} +//________________________________________________________________ +void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel) +{ + // Set Pedestal Cut of individual channel + if(board1023){ + AliWarning(Form("Profil Clock1 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); + delay = delay & 0x3FF; + } + if(board1023){ + AliWarning(Form("Profil Clock2 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); + delay = delay & 0x3FF; + } + if(board1023){ + AliWarning(Form("Profil Clock1 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); + delay = delay & 0x3FF; + } + if(board1023){ + AliWarning(Form("Profil Clock2 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay)); + delay = delay & 0x3FF; + } + if(board> i) & 0x1; + + if(word[0] != word[4]){ + if(word[4]) fallingEdge++; + else risingEdge++; + } + for(int i=1 ; i<5 ; i++){ + if(word[i] != word[i-1]) { + if(word[i-1]) fallingEdge++; + else risingEdge++; + } + } + if((fallingEdge>1)||(risingEdge>1)) isValid = kFALSE; + if(((risingEdge==0)&&(fallingEdge==0)) &&(!word[0])) isValid = kFALSE; + return isValid; +} + + +