From: mivanov Date: Tue, 4 Nov 2014 06:39:28 +0000 (+0100) Subject: ATO-97, ATO-78 - implemented convolution of calibration parameters. Used in order... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=0a0c96eba49b099322a6552896570850a1b1f285 ATO-97, ATO-78 - implemented convolution of calibration parameters. Used in order to correlate Pulser (electronic) and Krypton (combined: gas gain + electronic) gain calibration --- diff --git a/TPC/Base/AliTPCCalPad.cxx b/TPC/Base/AliTPCCalPad.cxx index 85e0be37b3d..18786bb3de0 100644 --- a/TPC/Base/AliTPCCalPad.cxx +++ b/TPC/Base/AliTPCCalPad.cxx @@ -187,6 +187,21 @@ Bool_t AliTPCCalPad::LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction return isOK; } +Bool_t AliTPCCalPad::Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalPad*outlierPad, TF1 *fpad, TF1 *frow){ + // + // replace constent with median in the neigborhood + // + Bool_t isOK=kTRUE; + for (Int_t isec = 0; isec < kNsec; isec++) { + AliTPCCalROC *outlierROC=(outlierPad==NULL)?NULL:outlierPad->GetCalROC(isec); + if (fROC[isec]){ + isOK&=fROC[isec]->Convolute(sigmaPad,sigmaRow,outlierROC,fpad,frow); + } + } + return isOK; +} + + //_____________________________________________________________________________ void AliTPCCalPad::Add(Float_t c1) { diff --git a/TPC/Base/AliTPCCalPad.h b/TPC/Base/AliTPCCalPad.h index 82eeb1f22ca..40f7fc876d5 100644 --- a/TPC/Base/AliTPCCalPad.h +++ b/TPC/Base/AliTPCCalPad.h @@ -29,6 +29,7 @@ class TH1F; class TCanvas; class TTree; class TH2; +class TF1; class AliTPCCalPad : public TNamed { public: @@ -50,6 +51,7 @@ class AliTPCCalPad : public TNamed { // convolution Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalPad*outlierPad=0, Bool_t doEdge=kTRUE); Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalPad*outlierPad=0, Bool_t doEdge=kTRUE); + Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalPad*outlierPad=0, TF1 *fpad=0, TF1 *frow=0 ); // // algebra void Add(Float_t c1); // add constant c1 to all channels of all ROCs diff --git a/TPC/Base/AliTPCCalROC.cxx b/TPC/Base/AliTPCCalROC.cxx index fb5f42583bc..21a2a84e8c5 100644 --- a/TPC/Base/AliTPCCalROC.cxx +++ b/TPC/Base/AliTPCCalROC.cxx @@ -257,6 +257,43 @@ Bool_t AliTPCCalROC::LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, return kTRUE; } +Bool_t AliTPCCalROC::Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalROC*outlierROC, TF1 */*fpad*/, TF1 */*frow*/){ + // + // convolute the calibration with function fpad,frow + // in range +-4 sigma + + Float_t *newBuffer=new Float_t[fNChannels] ; + // + for (Int_t iRow=0; iRow< Int_t(fNRows); iRow++){ + Int_t nPads=GetNPads(iRow); // number of rows in current row + for (Int_t iPad=0; iPadGetValue(jRow,jPad)>0; + if (!isOutlier){ + Double_t weight= TMath::Gaus(jPad,iPad,sigmaPad)*TMath::Gaus(jRow,iRow,sigmaRow); + sumCal+=weight*GetValue(jRow,jPad); + sumW+=weight; + } + } + } + if (sumW>0){ + sumCal/=sumW; + newBuffer[fkIndexes[iRow]+iPad]=sumCal; + } + } + } + memcpy(fData, newBuffer,GetNchannels()*sizeof(Float_t)); + delete []newBuffer; +} // diff --git a/TPC/Base/AliTPCCalROC.h b/TPC/Base/AliTPCCalROC.h index a85a460b6d0..477d07bad94 100644 --- a/TPC/Base/AliTPCCalROC.h +++ b/TPC/Base/AliTPCCalROC.h @@ -18,6 +18,7 @@ class TH1F; class TH2F; class TArrayI; +class TF1; //_____________________________________________________________________________ class AliTPCCalROC : public TNamed { @@ -41,6 +42,7 @@ class AliTPCCalROC : public TNamed { // Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE); Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE); + Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalROC*outlierPad=0, TF1 *fpad=0, TF1 *frow=0 ); // // algebra void Add(Float_t c1); // add c1 to each channel of the ROC