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