127 gROOT->GetListOfCleanups()->Add(
this);
144 gROOT->GetListOfCleanups()->Remove(
this);
153 if (
dynamic_cast<const TChain*
>(T)) {
155 if (
index->IsZombie()) {
157 Error(
"BuildIndex",
"Creating a TChainIndex unsuccessful - switching to TTreeIndex");
201 if (tree ==
nullptr)
return nullptr;
206 for (
Int_t i = 0; i <
nb; ++i) {
325 Warning(
"DrawScript",
"TTreeProxy does not work in interpreted mode yet. The script will be compiled.");
330 Info(
"DrawScript",
"%s",
Form(
"Will process tree/chain using %s",
selname.Data()));
369 "Drawing using a C++ file currently requires that both the expression and the selection are files\n\t\"%s\" is not a file",
388 "Drawing using a C++ file currently requires that both the expression and the selection are files\n\t\"%s\" is not a file",
420 gROOT->ProcessLineFast(
"new TCanvas();");
457 gPad->DrawFrame(-1.,-1.,1.,1.);
466 Warning(
"DrawSelect",
"The selected TTree subset is empty.");
484 if (
l == 0 || opt ==
"same") graph =
true;
501 }
else if (
action == 33) {
523 for (
Int_t col=0;col<ncolors;col++) {
534 gROOT->ProcessLine(
Form(
"TParallelCoord::SetEntryList((TParallelCoord*)0x%zx,(TEntryList*)0x%zx)",
539 gROOT->ProcessLineFast(
Form(
"(new TGL5DDataSet((TTree *)0x%zx))->Draw(\"%s\");", (
size_t)
fTree, opt.
Data()));
572 char *opt =
new char[
nch];
579 Int_t fitResult = -1;
641 return column.c_str();
654 if (
branch->GetNleaves() <= 1 ) {
679 if (*bname ==
'.') *bname=
'_';
680 if (*bname ==
',') *bname=
'_';
681 if (*bname ==
':') *bname=
'_';
682 if (*bname ==
'<') *bname=
'_';
683 if (*bname ==
'>') *bname=
'_';
684 if (*bname ==
'#') *bname=
'_';
685 if (*bname ==
'@') *bname=
'_';
739 Warning(
"TTreePlayer::MakeClass",
"The %s name provided ('%s') is not a valid C++ identifier and will be converted to '%s'.",(classname ?
"class" :
"tree"),
fileNameStem.Data(),
cppClassName.Data());
745 Error(
"MakeClass",
"cannot open output file %s",
thead.Data());
752 Error(
"MakeClass",
"cannot open output file %s",
tcimp.Data());
775 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
776 fprintf(fp,
"// This class has been automatically generated on\n");
777 fprintf(fp,
"// %s by ROOT version %s\n",
td.AsString(),
gROOT->GetVersion());
784 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
789 fprintf(fp,
"#include <TROOT.h>\n");
790 fprintf(fp,
"#include <TChain.h>\n");
791 fprintf(fp,
"#include <TFile.h>\n");
797 fprintf(fp,
"\n// Header file for the classes stored in the TTree if any.\n");
800 constexpr auto length = std::char_traits<char>::length;
808 static const char *
precstl =
"prec_stl/";
851 chain->LoadTree(first);
867 fprintf(fp,
" TTree *fChain; //!pointer to the analyzed TTree or TChain\n");
871 fprintf(fp,
" TTree *fChain; //!pointer to the analyzed TTree or TChain\n");
872 fprintf(fp,
" Int_t fCurrent; //!current Tree number in a TChain\n");
875 fprintf(fp,
"\n// Fixed size dimensions of array or collections stored in the TTree if any.\n");
882 if (*bname ==
'.') *bname=
'_';
883 if (*bname ==
',') *bname=
'_';
884 if (*bname ==
':') *bname=
'_';
885 if (*bname ==
'<') *bname=
'_';
886 if (*bname ==
'>') *bname=
'_';
902 fprintf(fp,
"\n // Declaration of leaf types\n");
929 if (
branch->GetNleaves() > 1) {
943 if (*bname ==
'.') *bname=
'_';
944 if (*bname ==
',') *bname=
'_';
945 if (*bname ==
':') *bname=
'_';
946 if (*bname ==
'<') *bname=
'_';
947 if (*bname ==
'>') *bname=
'_';
951 if (
branch->GetListOfBranches()->GetEntriesFast()) {
leafStatus[
l] = 1;
continue;}
964 if (*bname ==
'.') *bname=
'_';
965 if (*bname ==
',') *bname=
'_';
966 if (*bname ==
':') *bname=
'_';
967 if (*bname ==
'<') *bname=
'_';
968 if (*bname ==
'>') *bname=
'_';
977 if (
bre->GetType() != 3 &&
bre->GetType() != 4
978 &&
bre->GetStreamerType() <= 0 &&
bre->GetListOfBranches()->GetEntriesFast()) {
981 if (
bre->GetType() == 3 ||
bre->GetType() == 4) {
985 if (
bre->IsBranchFolder()) {
992 if (
bre->GetStreamerType() < 0) {
993 if (
branch->GetListOfBranches()->GetEntriesFast()) {
1001 if (
bre->GetStreamerType() == 0) {
1007 if (
bre->GetStreamerType() > 60) {
1043 const char *
stars =
" ";
1044 if (
bre &&
bre->GetBranchCount2()) {
1060 if (
bre &&
bre->GetBranchCount2()) {
1061 TLeaf *
l2 = (
TLeaf*)
bre->GetBranchCount2()->GetListOfLeaves()->At(0);
1065 if (*bname ==
'.') *bname=
'_';
1066 if (*bname ==
',') *bname=
'_';
1067 if (*bname ==
':') *bname=
'_';
1068 if (*bname ==
'<') *bname=
'_';
1069 if (*bname ==
'>') *bname=
'_';
1075 if (kmax)
fprintf(fp,
" %-14s %s%s[kMax%s]%s; //[%s]\n",
leaf->GetTypeName(),
stars,
1083 if (
stars[0]==
'*') {
1101 fprintf(fp,
" // List of branches\n");
1113 fprintf(fp,
" Int_t Version() const override { return 2; }\n");
1114 fprintf(fp,
" void Begin(TTree *tree) override;\n");
1115 fprintf(fp,
" void SlaveBegin(TTree *tree) override;\n");
1116 fprintf(fp,
" void Init(TTree *tree) override;\n");
1117 fprintf(fp,
" bool Notify() override;\n");
1118 fprintf(fp,
" bool Process(Long64_t entry) override;\n");
1119 fprintf(fp,
" Int_t GetEntry(Long64_t entry, Int_t getall = 0) override { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }\n");
1120 fprintf(fp,
" void SetOption(const char *option) override { fOption = option; }\n");
1121 fprintf(fp,
" void SetObject(TObject *obj) override { fObject = obj; }\n");
1122 fprintf(fp,
" void SetInputList(TList *input) override { fInput = input; }\n");
1123 fprintf(fp,
" TList* GetOutputList() const override { return fOutput; }\n");
1124 fprintf(fp,
" void SlaveTerminate() override;\n");
1125 fprintf(fp,
" void Terminate() override;\n\n");
1135 fprintf(fp,
" virtual Int_t Cut(Long64_t entry);\n");
1136 fprintf(fp,
" virtual Int_t GetEntry(Long64_t entry);\n");
1137 fprintf(fp,
" virtual Long64_t LoadTree(Long64_t entry);\n");
1138 fprintf(fp,
" virtual void Init(TTree *tree);\n");
1139 fprintf(fp,
" virtual void Loop();\n");
1140 fprintf(fp,
" virtual bool Notify();\n");
1141 fprintf(fp,
" virtual void Show(Long64_t entry = -1);\n");
1152 fprintf(fp,
"// if parameter tree is not specified (or zero), connect the file\n");
1153 fprintf(fp,
"// used to generate this class and read the Tree.\n");
1154 fprintf(fp,
" if (tree == 0) {\n");
1156 fprintf(fp,
"\n#ifdef SINGLE_TREE\n");
1157 fprintf(fp,
" // The following code should be used if you want this class to access\n");
1158 fprintf(fp,
" // a single tree instead of a chain\n");
1161 fprintf(fp,
" THbookFile *f = (THbookFile*)gROOT->GetListOfBrowsables()->FindObject(\"%s\");\n",
1168 fprintf(fp,
" tree = (TTree*)f->Get(%d);\n\n",
hid);
1170 fprintf(fp,
" TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(\"%s\");\n",
treefile.Data());
1171 fprintf(fp,
" if (!f || !f->IsOpen()) {\n");
1182 fprintf(fp,
"#else // SINGLE_TREE\n\n");
1183 fprintf(fp,
" // The following code should be used if you want this class to access a chain\n");
1184 fprintf(fp,
" // of trees.\n");
1185 fprintf(fp,
" TChain * chain = new TChain(\"%s\",\"%s\");\n",
1195 fprintf(fp,
" tree = chain;\n");
1196 fprintf(fp,
"#endif // SINGLE_TREE\n\n");
1208 fprintf(fp,
" if (!fChain) return;\n");
1212 fprintf(fp,
" delete fChain->GetCurrentFile();\n");
1221 fprintf(fp,
"// Read contents of entry.\n");
1223 fprintf(fp,
" if (!fChain) return 0;\n");
1224 fprintf(fp,
" return fChain->GetEntry(entry);\n");
1231 fprintf(fp,
"// Set the environment to read one entry\n");
1232 fprintf(fp,
" if (!fChain) return -5;\n");
1233 fprintf(fp,
" Long64_t centry = fChain->LoadTree(entry);\n");
1234 fprintf(fp,
" if (centry < 0) return centry;\n");
1235 fprintf(fp,
" if (fChain->GetTreeNumber() != fCurrent) {\n");
1236 fprintf(fp,
" fCurrent = fChain->GetTreeNumber();\n");
1239 fprintf(fp,
" return centry;\n");
1247 fprintf(fp,
" // The Init() function is called when the selector needs to initialize\n"
1248 " // a new tree or chain. Typically here the branch addresses and branch\n"
1249 " // pointers of the tree will be set.\n"
1250 " // It is normally not necessary to make changes to the generated\n"
1251 " // code, but the routine can be extended by the user if needed.\n"
1252 " // Init() will be called many times when running on PROOF\n"
1253 " // (once per file to be processed).\n\n");
1257 fprintf(fp,
" // Set object pointer\n");
1258 while( (obj = next()) ) {
1267 if (*bname ==
'.') *bname=
'_';
1268 if (*bname ==
',') *bname=
'_';
1269 if (*bname ==
':') *bname=
'_';
1270 if (*bname ==
'<') *bname=
'_';
1271 if (*bname ==
'>') *bname=
'_';
1280 fprintf(fp,
" // Set array pointer\n");
1282 fprintf(fp,
" for(int i=0; i<%s; ++i) %s[i] = 0;\n",
info->GetTitle(),
info->GetName());
1286 fprintf(fp,
" // Set branch addresses and branch pointers\n");
1287 fprintf(fp,
" if (!tree) return;\n");
1288 fprintf(fp,
" fChain = tree;\n");
1290 fprintf(fp,
" fChain->SetMakeClass(1);\n");
1300 if (
branch->GetNleaves() > 1) {
1320 if (*bname ==
'.') *bname=
'_';
1321 if (*bname ==
',') *bname=
'_';
1322 if (*bname ==
':') *bname=
'_';
1323 if (*bname ==
'<') *bname=
'_';
1324 if (*bname ==
'>') *bname=
'_';
1329 Error(
"MakeClass",
"The branch named %s (full path name: %s) is hidden by another branch of the same name and its data will not be loaded.",
branch->GetName(),
R__GetBranchPointerName(
leaf,
false).Data());
1333 if (
branch->GetListOfBranches()->GetEntriesFast()) {
1344 if (
len > 1)
fprintf(fp,
"%s fChain->SetBranchAddress(\"%s\", %s, &b_%s);\n",
1346 else fprintf(fp,
"%s fChain->SetBranchAddress(\"%s\", &%s, &b_%s);\n",
1360 fprintf(fp,
" // The Notify() function is called when a new file is opened. This\n"
1361 " // can be either for a new TTree in a TChain or when when a new TTree\n"
1362 " // is started when using PROOF. It is normally not necessary to make changes\n"
1363 " // to the generated code, but the routine can be extended by the\n"
1364 " // user if needed. The return value is currently not used.\n\n");
1365 fprintf(fp,
" return true;\n");
1373 fprintf(fp,
"// Print contents of entry.\n");
1374 fprintf(fp,
"// If entry is not specified, print current entry\n");
1376 fprintf(fp,
" if (!fChain) return;\n");
1377 fprintf(fp,
" fChain->Show(entry);\n");
1384 fprintf(fp,
"// This function may be called from Loop.\n");
1385 fprintf(fp,
"// returns 1 if entry is accepted.\n");
1386 fprintf(fp,
"// returns -1 otherwise.\n");
1404 fprintf(
fpc,
"// In a ROOT session, you can do:\n");
1407 fprintf(
fpc,
"// root> t.GetEntry(12); // Fill t data members with entry number 12\n");
1408 fprintf(
fpc,
"// root> t.Show(); // Show values of entry 12\n");
1409 fprintf(
fpc,
"// root> t.Show(16); // Read and show values of entry 16\n");
1410 fprintf(
fpc,
"// root> t.Loop(); // Loop on all entries\n");
1412 fprintf(
fpc,
"\n// This is the loop skeleton where:\n");
1413 fprintf(
fpc,
"// jentry is the global entry number in the chain\n");
1414 fprintf(
fpc,
"// ientry is the entry number in the current Tree\n");
1415 fprintf(
fpc,
"// Note that the argument to GetEntry must be:\n");
1416 fprintf(
fpc,
"// jentry for TChain::GetEntry\n");
1417 fprintf(
fpc,
"// ientry for TTree::GetEntry and TBranch::GetEntry\n");
1419 fprintf(
fpc,
"// To read only selected branches, Insert statements like:\n");
1421 fprintf(
fpc,
"// fChain->SetBranchStatus(\"*\",0); // disable all branches\n");
1422 fprintf(
fpc,
"// fChain->SetBranchStatus(\"branchname\",1); // activate branchname\n");
1424 fprintf(
fpc,
"// fChain->GetEntry(jentry); //read all branches\n");
1425 fprintf(
fpc,
"//by b_branchname->GetEntry(ientry); //read only this branch\n");
1427 fprintf(
fpc,
"\n Long64_t nentries = fChain->GetEntriesFast();\n");
1428 fprintf(
fpc,
"\n Long64_t nbytes = 0, nb = 0;\n");
1429 fprintf(
fpc,
" for (Long64_t jentry=0; jentry<nentries;jentry++) {\n");
1430 fprintf(
fpc,
" Long64_t ientry = LoadTree(jentry);\n");
1432 fprintf(
fpc,
" nb = fChain->GetEntry(jentry); nbytes += nb;\n");
1433 fprintf(
fpc,
" // if (Cut(ientry) < 0) continue;\n");
1441 fprintf(
fpc,
"// by the ROOT utility TTree::MakeSelector(). This class is derived\n");
1442 fprintf(
fpc,
"// from the ROOT class TSelector. For more information on the TSelector\n"
1443 "// framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual.\n\n");
1444 fprintf(
fpc,
"// The following methods are defined in this file:\n");
1445 fprintf(
fpc,
"// Begin(): called every time a loop on the tree starts,\n");
1446 fprintf(
fpc,
"// a convenient place to create your histograms.\n");
1447 fprintf(
fpc,
"// SlaveBegin(): called after Begin(), when on PROOF called only on the\n"
1448 "// slave servers.\n");
1449 fprintf(
fpc,
"// Process(): called for each event, in this function you decide what\n");
1450 fprintf(
fpc,
"// to read and fill your histograms.\n");
1451 fprintf(
fpc,
"// SlaveTerminate: called at the end of the loop on the tree, when on PROOF\n"
1452 "// called only on the slave servers.\n");
1453 fprintf(
fpc,
"// Terminate(): called at the end of the loop on the tree,\n");
1454 fprintf(
fpc,
"// a convenient place to draw/fit your histograms.\n");
1456 fprintf(
fpc,
"// To use this file, try the following session on your Tree T:\n");
1470 fprintf(
fpc,
" // The Begin() function is called at the start of the query.\n");
1471 fprintf(
fpc,
" // When running with PROOF Begin() is only called on the client.\n");
1472 fprintf(
fpc,
" // The tree argument is deprecated (on PROOF 0 is passed).\n");
1474 fprintf(
fpc,
" TString option = GetOption();\n");
1481 fprintf(
fpc,
" // The SlaveBegin() function is called after the Begin() function.\n");
1482 fprintf(
fpc,
" // When running with PROOF SlaveBegin() is called on each slave server.\n");
1483 fprintf(
fpc,
" // The tree argument is deprecated (on PROOF 0 is passed).\n");
1485 fprintf(
fpc,
" TString option = GetOption();\n");
1492 fprintf(
fpc,
" // The Process() function is called for each entry in the tree (or possibly\n"
1493 " // keyed object in the case of PROOF) to be processed. The entry argument\n"
1494 " // specifies which entry in the currently loaded tree is to be processed.\n"
1495 " // It can be passed to either %s::GetEntry() or TBranch::GetEntry()\n"
1496 " // to read either all or the required parts of the data. When processing\n"
1497 " // keyed objects with PROOF, the object is already loaded and is available\n"
1498 " // via the fObject pointer.\n"
1500 " // This function should contain the \"body\" of the analysis. It can contain\n"
1501 " // simple or elaborate selection criteria, run algorithms on the data\n"
1502 " // of the event and typically fill histograms.\n"
1504 " // The processing can be stopped by calling Abort().\n"
1506 " // Use fStatus to set the return value of TTree::Process().\n"
1508 " // The return value is currently not used.\n\n",
cppClassName.Data());
1516 fprintf(
fpc,
" // The SlaveTerminate() function is called after all entries or objects\n"
1517 " // have been processed. When running with PROOF SlaveTerminate() is called\n"
1518 " // on each slave server.");
1526 fprintf(
fpc,
" // The Terminate() function is the last function to be called during\n"
1527 " // a query. It always runs on the client, it can be used to present\n"
1528 " // the results graphically or save the results to file.");
1574 Error(
"MakeCode",
"cannot open output file %s", tfile.
Data());
1593 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
1594 fprintf(fp,
"// This file has been automatically generated \n");
1595 fprintf(fp,
"// (%s by ROOT version%s)\n",
td.AsString(),
gROOT->GetVersion());
1602 fprintf(fp,
"//////////////////////////////////////////////////////////\n");
1608 fprintf(fp,
"//Reset ROOT and connect tree file\n");
1609 fprintf(fp,
" gROOT->Reset();\n");
1611 fprintf(fp,
"\n#ifdef SINGLE_TREE\n");
1612 fprintf(fp,
" // The following code should be used if you want this code to access\n");
1613 fprintf(fp,
" // a single tree instead of a chain\n");
1615 fprintf(fp,
" TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject(\"%s\");\n",
treefile.Data());
1626 fprintf(fp,
"#else // SINGLE_TREE\n\n");
1627 fprintf(fp,
" // The following code should be used if you want this code to access a chain\n");
1628 fprintf(fp,
" // of trees.\n");
1629 fprintf(fp,
" TChain *%s = new TChain(\"%s\",\"%s\");\n",
1639 fprintf(fp,
"#endif // SINGLE_TREE\n\n");
1643 fprintf(fp,
"//Declaration of leaves types\n");
1648 const char *
headOK =
" ";
1657 if (
branch->GetListOfBranches()->GetEntriesFast() > 0)
continue;
1659 if (
branch->GetNleaves() > 1) {
1667 if (dim) dim[0] = 0;
1676 if (*bname ==
'.') *bname=
'_';
1677 if (*bname ==
',') *bname=
'_';
1678 if (*bname ==
':') *bname=
'_';
1679 if (*bname ==
'<') *bname=
'_';
1680 if (*bname ==
'>') *bname=
'_';
1716 fprintf(fp,
"\n // Set branch addresses.\n");
1723 if (
branch->GetNleaves() > 1) {
1731 if (dim) dim[0] = 0;
1739 if (*bname ==
'.') *bname=
'_';
1740 if (*bname ==
',') *bname=
'_';
1741 if (*bname ==
':') *bname=
'_';
1742 if (*bname ==
'<') *bname=
'_';
1743 if (*bname ==
'>') *bname=
'_';
1760 fprintf(fp,
"\n// This is the loop skeleton\n");
1761 fprintf(fp,
"// To read only selected branches, Insert statements like:\n");
1762 fprintf(fp,
"// %s->SetBranchStatus(\"*\",0); // disable all branches\n",
fTree->
GetName());
1763 fprintf(fp,
"// %s->SetBranchStatus(\"branchname\",1); // activate branchname\n",
GetName());
1765 fprintf(fp,
"\n Long64_t nbytes = 0;\n");
1766 fprintf(fp,
"// for (Long64_t i=0; i<nentries;i++) {\n");
1935 Error(
"MakeProxy",
"A file name for the user script is required");
2022 std::vector<TString>
cnames;
2025 principal =
nullptr;
2048 for (i=0;i<
ncols;i++) {
2059 for (i=0;i<
ncols;i++) {
2107 for (i=0;i<
ncols;i++) {
2113 for (i=0;i<
ncols;i++) {
2116 principal->AddRow(
xvars);
2122 principal->MakePrincipals();
2123 if (opt.principal->Print();
2124 if (opt.principal->MakeHistograms();
2125 if (opt.principal->MakeCode();
2210 if (!selector)
return -1;
2308 if (
gROOT->IsInterrupted())
break;
2333 if (
tpf)
tpf->SetEntryRange(0,0);
2453 constexpr auto length = std::char_traits<char>::length;
2464 int start = opt.
Index(
"lenmax=");
2475 int start = opt.
Index(
"colsize=");
2488 int start = opt.
Index(
"precision=");
2500 int start = opt.
Index(
"col=");
2534 for(; i<
flist.Length(); ++i) {
2535 int next =
flist.Index(
":",i);
2538 }
else if (next==
kNPOS) {
2551 std::vector<TString>
cnames;
2557 const char *
fname =
nullptr;
2569 out.open(
fname, std::ios::out);
2571 Error(
"Scan",
"Can not open file for redirection");
2576 if (
leaves==
nullptr)
return 0;
2599 if (
lf->GetBranch()->GetListOfBranches()->GetEntries() > 0)
continue;
2600 cnames.push_back(
lf->GetBranch()->GetMother()->GetName() );
2608 if (
mother->GetType() == 3 ||
mother->GetType() == 4) {
2615 if (!
strchr(
lf->GetBranch()->GetName() ,
'[') ) {
2621 strcmp(
lf->GetBranch()->GetName(),
lf->GetName() ) != 0 ) {
2652 if (
select->GetManager()->GetMultiplicity() > 0 ) {
2662 switch(
form->GetManager()->GetMultiplicity() ) {
2687 out<<
onerow.Data()<<
"*"<<std::endl;
2697 out<<
onerow.Data()<<
"*"<<std::endl;
2707 out<<
onerow.Data()<<
"*"<<std::endl;
2742 if (
ndata < var[
ui]->GetNdata() ) {
2782 out<<
onerow.Data()<<
"*"<<std::endl;
2807 out<<
onerow.Data()<<
"*"<<std::endl;
2832 std::vector<TString>
cnames;
2848 if (!
select)
return nullptr;
2849 if (!
select->GetNdim()) {
delete select;
return nullptr; }
2857 for (i=0;i<
ncols;i++) {
2867 for (i=0;i<
ncols;i++) {
2874 for (i = 0; i <
ncols; i++) {
2875 res->
AddField(i, var[i]->PrintValue(-1));
2912 if (
select->EvalInstance(0) == 0)
continue;
2927 for (i=0;i<
ncols;i++) {
2932 for (i=0;i<
ncols;i++) {
2988 if (
gROOT->IsBatch()) {
2989 if ((
hname !=
"RTreeViewer") ||
gROOT->IsWebDisplayBatch()) {
2990 Warning(
"StartViewer",
"The tree viewer cannot run in batch mode");
2995 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualTreeViewer",
hname.Data())) {
2996 if (
h->LoadPlugin() != -1)
3079 if (
npar <=0) {
Error(
"UnbinnedFit",
"Illegal number of parameters = %d",
npar);
return 0; }
3104 Info(
"UnbinnedFit",
"Ignore option D with more than 4 variables");
3112 Error(
"UnbinnedFit",
"Cannot fit: no entries selected");
3123 std::vector<double *>
vlist(ndim);
3124 for (
int i = 0; i < ndim; ++i)
3146 hf->SetLineWidth(3);
3150 for (
Int_t bin=1;bin<=nbins;bin++) {
3152 hf->SetBinContent(bin,func);
3198 lnk->GetObject()->Notify();
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
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
R__EXTERN TVirtualMutex * gROOTMutex
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
R__EXTERN Foption_t Foption
static TString R__GetBranchPointerName(TLeaf *leaf, bool replace=true)
Return the name of the branch pointer needed by MakeClass/MakeSelector.
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
#define R__LOCKGUARD(mutex)
Class describing the un-binned data sets (just x coordinates values) of any dimensions.
const_iterator begin() const
void InitializeGraphics(Bool_t only_web=kFALSE)
Initialize the graphics environment.
static void CreateApplication()
Static function used to create a default application environment.
static void NeedGraphicsLibs()
Static method.
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width.
A Branch for the case of an object.
A TTree is a list of TBranches.
A TChainElement describes a component of a TChain.
A chain is a collection of files containing TTree objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
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.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
TDirectory::TContext keeps track and restore the current directory.
virtual const char * GetPath() const
Returns the full path of the directory.
virtual TFile * GetFile() const
A List of entry numbers in a TTree or TChain.
virtual void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist If not,...
virtual Long64_t GetN() const
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
TH1 is the base class of all histogram classes in ROOT.
@ kNoAxis
NOTE: Must always be 0 !!!
virtual Int_t GetDimension() const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
TList * GetListOfFunctions() const
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual void LabelsDeflate(Option_t *axis="X")
Reduce the number of bins for the axis passed in the option to the number of bins having a label.
A TLeaf for a general object derived from TObject.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
void Clear(Option_t *option="") override
Remove all objects from the list.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
virtual TObjLink * FirstLink() const
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
The TNamed class is the base class for all named ROOT classes.
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.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
@ kCanDelete
if object in a list can be deleted
Principal Components Analysis (PCA)
A container proxy, which allows to access references stored in a TRefArray from TTree::Draw.
A specialized TSelector for TTree::Draw.
virtual void SetEstimate(Long64_t n)
Set number of entries to estimate variable limits.
TTreeFormula * GetVar3() const
See TSelectorDraw::GetVar.
virtual Long64_t GetDrawFlag() const
TH1 * GetOldHistogram() const
virtual UInt_t SplitNames(const TString &varexp, std::vector< TString > &names)
Build Index array for names in varexp.
TObject * GetObject() const
TTreeFormula * GetVar2() const
See TSelectorDraw::GetVar.
virtual Int_t GetAction() const
TTreeFormula * GetVar1() const
See TSelectorDraw::GetVar.
virtual Int_t GetDimension() const
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
bool Notify() override
This function is called at the first entry of a new tree in a chain.
virtual bool GetCleanElist() const
The class is derived from the ROOT class TSelector.
virtual Long64_t GetSelectedRows() const
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
virtual EAbort GetAbort() const
virtual void ProcessFill(Long64_t)
This method is called for all selected entries.
virtual void Init(TTree *)
virtual int Version() const
virtual bool ProcessCut(Long64_t)
This method is called before processing entry.
virtual bool Process(Long64_t)
The Process() function is called for each entry in the tree (or possibly keyed object in the case of ...
TClass * IsA() const override
virtual void SlaveBegin(TTree *)
bool Notify() override
This method must be overridden to handle object notification (the base implementation is no-op).
virtual void SetOption(const char *option)
virtual Long64_t GetStatus() const
virtual void SetInputList(TList *input)
virtual TList * GetOutputList() const
virtual void SlaveTerminate()
virtual void ResetAbort()
virtual void Begin(TTree *)
static TSelector * GetSelector(const char *filename)
The code in filename is loaded (interpreted or compiled, see below), filename must contain a valid cl...
void ToLower()
Change string to lower-case.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
TString & Remove(Ssiz_t pos)
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
Bool_t GetCanvasPreferGL() const
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
virtual Bool_t IsFileInIncludePath(const char *name, char **fullpath=nullptr)
Return true if 'name' is a file that can be found in the ROOT include path or the current directory.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form:
Base class for several text objects.
A cache to speed-up the reading of ROOT datasets.
A Tree Index with majorname and minorname.
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Int_t MakeCode(const char *filename) override
Generate skeleton function for this Tree.
TTree * CopyTree(const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Copy a Tree with selection, make a clone of this Tree header, then copy the selected entries.
Long64_t DrawSelect(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Draw expression varexp for specified entries that matches the selection.
TList * fInput
! input list to the selector
void DeleteSelectorFromFile()
Delete any selector created by this object.
void SetEstimate(Long64_t n) override
Set number of entries to estimate variable limits.
Int_t UnbinnedFit(const char *formula, const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Unbinned fit of one or more variable(s) from a Tree.
void RecursiveRemove(TObject *obj) override
cleanup pointers in the player pointing to obj
Long64_t DrawScript(const char *wrapperPrefix, const char *macrofilename, const char *cutfilename, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Draw the result of a C++ script.
TSelectorDraw * fSelector
! Pointer to current selector
void SetTree(TTree *t) override
Long64_t GetSelectedRows() const override
Int_t MakeReader(const char *classname, Option_t *option) override
Generate skeleton selector class for this tree.
const char * GetNameByIndex(TString &varexp, Int_t *index, Int_t colindex)
Return name corresponding to colindex in varexp.
Long64_t fSelectedRows
Number of selected entries.
Long64_t Scan(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Loop on Tree and print entries passing selection.
TSelector * fSelectorFromFile
! Pointer to a user defined selector created by this TTreePlayer object
const char * fScanFileName
Name of the file where Scan is redirected.
TList * fFormulaList
! Pointer to a list of coordinated list TTreeFormula (used by Scan and Query)
bool fScanRedirect
Switch to redirect TTree::Scan output to a file.
TTree * fTree
! Pointer to current Tree
void StartViewer(Int_t ww, Int_t wh) override
Start the TTreeViewer on this TTree.
Int_t MakeProxy(const char *classname, const char *macrofilename=nullptr, const char *cutfilename=nullptr, const char *option=nullptr, Int_t maxUnrolling=3) override
Generate a skeleton analysis class for this Tree using TBranchProxy.
Int_t MakeClass(const char *classname, Option_t *option) override
Generate skeleton analysis class for this Tree.
TPrincipal * Principal(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Interface to the Principal Components Analysis class.
TSelector * fSelectorUpdate
! Set to the selector address when it's entry list needs to be updated by the UpdateFormulaLeaves fun...
TH1 * fHistogram
! Pointer to histogram used for the projection
void UpdateFormulaLeaves() override
this function is called by TChain::LoadTree when a new Tree is loaded.
Long64_t Process(const char *filename, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Process this tree executing the TSelector code in the specified filename.
TSQLResult * Query(const char *varexp, const char *selection, Option_t *option, Long64_t nentries, Long64_t firstentry) override
Loop on Tree and return TSQLResult object containing entries passing selection.
TClass * fSelectorClass
! Pointer to the actual class of the TSelectorFromFile
Long64_t GetEntries(const char *selection) override
Return the number of entries matching the selection.
Int_t GetDimension() const override
Int_t fDimension
Dimension of the current expression.
TVirtualIndex * BuildIndex(const TTree *T, const char *majorname, const char *minorname) override
Build the index for the tree (see TTree::BuildIndex)
TTreePlayer()
Default Tree constructor.
~TTreePlayer() override
Tree destructor.
Int_t Fit(const char *formula, const char *varexp, const char *selection, Option_t *option, Option_t *goption, Long64_t nentries, Long64_t firstentry) override
Fit a projected item(s) from a Tree.
virtual Long64_t GetEntriesToProcess(Long64_t firstentry, Long64_t nentries) const
return the number of entries to be processed this function checks that nentries is not bigger than th...
Class defining interface to a TTree query result with the same interface as for SQL databases.
void AddRow(TSQLRow *row)
Adopt a row to result set.
void AddField(Int_t field, const char *fieldname)
Add field name to result set.
Class defining interface to a row of a TTree query result.
A TTree represents a columnar dataset.
bool EnableCache()
Enable the TTreeCache unless explicitly disabled for this TTree by a prior call to SetCacheSize(0).
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual Int_t GetScanField() const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Long64_t GetEstimate() const
virtual TObjArray * GetListOfLeaves()
TFile * GetCurrentFile() const
Return pointer to the current file.
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual void SetNotify(TObject *obj)
Sets the address of the object to be notified when the tree is loaded.
TDirectory * GetDirectory() const
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
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 Long64_t GetEntries() const
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
virtual TTree * GetTree() const
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
TEventList * GetEventList() const
virtual Long64_t GetEntriesFriend() const
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
virtual Int_t GetTreeNumber() const
virtual Int_t GetTimerInterval() const
virtual void SetScanField(Int_t n=50)
Sets the default maximum number of lines to be shown before <CR> when calling Scan().
virtual Long64_t GetCacheSize() const
virtual Long64_t GetMaxEntryLoop() const
Abstract Base Class for Fitting.
Abstract interface for Tree Index.
virtual Bool_t SendProcessingProgress(Double_t, Double_t, Bool_t=kFALSE)
virtual Bool_t SendProcessingStatus(const char *, Bool_t=kFALSE)
TFitResultPtr UnBinFit(ROOT::Fit::UnBinData *data, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption)
fit an unbin data set (from tree or from histogram buffer) using a TF1 pointer and fit options.
TString GetCppName(TString name)
Convert a valid TTree branch name or filename into a valid C++ variable name.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.