1 #ifndef IOPool_Input_RootTree_h
2 #define IOPool_Input_RootTree_h
26 #include <unordered_set>
27 #include <unordered_map>
34 class RootDelayedReader;
55 using Map = std::unordered_map<unsigned int, BranchInfo>;
60 auto itFound =
map_.find(iKey.
id());
61 if (itFound ==
map_.end()) {
64 return &itFound->second;
75 unsigned int cacheSize,
84 RootTree(std::shared_ptr<InputFile> filePtr,
86 unsigned int nIndexes,
87 unsigned int learningEntries,
88 bool enablePrefetching,
91 RootTree(std::shared_ptr<InputFile> filePtr,
93 unsigned int nIndexes,
94 unsigned int maxVirtualSize,
95 unsigned int cacheSize,
96 unsigned int learningEntries,
97 bool enablePrefetching,
100 RootTree(std::shared_ptr<InputFile> filePtr,
103 unsigned int nIndexes,
104 unsigned int maxVirtualSize,
105 unsigned int cacheSize,
106 unsigned int learningEntries,
107 bool enablePrefetching,
110 void init(
std::string const& productTreeName,
unsigned int maxVirtualSize,
unsigned int cacheSize);
126 bool current()
const {
return entryNumber_ < entries_ && entryNumber_ >= 0; }
140 template <
typename T>
146 template <
typename T>
148 branch->SetAddress(&pbuf);
152 template <
typename T>
156 branch->SetAddress(&pbuf);
163 template <
typename T>
165 branch->SetAddress(&pbuf);
bool current(EntryNumber entry) const
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
std::unordered_map< unsigned int, BranchInfo > Map
unsigned int const defaultNonEventLearningEntries
unsigned int learningEntries_
TTreeCache * checkTriggerCache(TBranch *branch, EntryNumber entryNumber) const
roottree::EntryNumber EntryNumber
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
void dropBranch(std::string const &oldBranchName)
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_
EntryNumber rawTriggerSwitchOverEntry_
EntryNumber const & entries() const
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
std::unordered_set< TBranch * > trainedSet_
TBranch * branchEntryInfoBranch_
void setPresence(BranchDescription &prod, std::string const &oldBranchName)
void trainCache(char const *branchNames)
unsigned int const defaultCacheSize
std::unique_ptr< RootDelayedReader > rootDelayedReader_
void setTreeMaxVirtualSize(int treeMaxVirtualSize)
TBranch * branchEntryInfoBranch() const
RootTree & operator=(RootTree const &)=delete
TTree const * metaTree() const
Int_t offsetToWrapperBase_
TTree const * tree() const
void init(std::string const &productTreeName, unsigned int maxVirtualSize, unsigned int cacheSize)
roottree::BranchMap BranchMap
BranchInfo const * find(BranchID const &iKey) const
void insertEntryForIndex(unsigned int index)
DelayedReader * resetAndGetRootDelayedReader() const
BranchDescription const branchDescription_
TTreeCache * selectCache(TBranch *branch, EntryNumber entryNumber) const
BranchType branchType() const
unsigned long treeAutoFlush_
void addBranch(BranchDescription const &prod, std::string const &oldBranchName)
TTreeCache * checkTriggerCacheImpl(TBranch *branch, EntryNumber entryNumber) const
EntryNumber const & entryNumber() const
DelayedReader * rootDelayedReader() const
EntryNumber const & entryNumberForIndex(unsigned int index) const
std::string const & processName() const
static constexpr EntryNumber_t invalidEntry
std::shared_ptr< TTreeCache > rawTreeCache_
BranchInfo(BranchDescription const &prod)
void getEntry(TBranch *branch, EntryNumber entry) const
void fillBranchEntry(TBranch *branch, T *&pbuf)
void insert(edm::BranchID const &iKey, BranchInfo const &iInfo)
IndexIntoFile::EntryNumber_t EntryNumber
std::shared_ptr< InputFile > filePtr_
void setCacheSize(unsigned int cacheSize)
bool performedSwitchOver_
void numberOfBranchesToAdd(BranchMap::Map::size_type iSize)
RootTree(std::shared_ptr< InputFile > filePtr, BranchType const &branchType, unsigned int nIndexes, unsigned int learningEntries, bool enablePrefetching, InputType inputType)
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
unsigned int const defaultNonEventCacheSize
bool skipEntries(unsigned int &offset)
std::unordered_set< TBranch * > triggerSet_
BranchMap const & branches() const
void reserve(Map::size_type iSize)
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)
void setEntryNumber(EntryNumber theEntryNumber)