4 #ifndef ALIHLTOUTHANDLERESDBRANCH_H
5 #define ALIHLTOUTHANDLERESDBRANCH_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 *
10 /// @file AliHLTOUTHandlerEsdBranch.h
11 /// @author Matthias Richter
13 /// @brief HLTOUT handler of type kEsd to merge objects into the hltEsd.
15 #include "AliHLTOUTHandler.h"
20 class AliHLTEsdManager;
23 * @class AliHLTOUTHandlerEsdBranch
24 * An HLTOUT handler of type kEsd to add objects to hltEsd branches.
26 * The handler extracts objects from HLTOUT data blocks or converts
27 * data to objects to be added to hltEsd branches. The default implementation
28 * covers the first case right away, the class can be used directly for single
29 * objects streamed to the HLTOUT.
31 * <h2>Object conversion</h2>
32 * The method ExtractAndAddObjects() has to loop over all input blocks and
33 * provide an appropriate conversion. If the data block simply contains a
34 * streamed object it just needs to be extracted and added to the ESD using
35 * the function Add(). This case is covered by the default implementation.
36 * Child classes can overload ExtractAndAddObjects() if there is further
37 * conversion/formatting required.
39 * <h2>Usage example:</h2>
40 * An agent implementation must announce to ability to process a certain
41 * data block by implementing AliHLTModuleAgent::GetHandlerDescription()
42 * and AliHLTModuleAgent::GetOutputHandler(). See AliHLTModuleAgent for
45 * int AliHLTMyAgent::GetHandlerDescription(AliHLTComponentDataType dt,
46 * AliHLTUInt32_t spec,
47 * AliHLTOUTHandlerDesc& desc) const
49 * // add TObject data blocks of type {ROOTTOBJ:SMPL} to ESD
50 * if (dt==(kAliHLTDataTypeTObject|kAliHLTDataOriginSample)) {
51 * desc=AliHLTOUTHandlerDesc(kEsd, dt, GetModuleId());
58 * AliHLTOUTHandler* AliHLTMyAgent::GetOutputHandler(AliHLTComponentDataType dt,
59 * AliHLTUInt32_t spec)
61 * // merge my objects into the hltEsd
62 * if (dt==(kAliHLTDataTypeTObject|kAliHLTDataOriginSample)) {
63 * static AliHLTOUTHandlerEsdBranch handler;
71 * <h2>Data output</h2>
72 * The handler produces a partial ESD containing the data objects. The framework
73 * merges all the different partial ESDs in the AliHLTEsdManager, respectively the
74 * specific implementation AliHLTEsdManagerImplementation.
76 * HLTOUT processing sequence:
77 * - first handlers of type kChain
78 * - handlers of type kEsd
79 * - handlers of type kProprietary
81 * @ingroup alihlt_aliroot_reconstruction
83 class AliHLTOUTHandlerEsdBranch : public AliHLTOUTHandler {
86 AliHLTOUTHandlerEsdBranch(const char* branchname=NULL);
87 /** standard destructor */
88 virtual ~AliHLTOUTHandlerEsdBranch();
91 * Process a data block.
94 int ProcessData(AliHLTOUT* pData);
96 int GetProcessedData(const AliHLTUInt8_t* &pData);
97 int ReleaseProcessedData(const AliHLTUInt8_t* pData, int size);
101 * Extract and add objects
102 * Loop over input blocks and extract/format the objects. Child class
103 * can implement specific conversion. The default implementation just
104 * extracts and adds objects.
106 virtual int ExtractAndAddObjects(AliHLTOUT* pData);
109 /** copy constructor prohibited */
110 AliHLTOUTHandlerEsdBranch(const AliHLTOUTHandlerEsdBranch&);
111 /** assignment operator prohibited */
112 AliHLTOUTHandlerEsdBranch& operator=(const AliHLTOUTHandlerEsdBranch&);
114 TString fBranch; //! transient
115 TObject* fESD; //! transient
116 TArrayC* fpData; //! transient
117 int fSize; //! transient
118 AliHLTEsdManager* fManager; //! transient
120 ClassDef(AliHLTOUTHandlerEsdBranch, 0)