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_;}
97 bool current()
const {
return entryNumber_ < entries_ && entryNumber_ >= 0;}
98 bool current(EntryNumber
entry)
const {
return entry < entries_ && entry >= 0;}
101 bool skipEntries(
unsigned int&
offset);
103 EntryNumber
const& entryNumberForIndex(
unsigned int index)
const;
104 EntryNumber
const&
entries()
const {
return entries_;}
105 void setEntryNumber(EntryNumber theEntryNumber);
106 void insertEntryForIndex(
unsigned int index);
107 std::vector<std::string>
const&
branchNames()
const {
return branchNames_;}
110 template <
typename T>
112 auxBranch_->SetAddress(&pAux);
115 template <
typename T>
117 if (metaTree_ !=
nullptr) {
119 branch->SetAddress(&pbuf);
122 fillBranchEntry<T>(
branch, pbuf);
126 template <
typename T>
128 branch->SetAddress(&pbuf);
132 template <
typename T>
134 if (metaTree_ !=
nullptr) {
136 branch->SetAddress(&pbuf);
139 fillBranchEntry<T>(
branch, entryNumber, pbuf);
143 template <
typename T>
145 branch->SetAddress(&pbuf);
149 TTree
const*
tree()
const {
return tree_;}
152 BranchMap
const& branches()
const;
157 inline TTreeCache* checkTriggerCache(TBranch*
branch, EntryNumber entryNumber)
const;
158 TTreeCache* checkTriggerCacheImpl(TBranch* branch, EntryNumber entryNumber)
const;
159 inline TTreeCache* selectCache(TBranch* branch, EntryNumber entryNumber)
const;
169 void setCacheSize(
unsigned int cacheSize);
170 void setTreeMaxVirtualSize(
int treeMaxVirtualSize);
171 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