Line data Source code
1 : //-*- Mode: C++ -*-
2 : // @(#) $Id$
3 :
4 : #ifndef ALIHLTTPCDIGITPUBLISHERCOMPONENT_H
5 : #define ALIHLTTPCDIGITPUBLISHERCOMPONENT_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 AliHLTTPCDigitPublisherComponent.h
11 : @author Matthias Richter
12 : @date
13 : @brief TPC digit publisher component (input from offline).
14 : */
15 :
16 : // see below 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 : class AliHLTTPCFileHandler;
25 :
26 : /**
27 : * @class AliHLTTPCDigitPublisherComponent
28 : * A digit publisher component for the TPC.
29 : *
30 : * Component ID: \b TPCDigitPublisher <br>
31 : * Library: \b libAliHLTTPC.
32 : *
33 : * Mandatory arguments: <br>
34 : * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
35 : * \li -slice <i> no </i> <br>
36 : * TPC slice no (slice = inner + outer sector)
37 : * \li -partition <i> no </i> <br>
38 : * readout partition no
39 : *
40 : * Optional arguments:<br>
41 : *
42 : *
43 : * @ingroup alihlt_system
44 : */
45 : class AliHLTTPCDigitPublisherComponent : public AliHLTOfflineDataSource {
46 : public:
47 : /** standard constructor */
48 : AliHLTTPCDigitPublisherComponent();
49 : /** destructor */
50 : virtual ~AliHLTTPCDigitPublisherComponent();
51 :
52 : /**
53 : * Get the id of the component.
54 : * Each component is identified by a unique id.
55 : * The function is pure virtual and must be implemented by the child class.
56 : * @return component id (string)
57 : */
58 : const char* GetComponentID();
59 :
60 : /**
61 : * Get the output data type of the component.
62 : * The function is pure virtual and must be implemented by the child class.
63 : * @return output data type
64 : */
65 : AliHLTComponentDataType GetOutputDataType();
66 :
67 : /**
68 : * Get a ratio by how much the data volume is shrinked or enhanced.
69 : * The function is pure virtual and must be implemented by the child class.
70 : * @param [out] constBase Additive part, independent of the input data volume.
71 : * @param [out] inputMultiplier Multiplication ratio.
72 : * @return values in the reference variables
73 : */
74 : void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
75 :
76 : /**
77 : * Spawn function.
78 : * Each component must implement a spawn function to create a new instance of
79 : * the class. Basically the function must return <i>new <b>my_class_name</b></i>.
80 : * @return new class instance
81 : */
82 : virtual AliHLTComponent* Spawn();
83 :
84 : protected:
85 :
86 : using AliHLTOfflineDataSource::GetEvent;
87 :
88 : /**
89 : * Init method.
90 : */
91 : int DoInit( int argc, const char** argv );
92 :
93 : /**
94 : * Deinit method.
95 : */
96 : int DoDeinit();
97 :
98 : /**
99 : * Data source method.
100 : * @param [in] evtData event data structure
101 : * @param [in] trigData trigger data structure
102 : * @param [in] outputPtr pointer to target buffer
103 : * @param [in,out] size <i>input</i>: size of target buffer
104 : * <i>output</i>:size of produced data
105 : * @param [in] outputBlocks list to receive output block descriptors
106 : * @return neg. error code if failed
107 : */
108 : int GetEvent( const AliHLTComponentEventData& evtData,
109 : AliHLTComponentTriggerData& trigData,
110 : AliHLTUInt8_t* outputPtr,
111 : AliHLTUInt32_t& size,
112 : vector<AliHLTComponentBlockData>& outputBlocks );
113 :
114 : private:
115 : /** copy constructor prohibited */
116 : AliHLTTPCDigitPublisherComponent(const AliHLTTPCDigitPublisherComponent&);
117 : /** assignment operator prohibited */
118 : AliHLTTPCDigitPublisherComponent& operator=(const AliHLTTPCDigitPublisherComponent&);
119 :
120 : /** max output block size, estimate during DoInit */
121 : UInt_t fMaxSize; //!transient
122 :
123 : /** first slice (range of slices currently not implemented) */
124 : int fMinSlice; //!transient
125 :
126 : /** first partition (range of partitions currently not implemented) */
127 : int fMinPart; //!transient
128 :
129 : /** instance of the file handler */
130 : static AliHLTTPCFileHandler* fgpFileHandler; //!transient
131 :
132 : /** no of file handler instances */
133 : static int fgFileHandlerInstances; //!transient
134 :
135 : /** event no the file handler is currently initialized for */
136 : static int fgCurrEvent; //!transient
137 :
138 6 : ClassDef(AliHLTTPCDigitPublisherComponent, 0);
139 : };
140 :
141 : #endif
|