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