]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/util/AliHLTBlockFilterComponent.cxx
tracking at slice borders improved
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTBlockFilterComponent.cxx
index 2c7c1314d92066501c17d5d3d6a4df181fca7ea9..191c71bf02bf00a5cd1ed10d33788681b7a40644 100644 (file)
@@ -1,4 +1,4 @@
-// @(#) $Id$
+// $Id$
 
 //**************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project        * 
 ClassImp(AliHLTBlockFilterComponent)
 
 AliHLTBlockFilterComponent::AliHLTBlockFilterComponent()
-  :
-  fFilterRules()
+  : AliHLTProcessor()
+  , fFilterRules()
+  , fPrescalar(0)
+  , fFirstEvent(0)
 {
   // see header file for class documentation
   // or
@@ -56,7 +58,7 @@ AliHLTComponentDataType AliHLTBlockFilterComponent::GetOutputDataType()
 {
   // see header file for class documentation
   if (fFilterRules.size()==1) return fFilterRules[0].fDataType;
-  if (fFilterRules.size()==0) return kAliHLTVoidDataType;
+  if (fFilterRules.size()==0) return kAliHLTAnyDataType;
   return kAliHLTMultipleDataType;
 }
 
@@ -156,6 +158,16 @@ int AliHLTBlockFilterComponent::DoInit( int argc, const char** argv )
        HLTError("invalid parameter/remnant (%s) for argument %s, number expected", pRemnant, argument.Data());
        iResult=-EINVAL;
       }
+      // -prescalar
+    } else if (argument.CompareTo("-prescalar")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      TString parameter(argv[i]);
+      fPrescalar=parameter.Atoi();
+      // -skip-events
+    } else if (argument.CompareTo("-skip-events")==0) {
+      if ((bMissingParam=(++i>=argc))) break;
+      TString parameter(argv[i]);
+      fFirstEvent=parameter.Atoi();
     } else {
       HLTError("unknown argument %s", argument.Data());
       iResult=-EINVAL;
@@ -186,6 +198,8 @@ int AliHLTBlockFilterComponent::DoEvent( const AliHLTComponentEventData& /*evtDa
 {
   // see header file for class documentation
   int iResult=0;
+  if ((fPrescalar==0 || ((GetEventCount())%fPrescalar)==0) &&
+      GetEventCount()>=(int)fFirstEvent) {
   for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock();
        pBlock!=NULL; 
        pBlock=GetNextInputBlock()) {
@@ -198,6 +212,7 @@ int AliHLTBlockFilterComponent::DoEvent( const AliHLTComponentEventData& /*evtDa
       HLTDebug("block type %s %#x discarded by filter rules", DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification);
     }
   }
+  }
   size=0;
   return iResult;
 }