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);
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
TTreeCache * checkTriggerCache(TBranch *branch, EntryNumber entryNumber) const
std::string const & processName() const
std::unordered_map< unsigned int, BranchInfo > Map
unsigned int const defaultNonEventLearningEntries
unsigned int learningEntries_
roottree::EntryNumber EntryNumber
std::shared_ptr< TTreeCache > rawTriggerTreeCache_
TTree const * tree() const
void dropBranch(std::string const &oldBranchName)
void fillBranchEntryMeta(TBranch *branch, EntryNumber entryNumber, T *&pbuf)
std::vector< std::string > branchNames_
TTree const * metaTree() const
EntryNumber const & entryNumber() const
EntryNumber const & entryNumberForIndex(unsigned int index) const
std::shared_ptr< TTreeCache > treeCache_
EntryNumber rawTriggerSwitchOverEntry_
bool current(EntryNumber entry) 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
DelayedReader * rootDelayedReader() const
std::unique_ptr< RootDelayedReader > rootDelayedReader_
void setTreeMaxVirtualSize(int treeMaxVirtualSize)
RootTree & operator=(RootTree const &)=delete
Int_t offsetToWrapperBase_
TBranch * branchEntryInfoBranch() const
BranchInfo const * find(BranchID const &iKey) const
void getEntry(TBranch *branch, EntryNumber entry) const
void init(std::string const &productTreeName, unsigned int maxVirtualSize, unsigned int cacheSize)
roottree::BranchMap BranchMap
void insertEntryForIndex(unsigned int index)
BranchDescription const branchDescription_
TTreeCache * selectCache(TBranch *branch, EntryNumber entryNumber) const
EntryNumber const & entries() const
unsigned long treeAutoFlush_
void addBranch(BranchDescription const &prod, std::string const &oldBranchName)
static constexpr EntryNumber_t invalidEntry
std::shared_ptr< TTreeCache > rawTreeCache_
BranchInfo(BranchDescription const &prod)
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)
BranchMap const & branches() const
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)
BranchType branchType() const
std::unique_ptr< std::vector< EntryNumber > > entryNumberForIndex_
unsigned int const defaultNonEventCacheSize
bool skipEntries(unsigned int &offset)
std::unordered_set< TBranch * > triggerSet_
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
DelayedReader * resetAndGetRootDelayedReader() const
TTreeCache * checkTriggerCacheImpl(TBranch *branch, EntryNumber entryNumber) const
EntryNumber switchOverEntry_
std::shared_ptr< TTreeCache > triggerTreeCache_
void fillBranchEntry(TBranch *branch, EntryNumber entryNumber, T *&pbuf)
void setEntryNumber(EntryNumber theEntryNumber)
std::vector< std::string > const & branchNames() const