]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSAgent.h
Update From Debojit
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSAgent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTPHOSAGENT_H
4 #define ALIHLTPHOSAGENT_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice                               */
7
8 /** @file   AliHLTPHOSAgent.h
9     @author Oystein Djuvsland
10     @date   
11     @brief  Agent of the libAliHLTPHOS library
12 */
13
14 #include "AliHLTModuleAgent.h"
15 #include "AliHLTOUTHandlerEquId.h"
16
17 class AliHLTOUTHandlerChain;
18
19 /**
20  * @class AliHLTPHOSAgent
21  * This is the agent for the AliHLTPHOS library.
22  *
23  * @ingroup alihlt_system
24  */
25 class AliHLTPHOSAgent : public AliHLTModuleAgent {
26  public:
27   /**
28    * standard constructor. The agent is automatically registered in the
29    * global agent manager
30    */
31   AliHLTPHOSAgent();
32   /** destructor */
33   virtual ~AliHLTPHOSAgent();
34
35   /**
36    * Register all configurations belonging to this module with the
37    * AliHLTConfigurationHandler. The agent can adapt the configurations
38    * to be registered to the current AliRoot setup by checking the
39    * runloader.
40    * @param handler      the configuration handler
41    * @param rawReader    AliRawReader instance
42    * @param runloader    AliRoot runloader
43    * @return neg. error code if failed
44    */
45   int CreateConfigurations(AliHLTConfigurationHandler* handler,
46                            AliRawReader* rawReader=NULL,
47                            AliRunLoader* runloader=NULL) const;
48
49   /**
50    * Get the top configurations belonging to this module.
51    * A top configuration describes a processing chain. It can simply be
52    * described by the last configuration(s) in the chain. 
53    * The agent can adapt the configurations to be registered to the current
54    * AliRoot setup by checking the runloader.
55    * @param rawReader    AliRawReader instance
56    * @param runloader    AliRoot runloader
57    * @return number of configurations, neg. error code if failed
58    */
59   const char* GetReconstructionChains(AliRawReader* rawReader=NULL,
60                                       AliRunLoader* runloader=NULL) const;
61
62   /**
63    * Component libraries which the configurations of this agent depend on.
64    * @return list of component libraries as a blank-separated string.
65    */
66   const char* GetRequiredComponentLibraries() const;
67
68   /**
69    * Register components for the AliHLTPHOS library.
70    * @param [in] pHandler  instance of the component handler          
71    */
72   int RegisterComponents(AliHLTComponentHandler* pHandler) const;
73
74   /**
75    * Get handler decription for PHOS data in the HLTOUT data stream.
76    * @param [in] dt        data type of the block
77    * @param [in] spec      specification of the block
78    * @param [out] desc      handler description
79    * @return 1 if the agent can provide a handler, 0 if not
80    */
81   int GetHandlerDescription(AliHLTComponentDataType dt,
82                             AliHLTUInt32_t spec,
83                             AliHLTOUTHandlerDesc& desc) const;
84
85   /**
86    * Get specific handler for PHOS data in the HLTOUT data stream.
87    * @param [in] dt        data type of the block
88    * @param [in] spec      specification of the block
89    * @return pointer to handler
90    */
91   AliHLTOUTHandler* GetOutputHandler(AliHLTComponentDataType dt,
92                                      AliHLTUInt32_t spec);
93
94   /**
95    * Delete an HLTOUT handler.
96    * @param pInstance      pointer to handler
97    */
98   int DeleteOutputHandler(AliHLTOUTHandler* pInstance);
99
100   /**
101    * The handler for PHOS RAW data in the HLTOUT stream.
102    */
103   class AliHLTPHOSRawDataHandler : public AliHLTOUTHandlerEquId {
104   public:
105     /** constructor */
106     AliHLTPHOSRawDataHandler();
107     /** destructor */
108     ~AliHLTPHOSRawDataHandler();
109
110     /**
111      * Process a data block.
112      * Decode specification and return equipment id of the data block.
113      * The data itsself i untouched.
114      * @return equipment id the block should be used for.
115      */
116     int ProcessData(AliHLTOUT* pData);
117
118   private:
119
120   };
121
122  protected:
123
124  private:
125   /** copy constructor prohibited */
126   AliHLTPHOSAgent(const AliHLTPHOSAgent&);
127   /** assignment operator prohibited */
128   AliHLTPHOSAgent& operator=(const AliHLTPHOSAgent&);
129
130   /** handler for PHOS raw data in the HLTOUT stream */
131   AliHLTPHOSRawDataHandler* fRawDataHandler; //!transient
132
133   ClassDef(AliHLTPHOSAgent, 1);
134 };
135
136 #endif