82 gROOT->GetListOfSpecials()->Add(
this);
89 gROOT->GetListOfDataSets()->Add(
this);
93 gROOT->GetListOfCleanups()->Add(
this);
155 gROOT->GetListOfSpecials()->Add(
this);
156 gROOT->GetListOfDataSets()->Add(
this);
159 gROOT->GetListOfCleanups()->Add(
this);
172 gROOT->GetListOfCleanups()->Remove(
this);
199 gROOT->GetListOfSpecials()->Remove(
this);
200 gROOT->GetListOfDataSets()->Remove(
this);
213 if (!chain)
return 0;
226 TIter next(chain->GetListOfFiles());
356 TString basename, treename, query, suffix;
365 static const char *dotr =
".root";
366 static Ssiz_t dotrl = strlen(dotr);
370 while (dotrIdx !=
kNPOS) {
371 lastDotrIdx = dotrIdx;
372 dotrIdx = suffix.
Index(dotr, dotrIdx + 1);
374 if (lastDotrIdx !=
kNPOS) {
376 basename.
Append(suffix, lastDotrIdx + dotrl);
378 suffix.
Replace(0, lastDotrIdx + dotrl,
"");
388 std::vector<std::string> expanded_glob;
391 }
catch (
const std::runtime_error &) {
397 const TString hashMarkTreeName{
"#" + treename};
398 for (
const auto &path : expanded_glob) {
399 if (suffix == hashMarkTreeName) {
481 if(
name==
nullptr ||
name[0]==
'\0') {
482 Error(
"AddFile",
"No file name; no files connected");
486 const char *treename =
GetName();
487 if (tname && strlen(tname) > 0) treename = tname;
489 TString basename, tn, query, suffix;
493 treename = tn.
Data();
497 char *filename =
new char[nch+1];
498 strlcpy(filename,basename.
Data(),nch+1);
499 strlcat(filename,query.
Data(),nch+1);
531 Error(
"AddFile",
"cannot find tree with name %s in file %s", treename, filename);
561 Warning(
"AddFile",
"Adding tree with no entries from file: %s", filename);
578 TIter next(filelist);
582 while ((o = next())) {
585 const char *url =
nullptr;
586 if (cn ==
"TFileInfo") {
590 Warning(
"AddFileInfoList",
"found TFileInfo with empty Url - ignoring");
593 }
else if (cn ==
"TUrl") {
594 url = ((
TUrl*)o)->GetUrl();
595 }
else if (cn ==
"TObjString") {
599 Warning(
"AddFileInfoList",
"object is of type %s : expecting TFileInfo, TUrl"
600 " or TObjString - ignoring", o->
ClassName());
677 Warning(
"AddFriend",
"Unknown TChain %s", chain);
700 Warning(
"AddFriend",
"Unknown TChain %s",chain);
710 if (!chain)
return nullptr;
723 Warning(
"AddFriend",
"Unknown TChain %s",chain->GetName());
766 Error(
"CopyTree",
"TChain::CopyTree is not supported if the TChain instance has friends.");
818 if (
LoadTree(firstentry) < 0)
return 0;
827 auto findBranchImpl = [
this](
const char *resolvedBranchName) ->
TBranch * {
829 return fTree->FindBranch(resolvedBranchName);
833 return fTree->FindBranch(resolvedBranchName);
840 std::string_view branchNameView{branchname};
841 std::string_view chainPrefix =
GetName();
844 branchNameView.remove_prefix(chainPrefix.length());
845 if (!branchNameView.empty() && branchNameView.front() ==
'.') {
846 branchNameView.remove_prefix(1);
849 return findBranchImpl(branchNameView.data());
853 return findBranchImpl(branchname);
861 auto findLeafImpl = [
this](
const char *resolvedBranchName) ->
TLeaf * {
863 return fTree->FindLeaf(resolvedBranchName);
867 return fTree->FindLeaf(resolvedBranchName);
874 std::string_view branchNameView{searchname};
875 std::string_view chainPrefix =
GetName();
878 branchNameView.remove_prefix(chainPrefix.length());
879 if (!branchNameView.empty() && branchNameView.front() ==
'.') {
880 branchNameView.remove_prefix(1);
883 return findLeafImpl(branchNameView.data());
887 return findLeafImpl(searchname);
900 return fTree->GetAlias(aliasName);
904 return fTree->GetAlias(aliasName);
939 Fatal(
"GetClusterIterator",
"TChain objects are not supported");
968 totalEntries += chainEl->GetEntries();
972 std::unique_ptr<TFile> curFile{
TFile::Open(chainEl->GetTitle(),
"READ_WITHOUT_GLOBALREGISTRATION")};
973 if (!curFile || curFile->IsZombie()) {
976 std::unique_ptr<TTree> curTree{curFile->Get<
TTree>(chainEl->GetName())};
980 totalEntries += curTree->GetEntries();
999 if (treeReadEntry < 0) {
1005 return fTree->GetEntry(treeReadEntry, getall);
1023 if (localentry<0)
return -1;
1026 for (
Int_t i=0; i<=treenum; i++){
1052 if (serial < 0)
return -1;
1076 return fTree->GetLeaf(branchname, leafname);
1080 return fTree->GetLeaf(branchname, leafname);
1111 return fTree->GetListOfBranches();
1115 return fTree->GetListOfBranches();
1128 return fTree->GetListOfLeaves();
1132 return fTree->GetListOfLeaves();
1143 TLeaf *leaf =
nullptr;
1145 Int_t treenumber = -1;
1148 if (entryNumber < 0)
1151 if (localEntryNumber < 0)
1154 leaf = this->
GetLeaf(columname);
1161 branch->
GetEntry(localEntryNumber);
1178 TLeaf *leaf =
nullptr;
1180 Int_t treenumber = -1;
1183 if (entryNumber < 0)
1186 if (localEntryNumber < 0)
1189 leaf = this->
GetLeaf(columname);
1196 branch->
GetEntry(localEntryNumber);
1215 return fTree->GetNbranches();
1219 return fTree->GetNbranches();
1247 return fTree->GetWeight();
1251 return fTree->GetWeight();
1261 Error(
"InPlaceClone",
"not implemented");
1281 for (
TObjLink* lnk =
fTree->GetListOfClones()->FirstLink(); lnk; lnk = lnk->Next()) {
1298 Error(
"LoadBaskets",
"Function not yet implemented for TChain.");
1310 assert(
fTree !=
nullptr);
1312 bool needUpdate =
false;
1313 if (
auto *innerFriendList =
fTree->GetListOfFriends()) {
1318 if (frEl->IsUpdated()) {
1320 frEl->ResetUpdated();
1322 if (frEl->IsUpdatedForChain()) {
1324 frEl->ResetUpdatedForChain();
1338 Int_t status = chainEl->GetStatus();
1340 fTree->SetBranchStatus(chainEl->GetName(), status);
1343 void *addr = chainEl->GetBaddress();
1348 TBranch **pp = chainEl->GetBranchPtr();
1356 if (!chainEl->GetCheckedType()) {
1358 (
EDataType)chainEl->GetBaddressType(), chainEl->GetBaddressIsPtr());
1363 chainEl->SetCheckedType(
true);
1380 external_fe->MarkUpdated();
1383 fPlayer->UpdateFormulaLeaves();
1444 for (treenum = 0; treenum <
fNtrees; treenum++) {
1462 fTree->LoadTree(treeReadEntry);
1469 auto *frTree = frEl->GetTree();
1470 frTree->LoadTreeFriend(entry,
this);
1477 return refreshFriendAddressesRet;
1480 return treeReadEntry;
1485 external_fe->MarkUpdated();
1494 if (!
fDirectory->GetList()->FindObject(
this)) {
1543 if (treeReadEntry) {
1564 Int_t returnCode = 0;
1581 Error(
"LoadTree",
"Cannot find tree with name %s in file %s", element->
GetName(), element->
GetTitle());
1645 if(!
fNotify->Notify())
return -6;
1685 if (loadResult == treeReadEntry) {
1711 if (treeReadEntry == -2) {
1737 UInt_t dummyFound = std::numeric_limits<UInt_t>::max();
1741 fTree->SetBranchStatus(element->
GetName(), status, &dummyFound);
1791 fPlayer->UpdateFormulaLeaves();
1796 if(!
fNotify->Notify())
return -6;
1800 return treeReadEntry;
1814 printf(
"TChain::Lookup - Looking up %d files .... \n", nelements);
1832 if (!stg || !stg->
Matches(eurl)) {
1839 Error(
"Lookup",
"TFileStager instance cannot be instantiated");
1843 Int_t n1 = (nelements > 100) ? (
Int_t) nelements / 100 : 1;
1845 if (nlook > 0 && !(nlook % n1)) {
1846 printf(
"Lookup | %3d %% finished\r", 100 * nlook / nelements);
1861 if (
gSystem->AccessPathName(eurl))
1862 Error(
"Lookup",
"file %s does not exist\n", eurl.
Data());
1864 Error(
"Lookup",
"file %s cannot be read\n", eurl.
Data());
1868 printf(
"Lookup | %3d %% finished\n", 100 * nlook / nelements);
1914 return Merge(file, 0, option);
1922 Error(
"Merge",
"not implemented");
1931 Error(
"Merge",
"not implemented");
2047 bool fastClone =
false;
2098 while ((branch = (
TBranch*) nextb())) {
2104 if (basketsize > 1000) {
2107 while ((branch = (
TBranch*) nextb())) {
2114 if ( newTree->
CopyEntries(
this, -1, option ) < 0 ) {
2116 Error(
"Merge",
"TTree has not been cloned\n");
2195 if (anchor && anchor[0] !=
'\0') {
2201 if (strstr(anchor,
"=")) {
2220 static const char *dotr =
".root";
2221 static Ssiz_t dotrl = strlen(dotr);
2224 while (js !=
kNPOS) {
2226 js = filename.
Index(dotr, js + 1);
2228 if (pIdx !=
kNPOS) {
2229 static const char *
slash =
"/";
2233 if (ppIdx !=
kNPOS) {
2235 treename = filename(ppIdx + slashl, filename.
Length());
2236 filename.
Remove(ppIdx + slashl - 1);
2251 Printf(
"******************************************************************************");
2253 Printf(
"******************************************************************************");
2257 if (tree) tree->
Print(option);
2370 static Int_t chCounter = 0;
2376 chName += chCounter;
2381 out <<
" TChain *" << chName.
Data() <<
" = new TChain(\"" <<
GetName() <<
"\");" << std::endl;
2387 if (
dynamic_cast<TChain *
>(frtree)) {
2391 out <<
" " << chName.
Data() <<
"->AddFriend(\"" << frtree->
GetName() <<
"\");" << std::endl;
2394 if (file &&
dynamic_cast<TFile *
>(file))
2395 out <<
" " << chName.
Data() <<
"->AddFriend(\"" << frtree->
GetName() <<
"\", \"" << file->
GetName()
2396 <<
"\");" << std::endl;
2407 out <<
" " << chName.
Data() <<
"->AddFile(\"" << chel->
GetTitle() <<
"\");" << std::endl;
2462 res =
fTree->SetCacheSize(cacheSize);
2481 fTree->ResetBranchAddress(branch);
2501 fTree->ResetBranchAddresses();
2506 auto *frTree = frEl->GetTree();
2508 frTree->ResetBranchAddresses();
2552 "Could not load the first tree in chain \"%s\", no dataset schema available. Thus, it is not possible "
2553 "to know whether the branch name \"%s\" corresponds to an available branch or not. This could happen "
2554 "if the chain has no files connected yet, make sure to add files to the chain before calling "
2555 "'TChain::SetBranchAddress'.",
2578 if (cloneBr && (cloneBr->
GetAddress() == oldAdd)) {
2591 Error(
"SetBranchAddress",
"unknown branch -> %s", bname);
2668 fTree->SetBranchStatus(bname, status, found);
2739 if (elist->
GetN() == 0){
2750 const auto *subentrylists = elist->
GetLists();
2751 if(strcmp(opt,
"sync") == 0){
2753 std::string msg{
"In 'TChain::SetEntryList': "};
2754 msg +=
"the input TEntryList doesn't have sub entry lists. Please make sure too add them through ";
2755 msg +=
"TEntryList::AddSubList";
2756 throw std::runtime_error(msg);
2758 const auto nsubelists = subentrylists->GetEntries();
2759 if(nsubelists != ne){
2760 std::string msg{
"In 'TChain::SetEntryList': "};
2761 msg +=
"the number of sub entry lists in the input TEntryList (";
2762 msg += std::to_string(nsubelists);
2763 msg +=
") is not equal to the number of files in the chain (";
2764 msg += std::to_string(ne);
2766 throw std::runtime_error(msg);
2770 for (
Int_t ie = 0; ie<ne; ie++){
2772 treename = chainElement->GetName();
2773 filename = chainElement->GetTitle();
2775 if(strcmp(opt,
"sync") == 0){
2780 templist =
static_cast<TEntryList*
>(subentrylists->At(ie));
2784 if (strcmp(treename, elisttreename) != 0 || strcmp(filename, elistfilename) != 0){
2785 std::string msg{
"In 'TChain::SetEntryList': "};
2786 msg +=
"the sub entry list at index ";
2787 msg += std::to_string(ie);
2788 msg +=
" doesn't correspond to treename '";
2790 msg +=
"' and filename '";
2792 msg +=
"': it has treename '";
2793 msg += elisttreename;
2794 msg +=
"' and filename '";
2795 msg += elistfilename;
2797 throw std::runtime_error(msg);
2801 templist = elist->
GetEntryList(treename, filename, opt);
2810 if (listfound == 0){
2811 Error(
"SetEntryList",
"No list found for the trees in this chain");
2874 Int_t dotslashpos = basename.
Index(
".root/");
2876 if (dotslashpos>=0) {
2878 behind_dot_root = basename(dotslashpos+6,basename.
Length()-dotslashpos+6);
2880 basename.
Remove(dotslashpos+5);
2919 char enlistname[100];
2926 const char *treename;
2927 const char *filename;
2932 printf(
"loading trees\n");
2935 for (
Int_t i=0; i<nsel; i++){
2947 enlist->
SetTree(treename, filename);
2948 enlist->
Enter(localentry);
2963 gROOT->GetListOfCleanups()->Remove(
this);
2964 gROOT->GetListOfSpecials()->Remove(
this);
2965 gROOT->GetListOfDataSets()->Remove(
this);
2971 gROOT->GetListOfCleanups()->Add(
this);
2972 gROOT->GetListOfSpecials()->Add(
this);
2973 gROOT->GetListOfDataSets()->Add(
this);
3025 if (
b.IsReading()) {
3029 gROOT->GetListOfCleanups()->Remove(
this);
3033 Version_t R__v =
b.ReadVersion(&R__s, &R__c);
3053 gROOT->GetListOfCleanups()->Add(
this);
3070 bool isptr,
bool suppressMissingBranchError)
3072 if (!
fStatus->FindObject(bname)) {
3074 element->IsDelayed(suppressMissingBranchError);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
short Version_t
Class version identifier (short).
int Ssiz_t
String size (currently int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
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.
externTVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
#define R__LOCKGUARD(mutex)
#define R__WRITE_LOCKGUARD(mutex)
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
A TTree is a list of TBranches.
virtual bool GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
virtual char * GetAddress() const
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Set compression settings.
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
virtual void SetAddress(void *add)
Set address of this branch.
virtual void SetAutoDelete(bool autodel=true)
Set the automatic delete bit.
virtual bool SetMakeClass(bool decomposeObj=true)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode).
virtual void SetBasketSize(Int_t bufsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
A TChainElement describes a component of a TChain.
void SetLoadResult(Int_t result)
virtual void SetBaddressClassName(const char *clname)
virtual Long64_t GetEntries() const
void SetCheckedType(bool m)
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
void SetDecomposedObj(bool m)
virtual bool HasBeenLookedUp()
virtual void SetStatus(Int_t status)
virtual void SetLookedUp(bool y=true)
Set/Reset the looked-up bit.
virtual UInt_t GetBaddressType() const
virtual bool GetBaddressIsPtr() const
virtual void SetNumberEntries(Long64_t n)
virtual TBranch ** GetBranchPtr() const
virtual Int_t GetPacketSize() const
virtual void SetBaddress(void *add)
virtual void CreatePackets()
Initialize the packet descriptor string.
virtual void SetBranchPtr(TBranch **ptr)
Int_t GetLoadResult() const
void ls(Option_t *option="") const override
List files in the chain.
virtual Int_t GetStatus() const
void IsDelayed(bool isDelayed)
virtual void * GetBaddress() const
virtual void SetBaddressType(UInt_t type)
bool GetCheckedType() const
virtual const char * GetBaddressClassName() const
virtual void SetBaddressIsPtr(bool isptr)
TLeaf * FindLeaf(const char *name) override
See TTree::GetReadEntry().
Int_t SetCacheSize(Long64_t cacheSize=-1) override
Set maximum size of the file cache (TTreeCache) in bytes.
virtual void CanDeleteRefs(bool flag=true)
When closing a file during the chain processing, the file may be closed with option "R" if flag is se...
TObjArray * GetListOfBranches() override
Return a pointer to the list of branches of the current tree.
void Streamer(TBuffer &) override
Stream a class object.
Long64_t GetEntryNumber(Long64_t entry) const override
Return entry number corresponding to entry.
Double_t GetWeight() const override
Return the chain weight.
virtual void SetAutoDelete(bool autodel=true)
Set the global branch kAutoDelete bit.
bool fCanDeleteRefs
! If true, TProcessIDs are deleted when closing a file
Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError) override
void SetEntryList(TEntryList *elist, Option_t *opt="") override
Set the input entry list (processing the entries of the chain will then be limited to the entries in ...
Int_t fNtrees
Number of trees.
TFriendElement * AddFriend(const char *chainname, const char *dummy="") override
Add a TFriendElement to the list of friends of this chain.
void DirectoryAutoAdd(TDirectory *) override
Override the TTree::DirectoryAutoAdd behavior: we never auto add.
~TChain() override
Destructor.
Int_t LoadBaskets(Long64_t maxmemory) override
Dummy function.
TTree * GetTree() const override
void Print(Option_t *option="") const override
Print the header information of each tree in the chain.
void RecursiveRemove(TObject *obj) override
Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree.
const char * GetAlias(const char *aliasName) const override
Returns the expanded value of the alias. Search in the friends if any.
TClass * IsA() const override
virtual Int_t AddFile(const char *name, Long64_t nentries=TTree::kMaxEntries, const char *tname="")
Add a new file to this chain.
void Reset(Option_t *option="") override
Resets the state of this chain.
void ResetAfterMerge(TFileMergeInfo *) override
Resets the state of this chain after a merge (keep the customization but forget the data).
Long64_t * fTreeOffset
[fTreeOffsetLen] Array of variables
TBranch * FindBranch(const char *name) override
See TTree::GetReadEntry().
void ResetBranchAddresses() override
Reset the addresses of the branches.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save TChain as a C++ statements on output stream out.
void SetEventList(TEventList *evlist) override
This function transfroms the given TEventList into a TEntryList.
TObjArray * GetListOfLeaves() override
Return a pointer to the list of leaves of the current tree.
bool GetBranchStatus(const char *branchname) const override
See TTree::GetReadEntry().
TBranch * GetBranch(const char *name) override
Return pointer to the branch name in the current tree.
Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
Loop on tree and print entries passing selection.
Double_t GetMaximum(const char *columname) override
Return maximum of column with name columname.
void SetWeight(Double_t w=1, Option_t *option="") override
Set chain weight.
Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
Process all entries in this chain, calling functions in filename.
void RemoveFriend(TTree *) override
Remove a friend from the list of friends.
virtual Int_t AddFileInfoList(TCollection *list, Long64_t nfiles=TTree::kMaxEntries)
Add all files referenced in the list to the chain.
virtual void CreatePackets()
Initialize the packet descriptor string.
void ResetBranchAddress(TBranch *) override
Reset the addresses of the branch.
TList * fStatus
-> List of active/inactive branches (TChainElement, owned)
void SetDirectory(TDirectory *dir) override
Remove reference to this chain from current directory and add reference to new directory dir.
Double_t GetMinimum(const char *columname) override
Return minimum of column with name columname.
virtual Long64_t Merge(const char *name, Option_t *option="")
Merge all the entries in the chain into a new tree in a new file.
TTree * fTree
! Pointer to current tree (Note: We do not own this tree.)
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.
void ParseTreeFilename(const char *name, TString &filename, TString &treename, TString &query, TString &suffix) const
Get the tree url or filename and other information from the name.
bool InPlaceClone(TDirectory *newdirectory, const char *options="") override
Move content to a new file. (NOT IMPLEMENTED for TChain).
Int_t GetNbranches() override
Return the number of branches of the current tree.
Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
Draw expression varexp for selected entries.
bool fGlobalRegistration
! if true, bypass use of global lists
virtual void SetEntryListFile(const char *filename="", Option_t *opt="")
Set the input entry list (processing the entries of the chain will then be limited to the entries in ...
Long64_t GetChainEntryNumber(Long64_t entry) const override
Return absolute entry number in the chain.
Int_t fTreeOffsetLen
Current size of fTreeOffset array.
void SetName(const char *name) override
Change the name of this TChain.
void ls(Option_t *option="") const override
List the chain.
void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr) override
Set branch status to Process or DoNotProcess.
Long64_t LoadTree(Long64_t entry) override
Find the tree which contains entry, and set it as the current tree.
TClusterIterator GetClusterIterator(Long64_t firstentry) override
Return an iterator over the cluster of baskets starting at firstentry.
void Browse(TBrowser *) override
Browse the contents of the chain.
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
Copy a tree with selection.
TObjArray * fFiles
-> List of file names containing the trees (TChainElement, owned)
Long64_t GetReadEntry() const override
See TTree::GetReadEntry().
@ kWithGlobalRegistration
TFile * fFile
! Pointer to current file (We own the file).
virtual void UseCache(Int_t maxCacheSize=10, Int_t pageSize=0)
Dummy function kept for back compatibility.
void InvalidateCurrentTree()
Set the TTree to be reloaded as soon as possible.
Long64_t GetEntries() const override
Return the total number of entries in the chain.
TFile * GetFile() const
Return a pointer to the current file.
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Get entry from the file to memory.
virtual void SetPacketSize(Int_t size=100)
Set number of entries per packet for parallel root.
Int_t fTreeNumber
! Current Tree number in fTreeOffset table
Int_t GetTreeNumber() const override
void Lookup(bool force=false)
Check / locate the files in the chain.
Long64_t RefreshFriendAddresses()
Refresh branch/leaf addresses of friend trees.
TLeaf * GetLeaf(const char *branchname, const char *leafname) override
Return a pointer to the leaf name in the current tree.
Int_t GetEntryWithIndex(Long64_t major, Long64_t minor=0) override
Return entry corresponding to major and minor number.
TClass instances represent classes, structs and namespaces in the ROOT type system.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Collection abstract base class.
A specialized string object used for TTree selections.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
TDirectory::TContext keeps track and restore the current directory.
Describe directory structure in memory.
Manages entry lists from different files, when they are not loaded in memory at the same time.
virtual Int_t GetTreeNumber() const
virtual TList * GetLists() const
virtual bool Enter(Long64_t entry, TTree *tree=nullptr)
virtual void SetTree(const TTree *tree)
virtual void SetReapplyCut(bool apply=false)
virtual void SetTreeNumber(Int_t index)
virtual void SetDirectory(TDirectory *dir)
virtual const char * GetTreeName() const
virtual TEntryList * GetEntryList(const char *treename, const char *filename, Option_t *opt="")
void GetFileName(const char *filename, TString &fn, bool *=nullptr)
virtual Long64_t GetN() const
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
virtual bool GetReapplyCut() const
virtual Int_t GetN() const
Class describing a generic file including meta information.
TUrl * GetCurrentUrl() const
Return the current url.
A class to pass information from the TFileMerger to the objects being merged.
virtual Bool_t Matches(const char *s)
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Int_t GetCompressionSettings() const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
A TFriendElement TF describes a TTree object TF in a file.
virtual TTree * GetTree()
Return pointer to friend TTree.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Double_t GetValue(Int_t i=0) const
virtual Int_t GetLen() const
Return the number of effective elements of this leaf, for the current entry.
TBranch * GetBranch() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Wrapper around a TObject so it can be stored in a TList.
Collectable string class.
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TObject()
TObject constructor.
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
@ kCanDelete
if object in a list can be deleted
@ kInvalidObject
if object ctor succeeded but object should not be used
@ kMustCleanup
if object destructor must call RecursiveRemove()
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
void ToLower()
Change string to lower-case.
TString & Insert(Ssiz_t pos, const char *s)
void Clear()
Clear string without changing its capacity.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
Bool_t MaybeWildcard() const
Returns true if string contains one of the wildcard characters "[]*?".
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A cache to speed-up the reading of ROOT datasets.
virtual void UpdateBranches(TTree *tree)
Update pointer to current Tree and recompute pointers to the branches in the cache.
virtual void ResetCache()
This will simply clear the cache.
Helper class to iterate over cluster of baskets.
Helper class to prevent infinite recursion in the usage of TTree Friends.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
TList * fFriends
pointer to list of friend elements
bool fIMTEnabled
! true if implicit multi-threading is enabled for this tree
virtual bool GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
UInt_t fFriendLockStatus
! Record which method is locking the friend recursion
TEventList * fEventList
! Pointer to event selection list (if one)
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
bool fCacheUserSet
! true if the cache setting was explicitly given by user
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 TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Copy a tree with selection.
void Streamer(TBuffer &) override
Stream a class object.
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
void Draw(Option_t *opt) override
Default Draw method for all objects.
void Print(Option_t *option="") const override
Print a summary of the tree contents.
TVirtualTreePlayer * fPlayer
! Pointer to current Tree player
TDirectory * GetDirectory() const
Long64_t fEntries
Number of entries.
TEntryList * fEntryList
! Pointer to event selection list (if one)
virtual TVirtualIndex * GetTreeIndex() const
TList * fExternalFriends
! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
virtual void SetAutoSave(Long64_t autos=-300000000)
In case of a program crash, it will be possible to recover the data in the tree up to the last AutoSa...
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process this tree executing the TSelector code in the specified filename.
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data).
virtual Long64_t GetEntries() const
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Long64_t fMaxVirtualSize
Maximum total size of buffers kept in memory.
TVirtualPerfStats * fPerfStats
! pointer to the current perf stats object
Double_t fWeight
Tree weight (see TTree::SetWeight).
TTree()
Default constructor and I/O constructor.
virtual Long64_t GetReadEntry() const
virtual TObjArray * GetListOfBranches()
virtual TTree * GetTree() const
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
void Browse(TBrowser *) override
Browse content of the TTree.
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T)
Load entry on behalf of our master tree, we may use an index.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
TObject * fNotify
Object to be notified when loading a Tree.
Long64_t fCacheSize
! Maximum size of file buffers
TList * fClones
! List of cloned trees which share our addresses
virtual void CopyAddresses(TTree *, bool undo=false)
Set branch addresses of passed tree equal to ours.
virtual TList * GetListOfFriends() const
Long64_t fReadEntry
! Number of the entry being processed
TDirectory * fDirectory
! Pointer to directory holding this tree
@ kNeedEnableDecomposedObj
void SetName(const char *name) override
Change the name of this tree.
virtual Int_t GetPacketSize() const
void AddClone(TTree *)
Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when...
virtual Int_t CheckBranchAddressType(TBranch *branch, TClass *ptrClass, EDataType datatype, bool ptr)
Check whether or not the address described by the last 3 parameters matches the content of the branch...
virtual Int_t GetFileNumber() const
virtual void SetChainOffset(Long64_t offset=0)
Int_t fPacketSize
! Number of entries in one packet for parallel root
virtual Long64_t GetChainOffset() const
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over tree entries and print entries passing selection.
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="", bool needCopyAddresses=false)
Copy nentries from given tree to this tree.
Int_t fMakeClass
! not zero when processing code generated by MakeClass
static constexpr Long64_t kMaxEntries
Used as the max value for any TTree range operation.
This class represents a WWW compatible URL.
const char * GetAnchor() const
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
void SetAnchor(const char *anchor)
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
const char * GetFile() const
void SetUrl(const char *url, Bool_t defaultIsFile=kFALSE)
Parse url character string and split in its different subcomponents.
void SetOptions(const char *opt)
const char * GetOptions() const
const char * GetProtocol() const
virtual void UpdateFormulaLeaves(const TTree *parent)=0
TRangeCast< T, false > TRangeStaticCast
TRangeStaticCast is an adapter class that allows the typed iteration through a TCollection.
std::vector< std::string > ExpandGlob(const std::string &glob)
Expands input glob into a collection of full paths to files.
externTVirtualRWMutex * gCoreMutex
bool StartsWith(std::string_view string, std::string_view prefix)