Support for heavy ions as primary in source.cxx
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTEsdManager.h
CommitLineData
c5123824 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 <vector>
19
20class AliESDEvent;
21class TTree;
22class TFile;
23
24/**
25 * @class AliHLTEsdManager
26 */
27class AliHLTEsdManager : public AliHLTLogging {
28 public:
29 /** constructor */
30 AliHLTEsdManager();
31 /** destructor */
32 virtual ~AliHLTEsdManager();
33
34 /**
35 * Convert data buffer to ESD.
36 * The buffer is supposed to describe a streamed AliESDEvent object.
37 * If no target object is specified, the ESD is written to a file AliHLTdetESDs.root,
38 * where 'det' is derived from the data type origin. Each time the function is invoked
39 * a new event is created. Dummy events are added if the previous events did not contain
40 *
41 * @param pBuffer [in] the data buffer
42 * @param size [in] data buffer size
43 * @param dt [in] data type of the block
44 * @param tgtesd [out] optional target
45 * @param eventno [in] optional event no
46 */
47 int WriteESD(const AliHLTUInt8_t* pBuffer, AliHLTUInt32_t size, AliHLTComponentDataType dt,
48 AliESDEvent* tgtesd=NULL, int eventno=-1);
49
50 protected:
51
52 private:
53 /** copy constructor prohibited */
54 AliHLTEsdManager(const AliHLTEsdManager&);
55 /** assignment operator prohibited */
56 AliHLTEsdManager& operator=(const AliHLTEsdManager&);
57
58 class AliHLTEsdListEntry : public AliHLTLogging {
59 public:
60 /** constructor */
61 AliHLTEsdListEntry(AliHLTComponentDataType dt);
c5123824 62 /** destructor */
63 ~AliHLTEsdListEntry();
64
65 /**
66 * Write the ESD to the corresponding file.
67 * The tree is first synchronized with the eventno and additional empty
68 * events might be inserted if there was a gap. Since we are writing
69 * several files in parallel, we have to make sure that those files contain
70 * the same number of events.
71 * @param pESD ESD to write
72 * @param eventno optional event no for tree synchronization
73 */
74 int WriteESD(AliESDEvent* pESD, int eventno=-1);
75
76 bool operator==(AliHLTComponentDataType dt) const;
77
78 private:
62ff1e23 79 /** copy constructor prohibited */
80 AliHLTEsdListEntry(const AliHLTEsdListEntry& src);
81 /** assignment operator prohibited */
82 AliHLTEsdListEntry& operator=(const AliHLTEsdListEntry& src);
c5123824 83
84 /** root file name */
85 TString fName; //!transient
86 /** the root file for this esd */
87 TFile* fpFile; //!transient
88 /** the tree for this esd */
89 TTree* fpTree; //!transient
90 /** the esd to fill into the tree */
91 AliESDEvent* fpEsd; //!transient
92 /** data type of the corresponding block */
93 AliHLTComponentDataType fDt; //!transient
94 };
95
62ff1e23 96 typedef vector<AliHLTEsdListEntry*> AliHLTEsdPList;
c5123824 97
98 /**
99 * Find list entry for given data type
100 */
101 AliHLTEsdListEntry* Find(AliHLTComponentDataType dt) const;
102
103 /** the list of the ESDs */
62ff1e23 104 AliHLTEsdPList fESDs; //!transient
c5123824 105
106 ClassDef(AliHLTEsdManager, 0)
107};
108#endif