forked from Dr15Jones/root_serialization
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathRootOutputer.h
More file actions
59 lines (46 loc) · 1.48 KB
/
RootOutputer.h
File metadata and controls
59 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#if !defined(RootOutputer_h)
#define RootOutputer_h
#include <vector>
#include <string>
#include <cstdint>
#include "OutputerBase.h"
#include "EventIdentifier.h"
#include "DataProductRetriever.h"
#include "SerialTaskQueue.h"
#include "TFile.h"
class TBranch;
class TTree;
namespace cce::tf {
class RootOutputer :public OutputerBase {
public:
struct Config {
int splitLevel_=99;
int compressionLevel_=9;
std::string compressionAlgorithm_="";
int basketSize_=16384;
int treeMaxVirtualSize_=-1;
int autoFlush_=-1;
int cacheSize_=0;
};
RootOutputer(std::string const& iFileName, unsigned int iNLanes, Config const&);
~RootOutputer();
void setupForLane(unsigned int iLaneIndex, std::vector<DataProductRetriever> const& iDPs) final;
void productReadyAsync(unsigned int iLaneIndex, DataProductRetriever const& iDataProduct, TaskHolder iCallback) const final;
bool usesProductReadyAsync() const final {return false;}
void outputAsync(unsigned int iLaneIndex, EventIdentifier const& iEventID, TaskHolder iCallback) const final;
void printSummary() const final;
private:
void write(unsigned int iLaneIndex, EventIdentifier const&);
mutable TFile file_;
TTree* eventTree_;
std::vector<TBranch*> branches_;
TBranch* eventIDBranch_;
EventIdentifier id_;
mutable SerialTaskQueue queue_;
std::vector<std::vector<DataProductRetriever> const*> retrievers_;
std::chrono::microseconds accumulatedTime_;
int basketSize_;
int splitLevel_;
};
}
#endif