From b405b00346f2c860216bfad7c5a08a5790eac5bd Mon Sep 17 00:00:00 2001 From: mbroz Date: Thu, 8 Jan 2015 16:24:04 +0100 Subject: [PATCH] More FEE parameters in calibration object --- AD/ADbase/AliADCalibData.cxx | 452 ++++++++++++++++++++++++++++++++++- AD/ADbase/AliADCalibData.h | 151 +++++++++++- 2 files changed, 599 insertions(+), 4 deletions(-) diff --git a/AD/ADbase/AliADCalibData.cxx b/AD/ADbase/AliADCalibData.cxx index 2eced28feca..a77d2ba81af 100644 --- a/AD/ADbase/AliADCalibData.cxx +++ b/AD/ADbase/AliADCalibData.cxx @@ -36,7 +36,17 @@ ClassImp(AliADCalibData) AliADCalibData::AliADCalibData(): fLightYields(NULL), fPMGainsA(NULL), - fPMGainsB(NULL) + fPMGainsB(NULL), + fBBAThreshold(0), + fBBCThreshold(0) , + fBGAThreshold(0) , + fBGCThreshold(0) , + fBBAForBGThreshold(0) , + fBBCForBGThreshold(0) , + fMultV0AThrLow(0) , + fMultV0AThrHigh(0) , + fMultV0CThrLow(0) , + fMultV0CThrHigh(0) { // default constructor @@ -62,6 +72,21 @@ AliADCalibData::AliADCalibData(): fTriggerCountOffset[i] = 3247; fRollOver[i] = 3563; } + for(int i=0; i=0 && channel<16) { + if(integrator) fPedestalCutOdd[channel] = val; + else fPedestalCutEven[channel] = val; + } else AliError(Form("Impossible to write at : Channel %d",channel)); +} +//________________________________________________________________ +void AliADCalibData::SetOnlinePedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel) +{ + Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel); + if(ch>=0 && ch<16) { + if(integrator) fPedestalCutOdd[ch] = val; + else fPedestalCutEven[ch] = val; + } + else + AliError("Board/Channel numbers are not valid"); +} +//________________________________________________________________ +UShort_t AliADCalibData::GetOnlinePedestalCut(Int_t integrator, Int_t channel) +{ + // Get Pedestal Cut of individual channel + if(channel>=0 && channel<16) { + if(integrator) return(fPedestalCutOdd[channel]); + else return(fPedestalCutEven[channel]); + }else AliError(Form("Impossible to read at : Channel %d",channel)); + return 0; +} +//________________________________________________________________ +void AliADCalibData::SetOnlinePedestal(UShort_t val, Int_t integrator, Int_t channel) +{ + // Set Pedestal of individual channel + if(channel>=0 && channel<16) { + if(integrator) fPedestalOdd[channel] = val; + else fPedestalEven[channel] = val; + } else AliError(Form("Impossible to write at : Channel %d ; Integrator %d ",channel,integrator)); +} +//________________________________________________________________ +void AliADCalibData::SetOnlinePedestal(UShort_t val,Int_t integrator, Int_t board, Int_t channel) +{ + Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel); + if(ch>=0 && ch<16) { + if(integrator) fPedestalOdd[ch] = val; + else fPedestalEven[ch] = val; + } + else + AliError("Board/Channel numbers are not valid"); +} +//________________________________________________________________ +UShort_t AliADCalibData::GetOnlinePedestal(Int_t integrator, Int_t channel) +{ + // Get Pedestal of individual channel + if(channel>=0 && channel<16) { + if(integrator) return(fPedestalOdd[channel]); + else return(fPedestalEven[channel]); + } else AliError(Form("Impossible to read at : Channel %d",channel)); + return 0; +} +//________________________________________________________________ +void AliADCalibData::SetEnableCharge(Bool_t val, Int_t channel) +{ + // Set the channels enabled for Charge triggers + if(channel>=0 && channel<16) fEnableCharge[channel] = val; + else AliError(Form("Impossible to write at : Channel %d",channel)); +} +//________________________________________________________________ +Bool_t AliADCalibData::GetEnableCharge(Int_t channel) +{ + // Get the channels enabled for Charge triggers + if(channel>=0 && channel<16) return(fEnableCharge[channel]); + else AliError(Form("Impossible to read at : Channel %d",channel)); + return kFALSE; +} +//________________________________________________________________ +void AliADCalibData::SetEnableTiming(Bool_t val, Int_t channel) +{ + // Set the channels enabled for Timing triggers + if(channel>=0 && channel<16) fEnableTiming[channel] = val; + else AliError(Form("Impossible to write at : Channel %d",channel)); +} +//________________________________________________________________ +Bool_t AliADCalibData::GetEnableTiming(Int_t channel) +{ + // Get the channels enabled for Timing triggers + if(channel>=0 && channel<16) return(fEnableTiming[channel]); + else AliError(Form("Impossible to read at : Channel %d",channel)); + return kFALSE; +} +//________________________________________________________________ +void AliADCalibData::SetEnableCharge(Bool_t val,Int_t board, Int_t channel) +{ + Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel); + // Set the channels enabled for Charge triggers + if(ch>=0) fEnableCharge[ch] = val; + else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel)); +} +//________________________________________________________________ +void AliADCalibData::SetEnableTiming(Bool_t val,Int_t board, Int_t channel) +{ + Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel); + // Set the channels enabled for Timing triggers + if(ch>=0) fEnableTiming[ch] = val; + else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel)); +} +//________________________________________________________________ +void AliADCalibData::SetTriggerSelected(UShort_t trigger, Int_t output) +{ + // Set the trigger selected on the outputs to CTP + if(output>=0 && output<5) fTriggerSelected[output] = trigger; + else AliError(Form("Trigger output number %d not valid",output)); +} + +//________________________________________________________________ +void AliADCalibData::SetClk1Win1(UShort_t* clks) +{ + // Set Win clock of BB + if(clks) for(int t=0; t=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; +} + //________________________________________________________________ Int_t AliADCalibData::GetOfflineChannelNumber(Int_t board, Int_t channel) { diff --git a/AD/ADbase/AliADCalibData.h b/AD/ADbase/AliADCalibData.h index a574c92d532..ad410068eac 100644 --- a/AD/ADbase/AliADCalibData.h +++ b/AD/ADbase/AliADCalibData.h @@ -61,6 +61,62 @@ class AliADCalibData: public TNamed { Float_t GetDiscriThr(Int_t channel) const {return fDiscriThr[channel];} Float_t* GetDiscriThr() const {return (Float_t*)fDiscriThr;} Float_t GetCalibDiscriThr(Int_t channel, Bool_t scaled); + + UShort_t * GetClk1Win1() const {return (UShort_t*)fClk1Win1;}; + UShort_t GetClk1Win1(Int_t board ) const {return ((board>=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && board=0 && output<5)?fTriggerSelected[output]:0);}; + + Bool_t GetEnableCharge(Int_t channel); + Bool_t GetEnableTiming(Int_t channel); + UShort_t GetOnlinePedestal(Int_t integrator, Int_t channel); + UShort_t GetOnlinePedestalCut(Int_t integrator, Int_t channel); + static Int_t GetBoardNumber(Int_t channel); static Int_t GetFEEChannelNumber(Int_t channel); @@ -109,13 +165,73 @@ class AliADCalibData: public TNamed { void SetDiscriThr(Float_t thr, Int_t board, Int_t channel); void SetDiscriThr(const Float_t* thresholds); + void SetClk1Win1(UShort_t* clks); + void SetClk1Win1(UShort_t clk, Int_t board); + void SetClk2Win1(UShort_t* clks); + void SetClk2Win1(UShort_t clk, Int_t board); + + void SetClk1Win2(UShort_t* clks); + void SetClk1Win2(UShort_t clk, Int_t board); + void SetClk2Win2(UShort_t* clks); + void SetClk2Win2(UShort_t clk, Int_t board); + + void SetDelayClk1Win1(UShort_t* delays); + void SetDelayClk1Win1(UShort_t delay, Int_t board); + void SetDelayClk2Win1(UShort_t* delays); + void SetDelayClk2Win1(UShort_t delay, Int_t board); + + void SetDelayClk1Win2(UShort_t* delays); + void SetDelayClk1Win2(UShort_t delay, Int_t board); + void SetDelayClk2Win2(UShort_t* delays); + void SetDelayClk2Win2(UShort_t delay, Int_t board); + + void SetLatchWin1(UShort_t *latchs); + void SetLatchWin1(UShort_t latch, Int_t board); + void SetLatchWin2(UShort_t *latchs); + void SetLatchWin2(UShort_t latch, Int_t board); + + void SetResetWin1(UShort_t *resets); + void SetResetWin1(UShort_t reset, Int_t board); + void SetResetWin2(UShort_t *resets); + void SetResetWin2(UShort_t reset, Int_t board); + + void SetPedestalSubtraction(Bool_t *peds); + void SetPedestalSubtraction(Bool_t ped, Int_t board); + + void SetBBAThreshold(UShort_t th) {fBBAThreshold = th;}; + void SetBBCThreshold(UShort_t th) {fBBCThreshold = th;}; + + void SetBGAThreshold(UShort_t th) {fBGAThreshold = th;}; + void SetBGCThreshold(UShort_t th) {fBGCThreshold = th;}; + + void SetBBAForBGThreshold(UShort_t th) {fBBAForBGThreshold = th;}; + void SetBBCForBGThreshold(UShort_t th) {fBBCForBGThreshold = th;}; + + + void SetMultV0AThrLow(UShort_t th) {fMultV0AThrLow = th;}; + void SetMultV0AThrHigh(UShort_t th) {fMultV0AThrHigh = th;}; + + void SetMultV0CThrLow(UShort_t th) {fMultV0CThrLow = th;}; + void SetMultV0CThrHigh(UShort_t th) {fMultV0CThrHigh = th;}; + + void SetTriggerSelected(UShort_t trigger, Int_t output); + + void SetEnableCharge(Bool_t val, Int_t board, Int_t channel); + void SetEnableTiming(Bool_t val, Int_t board, Int_t channel); + void SetEnableCharge(Bool_t val, Int_t channel); + void SetEnableTiming(Bool_t val, Int_t channel); + void SetOnlinePedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel); + void SetOnlinePedestalCut(UShort_t val, Int_t integrator, Int_t board, Int_t channel); + void SetOnlinePedestal(UShort_t val, Int_t integrator, Int_t channel); + void SetOnlinePedestalCut(UShort_t val, Int_t integrator, Int_t channel); protected: void InitLightYields(); void InitPMGains(); + Bool_t IsClkValid(UShort_t clock) const; - Float_t fPedestal[32]; // Mean pedestal values - Float_t fSigma[32]; // Sigmas of pedestal peaks + Float_t fPedestal[32]; // Mean pedestal values - used offline + Float_t fSigma[32]; // Sigmas of pedestal peaks - used offline Float_t fADCmean[32]; // ADC mean values Float_t fADCsigma[32]; // ADC sigma values Float_t fMeanHV[16]; // Mean PMT HV needed to compute MIP value @@ -131,6 +247,37 @@ class AliADCalibData: public TNamed { UInt_t fSearchWindow[kNCIUBoards];// HPTDC search window (25ns units) UInt_t fTriggerCountOffset[kNCIUBoards]; // HPTDC trigger count offset (25ns units) UInt_t fRollOver[kNCIUBoards]; // HPTDC roll-over (25ns units) + + UShort_t fClk1Win1[kNCIUBoards]; //Profil of the Clock 1 of the Window 1 (BB window) + UShort_t fClk2Win1[kNCIUBoards]; //Profil of the Clock 2 of the Window 1 (BB window) + UShort_t fClk1Win2[kNCIUBoards]; //Profil of the Clock 1 of the Window 2 (BG window) + UShort_t fClk2Win2[kNCIUBoards]; //Profil of the Clock 2 of the Window 2 (BG window) + UShort_t fDelayClk1Win1[kNCIUBoards]; // Delays of the Clock 1 of the Window 1 (BB window) + UShort_t fDelayClk2Win1[kNCIUBoards]; // Delays of the Clock 2 of the Window 1 (BB window) + UShort_t fDelayClk1Win2[kNCIUBoards]; // Delays of the Clock 1 of the Window 2 (BG window) + UShort_t fDelayClk2Win2[kNCIUBoards]; // Delays of the Clock 2 of the Window 2 (BG window) + UShort_t fLatchWin1[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 1 (BB window) + UShort_t fLatchWin2[kNCIUBoards]; //Profil of the Clock of the Latch signal of Window 2 (BG window) + UShort_t fResetWin1[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 1 (BB window) + UShort_t fResetWin2[kNCIUBoards]; //Profil of the Clock of the Reset signal of Window 2 (BG window) + Bool_t fPedestalSubtraction[kNCIUBoards]; // Flag to en(dis)able pedestal subtraction before centrality trigger calculation + UShort_t fBBAThreshold; // Minimum bias Threshold in number of channel hit for ADA + UShort_t fBBCThreshold; // Minimum bias Threshold in number of channel hit for ADC + UShort_t fBGAThreshold; // Beam Gas Threshold in number of channel hit for ADA + UShort_t fBGCThreshold; // Beam Gas Threshold in number of channel hit for ADC + UShort_t fBBAForBGThreshold; // BBA threshold for Beam Gas triggers (i.e. BBA and BGC) + UShort_t fBBCForBGThreshold; // BBC threshold for Beam Gas triggers (i.e. BBC and BGA) + UShort_t fMultV0AThrLow; // Threshold used for multiplicity triggers (i.e. MTA and MTC) + UShort_t fMultV0AThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC) + UShort_t fMultV0CThrLow; // Threshold used for multiplicity triggers (i.e. MTA and MTC) + UShort_t fMultV0CThrHigh; // Threshold used for multiplicity triggers (i.e. MTA and MTC) + UShort_t fTriggerSelected[5]; // Triggers selected on the 5 outputs to CTP + Bool_t fEnableCharge[16]; // Flag to know is a channel is participating to the Charge triggers + Bool_t fEnableTiming[16]; // Flag to know is a channel is participating to the Timing triggers + UShort_t fPedestalOdd[16]; // Pedestals for the Odd integrators + UShort_t fPedestalEven[16]; // Pedestals for the Even integrators + UShort_t fPedestalCutOdd[16]; // Pedestals Cut for the Odd integrators + UShort_t fPedestalCutEven[16]; // Pedestals Cut for the Even integrators Float_t fDiscriThr[16]; // Discriminator thresholds -- 2.39.3