1 #ifndef IOPool_Input_RootTree_h 2 #define IOPool_Input_RootTree_h 23 #include <unordered_set> 32 class RootDelayedReader;
37 class ModuleCallingContext;
39 namespace signalslot {
40 template <
typename T>
class Signal;
52 branchDescription_(prod),
56 offsetToWrapperBase_(0) {}
63 typedef std::map<BranchKey const, BranchInfo>
BranchMap;
73 RootTree(std::shared_ptr<InputFile> filePtr,
75 unsigned int nIndexes,
76 unsigned int maxVirtualSize,
77 unsigned int cacheSize,
78 unsigned int learningEntries,
79 bool enablePrefetching,
95 bool next() {
return ++entryNumber_ < entries_;}
98 bool current()
const {
return entryNumber_ < entries_ && entryNumber_ >= 0;}
99 bool current(EntryNumber
entry)
const {
return entry < entries_ && entry >= 0;}
102 bool skipEntries(
unsigned int&
offset);
104 EntryNumber
const& entryNumberForIndex(
unsigned int index)
const;
105 EntryNumber
const&
entries()
const {
return entries_;}
106 void setEntryNumber(EntryNumber theEntryNumber);
107 void insertEntryForIndex(
unsigned int index);
108 std::vector<std::string>
const&
branchNames()
const {
return branchNames_;}
111 template <
typename T>
113 auxBranch_->SetAddress(&pAux);
116 template <
typename T>
118 if (metaTree_ !=
nullptr) {
120 branch->SetAddress(&pbuf);
123 fillBranchEntry<T>(
branch, pbuf);
127 template <
typename T>
129 branch->SetAddress(&pbuf);
133 template <
typename T>
135 if (metaTree_ !=
nullptr) {
137 branch->SetAddress(&pbuf);
140 fillBranchEntry<T>(
branch, entryNumber, pbuf);
144 template <
typename T>
146 branch->SetAddress(&pbuf);
150 TTree
const*
tree()
const {
return tree_;}
153 BranchMap
const& branches()
const;
158 inline TTreeCache* checkTriggerCache(TBranch*
branch, EntryNumber entryNumber)
const;
159 TTreeCache* checkTriggerCacheImpl(TBranch* branch, EntryNumber entryNumber)
const;
160 inline TTreeCache* selectCache(TBranch* branch, EntryNumber entryNumber)
const;
170 void setCacheSize(
unsigned int cacheSize);
171 void setTreeMaxVirtualSize(
int treeMaxVirtualSize);
172 void startTraining();
bool current(EntryNumber entry) const
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
unsigned int const defaultNonEventLearningEntries
unsigned int learningEntries_
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
void fillBranchEntryMeta(TBranch *branch, EntryNumber entryNumber, T *&pbuf)
std::vector< std::string > branchNames_
std::vector< std::string > const & branchNames() const
std::shared_ptr< TTreeCache > treeCache_
std::shared_ptr< BranchMap > branches_
EntryNumber rawTriggerSwitchOverEntry_
roottree::BranchMap BranchMap
EntryNumber const & entries() const
std::unordered_set< TBranch * > trainedSet_
TBranch * branchEntryInfoBranch_
void fillBranchEntryMeta(TBranch *branch, T *&pbuf)
unsigned int const defaultCacheSize
std::unique_ptr< RootDelayedReader > rootDelayedReader_
TBranch * branchEntryInfoBranch() const
std::map< BranchKey const, BranchInfo > BranchMap
TTree const * metaTree() const
Int_t offsetToWrapperBase_
TTree const * tree() const
BranchDescription const branchDescription_
BranchType branchType() const
unsigned long treeAutoFlush_
IndexIntoFile::EntryNumber_t EntryNumber
EntryNumber const & entryNumber() const
TBranch * provenanceBranch_
std::shared_ptr< TTreeCache > rawTreeCache_
BranchInfo(BranchDescription const &prod)
void fillBranchEntry(TBranch *branch, T *&pbuf)
std::shared_ptr< InputFile > filePtr_
bool performedSwitchOver_
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
unsigned int const defaultNonEventCacheSize
std::unordered_set< TBranch * > triggerSet_
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
unsigned int const defaultLearningEntries
EntryNumber switchOverEntry_
std::shared_ptr< TTreeCache > triggerTreeCache_
void fillBranchEntry(TBranch *branch, EntryNumber entryNumber, T *&pbuf)
def branchType(schema, name)
roottree::EntryNumber EntryNumber