4 #ifndef ALIHLTBLOCKFILTERCOMPONENT_H
5 #define ALIHLTBLOCKFILTERCOMPONENT_H
6 /* This file is property of and copyright by the ALICE HLT Project *
7 * ALICE Experiment at CERN, All rights reserved. *
8 * See cxx source for full Copyright notice */
10 /** @file AliHLTBlockFilterComponent.h
11 @author Matthias Richter
13 @brief A simple data block filter and merger, merges block descriptors
15 // see below for class documentation
17 // refer to README to build package
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21 #include "AliHLTProcessor.h"
24 * @class AliHLTBlockFilterComponent
25 * A data block merger and filter.
26 * It merges data block descriptors fulfilling the filtering rules and
27 * forwards the descriptors to the output. The actual data is not touched.
29 class AliHLTBlockFilterComponent : public AliHLTProcessor
32 /** standard constructor */
33 AliHLTBlockFilterComponent();
35 virtual ~AliHLTBlockFilterComponent();
38 * The id of the component.
39 * @return component id (string)
41 virtual const char* GetComponentID() {return "BlockFilter";};
44 * Get the input data types of the component.
45 * @return list of data types in the vector reference
47 void GetInputDataTypes( AliHLTComponentDataTypeList& );
50 * Get the output data type of the component.
51 * If @ref kAliHLTMultipleDataType is returned, the framework invokes
52 * @ref GetOutputDataTypes.
53 * @return output data type
55 AliHLTComponentDataType GetOutputDataType();
58 * Get the output data types of the component.
59 * The function can be implemented to indicate multiple output data types
60 * in the target array.
61 * @ref GetOutputDataType must return @ref kAliHLTMultipleDataType in order
62 * to invoke this method.
63 * @param tgtList list to receive the data types
64 * @return no of output data types, data types in the target list
66 int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
69 * Get a ratio by how much the data volume is shrinked or enhanced.
70 * @param constBase <i>return</i>: additive part, independent of the
72 * @param inputMultiplier <i>return</i>: multiplication ratio
73 * @return values in the reference variables
75 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
79 * @return new class instance
81 virtual AliHLTComponent* Spawn() {return new AliHLTBlockFilterComponent;}
86 * Data processing method for the component.
87 * Filters the incoming data descriptors according to the rules and forwards
88 * them into the output.
89 * @return neg. error code if failed
91 int DoEvent( const AliHLTComponentEventData& evtData,
92 const AliHLTComponentBlockData* blocks,
93 AliHLTComponentTriggerData& trigData,
94 AliHLTUInt8_t* outputPtr,
96 AliHLTComponentBlockDataList& outputBlocks );
98 using AliHLTProcessor::DoEvent;
101 * Component initialisation and argument scan.
103 int DoInit( int argc, const char** argv );
111 /** copy constructor prohibited */
112 AliHLTBlockFilterComponent(const AliHLTBlockFilterComponent&);
113 /** assignment operator prohibited */
114 AliHLTBlockFilterComponent& operator=(const AliHLTBlockFilterComponent&);
117 * Check if the data block is selected by the filter rules.
118 * @return 1 if selected
120 int IsSelected(const AliHLTComponentBlockData& block);
122 /** filtering rules, only the data type and specification members are use */
123 AliHLTComponentBlockDataList fFilterRules; //! transient
125 ClassDef(AliHLTBlockFilterComponent, 0)