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 */
10 /** @file AliHLTRawReaderPublisherComponent.h
11 @author Matthias Richter
13 @brief A general data publisher component for the AliRawReader.
16 // see header file for class documentation
18 // refer to README to build package
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22 #include "AliHLTOfflineDataSource.h"
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.
29 * If no data specification is given, the equipment id is used as default.
30 * A child class can implement @ref GetSpecificationFromEquipmentId to
31 * provide a different rule.
33 * The component publishes one data block for each equipment id in the
34 * give range. If the RawReader does not provide any data, an empty data
35 * block consisting of the Common Data Header is produced.
37 * Component ID: \b AliRawReaderPublisher <br>
38 * Library: \b libAliHLTUtil.
40 * Mandatory arguments: <br>
41 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
42 * \li -detector <i> detector name </i>
43 * e.g. <tt> -detector TPC </tt>
44 * \li -equipmentid <i> id </i>
45 * the equipmentid within the detector, e.g. TPC 0 is 768
46 * \li -minid <i> id </i>
47 * the minimum equipmentid including detector offset, e.g. 768 is TPC 0
48 * \li -maxid <i> id </i>
49 * the maximum equipmentid including detector offset (default = minid)
51 * print out some more info messages, mainly for the sake of tutorials
52 * \li -datatype <i> datatype dataorigin </i> <br>
53 * data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt>
54 * \li -dataspec <i> specification </i> <br>
55 * data specification treated as decimal number or hex number if
58 * Optional arguments:<br>
61 * @ingroup alihlt_system
63 class AliHLTRawReaderPublisherComponent : public AliHLTOfflineDataSource {
65 /** standard constructor */
66 AliHLTRawReaderPublisherComponent();
68 virtual ~AliHLTRawReaderPublisherComponent();
71 * Get the id of the component.
72 * Each component is identified by a unique id.
73 * The function is pure virtual and must be implemented by the child class.
74 * @return component id (string)
76 const char* GetComponentID();
79 * Get the output data type of the component.
80 * The function is pure virtual and must be implemented by the child class.
81 * @return output data type
83 AliHLTComponentDataType GetOutputDataType();
86 * Get a ratio by how much the data volume is shrinked or enhanced.
87 * The function is pure virtual and must be implemented by the child class.
88 * @param constBase <i>return</i>: additive part, independent of the
90 * @param inputMultiplier <i>return</i>: multiplication ratio
91 * @return values in the reference variables
93 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
97 * Each component must implement a spawn function to create a new instance of
98 * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
99 * @return new class instance
101 virtual AliHLTComponent* Spawn();
107 int DoInit( int argc, const char** argv );
115 * Data source method.
116 * @param evtData event data structure
117 * @param trigData trigger data structure
118 * @param outputPtr pointer to target buffer
119 * @param size <i>input</i>: size of target buffer
120 * <i>output</i>:size of produced data
121 * @param outputBlocks list to receive output block descriptors
122 * @return neg. error code if failed
124 int GetEvent( const AliHLTComponentEventData& evtData,
125 AliHLTComponentTriggerData& trigData,
126 AliHLTUInt8_t* outputPtr,
127 AliHLTUInt32_t& size,
128 vector<AliHLTComponentBlockData>& outputBlocks );
130 using AliHLTOfflineDataSource::GetEvent;
133 virtual int GetSpecificationFromEquipmentId(int id, AliHLTUInt32_t &specification) const;
136 /** copy constructor prohibited */
137 AliHLTRawReaderPublisherComponent(const AliHLTRawReaderPublisherComponent&);
138 /** assignment operator prohibited */
139 AliHLTRawReaderPublisherComponent& operator=(const AliHLTRawReaderPublisherComponent&);
141 /** max output block size, estimated during DoInit */
142 Int_t fMaxSize; //!transient
144 /** detector string */
145 TString fDetector; //!transient
147 /** min equipment id */
148 int fMinEquId; //!transient
150 /** max equipment id */
151 int fMaxEquId; //!transient
153 /** be verbose: info printouts */
154 Bool_t fVerbose; //!transient
157 AliHLTComponentDataType fDataType; //!transient
159 /** data specification */
160 AliHLTUInt32_t fSpecification; //!transient
162 ClassDef(AliHLTRawReaderPublisherComponent, 0);