/************************************************************************** * 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); Int_t val; if(aValue) { val = aValue->GetUInt(); AliInfo(Form("%s : %d",aliasName->String().Data(), val)); SetParameter(aliasName->String(),val); } } } //_____________________________________________________________________________ void AliVZEROTriggerData::SetParameter(TString name, Int_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); else if(name.Contains("Clk1Win1")) SetClk1Win1((UShort_t) val,iBoard); else if(name.Contains("DelayClk1Win2")) SetDelayClk1Win2((UShort_t) val,iBoard); else if(name.Contains("Clk1Win2")) SetClk1Win2((UShort_t) val,iBoard); else if(name.Contains("DelayClk2Win1")) SetDelayClk2Win1((UShort_t) val,iBoard); else if(name.Contains("Clk2Win1")) SetClk2Win1((UShort_t) val,iBoard); else if(name.Contains("DelayClk2Win2")) SetDelayClk2Win2((UShort_t) val,iBoard); else if(name.Contains("Clk2Win2")) SetClk2Win2((UShort_t) val,iBoard); else if(name.Contains("LatchWin1")) SetLatchWin1((UShort_t) val,iBoard); else if(name.Contains("LatchWin2")) SetLatchWin2((UShort_t) val,iBoard); else if(name.Contains("ResetWin1")) SetResetWin1((UShort_t) val,iBoard); else if(name.Contains("ResetWin2")) SetResetWin2((UShort_t) val,iBoard); else if(name.Contains("PedestalSubtraction")) SetPedestalSubtraction((Bool_t) val,iBoard); 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, iChannel-1 ); else if(name.Contains("EnableCharge")) SetEnableCharge((Bool_t) val, iBoard , iChannel-1); else if(name.Contains("EnableTiming")) SetEnableTiming((Bool_t) val, iBoard , iChannel-1); else if(name.Contains("DiscriThr")) SetDiscriThr((UShort_t) val, iBoard, iChannel-1); else if(name.Contains("DelayHit")) SetDelayHit((UShort_t) val, iBoard, iChannel-1); else if(name.Contains("PedOdd")) SetPedestal((UShort_t) val, 1, iBoard, iChannel-1); else if(name.Contains("PedEven")) SetPedestal((UShort_t) val, 0, iBoard, iChannel-1); else if(name.Contains("PedCutOdd")) SetPedestalCut((UShort_t) val, 1, iBoard, iChannel-1); else if(name.Contains("PedCutEven")) SetPedestalCut((UShort_t) val, 0, iBoard, iChannel-1); else AliError(Form("No Setter found for FEE parameter : %s",name.Data())); // delete nameSplit; } //________________________________________________________________ void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel) { // Set Pedestal Cut of individual channel if((board>=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && board=0 && channel=0 && output=0) && (board=0) && (board=0) && (board=0) && (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((board>=0) && (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((board>=0) && (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((board>=0) && (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>=0) && (board=0) && (board=0) && (board=0) && (board=0) && (board=0) && (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; }