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)
{
class TCanvas;
class TTree;
class TH2;
+class TF1;
class AliTPCCalPad : public TNamed {
public:
// 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
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; iPad<nPads; iPad++){
+ Int_t jRow0=TMath::Max(TMath::Nint(iRow-sigmaRow*4.),0);
+ Int_t jRow1=TMath::Min(TMath::Nint(iRow+sigmaRow*4.),Int_t(fNRows));
+ Int_t jPad0=TMath::Max(TMath::Nint(iPad-sigmaPad*4.),0);
+ Int_t jPad1=TMath::Min(TMath::Nint(iRow+sigmaPad*4.),Int_t(nPads));
+ //
+ Double_t sumW=0;
+ Double_t sumCal=0;
+ for (Int_t jRow=jRow0; jRow<=jRow1; jRow++){
+ for (Int_t jPad=jPad0; jPad<=jPad1; jPad++){
+ if (!IsInRange(jRow,jPad)) continue;
+ Bool_t isOutlier=(outlierROC==NULL)?kFALSE:outlierROC->GetValue(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;
+}
//
class TH1F;
class TH2F;
class TArrayI;
+class TF1;
//_____________________________________________________________________________
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