72 Error(
"TChainIndex",
"Cannot create a TChainIndex."
73 " The Tree passed as an argument is not a TChain");
83 for (i = 0; i < chain->
GetNtrees(); i++) {
93 if (strcmp(majorname,
index->GetMajorName()) || strcmp(minorname,
index->GetMinorName())) {
108 Error(
"TChainIndex",
"Error creating a tree index on a tree in the chain");
114 Error(
"TChainIndex",
"The underlying TTree must have a TTreeIndex but has a %s.",
115 index->IsA()->GetName());
125 if(
fEntries[i].GetMaxIndexValPair() >
fEntries[i+1].GetMinIndexValPair() ) {
128 Error(
"TChainIndex",
"The indices in files of this chain aren't sorted.");
142 Error(
"Append",
"The given index is not a TTreeIndex but a %s",
143 index->IsA()->GetName());
155 if(
fEntries[i].GetMaxIndexValPair() >
fEntries[i+1].GetMinIndexValPair() ) {
158 Error(
"Append",
"The indices in files of this chain aren't sorted.");
169 for (
unsigned int i = 0; i <
fEntries.size(); i++) {
202 Warning(
"GetSubTreeIndex",
"No subindices in the chain. The chain is probably empty");
208 if( indexValue <
fEntries[0].GetMinIndexValPair() ) {
209 Warning(
"GetSubTreeIndex",
"The index value is less than the smallest index values in subtrees");
214 for (
unsigned int i = 0; i <
fEntries.size() - 1; i++) {
215 if( indexValue <
fEntries[i+1].GetMinIndexValPair() ) {
221 if( indexValue >
fEntries[treeNo].GetMaxIndexValPair() ) {
233 Warning(
"GetSubTreeIndex",
"The tree has no index and the chain index"
234 " doesn't store an index for that tree");
262 if (!parent)
return -3;
294 std::pair<TVirtualIndex*, Int_t> indexAndNumber =
GetSubTreeIndex(major, minor);
295 if (!indexAndNumber.first) {
300 Long64_t rv = indexAndNumber.first->GetEntryNumberWithBestIndex(major, minor);
314 std::pair<TVirtualIndex*, Int_t> indexAndNumber =
GetSubTreeIndex(major, minor);
315 if (!indexAndNumber.first) {
320 Long64_t rv = indexAndNumber.first->GetEntryNumberWithIndex(major, minor);
376 if ((majorFormula ==
nullptr || majorFormula->GetNdim() == 0) ||
377 (minorFormula ==
nullptr || minorFormula->GetNdim() == 0))
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Holds a description of indices of trees in the chain.
std::pair< Long64_t, Long64_t > IndexValPair_t
TVirtualIndex * fTreeIndex
Long64_t fMinIndexValMinor
Long64_t fMaxIndexValMinor
void SetMinMaxFrom(const TTreeIndex *index)
std::vector< TChainIndexEntry > fEntries
Pointer to minor TreeFormula in Parent tree (if any)
TTreeFormula * fMinorFormulaParent
Pointer to major TreeFormula in Parent tree (if any)
virtual Bool_t IsValidFor(const TTree *parent)
Return kTRUE if index can be applied to the TTree.
virtual void UpdateFormulaLeaves(const TTree *parent)
Updates the parent formulae.
virtual ~TChainIndex()
The destructor.
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const
See TTreeIndex::GetEntryNumberWithBestIndex for details.
virtual void SetTree(TTree *T)
See TTreeIndex::SetTree.
virtual Long64_t GetEntryNumberFriend(const TTree *parent)
See TTreeIndex::GetEntryNumberFriend for description.
std::pair< TVirtualIndex *, Int_t > GetSubTreeIndex(Long64_t major, Long64_t minor) const
Returns a TVirtualIndex for a tree which holds the entry with the specified major and minor values an...
virtual void Append(const TVirtualIndex *, Bool_t delaySort=kFALSE)
Add an index to this chain.
void ReleaseSubTreeIndex(TVirtualIndex *index, Int_t treeNo) const
Releases the tree index got using GetSubTreeIndex.
TChainIndex()
Default constructor for TChainIndex.
void DeleteIndices()
Delete all the indices which were built by this object.
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const
Returns the entry number with given index values.
TTreeFormula * fMajorFormulaParent
TTreeFormula * GetMajorFormulaParent(const TTree *parent)
Return a pointer to the TreeFormula corresponding to the majorname in parent tree T.
TTreeFormula * GetMinorFormulaParent(const TTree *parent)
Return a pointer to the TreeFormula corresponding to the minorname in parent tree T.
A chain is a collection of files containing TTree objects.
virtual Long64_t LoadTree(Long64_t entry)
Find the tree which contains entry, and set it as the current tree.
virtual TTree * GetTree() const
Long64_t * GetTreeOffset() const
const char * GetName() const override
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
A Tree Index with majorname and minorname.
Helper class to prevent infinite recursion in the usage of TTree Friends.
A TTree represents a columnar dataset.
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
TFile * GetCurrentFile() const
Return pointer to the current file.
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
virtual TVirtualIndex * GetTreeIndex() const
virtual Long64_t GetEntries() const
virtual Long64_t GetReadEntry() const
virtual TTree * GetTree() const
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
Abstract interface for Tree Index.