]>
Commit | Line | Data |
---|---|---|
f1207f29 | 1 | //-*- Mode: C++ -*- |
2 | // $Id$ | |
3 | ||
4 | #ifndef ALIHLTESDMANAGER_H | |
5 | #define ALIHLTESDMANAGER_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 AliHLTEsdManager.h | |
11 | @author Matthias Richter | |
12 | @date | |
13 | @brief Manager for merging and writing of HLT ESDs | |
14 | */ | |
15 | ||
16 | #include "AliHLTDataTypes.h" | |
17 | #include "AliHLTLogging.h" | |
18 | #include "TString.h" | |
19 | ||
20 | class AliESDEvent; | |
21 | ||
22 | /** | |
23 | * @class AliHLTEsdManager | |
24 | * Tool to write and merge HLT ESD objects. | |
25 | * | |
26 | * HLT components can produce ESD output. The ESD objects are sent via | |
27 | * a TMessage like mechanism as part of the HLTOUT data. This class retrieves | |
28 | * streamed AliESDEvent objects from an HLT output block. An ESD object can be | |
29 | * copied to a global ESD provided by the caller or to files. The name of the | |
30 | * ROOT files follows the scheme AliHLTDETESDs.root where DET denotes a detector. | |
31 | * E.g. the ESD from a data block of type {ESD_TREE,TPC} will be added to the | |
32 | * file AliHLTTPCESDs.root. | |
33 | * | |
34 | * For the sake of library (in)dependencies, the concrete implementation of | |
35 | * the AliHLTEsdManager is separated from the libHLTbase class as this would | |
36 | * introduce dependencies to AliRoot libraries. The user does not notice the | |
37 | * handling apart from the fact that an instance can not be created and | |
38 | * deleted directly. Instead | |
39 | * <pre> | |
40 | * AliHLTEsdManager* pManager=AliHLTEsdManager::New(); | |
41 | * // .... | |
42 | * AliHLTEsdManager::Delete(pManager); | |
43 | * </pre> | |
44 | * must be used. | |
45 | * | |
46 | * @ingroup alihlt_aliroot_reconstruction | |
47 | */ | |
48 | class AliHLTEsdManager : public AliHLTLogging { | |
49 | public: | |
50 | /** create an instance of the manager */ | |
51 | static AliHLTEsdManager* New(); | |
52 | /** delete an instance of the manager */ | |
53 | static void Delete(AliHLTEsdManager* instance); | |
54 | ||
794de106 | 55 | /** |
56 | * Set the options for the ESD merging and writing | |
57 | * Takes a string of blank separated options. | |
58 | * \li -writelocal use local file writing in the specified diectory | |
59 | * The file name is derived from the data origin | |
60 | * \li -directory=<> Set the directory path | |
61 | * This makes the SetDirectory method obsolete | |
62 | * @return neg error code if failed | |
63 | */ | |
64 | virtual int SetOption(const char* option)=0; | |
65 | ||
f1207f29 | 66 | /** |
67 | * Convert data buffer to ESD. | |
68 | * The buffer is supposed to describe a streamed AliESDEvent object. | |
69 | * If no target object is specified, the ESD is written to a file AliHLTdetESDs.root, | |
70 | * where 'det' is derived from the data type origin. Each time the function is invoked | |
71 | * a new event is created. Dummy events are added if the previous events did not contain | |
72 | * | |
73 | * @param pBuffer [in] the data buffer | |
74 | * @param size [in] data buffer size | |
75 | * @param dt [in] data type of the block | |
76 | * @param tgtesd [out] optional target | |
77 | * @param eventno [in] optional event no | |
78 | */ | |
79 | virtual int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt, | |
80 | AliESDEvent* tgtesd=NULL, int eventno=-1)=0; | |
81 | ||
57584811 | 82 | /** |
83 | * Merge content of source ESD into the target ESD. | |
84 | * Merging is done on the level of objects in the ESD and for the | |
85 | * moment it's only implemented for the TClonesArrays. In that case it's | |
86 | * easy to detect whether the object is empty or not. | |
87 | * | |
88 | * \b Note: The function can not match entries of the same type, like e.g. | |
89 | * tracks from the 'Tracks' member. | |
90 | */ | |
91 | virtual int Merge(AliESDEvent* pTgt, AliESDEvent* pSrc) const =0; | |
92 | ||
f1207f29 | 93 | /** |
94 | * Align all ESD to the same number of events. | |
95 | * The function adds empty events to all ESD files if their event number | |
96 | * does not match the specified one. | |
97 | * @param eventno the desired event no | |
98 | * @return neg. error code if failed | |
99 | */ | |
100 | virtual int PadESDs(int eventno)=0; | |
101 | ||
102 | /** | |
103 | * Set the target directory for the ESD files. | |
104 | */ | |
105 | virtual void SetDirectory(const char* directory)=0; | |
106 | ||
107 | /** | |
108 | * Get the list of the internally created files. | |
109 | * Returns a blank separated list of the file names. | |
110 | */ | |
111 | virtual TString GetFileNames(AliHLTComponentDataType dt=kAliHLTAnyDataType) const = 0; | |
112 | ||
113 | protected: | |
114 | /** constructor */ | |
115 | AliHLTEsdManager(); | |
116 | /** destructor */ | |
117 | virtual ~AliHLTEsdManager(); | |
118 | ||
119 | private: | |
120 | /** copy constructor prohibited */ | |
121 | AliHLTEsdManager(const AliHLTEsdManager&); | |
122 | /** assignment operator prohibited */ | |
123 | AliHLTEsdManager& operator=(const AliHLTEsdManager&); | |
124 | ||
125 | /** the name of the actual implementation */ | |
126 | static const char* fgkImplName; //! | |
127 | ||
128 | /** the library of the implementation */ | |
129 | static const char* fgkImplLibrary; //! | |
130 | ||
131 | ClassDef(AliHLTEsdManager, 0) | |
132 | }; | |
133 | ||
134 | #endif |