Line data Source code
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 : UInt_t GetDetectorMask() const;
51 :
52 : /**
53 : * Register all configurations belonging to this module with the
54 : * AliHLTConfigurationHandler. The agent can adapt the configurations
55 : * to be registered to the current AliRoot setup by checking the
56 : * runloader.
57 : * @param handler the configuration handler
58 : * @param rawReader AliRawReader instance
59 : * @param runloader AliRoot runloader
60 : * @return neg. error code if failed
61 : */
62 : int CreateConfigurations(AliHLTConfigurationHandler* handler,
63 : AliRawReader* rawReader=NULL,
64 : AliRunLoader* runloader=NULL) const;
65 :
66 : /**
67 : * Get the top configurations belonging to this module.
68 : * A top configuration describes a processing chain. It can simply be
69 : * described by the last configuration(s) in the chain.
70 : * The agent can adapt the configurations to be registered to the current
71 : * AliRoot setup by checking the runloader.
72 : * @param rawReader AliRawReader instance
73 : * @param runloader AliRoot runloader
74 : * @return number of configurations, neg. error code if failed
75 : */
76 : const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
77 : AliRunLoader* runloader=NULL) const;
78 :
79 : /**
80 : * Component libraries which the configurations of this agent depend on.
81 : * @return list of component libraries as a blank-separated string.
82 : */
83 : const char* GetRequiredComponentLibraries() const;
84 :
85 : /**
86 : * Register components for the AliHLTTPC library.
87 : * @param [in] pHandler instance of the component handler
88 : */
89 : int RegisterComponents(AliHLTComponentHandler* pHandler) const;
90 :
91 : /**
92 : * Get handler decription for TPC data in the HLTOUT data stream.
93 : * @param [in] dt data type of the block
94 : * @param [in] spec specification of the block
95 : * @param [out] desc handler description
96 : * @return 1 if the agent can provide a handler, 0 if not
97 : */
98 : int GetHandlerDescription(AliHLTComponentDataType dt,
99 : AliHLTUInt32_t spec,
100 : AliHLTOUTHandlerDesc& desc) const;
101 :
102 : /**
103 : * Get specific handler for TPC data in the HLTOUT data stream.
104 : * @param [in] dt data type of the block
105 : * @param [in] spec specification of the block
106 : * @return pointer to handler
107 : */
108 : AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
109 : AliHLTUInt32_t spec);
110 :
111 : /**
112 : * Delete an HLTOUT handler.
113 : * @param pInstance pointer to handler
114 : */
115 : int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
116 :
117 : /**
118 : * The handler for TPC RAW data in the HLTOUT stream.
119 : */
120 : class AliHLTTPCRawDataHandler : public AliHLTOUTHandlerEquId {
121 : public:
122 : /** constructor */
123 : AliHLTTPCRawDataHandler();
124 : /** destructor */
125 : ~AliHLTTPCRawDataHandler();
126 :
127 : /**
128 : * Process a data block.
129 : * Decode specification and return equipment id of the data block.
130 : * The data itsself i untouched.
131 : * @return equipment id the block should be used for.
132 : */
133 : int ProcessData(AliHLTOUT* pData);
134 :
135 : private:
136 :
137 : };
138 :
139 : enum EOptions {
140 : // indicate cluster id data blocks in the HLTOUT
141 : kHaveCompressedClusterIdDataBlock = BIT(15)
142 : };
143 :
144 : protected:
145 :
146 : private:
147 : /** copy constructor prohibited */
148 : AliHLTTPCAgent(const AliHLTTPCAgent&);
149 : /** assignment operator prohibited */
150 : AliHLTTPCAgent& operator=(const AliHLTTPCAgent&);
151 :
152 : /** handler for TPC raw data in the HLTOUT stream */
153 : AliHLTTPCRawDataHandler* fRawDataHandler; //!transient
154 :
155 : /** afterburner for {'TRAKSEGS':'TPC '} in the HLTOUT stream */
156 : AliHLTOUTHandlerChain* fTracksegsDataHandler; //! transient
157 :
158 : /// handler for {'CLUSTERS':'TPC '}
159 : AliHLTOUTHandlerChain* fClustersDataHandler; //! transient
160 :
161 : /// handler for data blocks related to data compression
162 : AliHLTOUTHandlerChain* fCompressionMonitorHandler; //! transient
163 :
164 6 : ClassDef(AliHLTTPCAgent, 0);
165 : };
166 :
167 : #endif
|