+Bool_t AliTPCCalROC::MedianFilter(Int_t deltaRow, Int_t deltaPad){
+ //
+ // Modify content of the class
+ // write median
+ Float_t *newBuffer=new Float_t[fNChannels] ;
+ Float_t *cacheBuffer=new Float_t[fNChannels] ;
+ //
+ for (UInt_t iRow=0; iRow<fNRows; iRow++){
+ Int_t nPads=GetNPads(iRow); // number of rows in current row
+ for (Int_t iPad=0; iPad<nPads; iPad++){
+ Int_t counter=0;
+ for (Int_t dRow=-deltaRow; dRow<=deltaRow; dRow++){
+ Int_t jRow=iRow+dRow;
+ Int_t jPads= GetNPads(jRow);
+ if (jPads==0) continue;
+ Int_t offset=(nPads-jPads)/2.;
+ for (Int_t dPad=-deltaPad; dPad<=deltaPad; dPad++){
+ Int_t jPad=iPad+dPad+offset;
+ if (jPad<0 || jPad>=jPads) continue;
+ cacheBuffer[counter++]=GetValue(jRow,jPad);
+ }
+ }
+ newBuffer[fkIndexes[iRow]+iPad] = TMath::Median(counter,cacheBuffer);
+ }
+ }
+ memcpy(fData, newBuffer,GetNchannels()*sizeof(Float_t));
+ delete []newBuffer;
+ delete []cacheBuffer;
+ return kTRUE;
+}
+
+Bool_t AliTPCCalROC::LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type){
+ //
+ //
+ // //
+ // Modify content of the class
+ // write median
+ if (fraction<0 || fraction>1) return kFALSE;
+ Float_t *newBuffer=new Float_t[fNChannels] ;
+ Double_t *cacheBuffer=new Double_t[fNChannels];
+ //
+ for (UInt_t iRow=0; iRow<fNRows; iRow++){
+ Int_t nPads=GetNPads(iRow); // number of rows in current row
+ for (Int_t iPad=0; iPad<nPads; iPad++){
+ Int_t counter=0;
+ for (Int_t dRow=-deltaRow; dRow<=deltaRow; dRow++){
+ Int_t jRow=iRow+dRow;
+ Int_t jPads= GetNPads(jRow);
+ if (jPads==0) continue;
+ Int_t offset=(nPads-jPads)/2.;
+ for (Int_t dPad=-deltaPad; dPad<=deltaPad; dPad++){
+ Int_t jPad=iPad+dPad+offset;
+ if (jPad<0 || jPad>=jPads) continue;
+ cacheBuffer[counter++]=GetValue(jRow,jPad);
+ }
+ }
+ Double_t mean,rms;
+ AliMathBase::EvaluateUni(counter,cacheBuffer,mean,rms,fraction*Double_t(counter));
+ newBuffer[fkIndexes[iRow]+iPad] = (type==0)? mean:rms;
+ }
+ }
+ memcpy(fData, newBuffer,GetNchannels()*sizeof(Float_t));
+ delete []newBuffer;
+ delete []cacheBuffer;
+ return kTRUE;
+}
+
+