4 #ifndef ALIHLTMONITORINGRELAY_H
5 #define ALIHLTMONITORINGRELAY_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 AliHLTMonitoringRelay.h
11 @author Matthias Richter
13 @brief Relay components for monitoring objects.
16 #include "AliHLTProcessor.h"
23 * @class AliHLTMonitoringRelay
24 * A relay component for monitoring data objects.
25 * It keeps a copy of the last block of every parent and forwards all
26 * the blocks together. By that, the output of histograms (rarely to
27 * be published but for every event filled.
29 * Input data blocks must be uniquely identified by the combination of
30 * - data type (id and origin)
31 * - block specification
35 * <h2>General properties:</h2>
37 * Component ID: \b MonitoringRelay <br>
38 * Library: \b libAliHLTUtil.so <br>
39 * Input Data Types: kAliHLTAnyDataType <br>
40 * Output Data Types: according to input blocks <br>
42 * <h2>Mandatory arguments:</h2>
43 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
45 * <h2>Optional arguments:</h2>
46 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
48 * print out some more info messages, mainly for the sake of tutorials
50 * <h2>Configuration:</h2>
51 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
52 * Configuration by component arguments.
54 * <h2>Default CDB entries:</h2>
55 * The component loads no CDB entries.
57 * <h2>Performance:</h2>
58 * Low profile: input objects are unpacked and binary copied, no streaming
61 * <h2>Memory consnumption:</h2>
62 * The component allocates memory of the maximum size for every input
65 * <h2>Output size:</h2>
67 * @ingroup alihlt_util_components
69 class AliHLTMonitoringRelay : public AliHLTProcessor
72 /// standard constructor
73 AliHLTMonitoringRelay();
75 virtual ~AliHLTMonitoringRelay();
77 /// inherited from AliHLTComponent, get component id
78 virtual const char* GetComponentID() {return "MonitoringRelay";};
80 /// inherited from AliHLTComponent, get the input data type
81 void GetInputDataTypes( AliHLTComponentDataTypeList& );
83 /// inherited from AliHLTComponent, get the output data type
84 AliHLTComponentDataType GetOutputDataType();
86 /// inherited from AliHLTComponent, get the output data size estimator
87 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
89 /// inherited from AliHLTComponent, create a component
90 virtual AliHLTComponent* Spawn() {return new AliHLTMonitoringRelay;}
92 /// descriptor of monitoring items
93 class AliHLTMonitoringItem {
95 // standard constructor
96 AliHLTMonitoringItem();
98 AliHLTMonitoringItem(const AliHLTComponentBlockData* pBlock, const TObject* pObject);
100 ~AliHLTMonitoringItem();
102 /// copy data from buffer
103 int SetData(void* pBuffer, int size);
105 /// get buffer pointer of the current data
106 void* GetBuffer() const;
107 /// get size of the current data
108 unsigned GetSize() const;
110 const AliHLTComponentDataType& GetDataType() const;
111 /// get specification
112 AliHLTUInt32_t GetSpecification() const;
114 bool operator==(const AliHLTComponentBlockData& bd) const;
115 bool operator!=(const AliHLTComponentBlockData& bd) const;
116 bool operator==(const TObject& object) const;
117 bool operator!=(const TObject& object) const;
121 /// copy constructor prohibited
122 AliHLTMonitoringItem(const AliHLTMonitoringItem&);
123 /// assignment operator prohibited
124 AliHLTMonitoringItem& operator=(const AliHLTMonitoringItem&);
126 AliHLTComponentDataType fDt; //! transient
127 AliHLTUInt32_t fSpecification; //! transient
128 TString fName; //! transient
129 TString fTitle; //! transient
130 TArrayC* fData; //! transient
131 int fDataSize; //! transient
133 typedef vector<AliHLTMonitoringItem*> AliHLTMonitoringItemPList;
136 /// inherited from AliHLTProcessor, data processing
137 int DoEvent( const AliHLTComponentEventData& evtData,
138 AliHLTComponentTriggerData& trigData );
140 using AliHLTProcessor::DoEvent;
142 /// inherited from AliHLTComponent, component initialisation
143 int DoInit( int argc, const char** argv );
145 /// inherited from AliHLTComponent, scan argument
146 int ScanConfigurationArgument(int argc, const char** argv);
148 /// inherited from AliHLTComponent, component cleanup.
152 /// copy constructor prohibited
153 AliHLTMonitoringRelay(const AliHLTMonitoringRelay&);
154 /// assignment operator prohibited
155 AliHLTMonitoringRelay& operator=(const AliHLTMonitoringRelay&);
157 /// find a block of data type and specificaton
158 AliHLTMonitoringItem* FindItem(const AliHLTComponentBlockData* pBlock, const TObject* pObject) const;
160 /// the list of items
161 AliHLTMonitoringItemPList fItems; //! transient
162 /// actual size of the data sample
163 unsigned fOutputSize; //! transient
165 ClassDef(AliHLTMonitoringRelay, 0)