A Tree Index with majorname and minorname.
TTreeIndex() | |
TTreeIndex(const TTree* T, const char* majorname, const char* minorname) | |
virtual | ~TTreeIndex() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | Append(const TVirtualIndex*, Bool_t delaySort = kFALSE) |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TNamed::Clear(Option_t* option = "") |
virtual TObject* | TNamed::Clone(const char* newname = "") const |
virtual Int_t | TNamed::Compare(const TObject* obj) const |
bool | ConvertOldToNew() |
virtual void | TNamed::Copy(TObject& named) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual void | TNamed::FillBuffer(char*& buffer) |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
Long64_t | FindValues(Long64_t major, Long64_t minor) const |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual Long64_t | GetEntryNumberFriend(const TTree* parent) |
virtual Long64_t | GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const |
virtual Long64_t | GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const |
virtual const char* | TObject::GetIconName() const |
virtual Long64_t* | GetIndex() const |
virtual Long64_t* | GetIndexValues() const |
virtual Long64_t* | GetIndexValuesMinor() const |
virtual TTreeFormula* | GetMajorFormula() |
virtual TTreeFormula* | GetMajorFormulaParent(const TTree* parent) |
virtual const char* | GetMajorName() const |
virtual TTreeFormula* | GetMinorFormula() |
virtual TTreeFormula* | GetMinorFormulaParent(const TTree* parent) |
virtual const char* | GetMinorName() const |
virtual Long64_t | GetN() const |
virtual const char* | TNamed::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual const char* | TNamed::GetTitle() const |
virtual TTree* | TVirtualIndex::GetTree() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TNamed::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TNamed::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TNamed::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
virtual void | TNamed::SetName(const char* name)MENU |
virtual void | TNamed::SetNameTitle(const char* name, const char* title) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | TNamed::SetTitle(const char* title = "")MENU |
virtual void | SetTree(const TTree* T) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector&) |
virtual Int_t | TNamed::Sizeof() const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | UpdateFormulaLeaves(const TTree* parent) |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
TTreeIndex(const TTreeIndex&) | |
TTreeIndex& | operator=(const TTreeIndex&) |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
Long64_t* | fIndex | [fN] Index of sorted values |
Long64_t* | fIndexValues | [fN] Sorted index values, higher 64bits |
Long64_t* | fIndexValuesMinor | [fN] Sorted index values, lower 64bits |
TTreeFormula* | fMajorFormula | ! Pointer to major TreeFormula |
TTreeFormula* | fMajorFormulaParent | ! Pointer to major TreeFormula in Parent tree (if any) |
TString | fMajorName | Index major name |
TTreeFormula* | fMinorFormula | ! Pointer to minor TreeFormula |
TTreeFormula* | fMinorFormulaParent | ! Pointer to minor TreeFormula in Parent tree (if any) |
TString | fMinorName | Index minor name |
Long64_t | fN | Number of entries |
TString | TNamed::fName | object identifier |
TString | TNamed::fTitle | object title |
TTree* | TVirtualIndex::fTree | ! pointer to Tree |
Normal constructor for TTreeIndex Build an index table using the leaves of Tree T with major & minor names The index is built with the expressions given in "majorname" and "minorname". a Long64_t array fIndexValues is built with: major = the value of majorname converted to an integer minor = the value of minorname converted to an integer fIndexValues[i] = major<<31 + minor This array is sorted. The sorted fIndex[i] contains the serial number in the Tree corresponding to the pair "major,minor" in fIndexvalues[i]. Once the index is computed, one can retrieve one entry via T->GetEntryWithIndex(majornumber, minornumber) Example: tree.BuildIndex("Run","Event"); //creates an index using leaves Run and Event tree.GetEntryWithIndex(1234,56789); //reads entry corresponding to Run=1234 and Event=56789 Note that majorname and minorname may be expressions using original Tree variables eg: "run-90000", "event +3*xx". However the result must be integer. In case an expression is specified, the equivalent expression must be computed when calling GetEntryWithIndex. To build an index with only majorname, specify minorname="0" (default) TreeIndex and Friend Trees Assuming a parent Tree T and a friend Tree TF, the following cases are supported: CASE 1: T->GetEntry(entry) is called In this case, the serial number entry is used to retrieve the data in both Trees. CASE 2: T->GetEntry(entry) is called, TF has a TreeIndex the expressions given in major/minorname of TF are used to compute the value pair major,minor with the data in T. TF->GetEntryWithIndex(major,minor) is then called (tricky case!) CASE 3: T->GetEntryWithIndex(major,minor) is called. It is assumed that both T and TF have a TreeIndex built using the same major and minor name. Saving the TreeIndex Once the index is built, it can be saved with the TTree object with tree.Write(); (if the file has been open in "update" mode). The most convenient place to create the index is at the end of the filling process just before saving the Tree header. If a previous index was computed, it is redefined by this new call. Note that this function can also be applied to a TChain. The return value is the number of entries in the Index (< 0 indicates failure) It is possible to play with different TreeIndex in the same Tree. see comments in TTree::SetTreeIndex.
Returns the entry number in this (friend) Tree corresponding to entry in the master Tree 'parent'. In case this (friend) Tree and 'master' do not share an index with the same major and minor name, the entry serial number in the (friend) tree and in the master Tree are assumed to be the same
find position where major|minor values are in the IndexValues tables this is the index in IndexValues table, not entry# ! use lower_bound STD algorithm.
Return entry number corresponding to major and minor number. Note that this function returns only the entry number, not the data To read the data corresponding to an entry number, use TTree::GetEntryWithIndex the BuildIndex function has created a table of Double_t* of sorted values corresponding to val = major<<31 + minor; The function performs binary search in this sorted table. If it finds a pair that maches val, it returns directly the index in the table. If an entry corresponding to major and minor is not found, the function returns the index of the major,minor pair immediatly lower than the requested value, ie it will return -1 if the pair is lower than the first entry in the index. See also GetEntryNumberWithIndex
Return entry number corresponding to major and minor number. Note that this function returns only the entry number, not the data To read the data corresponding to an entry number, use TTree::GetEntryWithIndex the BuildIndex function has created a table of Double_t* of sorted values corresponding to val = major<<31 + minor; The function performs binary search in this sorted table. If it finds a pair that maches val, it returns directly the index in the table, otherwise it returns -1. See also GetEntryNumberWithBestIndex
Return a pointer to the TreeFormula corresponding to the majorname.
Return a pointer to the TreeFormula corresponding to the minorname.
Return a pointer to the TreeFormula corresponding to the majorname in parent tree.
Return a pointer to the TreeFormula corresponding to the minorname in parent tree.
Print the table with : serial number, majorname, minorname. if option = "10" print only the first 10 entries if option = "100" print only the first 100 entries if option = "1000" print only the first 1000 entries
Stream an object of class TTreeIndex. Note that this Streamer should be changed to an automatic Streamer once TStreamerInfo supports an index of type Long64_t
this function is called by TChain::LoadTree and TTreePlayer::UpdateFormulaLeaves when a new Tree is loaded. Because Trees in a TChain may have a different list of leaves, one must update the leaves numbers in the TTreeFormula used by the TreeIndex.