96 FILE *left = fopen(from.
Data(),
"r");
97 FILE *right = fopen(to.
Data(),
"r");
100 char rightbuffer[256];
102 char *lvalue,*rvalue;
107 lvalue = fgets(leftbuffer,
sizeof(leftbuffer), left);
108 rvalue = fgets(rightbuffer,
sizeof(rightbuffer), right);
110 if (lvalue&&rvalue) {
111 if (strstr(lvalue,
"by ROOT version")) {
117 if (lvalue&&!rvalue)
areEqual =
false;
118 if (rvalue&&!lvalue)
areEqual =
false;
120 }
while(areEqual && lvalue && rvalue);
140 if (countname && strlen(countname)>0) ndim = 1;
156 }
else if (ndim==1) {
166 for(
Int_t ind = ndim - 2; ind > 0; --ind) {
167 result +=
"TMultiArrayType<";
174 for(
Int_t ind = ndim - 2; ind > 0; --ind) {
214 const char *fileprefix,
217 fMaxDatamemberType(2),
223 fMaxUnrolling(maxUnrolling),
224 fCurrentListOfTopProxies(&fListOfTopProxies)
237 const char *script,
const char *cutscript,
238 const char *fileprefix,
241 fMaxDatamemberType(2),
243 fCutScript(cutscript),
247 fMaxUnrolling(maxUnrolling),
248 fCurrentListOfTopProxies(&fListOfTopProxies)
271 if (desc==
nullptr)
return nullptr;
301 if (desc==
nullptr)
return;
353 if (strstr(classname,
"<")!=
nullptr) {
357 if (
gDebug>=6)
Warning(
"AddForward",
"Forward declaration of templated class not implemented yet.");
358 }
else if (strcmp(classname,
"string")==0) {
381 if (pragma_text ==
n->GetString()) {
399 Warning(
"TTreeProxyGenerator",
"The branch name \"%s\" is duplicated. Only the first instance \n"
400 "\twill be available directly. The other instance(s) might be available via their complete name\n"
401 "\t(including the name of their mother branche's name).",desc->
GetName());
422 if (clname[strlen(clname)-1]==
'>') {
425 }
else if (isscope) {
449 if (nest == 0 && clname[i+1] ==
':') {
457 if (nest == 1) last = i + 1;
460 if (nest == 0)
return;
463 if ((clname[i] ==
',' && nest == 1) || (clname[i] ==
'>' && nest == 0)) {
464 TString incName(clname + last, i - last);
466 if (clname[i] ==
'>' && nest == 1) incName.
Append(
">");
468 if (isdigit(incName[0])) {
487 if (info==
nullptr) info = branch->
GetInfo();
528 bool skipped =
false;
531 TIter peek = branches;
533 if (topdesc && topdesc->
IsClones()) {
537 containerName =
"TClonesArray";
538 }
else if (topdesc && topdesc->
IsSTL()) {
548 containerName =
"TClonesArray";
555 }
else if (branch->
GetType() == 3) {
557 containerName =
"TClonesArray";
558 }
else if (branch->
GetType() == 4) {
566 subBranchPrefix = mom->
GetName();
567 if (subBranchPrefix[subBranchPrefix.
Length()-1]==
'.') {
570 subBranchPrefix =
"";
580 bool usedBranch =
true;
582 TIter peek = branches;
585 if (branch==
nullptr) {
587 Error(
"AnalyzeBranches",
"Ran out of branches when looking in branch %s, class %s",
590 Error(
"AnalyzeBranches",
"Ran out of branches when looking in class %s, element %s",
591 info->
GetName(),element->GetName());
601 if (element->GetType()==-1) {
612 else branchEndname = branch->
GetName();
614 pos = branchEndname.
Index(
".");
616 if (subBranchPrefix.
Length() &&
617 branchEndname.
BeginsWith( subBranchPrefix ) ) {
624 bool ispointer =
false;
625 switch(element->GetType()) {
704 TClass *cl = element->GetClassPointer();
707 proxyTypeName =
Form(
"T%sObjProxy<%s >", middle.
Data(), cl->
GetName());
713 containerName =
"TClonesArray";
721 proxyTypeName =
Form(
"TStlSimpleProxy<%s >", cl->
GetName());
734 if (element->IsBase()) {
745 if (branchEndname == element->GetName()) {
771 proxyTypeName = local_cldesc->
GetName();
772 local_cldesc =
AddClass(local_cldesc);
798 if (objInfo ==
nullptr) {
813 if (added) proxyTypeName = added->
GetName();
818 if (branchEndname == element->GetName()) {
844 proxyTypeName = local_cldesc->
GetName();
845 local_cldesc =
AddClass(local_cldesc);
866 if (local_prefix.
Length()) local_prefix +=
".";
867 local_prefix += element->GetName();
889 if (added) proxyTypeName = added->
GetName();
899 Error(
"AnalyzeBranch",
900 "Unsupported type for %s (%d).",
901 branch->
GetName(),element->GetType());
905 TString dataMemberName = element->GetName();
908 proxyTypeName, branchname,
true, skipped ), isBase );
910 dataMemberName.
Prepend(prefix);
912 proxyTypeName, branchname,
true, skipped ) );
931 Error(
"AnalyzeOldLeaf",
"TLeafObject not supported yet");
937 if (pos!=-1) leafTypeName.
Remove(pos);
943 std::vector<Int_t> maxDim;
948 pos = temp.
Index(
"[");
950 if (pos) temp.
Remove(0,pos);
954 pos = temp.
Index(
"[");
956 if (pos) temp.
Remove(0,pos);
963 const char *current = dimensions.
Data();
969 if (current[0] ==
']') {
970 maxDim.push_back(-1);
972 scanindex = sscanf(current,
"%d",&
index);
974 maxDim.push_back(
index);
976 maxDim.push_back(-2);
980 current = (
char*)strstr( current,
"[" );
998 type += leafTypeName;
1004 type += leafTypeName;
1009 type =
"TArrayProxy<";
1010 for(
Int_t ind = dim - 2; ind > 0; --ind) {
1011 type +=
"TMultiArrayType<";
1013 type +=
"TArrayType<";
1016 type += maxDim[dim-1];
1018 for(
Int_t ind = dim - 2; ind > 0; --ind) {
1020 type += maxDim[ind];
1035 true,
false,
true ),
1041 true,
false,
true ) );
1058 UInt_t extraLookedAt = 0;
1074 for(
int l=0;
l<nleaves;
l++) {
1080 TString dataMemberName = branchName;
1085 branchName.
Data() ),
1091 branchName.
Data() ) );
1102 return extraLookedAt;
1113 while ( (branch = (
TBranch*)next()) ) {
1115 const char *branchname = branch->
GetName();
1117 if (classname && strlen(classname)) {
1130 containerName =
"TClonesArray";
1138 Error(
"AnalyzeTree",
1139 "Introspection of TClonesArray in older file not implemented yet.");
1154 Error(
"AnalyzeTree",
1155 "Introspection of TClonesArray for %s failed.",branch->
GetName());
1160 containerName = cl->
GetName();
1204 TString dataMemberName = branchname;
1213 true,
false,
false ) );
1232 TString dataMemberName = branchname;
1235 if ( branchname[strlen(branchname)-1] !=
'.' ) {
1281 bool isBase =
false;
1292 containerName =
"TClonesArray";
1293 }
else if (topdesc->
IsSTL()) {
1301 if (!element)
return;
1303 if (strcmp(element->
GetName(),
"This")==0) {
1305 containerName = cl->
GetName();
1331 if (subpath.
Length()>0) subpath +=
".";
1332 subpath += dataMemberName;
1440 containerName =
"TClonesArray";
1454 if (path && strlen(path)>0) fullpath.
Append(path).
Append(
".");
1455 fullpath += element->
GetName();
1474 if (
cname.Length()==0) {
1475 Error(
"AnalyzeTree",
1476 "Introspection of TClonesArray in older file not implemented yet.");
1481 containerName = cl->
GetName();
1485 else Error(
"AnalyzeTree",
"missing class for %s.",branch->
GetName());
1496 Error(
"AnalyzeTree",
1497 "Unsupported type for %s %s %d",
1502 dataMemberName = element->
GetName();
1520 if (subpath.
Length()>0) subpath +=
".";
1521 subpath += dataMemberName;
1534 pxDataMemberName = dataMemberName;
1537 dataMemberName.
Data(),
false),
1540 Error(
"AnalyzeTree",
"topdesc should not be null in TTreeProxyGenerator::AnalyzeElement.");
1567 if (!cl)
return false;
1601 Error(
"WriteProxy",
"No user script has been specified.");
1610 while ( incPath.
Index(
" :") != -1 ) {
1613 incPath.
Prepend(fileLocation+
":.:");
1620 const char *cutfilename =
nullptr;
1623 incPath.
Prepend(fileLocation+
":.:");
1647 bool updating =
false;
1659 treefile =
"Memory Directory";
1663 if (dot_pos ==
kNPOS) {
1664 Error(
"WriteProxy",
"User's script (%s) has no extension! Nothing will be written.",scriptfunc.
Data());
1666 delete [] cutfilename;
1670 TString scriptHeader = scriptfunc;
1671 const char * extensions[] = {
".h",
".hh",
".hpp",
".hxx",
".hPP",
".hXX" };
1674 for (i = 0; i < 6; i++ ) {
1675 TString possible = scriptHeader;
1676 possible.
Append(extensions[i]);
1679 scriptHeader = possible;
1681 scriptHeader.
Data())));
1691 dot_pos = cutscriptfunc.
Last(
'.');
1693 TString cutscriptHeader = cutscriptfunc;
1695 for (i = 0; i < 6; i++ ) {
1696 TString possible = cutscriptHeader;
1697 possible.
Append(extensions[i]);
1700 cutscriptHeader = possible;
1702 cutscriptHeader.
Data())));
1711 TString tmpfilename =
".Proxy-";
1717 if (hf ==
nullptr) {
1718 Error(
"WriteProxy",
"Unable to open the file %s for writing.",
1721 delete [] cutfilename;
1726 fprintf(hf,
"/////////////////////////////////////////////////////////////////////////\n");
1727 fprintf(hf,
"// This class has been automatically generated \n");
1728 fprintf(hf,
"// (at %s by ROOT version %s)\n",td.
AsString(),
gROOT->GetVersion());
1731 fprintf(hf,
"// found on file: %s\n",treefile.
Data());
1735 fprintf(hf,
"/////////////////////////////////////////////////////////////////////////\n");
1739 fprintf(hf,
"#ifndef %s_h\n",classname.
Data());
1740 fprintf(hf,
"#define %s_h\n",classname.
Data());
1745 fprintf(hf,
"#define R__BRANCHPROXY_GENERATOR_VERSION 2\n\n");
1746 fprintf(hf,
"// ROOT headers needed by the proxy\n");
1747 fprintf(hf,
"#include <TROOT.h>\n");
1748 fprintf(hf,
"#include <TChain.h>\n");
1749 fprintf(hf,
"#include <TFile.h>\n");
1750 fprintf(hf,
"#include <TPad.h>\n");
1751 fprintf(hf,
"#include <TH1.h>\n");
1752 fprintf(hf,
"#include <TSelector.h>\n");
1753 fprintf(hf,
"#include <TBranchProxy.h>\n");
1754 fprintf(hf,
"#include <TBranchProxyDirector.h>\n");
1755 fprintf(hf,
"#include <TBranchProxyTemplate.h>\n");
1756 fprintf(hf,
"#include <TFriendProxy.h>\n");
1757 fprintf(hf,
"using namespace ROOT::Internal;\n");
1758 fprintf(hf,
"using ROOT::Detail::TBranchProxy;\n");
1761 fprintf(hf,
"// forward declarations needed by this particular proxy\n");
1764 while ( (current=next()) ) {
1765 if (strstr(current->
GetTitle(),
"::")==
nullptr) {
1769 fprintf(hf,
"%s",current->
GetTitle());
1774 fprintf(hf,
"// Header needed by this particular proxy\n");
1777 while ( (header = next()) ) {
1778 fprintf(hf,
"%s",header->
GetTitle());
1782 fprintf(hf,
"class %s_Interface {\n", scriptfunc.
Data());
1783 fprintf(hf,
" // This class defines the list of methods that are directly used by %s,\n",classname.
Data());
1784 fprintf(hf,
" // and that can be overloaded in the user's script\n");
1785 fprintf(hf,
"public:\n");
1786 fprintf(hf,
" void %s_Begin(TTree*) {}\n",scriptfunc.
Data());
1787 fprintf(hf,
" void %s_SlaveBegin(TTree*) {}\n",scriptfunc.
Data());
1788 fprintf(hf,
" bool %s_Notify() { return true; }\n",scriptfunc.
Data());
1789 fprintf(hf,
" bool %s_Process(Long64_t) { return true; }\n",scriptfunc.
Data());
1790 fprintf(hf,
" void %s_SlaveTerminate() {}\n",scriptfunc.
Data());
1791 fprintf(hf,
" void %s_Terminate() {}\n",scriptfunc.
Data());
1795 fprintf(hf,
"class %s : public TSelector, public %s_Interface {\n", classname.
Data(), scriptfunc.
Data());
1796 fprintf(hf,
"public :\n");
1797 fprintf(hf,
" TTree *fChain; ///<!pointer to the analyzed TTree or TChain\n");
1798 fprintf(hf,
" TH1 *htemp; ///<!pointer to the histogram\n");
1799 fprintf(hf,
" TBranchProxyDirector fDirector; ///<!Manages the proxys\n\n");
1801 fprintf(hf,
" // Optional User methods\n");
1802 fprintf(hf,
" TClass *fClass; // Pointer to this class's description\n");
1805 fprintf(hf,
"\n // Wrapper class for each unwounded class\n");
1814 fprintf(hf,
"\n // Wrapper class for each friend TTree\n");
1822 fprintf(hf,
"\n // Proxy for each of the branches, leaves and friends of the tree\n");
1838 fprintf(hf,
" %s(TTree *tree=0) : \n",classname.
Data());
1839 fprintf(hf,
" fChain(0)");
1840 fprintf(hf,
",\n htemp(0)");
1841 fprintf(hf,
",\n fDirector(tree,-1)");
1842 fprintf(hf,
",\n fClass (TClass::GetClass(\"%s\"))",classname.
Data());
1845 fprintf(hf,
",\n %-*s(&fDirector,\"%s\")",
1851 fprintf(hf,
",\n %-*s(&fDirector,tree,%d)",
1855 fprintf(hf,
"\n { }\n");
1858 fprintf(hf,
" ~%s() override;\n",classname.
Data());
1859 fprintf(hf,
" Int_t Version() const override {return 1;}\n");
1860 fprintf(hf,
" void Begin(::TTree *tree) override;\n");
1861 fprintf(hf,
" void SlaveBegin(::TTree *tree) override;\n");
1862 fprintf(hf,
" void Init(::TTree *tree) override;\n");
1863 fprintf(hf,
" bool Notify() override;\n");
1864 fprintf(hf,
" bool Process(Long64_t entry) override;\n");
1865 fprintf(hf,
" void SlaveTerminate() override;\n");
1866 fprintf(hf,
" void Terminate() override;\n");
1868 fprintf(hf,
" ClassDefOverride(%s,0);\n",classname.
Data());
1871 fprintf(hf,
"//inject the user's code\n");
1881 fprintf(hf,
"#endif\n");
1884 fprintf(hf,
"#ifdef __ROOTCLING__\n");
1889 fprintf(hf,
"#pragma link C++ class %s::%s-;\n",classname.
Data(),clp->
GetName());
1900 fprintf(hf,
"#pragma link C++ class %s;\n",classname.
Data());
1901 fprintf(hf,
"#endif\n");
1905 fprintf(hf,
"inline %s::~%s() {\n",classname.
Data(),classname.
Data());
1906 fprintf(hf,
" // destructor. Clean up helpers.\n");
1910 fprintf(hf,
"inline void %s::Init(TTree *tree)\n",classname.
Data());
1912 fprintf(hf,
"// Set branch addresses\n");
1913 fprintf(hf,
" if (tree == 0) return;\n");
1914 fprintf(hf,
" fChain = tree;\n");
1915 fprintf(hf,
" fDirector.SetTree(fChain);\n");
1916 fprintf(hf,
" if (htemp == 0) {\n");
1917 fprintf(hf,
" htemp = fDirector.CreateHistogram(GetOption());\n");
1921 fprintf(hf,
" htemp->SetTitle(\"%s\");\n",
fScript.
Data());
1923 fprintf(hf,
" fObject = htemp;\n");
1927 fprintf(hf,
"bool %s::Notify()\n",classname.
Data());
1929 fprintf(hf,
" // Called when loading a new file.\n");
1930 fprintf(hf,
" // Get branch pointers.\n");
1931 fprintf(hf,
" fDirector.SetTree(fChain);\n");
1932 fprintf(hf,
" %s_Notify();\n",scriptfunc.
Data());
1934 fprintf(hf,
" return true;\n");
1940 fprintf(hf,
"inline void %s::Begin(TTree *tree)\n",classname.
Data());
1942 fprintf(hf,
" // The Begin() function is called at the start of the query.\n");
1943 fprintf(hf,
" // The tree argument is deprecated.\n");
1945 fprintf(hf,
" TString option = GetOption();\n");
1946 fprintf(hf,
" %s_Begin(tree);\n",scriptfunc.
Data());
1952 fprintf(hf,
"inline void %s::SlaveBegin(TTree *tree)\n",classname.
Data());
1954 fprintf(hf,
" // The SlaveBegin() function is called after the Begin() function.\n");
1955 fprintf(hf,
" // The tree argument is deprecated.\n");
1957 fprintf(hf,
" Init(tree);\n");
1959 fprintf(hf,
" %s_SlaveBegin(tree);\n",scriptfunc.
Data());
1965 fprintf(hf,
"inline bool %s::Process(Long64_t entry)\n",classname.
Data());
1968 fprintf(hf,
" // The Process() function is called for each entry in the tree to be processed.\n"
1969 " // The entry argument specifies which entry in the currently loaded tree is to be processed.\n"
1970 " // It can be passed to either TTree::GetEntry() or TBranch::GetEntry()\n"
1971 " // to read either all or the required parts of the data.\n"
1973 " // This function should contain the \"body\" of the analysis. It can contain\n"
1974 " // simple or elaborate selection criteria, run algorithms on the data\n"
1975 " // of the event and typically fill histograms.\n\n");
1976 fprintf(hf,
" // WARNING when a selector is used with a TChain, you must use\n");
1977 fprintf(hf,
" // the pointer to the current TTree to call GetEntry(entry).\n");
1978 fprintf(hf,
" // The entry is always the local entry number in the current tree.\n");
1979 fprintf(hf,
" // Assuming that fChain is the pointer to the TChain being processed,\n");
1980 fprintf(hf,
" // use fChain->GetTree()->GetEntry(entry).\n");
1983 fprintf(hf,
" fDirector.SetReadEntry(entry);\n");
1986 fprintf(hf,
" if (%s()) %s();\n",cutscriptfunc.
Data(),scriptfunc.
Data());
1988 fprintf(hf,
" %s();\n",scriptfunc.
Data());
1992 fprintf(hf,
" if (%s()) htemp->Fill(%s());\n",cutscriptfunc.
Data(),scriptfunc.
Data());
1994 fprintf(hf,
" htemp->Fill(%s());\n",scriptfunc.
Data());
1997 fprintf(hf,
" %s_Process(entry);\n",scriptfunc.
Data());
1998 fprintf(hf,
" return true;\n");
2000 fprintf(hf,
"}\n\n");
2003 fprintf(hf,
"inline void %s::SlaveTerminate()\n",classname.
Data());
2005 fprintf(hf,
" // The SlaveTerminate() function is called after all entries or objects\n"
2006 " // have been processed.");
2008 fprintf(hf,
" %s_SlaveTerminate();\n",scriptfunc.
Data());
2009 fprintf(hf,
"}\n\n");
2012 fprintf(hf,
"inline void %s::Terminate()\n",classname.
Data());
2014 fprintf(hf,
" // Function called at the end of the event loop.\n");
2015 fprintf(hf,
" htemp = (TH1*)fObject;\n");
2016 fprintf(hf,
" Int_t drawflag = (htemp && htemp->GetEntries()>0);\n");
2018 fprintf(hf,
" if (gPad && !drawflag && !fOption.Contains(\"goff\") && !fOption.Contains(\"same\")) {\n");
2019 fprintf(hf,
" gPad->Clear();\n");
2020 fprintf(hf,
" } else {\n");
2021 fprintf(hf,
" if (fOption.Contains(\"goff\")) drawflag = false;\n");
2022 fprintf(hf,
" if (drawflag) htemp->Draw(fOption);\n");
2024 fprintf(hf,
" %s_Terminate();\n",scriptfunc.
Data());
2037 delete [] cutfilename;
int Int_t
Signed integer 4 bytes (int)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
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.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void ErrorHandler(int level, const char *location, const char *fmt, std::va_list va)
General error handler function. It calls the user set error handler.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
void Debug(Int_t level, const char *fmt,...)
const char * GetBranchName() const
Get the branch name.
const char * GetRawSymbol() const
Get the real symbol name.
const char * GetSubBranchPrefix() const
Get the prefix from the branch name.
bool IsClones() const
Return true if this proxy is for a TClonesArray.
void OutputDecl(FILE *hf, int offset, UInt_t)
Output the declaration and implementation of this emulation class.
virtual bool IsEquivalent(const TBranchProxyClassDescriptor *other)
Return true if this description is the 'same' as the other decription.
bool IsSTL() const
Return true if this proxy is for a TClonesArray.
TString GetContainerName() const
Return the name of the container holding this class, if any.
void AddDescriptor(TBranchProxyDescriptor *desc, bool isBase)
Add a descriptor to this proxy.
const char * GetTypeName()
Get the name of the type of the data member.
bool IsEquivalent(const TFriendProxyDescriptor *other)
Return true if this descriptor and the other are equivalent (describe the same entity).
void OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
Print the declaration needed for this descriptor.
TList * GetListOfTopProxies()
void OutputClassDecl(FILE *hf, int offset, UInt_t maxVarname)
Print the declaration needed for this descriptor.
Base class for code generators like TTreeProxyGenerator and TTreeReaderGenerator.
TList fListOfHeaders
List of included headers.
void AddHeader(TClass *cl)
Add a header inclusion request.
TVirtualStreamerInfo * GetStreamerInfo(TBranch *branch, TIter current, TClass *cl)
Return the correct TStreamerInfo of class 'cl' in the list of branches (current) [Assuming these bran...
TVirtualStreamerInfo * GetBaseClass(TStreamerElement *element)
Check if element is a base class and if yes, return the base class.
TTree * fTree
Pointer to the tree.
TString fOptionStr
User options as a string.
TString GetContainedClassName(TBranchElement *branch, TStreamerElement *element, bool ispointer)
Get name of class inside a container.
void AnalyzeTree(TTree *tree)
Analyze a TTree and its (potential) friends.
TBranchProxyClassDescriptor * AddClass(TBranchProxyClassDescriptor *desc)
Add a Class Descriptor.
void AddDescriptor(TBranchProxyDescriptor *desc)
Add a branch descriptor.
void AddPragma(const char *pragma_text)
Add a forward declaration request.
UInt_t AnalyzeOldLeaf(TLeaf *leaf, UInt_t level, TBranchProxyClassDescriptor *topdesc)
Analyze the leaf and populate the `TTreeProxyGenerator or the topdesc with its findings.
UInt_t AnalyzeOldBranch(TBranch *branch, UInt_t level, TBranchProxyClassDescriptor *desc)
Analyze the branch and populate the TTreeProxyGenerator or the topdesc with its findings.
void AnalyzeElement(TBranch *branch, TStreamerElement *element, UInt_t level, TBranchProxyClassDescriptor *desc, const char *path)
Analyze the element and populate the TTreeProxyGenerator or the topdesc with its findings.
TTreeProxyGenerator(TTree *tree, const char *script, const char *fileprefix, const char *option, UInt_t maxUnrolling)
Constructor.
void AddFriend(TFriendProxyDescriptor *desc)
Add Friend descriptor.
void CheckForMissingClass(const char *clname)
Check if the template parameter refers to an enum and/or a missing class (we can't tell those 2 apart...
void ParseOptions()
Parse the options string.
TList * fCurrentListOfTopProxies
!
void AddForward(TClass *cl)
Add a forward declaration request.
bool NeedToEmulate(TClass *cl, UInt_t level)
Return true if we should create a nested class representing this class.
void AddMissingClassAsEnum(const char *clname, bool isscope)
Generate an enum for a given type if it is not known in the list of class unless the type itself a te...
UInt_t AnalyzeBranches(UInt_t level, TBranchProxyClassDescriptor *topdesc, TBranchElement *branch, TVirtualStreamerInfo *info=nullptr)
Analyze the sub-branch and populate the TTreeProxyGenerator or the topdesc with its findings.
void WriteProxy()
Check whether the file exist and do something useful if it does.
UInt_t fMaxDatamemberType
A Branch for the case of an object.
TBranchElement * GetBranchCount() const
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
A TTree is a list of TBranches.
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
virtual char * GetAddress() const
TObjArray * GetListOfBranches()
Int_t GetSplitLevel() const
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
TClass * IsA() const override
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
virtual void SetAddress(void *add)
Set address of this branch.
TObjArray * GetListOfLeaves()
TBranch * GetMother() const
Get our top-level parent branch in the tree.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
Bool_t CanIgnoreTObjectStreamer()
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
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.
An array of clone (identical) objects.
TClass * GetClass() const
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsString() const
Return the date & time as a string (ctime() format).
virtual TFile * GetFile() const
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 const char * GetTypeName() const
TClass * IsA() const override
TBranch * GetBranch() const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
The TNamed class is the base class for all named ROOT classes.
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.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t GetEntriesFast() const
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
Collectable string class.
Mother of all ROOT objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
const char * GetCountName() const
Describe one element (data member) to be Streamed.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element and updates fClassObject.
Int_t GetArrayDim() const
Int_t GetMaxIndex(Int_t i) const
const char * GetTypeName() const
TClass * IsA() const override
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Prepend(const char *cs)
TString & Remove(Ssiz_t pos)
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual FILE * TempFileName(TString &base, const char *dir=nullptr, const char *suffix=nullptr)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual const char * GetIncludePath()
Get the list of include path.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
A TTree represents a columnar dataset.
TDirectory * GetDirectory() const
virtual Long64_t GetReadEntry() const
virtual TObjArray * GetListOfBranches()
virtual TTree * GetTree() const
virtual TList * GetListOfFriends() const
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
Abstract Interface class describing Streamer information for one class.
@ kUChar
Equal to TDataType's kchar.
virtual TObjArray * GetElements() const =0
virtual TClass * GetClass() const =0
TString GetArrayType(TStreamerElement *element, const char *subtype, TTreeProxyGenerator::EContainer container)
static bool R__AddPragmaForClass(TTreeProxyGenerator *gen, TClass *cl)
Add the "pragma C++ class" if needed and return true if it has been added or if it is known to not be...
bool areEqual(const RULE *r1, const RULE *r2, bool moduloNameOrPattern=false)
bool IsStdClass(const char *type)
return true if the class belongs to the std namespace
std::string ShortType(const char *typeDesc, int mode)
Return the absolute type of typeDesc.