]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTOUTHandlerChain.h
Enlarged cut on cluster matching in AliITSVertexerCosmics. Needed to improve efficien...
[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 ALICE HLT Project        * 
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 retrieves the data and it's properties and derives the
88    * equipment id from it. The default behavior returns the specification as
89    * equipment id and does not touch the data itself.
90    * @return equipment id the block should be used for.
91    */
92   virtual int ProcessData(AliHLTOUT* pData);
93  protected:
94   /**
95    * Create configurations.
96    * The configurations of the chain to be run can be defined either by
97    * the AliHLTModuleAgent in conjunction with all other configurations or
98    * by an implementation of the function.
99    */
100   virtual int CreateConfigurations(AliHLTConfigurationHandler* handler);
101
102  private:
103   /** standard constructor prohibited */
104   AliHLTOUTHandlerChain();
105   /** copy constructor prohibited */
106   AliHLTOUTHandlerChain(const AliHLTOUTHandlerChain&);
107   /** assignment operator prohibited */
108   AliHLTOUTHandlerChain& operator=(const AliHLTOUTHandlerChain&);
109
110   /**
111    * Create and init AliHLTSystem.
112    * Read the arguments and create the AliHLTOUTTask as data dump.
113    */
114   int InitSystem();
115
116   TString fChains; //! transient
117   TString fOptions; //! transient
118
119   AliHLTSystem* fpSystem; //!transient
120   bool fbHaveOutput; //!transient
121
122   ClassDef(AliHLTOUTHandlerChain, 1)
123 };
124 #endif