]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCAgent.h
fix of segm. violation in the GPU tracker (by D.Rohr)
[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 ALICE HLT Project        * 
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  * @ingroup alihlt_system
26  */
27 class AliHLTTPCAgent : public AliHLTModuleAgent {
28  public:
29   /**
30    * standard constructor. The agent is automatically registered in the
31    * global agent manager
32    */
33   AliHLTTPCAgent();
34   /** destructor */
35   virtual ~AliHLTTPCAgent();
36
37   /**
38    * Register all configurations belonging to this module with the
39    * AliHLTConfigurationHandler. The agent can adapt the configurations
40    * to be registered to the current AliRoot setup by checking the
41    * runloader.
42    * @param handler      the configuration handler
43    * @param rawReader    AliRawReader instance
44    * @param runloader    AliRoot runloader
45    * @return neg. error code if failed
46    */
47   int CreateConfigurations(AliHLTConfigurationHandler* handler,
48                            AliRawReader* rawReader=NULL,
49                            AliRunLoader* runloader=NULL) const;
50
51   /**
52    * Get the top configurations belonging to this module.
53    * A top configuration describes a processing chain. It can simply be
54    * described by the last configuration(s) in the chain. 
55    * The agent can adapt the configurations to be registered to the current
56    * AliRoot setup by checking the runloader.
57    * @param rawReader    AliRawReader instance
58    * @param runloader    AliRoot runloader
59    * @return number of configurations, neg. error code if failed
60    */
61   const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
62                                       AliRunLoader* runloader=NULL) const;
63
64   /**
65    * Component libraries which the configurations of this agent depend on.
66    * @return list of component libraries as a blank-separated string.
67    */
68   const char* GetRequiredComponentLibraries() const;
69
70   /**
71    * Register components for the AliHLTTPC library.
72    * @param [in] pHandler  instance of the component handler          
73    */
74   int RegisterComponents(AliHLTComponentHandler* pHandler) const;
75
76   /**
77    * Get handler decription for TPC data in the HLTOUT data stream.
78    * @param [in]  dt        data type of the block
79    * @param [in]  spec      specification of the block
80    * @param [out] desc      handler description
81    * @return 1 if the agent can provide a handler, 0 if not
82    */
83   int GetHandlerDescription(AliHLTComponentDataType dt,
84                             AliHLTUInt32_t spec,
85                             AliHLTOUTHandlerDesc& desc) const;
86
87   /**
88    * Get specific handler for TPC data in the HLTOUT data stream.
89    * @param [in] dt        data type of the block
90    * @param [in] spec      specification of the block
91    * @return pointer to handler
92    */
93   AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
94                                      AliHLTUInt32_t spec);
95
96   /**
97    * Delete an HLTOUT handler.
98    * @param pInstance      pointer to handler
99    */
100   int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
101
102   /**
103    * The handler for TPC RAW data in the HLTOUT stream.
104    */
105   class AliHLTTPCRawDataHandler : public AliHLTOUTHandlerEquId {
106   public:
107     /** constructor */
108     AliHLTTPCRawDataHandler();
109     /** destructor */
110     ~AliHLTTPCRawDataHandler();
111
112     /**
113      * Process a data block.
114      * Decode specification and return equipment id of the data block.
115      * The data itsself i untouched.
116      * @return equipment id the block should be used for.
117      */
118     int ProcessData(AliHLTOUT* pData);
119
120   private:
121
122   };
123
124   enum EOptions {
125     // indicate cluster id data blocks in the HLTOUT
126     kHaveCompressedClusterIdDataBlock = BIT(15)
127   };
128
129  protected:
130
131  private:
132   /** copy constructor prohibited */
133   AliHLTTPCAgent(const AliHLTTPCAgent&);
134   /** assignment operator prohibited */
135   AliHLTTPCAgent& operator=(const AliHLTTPCAgent&);
136
137   /** handler for TPC raw data in the HLTOUT stream */
138   AliHLTTPCRawDataHandler* fRawDataHandler; //!transient
139
140   /** afterburner for {'TRAKSEGS':'TPC '} in the HLTOUT stream */
141   AliHLTOUTHandlerChain* fTracksegsDataHandler; //! transient
142
143   /// handler for {'CLUSTERS':'TPC '}
144   AliHLTOUTHandlerChain* fClustersDataHandler; //! transient
145
146   /// handler for data blocks related to data compression
147   AliHLTOUTHandlerChain* fCompressionMonitorHandler; //! transient
148
149   ClassDef(AliHLTTPCAgent, 0);
150 };
151
152 #endif