Line data Source code
1 : //-*- Mode: C++ -*-
2 : // $Id$
3 :
4 : #ifndef ALIHLTITSAGENT_H
5 : #define ALIHLTITSAGENT_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 AliHLTITSAgent.h
11 : // @author Matthias Richter
12 : // @date 25.08.2008
13 : // @brief Agent of the libAliHLTITS library
14 : // @note
15 :
16 : #include "AliHLTModuleAgent.h"
17 :
18 : // raw data handler of HLTOUT data
19 : #include "AliHLTOUTHandlerEquId.h"
20 :
21 : /**
22 : * @class AliHLTITSAgent
23 : * This is the agent for the AliHLTSample library.<br>
24 : *
25 : * The agent implements the HLTOUT handling of raw data blocks from the
26 : * ITS SDD.
27 : * This assumes that the data blocks are sent with data type
28 : * {DDL_RAW :ISDD} and the bit set in the specification corresponding.
29 : * to detector DDL id.
30 : * An HLTOUT handler is implemented to extract the equipment id from
31 : * the specification.
32 : *
33 : * @ingroup alihlt_its
34 : */
35 : class AliHLTITSAgent : public AliHLTModuleAgent {
36 : public:
37 : /**
38 : * standard constructor. The agent is automatically registered in the
39 : * global agent manager
40 : */
41 : AliHLTITSAgent();
42 : /** destructor */
43 : virtual ~AliHLTITSAgent();
44 :
45 : UInt_t GetDetectorMask() const;
46 :
47 : /**
48 : * Inherited from AliHLTModuleAgent
49 : * Register all configurations belonging to this module with the
50 : * AliHLTConfigurationHandler. The agent can adapt the configurations
51 : * to be registered to the current AliRoot setup by checking the
52 : * runloader.
53 : * @param handler the configuration handler
54 : * @param rawReader AliRawReader instance
55 : * @param runloader AliRoot runloader
56 : * @return neg. error code if failed
57 : */
58 : int CreateConfigurations(AliHLTConfigurationHandler* handler,
59 : AliRawReader* rawReader=NULL,
60 : AliRunLoader* runloader=NULL) const;
61 :
62 : /**
63 : * Inherited from AliHLTModuleAgent
64 : * Get the top configurations belonging to this module.
65 : * A top configuration describes a processing chain. It can simply be
66 : * described by the last configuration(s) in the chain.
67 : * The agent can adapt the configurations to be registered to the current
68 : * AliRoot setup by checking the runloader.
69 : * @param rawReader AliRawReader instance
70 : * @param runloader AliRoot runloader
71 : * @return number of configurations, neg. error code if failed
72 : */
73 : const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
74 : AliRunLoader* runloader=NULL) const;
75 :
76 : /**
77 : * Inherited from AliHLTModuleAgent
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 : * Inherited from AliHLTModuleAgent
85 : * Register components for the AliHLTSample library.
86 : * @param pHandler [in] instance of the component handler
87 : */
88 : int RegisterComponents(AliHLTComponentHandler* pHandler) const;
89 :
90 : /**
91 : * Inherited from AliHLTModuleAgent
92 : * Return HLTOUT handler description for a certain data block in the
93 : * HLTOUT payload.
94 : * @return 1 if module provides a handler
95 : */
96 : int GetHandlerDescription(AliHLTComponentDataType dt,
97 : AliHLTUInt32_t spec,
98 : AliHLTOUTHandlerDesc& desc) const;
99 :
100 : /**
101 : * Inherited from AliHLTModuleAgent
102 : * Create HLTOUT handler for a certain data block in the
103 : * HLTOUT payload. The same handler can be returned multiple
104 : * times, even for different data types. The framework will
105 : * handle this.
106 : * @return pointer to handler
107 : */
108 : AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
109 : AliHLTUInt32_t spec);
110 :
111 : /**
112 : * Inherited from AliHLTModuleAgent
113 : * Delete the instance of the handler. This is only called once
114 : * even if the same handler has been issued multiple times
115 : */
116 : int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
117 :
118 : AliHLTModulePreprocessor* GetPreprocessor();
119 :
120 : class AliHLTOUTSDDRawDataHandler: public AliHLTOUTHandlerEquId {
121 : public:
122 0 : AliHLTOUTSDDRawDataHandler() {}
123 0 : ~AliHLTOUTSDDRawDataHandler() {}
124 : int ProcessData(AliHLTOUT* pData);
125 : private:
126 : };
127 :
128 : /**
129 : * Create configurations for all CFs for the ITS subdetectors
130 : * Get the necessary information from AliDAQ using the detector id.
131 : * @param pHandler Instance of the configuration handler
132 : * @param detectorId Id of the detector as specified in AliDAQ
133 : * @param output Target string to receive the configurations
134 : * @return neg. error code f failed
135 : */
136 : int CreateCFConfigurations(AliHLTConfigurationHandler* pHandler, int detectorId, TString& output) const;
137 :
138 : protected:
139 :
140 : private:
141 :
142 : /** copy constructor prohibited */
143 : AliHLTITSAgent(const AliHLTITSAgent&);
144 : /** assignment operator prohibited */
145 : AliHLTITSAgent& operator=(const AliHLTITSAgent&);
146 :
147 : /** handler for ITS raw data in the HLTOUT stream */
148 : AliHLTOUTHandlerEquId* fRawDataHandler; //!transient
149 :
150 : /** ROOT specific member definition */
151 6 : ClassDef(AliHLTITSAgent, 0);
152 : };
153 :
154 : #endif
|