]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/util/AliHLTRawReaderPublisherComponent.h
documentation
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRawReaderPublisherComponent.h
CommitLineData
6666bfe5 1//-*- Mode: C++ -*-
2// @(#) $Id$
3
4#ifndef ALIHLTRAWREADERPUBLISHERCOMPONENT_H
5#define ALIHLTRAWREADERPUBLISHERCOMPONENT_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 */
9
10/** @file AliHLTRawReaderPublisherComponent.h
11 @author Matthias Richter
12 @date
13 @brief A general data publisher component for the AliRawReader.
14*/
15
16// see header file for class documentation
17// or
18// refer to README to build package
19// or
20// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
22#include "AliHLTOfflineDataSource.h"
23
24/**
25 * @class AliHLTRawReaderPublisherComponent
26 * A general data publisher component for the AliRawReader.
27 * The component publishs the data of a given detector and equipment ID.
28 * Publication of several IDs, i.e. DDLs, requires derivation of
29 * the data type and/or specification from the ID. This requires a child
30 * class and implementation of @ref GetSpecificationFromEquipmentId.
31 *
32 * Component ID: \b AliRawReaderPublisher <br>
33 * Library: \b libAliHLTUtil.
34 *
35 * Mandatory arguments: <br>
36 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
37 * \li -detector <i> detector name </i>
38 * e.g. <tt> -detector TPC </tt>
39 * \li -equipmentid <i> id </i>
40 * the equipmentid
41 * \li -minid <i> id </i>
42 * the minimum equipmentid
43 * \li -maxid <i> id </i>
44 * the maximum equipmentid
45 * \li -verbose<br>
46 * print out some more info messages, mainly for the sake of tutorials
47 * \li -datatype <i> datatype dataorigin </i> <br>
48 * data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt>
49 * \li -dataspec <i> specification </i> <br>
50 * data specification treated as decimal number or hex number if
51 * prepended by '0x'
52 *
53 * Optional arguments:<br>
54 *
55 *
56 * @ingroup alihlt_system
57 */
58class AliHLTRawReaderPublisherComponent : public AliHLTOfflineDataSource {
59 public:
60 /** standard constructor */
61 AliHLTRawReaderPublisherComponent();
62 /** destructor */
63 virtual ~AliHLTRawReaderPublisherComponent();
64
65 /**
66 * Get the id of the component.
67 * Each component is identified by a unique id.
68 * The function is pure virtual and must be implemented by the child class.
69 * @return component id (string)
70 */
71 const char* GetComponentID();
72
73 /**
74 * Get the output data type of the component.
75 * The function is pure virtual and must be implemented by the child class.
76 * @return output data type
77 */
78 AliHLTComponentDataType GetOutputDataType();
79
80 /**
81 * Get a ratio by how much the data volume is shrinked or enhanced.
82 * The function is pure virtual and must be implemented by the child class.
83 * @param constBase <i>return</i>: additive part, independent of the
84 * input data volume
85 * @param inputMultiplier <i>return</i>: multiplication ratio
86 * @return values in the reference variables
87 */
88 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
89
90 /**
91 * Spawn function.
92 * Each component must implement a spawn function to create a new instance of
93 * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
94 * @return new class instance
95 */
96 virtual AliHLTComponent* Spawn();
97
98 protected:
99 /**
100 * Init method.
101 */
102 int DoInit( int argc, const char** argv );
103
104 /**
105 * Deinit method.
106 */
107 int DoDeinit();
108
109 /**
110 * Data source method.
111 * @param evtData event data structure
112 * @param trigData trigger data structure
113 * @param outputPtr pointer to target buffer
114 * @param size <i>input</i>: size of target buffer
115 * <i>output</i>:size of produced data
116 * @param outputBlocks list to receive output block descriptors
117 * @return neg. error code if failed
118 */
119 int GetEvent( const AliHLTComponentEventData& evtData,
120 AliHLTComponentTriggerData& trigData,
121 AliHLTUInt8_t* outputPtr,
122 AliHLTUInt32_t& size,
123 vector<AliHLTComponentBlockData>& outputBlocks );
124
125 protected:
126 virtual int GetSpecificationFromEquipmentId(int id, AliHLTUInt32_t &specification) const;
127
128 private:
129 /** copy constructor prohibited */
130 AliHLTRawReaderPublisherComponent(const AliHLTRawReaderPublisherComponent&);
131 /** assignment operator prohibited */
132 AliHLTRawReaderPublisherComponent& operator=(const AliHLTRawReaderPublisherComponent&);
133
134 /** max output block size, estimated during DoInit */
135 Int_t fMaxSize; //!transient
136
137 /** detector string */
138 TString fDetector; //!transient
139
140 /** min equipment id */
141 int fMinEquId; //!transient
142
143 /** max equipment id */
144 int fMaxEquId; //!transient
145
146 /** be verbose: info printouts */
147 Bool_t fVerbose; //!transient
148
149 /** data type */
150 AliHLTComponentDataType fDataType; //!transient
151
152 /** data specification */
153 AliHLTUInt32_t fSpecification; //!transient
154
155 ClassDef(AliHLTRawReaderPublisherComponent, 0);
156};
157
158#endif