3 #ifndef ALIHLTSAMPLEMONITORINGCOMPONENT_H
4 #define ALIHLTSAMPLEMONITORINGCOMPONENT_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 AliHLTSampleMonitoringComponent.h
11 @author Matthias Richter
13 @brief A sample monitoring component for the HLT.
16 #include "AliHLTProcessor.h"
21 * @class AliHLTSampleMonitoringComponent
22 * An HLT sample component.
23 * This component does not any data processing at all. It just
24 * illustrates the existence of several components in ine library and
25 * allows to set up a very simple chain with different components.
27 * The component generates two histograms and accumulates random data
28 * as events are coming in. The two histograms are sent out via tree
29 * different approaches, see output data types.
31 * <h2>General properties:</h2>
33 * Component ID: \b Sample-MonitoringComponent <br>
34 * Library: \b libAliHLTSample.so <br>
35 * Input Data Types: @ref kAliHLTAnyDataType <br>
36 * in fact, the component ignores all incoming data blocks
39 * \li {ROOT_TH1,EXPL} <br>
40 * one histogram per data block, specification identifies the
42 * \li {ROOTOBJA,EXPL} <br>
43 * the two histograms are added to a TOBjArray which is pushed
44 * to the output stream
45 * \li {ROOTTREE,EXPL} <br>
46 * the two histograms are added to a TTree which is pushed
47 * to the output stream
49 * <h2>Mandatory arguments:</h2>
50 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52 * <h2>Optional arguments:</h2>
53 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
54 * \li -push-histograms <br>
55 * push histograms idividually
56 * \li -push-ttree (default) <br>
57 * push histograms embedded in TTree
58 * \li -push-array <br>
59 * push histograms embedded in TObjArray
61 * <h2>Configuration:</h2>
62 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
64 * <h2>Default CDB entries:</h2>
65 * The component has no default CDB entry.
66 * It does not load any configuration from the global <tt>ConfigHLT</tt>
69 * For re-configuration/steering the component expects a TObjString object
70 * holding a string with the configuration parameters explained above.
72 * <h2>Performance:</h2>
73 * The component does not any event data processing.
75 * <h2>Memory consumption:</h2>
76 * The component does not any event data processing.
78 * <h2>Output size:</h2>
79 * The component has no output data.
81 * The component implements the @ref alihltcomponent-low-level-interface.
82 * for data processing.
84 * Using the latter case, a component can also be reconfigured. Special
85 * events are propageted through the chain in order to trigger the re-
86 * configuration. The component needs to implement the function
87 * @ref Reconfigure(). The simplest version of a configuration object is
88 * a string object (TObjString) containing configuration arguments.
90 * @ingroup alihlt_tutorial
92 class AliHLTSampleMonitoringComponent : public AliHLTProcessor {
94 AliHLTSampleMonitoringComponent();
95 virtual ~AliHLTSampleMonitoringComponent();
97 // AliHLTComponent interface functions
98 const char* GetComponentID();
99 void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
100 AliHLTComponentDataType GetOutputDataType();
101 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
102 AliHLTComponent* Spawn();
105 // AliHLTComponent interface functions
106 int DoInit( int argc, const char** argv );
108 int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
109 int Reconfigure(const char* cdbEntry, const char* chainId);
111 using AliHLTProcessor::DoEvent;
114 /** copy constructor prohibited */
115 AliHLTSampleMonitoringComponent(const AliHLTSampleMonitoringComponent&);
116 /** assignment operator prohibited */
117 AliHLTSampleMonitoringComponent& operator=(const AliHLTSampleMonitoringComponent&);
120 * Configure the component.
121 * Parse a string for the configuration arguments and set the component
124 * This function illustrates the scanning of an argument string. The string
125 * was presumably fetched from the CDB.
127 int Configure(const char* arguments);
129 /** send histograms individually as data blocks */
130 bool fPushHistograms; // !transient
132 /** send histograms TTree embedded */
133 bool fPushTTree; // !transient
135 /** send histograms Object Array embedded */
136 bool fPushTObjArray; // !transient
138 /** test histogram */
139 TH1F* fHpx; //!transient
141 /** test histogram */
142 TH1F* fHpy; //!transient
144 ClassDef(AliHLTSampleMonitoringComponent, 0)