46 std::swap(fMinIndexValue,
other.fMinIndexValue);
47 std::swap(fMinIndexValMinor,
other.fMinIndexValMinor);
48 std::swap(fMaxIndexValue,
other.fMaxIndexValue);
49 std::swap(fMaxIndexValMinor,
other.fMaxIndexValMinor);
50 std::swap(fTreeIndex,
other.fTreeIndex);
55 fMinIndexValue =
other.fMinIndexValue;
56 fMinIndexValMinor =
other.fMinIndexValMinor;
57 fMaxIndexValue =
other.fMaxIndexValue;
58 fMaxIndexValMinor =
other.fMaxIndexValMinor;
92 Error(
"TChainIndex",
"Cannot create a TChainIndex."
93 " The Tree passed as an argument is not a TChain");
103 for (i = 0; i <
chain->GetNtrees(); i++) {
108 entry.fTreeIndex =
nullptr;
115 Error(
"TChainIndex",
"Tree in file %s has an index built with majorname=%s and minorname=%s",
chain->GetTree()->GetCurrentFile()->GetName(),
index->GetMajorName(),
index->GetMinorName());
122 chain->GetTree()->SetTreeIndex(
nullptr);
128 Error(
"TChainIndex",
"Error creating a tree index on a tree in the chain");
134 Error(
"TChainIndex",
"The underlying TTree must have a TTreeIndex but has a %s.",
135 index->IsA()->GetName());
145 if(
fEntries[i].GetMaxIndexValPair() >
fEntries[i+1].GetMinIndexValPair() ) {
148 Error(
"TChainIndex",
"The indices in files of this chain aren't sorted.");
162 Error(
"Append",
"The given index is not a TTreeIndex but a %s",
163 index->IsA()->GetName());
167 entry.fTreeIndex =
nullptr;
175 if(
fEntries[i].GetMaxIndexValPair() >
fEntries[i+1].GetMinIndexValPair() ) {
178 Error(
"Append",
"The indices in files of this chain aren't sorted.");
189 for (
unsigned int i = 0; i <
fEntries.size(); i++) {
220 using std::make_pair;
222 Warning(
"GetSubTreeIndex",
"No subindices in the chain. The chain is probably empty");
229 Warning(
"GetSubTreeIndex",
"The index value is less than the smallest index values in subtrees");
234 for (
unsigned int i = 0; i <
fEntries.size() - 1; i++) {
253 Warning(
"GetSubTreeIndex",
"The tree has no index and the chain index"
254 " doesn't store an index for that tree");
282 if (!parent)
return -3;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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
void Swap(TChainIndexEntry &other)
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)
~TChainIndex() override
The destructor.
bool IsValidFor(const TTree *parent) override
Return true if index can be applied to the TTree.
TObject * Clone(const char *newname="") const override
Create a deep copy of the TChainIndex.
void Append(const TVirtualIndex *, bool delaySort=false) override
Add an index to this chain.
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...
Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const override
Returns the entry number with given index values.
void ReleaseSubTreeIndex(TVirtualIndex *index, Int_t treeNo) const
Releases the tree index got using GetSubTreeIndex.
Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const override
See TTreeIndex::GetEntryNumberWithBestIndex for details.
void UpdateFormulaLeaves(const TTree *parent) override
Updates the parent formulae.
TChainIndex()
Default constructor for TChainIndex.
void DeleteIndices()
Delete all the indices which were built by this object.
TTreeFormula * fMajorFormulaParent
Long64_t GetEntryNumberFriend(const TTree *parent) override
See TTreeIndex::GetEntryNumberFriend for description.
TTreeFormula * GetMajorFormulaParent(const TTree *parent)
Return a pointer to the TreeFormula corresponding to the majorname in parent tree T.
void SetTree(TTree *T) override
See TTreeIndex::SetTree.
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.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
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.
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.