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