-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSerialRNTupleTFileSource.h
More file actions
58 lines (45 loc) · 1.74 KB
/
SerialRNTupleTFileSource.h
File metadata and controls
58 lines (45 loc) · 1.74 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
#if !defined(SerialRNTupleTFileSource_h)
#define SerialRNTupleTFileSource_h
#include <string>
#include <memory>
#include <optional>
#include <vector>
#include <atomic>
#include "DataProductRetriever.h"
#include "DelayedProductRetriever.h"
#include "SharedSourceBase.h"
#include "SerialTaskQueue.h"
#include "ROOT/RNTuple.hxx"
#include "ROOT/RNTupleReader.hxx"
#include "SerialRNTupleRetrievers.h"
namespace cce::tf {
class SerialRNTupleTFileSource : public SharedSourceBase {
public:
SerialRNTupleTFileSource(unsigned iNLanes, unsigned long long iNEvents, std::string const& iName, bool iDelayReading);
size_t numberOfDataProducts() const final {return dataProductsPerLane_[0].size();}
std::vector<DataProductRetriever>& dataProducts(unsigned int iLane, long iEventIndex) final {
return dataProductsPerLane_[iLane];
}
EventIdentifier eventIdentifier(unsigned int iLane, long iEventIndex) final {
return identifiers_[iLane];
}
void printSummary() const final;
std::chrono::microseconds accumulatedTime() const;
private:
void readEventAsync(unsigned int iLane, long iEventIndex, OptionalTaskHolder) final;
std::unique_ptr<TFile> file_;
SerialTaskQueue queue_;
std::unique_ptr<ROOT::RNTupleReader> events_;
long nEvents_;
std::chrono::microseconds accumulatedTime_;
//per lane items
std::vector<std::unique_ptr<ROOT::REntry>> entries_;
std::vector<SerialRNTuplePromptRetriever> promptReaders_;
std::vector<SerialRNTupleDelayedRetriever> delayedReaders_;
std::vector<EventIdentifier> identifiers_;
std::vector<std::vector<void*>> ptrToDataProducts_;
std::vector<std::vector<DataProductRetriever>> dataProductsPerLane_;
bool delayReading_;
};
}
#endif