90ebac25 |
1 | //-*- Mode: C++ -*- |
2 | // @(#) $Id$ |
3 | |
4 | #ifndef ALIHLTLOADERPUBLISHERCOMPONENT_H |
5 | #define ALIHLTLOADERPUBLISHERCOMPONENT_H |
79c114b5 |
6 | /* This file is property of and copyright by the ALICE HLT Project * |
7 | * ALICE Experiment at CERN, All rights reserved. * |
90ebac25 |
8 | * See cxx source for full Copyright notice */ |
9 | |
10 | /** @file AliHLTLoaderPublisherComponent.h |
11 | @author Matthias Richter |
12 | @date |
13 | @brief A general tree publisher component for the AliLoader. |
14 | */ |
15 | |
16 | #include "AliHLTOfflineDataSource.h" |
17 | |
18 | class AliLoader; |
19 | |
20 | /** |
21 | * @class AliHLTLoaderPublisherComponent |
22 | * A general tree publisher component for the AliLoader. |
23 | * |
24 | * Component ID: \b AliLoaderPublisher <br> |
25 | * Library: \b libAliHLTUtil. |
26 | * |
27 | * Mandatory arguments: <br> |
28 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating --> |
29 | * \li -loader <i> loader name </i> |
30 | * e.g. <tt> -loader TPCLoader </tt> |
31 | * \li -tree <i> tree name </i> : digits (default), clusters |
32 | * e.g. <tt> -tree digits </tt> |
33 | * \li -verbose<br> |
34 | * print out some more info messages, mainly for the sake of tutorials |
35 | * \li -datatype <i> datatype dataorigin </i> <br> |
36 | * data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt> |
37 | * \li -dataspec <i> specification </i> <br> |
38 | * data specification treated as decimal number or hex number if |
39 | * prepended by '0x' |
40 | * |
41 | * Optional arguments:<br> |
42 | * |
43 | * |
44 | * @ingroup alihlt_system |
45 | */ |
46 | class AliHLTLoaderPublisherComponent : public AliHLTOfflineDataSource { |
47 | public: |
48 | /** standard constructor */ |
49 | AliHLTLoaderPublisherComponent(); |
50 | /** destructor */ |
51 | virtual ~AliHLTLoaderPublisherComponent(); |
52 | |
53 | /** |
54 | * Get the id of the component. |
55 | * Each component is identified by a unique id. |
56 | * The function is pure virtual and must be implemented by the child class. |
57 | * @return component id (string) |
58 | */ |
59 | const char* GetComponentID(); |
60 | |
61 | /** |
62 | * Get the output data type of the component. |
63 | * The function is pure virtual and must be implemented by the child class. |
64 | * @return output data type |
65 | */ |
66 | AliHLTComponentDataType GetOutputDataType(); |
67 | |
68 | /** |
69 | * Get a ratio by how much the data volume is shrinked or enhanced. |
70 | * The function is pure virtual and must be implemented by the child class. |
71 | * @param constBase <i>return</i>: additive part, independent of the |
72 | * input data volume |
73 | * @param inputMultiplier <i>return</i>: multiplication ratio |
74 | * @return values in the reference variables |
75 | */ |
76 | void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); |
77 | |
78 | /** |
79 | * Spawn function. |
80 | * Each component must implement a spawn function to create a new instance of |
81 | * the class. Basically the function must return <i>new <b>my_class_name</b></i>. |
82 | * @return new class instance |
83 | */ |
84 | virtual AliHLTComponent* Spawn(); |
85 | |
86 | protected: |
87 | /** |
88 | * Init method. |
89 | */ |
90 | int DoInit( int argc, const char** argv ); |
91 | |
92 | /** |
93 | * Deinit method. |
94 | */ |
95 | int DoDeinit(); |
96 | |
97 | /** |
98 | * Data source method. |
99 | * @param evtData event data structure |
100 | * @param trigData trigger data structure |
101 | * @return |
102 | */ |
103 | int GetEvent(const AliHLTComponentEventData& evtData, |
104 | AliHLTComponentTriggerData& trigData); |
105 | |
106 | private: |
79c114b5 |
107 | /** not a valid copy constructor, defined according to effective C++ style */ |
108 | AliHLTLoaderPublisherComponent(const AliHLTLoaderPublisherComponent&); |
109 | /** not a valid assignment op, but defined according to effective C++ style */ |
110 | AliHLTLoaderPublisherComponent& operator=(const AliHLTLoaderPublisherComponent&); |
111 | |
90ebac25 |
112 | /** |
113 | * Get tree of type specified in fTreeType from loader. |
114 | */ |
115 | TTree* GetTree(); |
116 | |
56951e49 |
117 | /** max output block size, estimated during DoInit */ |
90ebac25 |
118 | Int_t fMaxSize; //!transient |
119 | |
120 | /** loader string */ |
121 | TString fLoaderType; //!transient |
122 | |
123 | /** tree string */ |
124 | TString fTreeType; //!transient |
125 | |
126 | /** be verbose: info printouts */ |
127 | Bool_t fVerbose; //!transient |
128 | |
129 | /** data type */ |
130 | AliHLTComponentDataType fDataType; //!transient |
131 | |
132 | /** data specification */ |
133 | AliHLTUInt32_t fSpecification; //!transient |
134 | |
135 | /** instance of the AliLoader */ |
136 | AliLoader* fpLoader; //!transient |
137 | |
138 | ClassDef(AliHLTLoaderPublisherComponent, 0); |
139 | }; |
140 | |
141 | #endif |