]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCAgent.h
Change "undefined" value of the time stamp from 0 to kMaxUInt, while 0 could be a...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCAgent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTTPCAGENT_H
5 #define ALIHLTTPCAGENT_H
6 //* This file is property of and copyright by the                          * 
7 //* ALICE Experiment at CERN, All rights reserved.                         *
8 //* See cxx source for full Copyright notice                               *
9
10 //  @file   AliHLTTPCAgent.h
11 //  @author Matthias Richter
12 //  @date   
13 //  @brief  Agent of the libAliHLTTPC library
14 //  @note
15
16 #include "AliHLTModuleAgent.h"
17 #include "AliHLTOUTHandlerEquId.h"
18
19 class AliHLTOUTHandlerChain;
20
21 /**
22  * @class AliHLTTPCAgent
23  * This is the agent for the AliHLTTPC library.
24  *
25  * Defined reconstruction chains:
26  * - TPC-raw-data
27  * - TPC-hwcfdata
28  * - TPC-raw-clusters
29  * - TPC-clusters
30  * - TPC-global-merger
31  * - TPC-mcTrackMarker
32  * - TPC-compression
33  *
34  * Default reconstruction chains:
35  * - simulation: TPC-compression
36  * - reconstruction: TPC-compression-emulation
37  *
38  * @ingroup alihlt_system
39  */
40 class AliHLTTPCAgent : public AliHLTModuleAgent {
41  public:
42   /**
43    * standard constructor. The agent is automatically registered in the
44    * global agent manager
45    */
46   AliHLTTPCAgent();
47   /** destructor */
48   virtual ~AliHLTTPCAgent();
49
50   /**
51    * Register all configurations belonging to this module with the
52    * AliHLTConfigurationHandler. The agent can adapt the configurations
53    * to be registered to the current AliRoot setup by checking the
54    * runloader.
55    * @param handler      the configuration handler
56    * @param rawReader    AliRawReader instance
57    * @param runloader    AliRoot runloader
58    * @return neg. error code if failed
59    */
60   int CreateConfigurations(AliHLTConfigurationHandler* handler,
61                            AliRawReader* rawReader=NULL,
62                            AliRunLoader* runloader=NULL) const;
63
64   /**
65    * Get the top configurations belonging to this module.
66    * A top configuration describes a processing chain. It can simply be
67    * described by the last configuration(s) in the chain. 
68    * The agent can adapt the configurations to be registered to the current
69    * AliRoot setup by checking the runloader.
70    * @param rawReader    AliRawReader instance
71    * @param runloader    AliRoot runloader
72    * @return number of configurations, neg. error code if failed
73    */
74   const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
75                                       AliRunLoader* runloader=NULL) const;
76
77   /**
78    * Component libraries which the configurations of this agent depend on.
79    * @return list of component libraries as a blank-separated string.
80    */
81   const char* GetRequiredComponentLibraries() const;
82
83   /**
84    * Register components for the AliHLTTPC library.
85    * @param [in] pHandler  instance of the component handler          
86    */
87   int RegisterComponents(AliHLTComponentHandler* pHandler) const;
88
89   /**
90    * Get handler decription for TPC data in the HLTOUT data stream.
91    * @param [in]  dt        data type of the block
92    * @param [in]  spec      specification of the block
93    * @param [out] desc      handler description
94    * @return 1 if the agent can provide a handler, 0 if not
95    */
96   int GetHandlerDescription(AliHLTComponentDataType dt,
97                             AliHLTUInt32_t spec,
98                             AliHLTOUTHandlerDesc& desc) const;
99
100   /**
101    * Get specific handler for TPC data in the HLTOUT data stream.
102    * @param [in] dt        data type of the block
103    * @param [in] spec      specification of the block
104    * @return pointer to handler
105    */
106   AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
107                                      AliHLTUInt32_t spec);
108
109   /**
110    * Delete an HLTOUT handler.
111    * @param pInstance      pointer to handler
112    */
113   int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
114
115   /**
116    * The handler for TPC RAW data in the HLTOUT stream.
117    */
118   class AliHLTTPCRawDataHandler : public AliHLTOUTHandlerEquId {
119   public:
120     /** constructor */
121     AliHLTTPCRawDataHandler();
122     /** destructor */
123     ~AliHLTTPCRawDataHandler();
124
125     /**
126      * Process a data block.
127      * Decode specification and return equipment id of the data block.
128      * The data itsself i untouched.
129      * @return equipment id the block should be used for.
130      */
131     int ProcessData(AliHLTOUT* pData);
132
133   private:
134
135   };
136
137   enum EOptions {
138     // indicate cluster id data blocks in the HLTOUT
139     kHaveCompressedClusterIdDataBlock = BIT(15)
140   };
141
142  protected:
143
144  private:
145   /** copy constructor prohibited */
146   AliHLTTPCAgent(const AliHLTTPCAgent&);
147   /** assignment operator prohibited */
148   AliHLTTPCAgent& operator=(const AliHLTTPCAgent&);
149
150   /** handler for TPC raw data in the HLTOUT stream */
151   AliHLTTPCRawDataHandler* fRawDataHandler; //!transient
152
153   /** afterburner for {'TRAKSEGS':'TPC '} in the HLTOUT stream */
154   AliHLTOUTHandlerChain* fTracksegsDataHandler; //! transient
155
156   /// handler for {'CLUSTERS':'TPC '}
157   AliHLTOUTHandlerChain* fClustersDataHandler; //! transient
158
159   /// handler for data blocks related to data compression
160   AliHLTOUTHandlerChain* fCompressionMonitorHandler; //! transient
161
162   ClassDef(AliHLTTPCAgent, 0);
163 };
164
165 #endif