]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTHandlerChain.h
HLTcalo module
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTOUTHandlerChain.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTOUTHANDLERCHAIN_H
5 #define ALIHLTOUTHANDLERCHAIN_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   AliHLTOUTHandlerChain.h
11 /// @author Matthias Richter
12 /// @date   24.06.2008
13 /// @brief  HLTOUT handler of type kChain.
14 ///
15
16 #include "AliHLTOUTHandler.h"
17 #include "TString.h"
18
19 class AliHLTSystem;
20 class AliHLTConfiguration;
21 class AliHLTConfigurationHandler;
22
23 /**
24  * @class AliHLTOUTHandlerChain
25  * The default HLTOUT handler for type kChain.
26  *
27  * The handler implements the kChain processing of HLTOUT data.
28  * The ids of the chains to be run during processing are provided
29  * as parameter to the constructor. The AliHLTModuleAgent
30  * can just create a new instance and specify the chains in order
31  * to define the HLTOUT handling of type kChain for a certain data
32  * block. The same instance can be returned for multiple data blocks.
33  * The handler will run once on all data blocks.
34  *
35  * The AliHLTOUTPublisherComponent must be used as data source in order
36  * to publish the data blocks from HLTOUT into the chain. The component
37  * publishes all data blocks selected for the handler. Additional
38  * filter rules can be applied.
39  *
40  * <h2>Chain configuration</h2>
41  * The tasks in the chain to be run can be defined either by
42  * the AliHLTModuleAgent in conjunction with all other configurations or
43  * by an implementation of CreateConfigurations().
44  *
45  * The handler is controlled by arguments passed to the constructor, the
46  * syntax is equal to the AliHLTSystem (see AliHLTSystem::ScanOptions).
47  *
48  * <h2>Usage example:</h2>
49  * An agent implementation for some sample histograms. Asumes a chain to
50  * be registered with name 'SAMPLE-my-histo-converter'
51  * <pre>
52  *  AliHLTOUTHandler* AliHLTMyAgent::GetOutputHandler(AliHLTComponentDataType dt,
53  *                                                    AliHLTUInt32_t spec)
54  *  {
55  *   // afterburner for some histograms
56  *   if (dt==kAliHLTDataTypeHistogram|kAliHLTDataOriginSample) {
57  *     return new AliHLTOUTHandlerChain("chains=SAMPLE-my-histo-converter");
58  *   }
59  *
60  *   return NULL;
61  *  }
62  * </pre>
63  *
64  * <h2>Data output</h2>
65  * The chain can produce output data as usual. All produced data blocks are
66  * added to the HLTOUT. This means a chain can e.g. produce ESD data blocks
67  * out of the HLT output by applying a converter component as an afterburner.
68  * The produced output of the chain is automatically subject to HLTOUT
69  * standard processing.
70  *
71  * HLTOUT processing sequence:
72  * - first handlers of type kChain
73  * - handlers of type kEsd
74  * - handlers of type kProprietary
75  *
76  * @ingroup alihlt_aliroot_reconstruction
77  */
78 class AliHLTOUTHandlerChain : public AliHLTOUTHandler {
79  public:
80   /** constructor */
81   AliHLTOUTHandlerChain(const char* arguments);
82   /** standard destructor */
83   virtual ~AliHLTOUTHandlerChain();
84
85   /**
86    * Process a data block.
87    * The handler runs a normal HLT chain for processing of the selected blocks.
88    * The input of the chain is provided by the AliHLTOUTPublisher component.
89    * @return equipment id the block should be used for.
90    */
91   virtual int ProcessData(AliHLTOUT* pData);
92  protected:
93   /**
94    * Create configurations.
95    * The configurations of the chain to be run can be defined either by
96    * the AliHLTModuleAgent in conjunction with all other configurations or
97    * by an implementation of the function.
98    */
99   virtual int CreateConfigurations(AliHLTConfigurationHandler* handler);
100
101  private:
102   /** standard constructor prohibited */
103   AliHLTOUTHandlerChain();
104   /** copy constructor prohibited */
105   AliHLTOUTHandlerChain(const AliHLTOUTHandlerChain&);
106   /** assignment operator prohibited */
107   AliHLTOUTHandlerChain& operator=(const AliHLTOUTHandlerChain&);
108
109   /**
110    * Create and init AliHLTSystem.
111    * Read the arguments and create the AliHLTOUTTask as data dump.
112    */
113   int InitSystem();
114
115   TString fChains; //! transient
116   TString fOptions; //! transient
117
118   AliHLTSystem* fpSystem; //!transient
119   bool fbHaveOutput; //!transient
120
121   ClassDef(AliHLTOUTHandlerChain, 1)
122 };
123 #endif