]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
some quick hacks to improve speed for ActiveChannelSelection: terminate ZeroSuppressi...
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Oct 2008 00:14:09 +0000 (00:14 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 10 Oct 2008 00:14:09 +0000 (00:14 +0000)
HLT/TPCLib/AliHLTTPCPad.cxx
HLT/TPCLib/AliHLTTPCPad.h
HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.cxx

index 6e3a5a154bb4d54cce3601d7e4def8ff89ef0dcc..b4cb5dc3280fa02cdd30055b687defc09a2f9fd6 100644 (file)
@@ -534,7 +534,7 @@ Int_t AliHLTTPCPad::GetDataSignal(Int_t bin) const
   return fDataSignals[bin];
 }
 
-void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoint, Int_t beginTime, Int_t endTime, Int_t timebinsLeft, Int_t timebinsRight, Int_t valueUnderAverage){
+void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoint, Int_t beginTime, Int_t endTime, Int_t timebinsLeft, Int_t timebinsRight, Int_t valueUnderAverage, bool speedup){
   //see headerfile for documentation
  
   //HLTDebug("In Pad: nRMS=%d, threshold=%d, reqMinPoint=%d, beginTime=%d, endTime=%d, timebinsLeft=%d timebinsRight=%d valueUnderAverage=%d \n",nRMS,threshold,reqMinPoint,beginTime,endTime,timebinsLeft,timebinsRight,valueUnderAverage);
@@ -553,7 +553,8 @@ void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoin
   }
  
   Int_t fThresholdUsed=threshold;
+
+  Int_t maxVal=0;
   Int_t nAdded=0;
   Int_t sumNAdded=0;
   fSizeOfSignalPositionArray=0;
@@ -562,6 +563,7 @@ void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoin
       if(fDataSignals[i]>0){
        nAdded++;
        sumNAdded+=fDataSignals[i]*fDataSignals[i];
+       if (maxVal<fDataSignals[i]) maxVal=fDataSignals[i];
       }
     }
   }
@@ -570,6 +572,7 @@ void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoin
       if(fDataSignals[i]>0){
        nAdded++;
        sumNAdded+=fDataSignals[i];
+       if (maxVal<fDataSignals[i]) maxVal=fDataSignals[i];
       }
     }
   }
@@ -600,6 +603,7 @@ void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoin
   else{
     fThresholdUsed = (Int_t)(averageValue + threshold); 
   }
+  if (maxVal<fThresholdUsed) return;
 
   // Do zero suppression on the adc values within [beginTime,endTime](add the good values)
   for(Int_t i=beginTime;i<endTime;i++){
@@ -630,6 +634,9 @@ void AliHLTTPCPad::ZeroSuppress(Double_t nRMS, Int_t threshold, Int_t reqMinPoin
        fDataSignals[t]=(AliHLTTPCSignal_t)(fDataSignals[t]-averageValue + valueUnderAverage);
        fSignalPositionArray[fSizeOfSignalPositionArray]=t;
        fSizeOfSignalPositionArray++;
+       // Matthias Oct 10 2008: trying hard to make the code faster for the
+       // AltroChannelSelection. For that we only need to know there is data
+       if (speedup) return;
       }
       i+=lastSignalTime;
     }
index f0712201a21152d6ed4962a859b4843acbda6afa..ec8a1fd28da3a202304ff6fb602fccb1da1b0da8 100644 (file)
@@ -297,7 +297,7 @@ public:
    * @param timebinsRight      Timebins to include right of the signals above threshold (to include tails)
    * @param valueBelowAverage  The number of adc-counts below the average value. (sometimes there can be useful to also add some signals below average for your signals, especially when there is a lot of noise) It means that more of the tails of the signal is added.
    */
-  void ZeroSuppress(Double_t nRMS,Int_t threshold,Int_t reqMinPoint,Int_t beginTime,Int_t endTime,Int_t timebinsLeft, Int_t timebinsRight, Int_t valueBelowAverage);
+  void ZeroSuppress(Double_t nRMS,Int_t threshold,Int_t reqMinPoint,Int_t beginTime,Int_t endTime,Int_t timebinsLeft, Int_t timebinsRight, Int_t valueBelowAverage, bool speedup=false);
   
   /**
    * Bool method which returns the timein number of the first signal and number of consecutive signals, used together with GetPointer(bin) to access data 
index 9edbd702f400d7c1ecb0bb92f212cac115fd7e8c..6ff31087687141219d1757a413b39c8c29d33026 100755 (executable)
@@ -433,7 +433,7 @@ int AliHLTTPCZeroSuppressionComponent::DoEvent( const AliHLTComponentEventData&
        
        AliHLTTPCPad *tmpPad = fRowPadVector[row][pad];
        tmpPad->SetDataToDefault();
-       
+
        //reading data to pad
        while(fDigitReader->NextBunch()){
          const UInt_t *bunchData= fDigitReader->GetSignals();
@@ -453,7 +453,7 @@ int AliHLTTPCZeroSuppressionComponent::DoEvent( const AliHLTComponentEventData&
        sumOccupancy+=tmpPad->GetNAddedSignals();
 
        if(tmpPad->GetNAddedSignals()>=(UInt_t)fMinimumNumberOfSignals){
-         tmpPad->ZeroSuppress(fNRMSThreshold, fSignalThreshold, fMinimumNumberOfSignals, fStartTimeBin, fEndTimeBin, fLeftTimeBin, fRightTimeBin, fValueBelowAverage);
+         tmpPad->ZeroSuppress(fNRMSThreshold, fSignalThreshold, fMinimumNumberOfSignals, fStartTimeBin, fEndTimeBin, fLeftTimeBin, fRightTimeBin, fValueBelowAverage, fSkipSendingZSData);
          if(tmpPad->GetNAddedSignals()>0){
            assert((int)mapping.GetRow(fDigitReader->GetAltroBlockHWaddr())==row);
            assert((int)mapping.GetPad(fDigitReader->GetAltroBlockHWaddr())==pad);