Skip to content

[doxy] Enable compilation of macros #10195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
93be20b
[doxy] add C compilation flags in filter for speedup
ferdymercury Mar 22, 2022
a7b76e3
compile script
ferdymercury Mar 22, 2022
ed47230
compile flag
ferdymercury Mar 22, 2022
4f53700
compile flag
ferdymercury Mar 22, 2022
d407307
missing headers
ferdymercury Mar 22, 2022
6371e20
missing headers
ferdymercury Mar 22, 2022
aacd810
missing headers
ferdymercury Mar 22, 2022
728783a
missing headers
ferdymercury Mar 22, 2022
73457e8
headers
ferdymercury Mar 22, 2022
3aefe41
headers
ferdymercury Mar 22, 2022
ceede46
headers
ferdymercury Mar 22, 2022
f47f7ff
headers
ferdymercury Mar 22, 2022
5a32033
headers
ferdymercury Mar 22, 2022
75e7bd0
headers
ferdymercury Mar 22, 2022
dafdb4a
headers
ferdymercury Mar 22, 2022
e189238
headers and signature
ferdymercury Mar 22, 2022
c130e9c
headers and signature
ferdymercury Mar 22, 2022
fbf3a0f
headers and signature
ferdymercury Mar 22, 2022
8628f17
headers
ferdymercury Mar 22, 2022
119a688
header and signature
ferdymercury Mar 22, 2022
0a25501
header and signature
ferdymercury Mar 22, 2022
6259679
header and signature
ferdymercury Mar 22, 2022
d91c7d4
headers
ferdymercury Mar 22, 2022
47eb9c8
headers
ferdymercury Mar 22, 2022
2f1e443
headers
ferdymercury Mar 22, 2022
b3593a6
headers
ferdymercury Mar 22, 2022
d89a685
missing headers
ferdymercury Mar 22, 2022
aa8ba2f
headers and signature
ferdymercury Mar 22, 2022
74d672e
headers and signature
ferdymercury Mar 22, 2022
ce75b4e
headers and signature
ferdymercury Mar 22, 2022
270682b
missing headers
ferdymercury Mar 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/base/doc/macros/fillpatterns.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TLatex.h"
#include "TBox.h"
#include "TStyle.h"

void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
{
// Draw an box using the fill pattern "pat" with the "pat" value
Expand Down
3 changes: 3 additions & 0 deletions core/base/doc/macros/fonts.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

void drawtext(double x, double y, int f, const char *s)
{
TLatex *t = new TLatex(x,y,Form("#font[41]{%d :} %s",f,s));
Expand Down
5 changes: 5 additions & 0 deletions core/base/doc/macros/textalign.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TLine.h"
#include "TText.h"

void textalign()
{
auto *Ta = new TCanvas("Ta","Ta",0,0,500,200);
Ta->Range(0,0,1,1);
Expand Down
8 changes: 8 additions & 0 deletions core/base/doc/macros/textangle.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#include "TCanvas.h"
#include "TLine.h"
#include "TMarker.h"
#include "TArc.h"
#include "TText.h"
#include "TLatex.h"

void textangle()
{
auto *Ta = new TCanvas("Ta","Text angle",0,0,300,326);
Ta->Range(0,0,1,1);
Expand Down
5 changes: 4 additions & 1 deletion documentation/doxygen/MakeRCanvasJS.C
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/// Generates the json file output of the macro MacroName

#include "TSystem.h"
#include "TROOT.h"
#include "TBufferJSON.h"
#include "ROOT/RCanvas.hxx"

void MakeRCanvasJS(const char *MacroName, const char *IN, const char *OutDir, bool cp, bool py)
{
using namespace ROOT::Experimental;

// Execute the macro as a C++ one or a Python one.
if (!py) gROOT->ProcessLine(Form(".x %s",MacroName));
if (!py) gROOT->ProcessLine(Form(".x %s+",MacroName));
else gROOT->ProcessLine(Form("TPython::ExecScript(\"%s\");",MacroName));

// If needed, copy the macro in the documentation directory.
Expand Down
7 changes: 6 additions & 1 deletion documentation/doxygen/MakeTCanvasJS.C
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#include "TSystem.h"
#include "TROOT.h"
#include "TBufferJSON.h"
#include "TCanvas.h"

/// Generates the root file output of the macro MacroName

void MakeTCanvasJS(const char *MacroName, const char *IN, const char *OutDir, bool cp, bool py)
{

// Execute the macro as a C++ one or a Python one.
if (!py) gROOT->ProcessLine(Form(".x %s",MacroName));
if (!py) gROOT->ProcessLine(Form(".x %s+",MacroName));
else gROOT->ProcessLine(Form("TPython::ExecScript(\"%s\");",MacroName));

// If needed, copy the macro in the documentation directory.
Expand Down
16 changes: 8 additions & 8 deletions documentation/doxygen/filter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void FilterClass()
if (m) {
fclose(m);
m = 0;
ExecuteCommand(StringFormat("root -l -b -q \"makeimage.C(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",true,false)\""
ExecuteCommand(StringFormat("root -l -b -q \"makeimage.C+(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",true,false)\""
, StringFormat("%s_%3.3d.C", gClassName.c_str(), gMacroID).c_str()
, StringFormat("%s_%3.3d.%s", gClassName.c_str(), gImageID, gImageType.c_str()).c_str()
, gOutDir.c_str()));
Expand Down Expand Up @@ -338,7 +338,7 @@ void FilterTutorial()
ReplaceAll(image_name, " ", "");
ReplaceAll(image_name, "///\\macro_image(", "");
ReplaceAll(image_name, ")\n", "");
ExecuteCommand(StringFormat("root -l -b -q %s", gFileName.c_str()));
ExecuteCommand(StringFormat("root -l -b -q %s+", gFileName.c_str()));
ExecuteCommand(StringFormat("mv %s %s/html", image_name.c_str(), gOutDir.c_str()));
ReplaceAll(gLineString, "macro_image (", "image html ");
ReplaceAll(gLineString, ")", "");
Expand All @@ -347,15 +347,15 @@ void FilterTutorial()
IN = gImageName;
int i = IN.find(".");
IN.erase(i,IN.length());
ExecuteCommand(StringFormat("root -l -b -q \"MakeTCanvasJS.C(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
ExecuteCommand(StringFormat("root -l -b -q \"MakeTCanvasJS.C+(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
gFileName.c_str(), IN.c_str(), gOutDir.c_str()));
ReplaceAll(gLineString, "macro_image", StringFormat("htmlinclude %s.html",IN.c_str()));
} else if (rcanvas_js) {
string IN;
IN = gImageName;
int i = IN.find(".");
IN.erase(i,IN.length());
ExecuteCommand(StringFormat("root -l -b -q --web=batch \"MakeRCanvasJS.C(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
ExecuteCommand(StringFormat("root -l -b -q --web=batch \"MakeRCanvasJS.C+(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
gFileName.c_str(), IN.c_str(), gOutDir.c_str()));
ReplaceAll(gLineString, "macro_image", StringFormat("htmlinclude %s.html",IN.c_str()));
} else {
Expand All @@ -371,10 +371,10 @@ void FilterTutorial()
}
} else {
if (nobatch) {
ExecuteCommand(StringFormat("root -l -q \"makeimage.C(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
ExecuteCommand(StringFormat("root -l -q \"makeimage.C+(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
gFileName.c_str(), gImageName.c_str(), gOutDir.c_str()));
} else {
ExecuteCommand(StringFormat("root -l -b -q \"makeimage.C(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
ExecuteCommand(StringFormat("root -l -b -q \"makeimage.C+(\\\"%s\\\",\\\"%s\\\",\\\"%s\\\",false,false)\"",
gFileName.c_str(), gImageName.c_str(), gOutDir.c_str()));
}
}
Expand Down Expand Up @@ -407,7 +407,7 @@ void FilterTutorial()
// \macro_output found
if (gLineString.find("\\macro_output") != string::npos) {
remove(gOutputName.c_str());
if (!gPython) ExecuteCommand(StringFormat("root -l -b -q %s", gFileName.c_str()).c_str());
if (!gPython) ExecuteCommand(StringFormat("root -l -b -q %s+", gFileName.c_str()).c_str());
else ExecuteCommand(StringFormat("%s %s", gPythonExec.c_str(), gFileName.c_str()).c_str());
ExecuteCommand(StringFormat("sed -i '/Processing/d' %s", gOutputName.c_str()).c_str());
rename(gOutputName.c_str(), StringFormat("%s/macros/%s",gOutDir.c_str(), gOutputName.c_str()).c_str());
Expand Down Expand Up @@ -483,7 +483,7 @@ void ExecuteMacro()
gMacroName = gLineString.substr(i1,i2-i1+1);

// Build the ROOT command to be executed.
gLineString.insert(0, StringFormat("root -l -b -q \"makeimage.C(\\\""));
gLineString.insert(0, StringFormat("root -l -b -q \"makeimage.C+(\\\""));
size_t l = gLineString.length();
gLineString.replace(l-1,1,StringFormat("\\\",\\\"%s\\\",\\\"%s\\\",true,false)\"", gImageName.c_str(), gOutDir.c_str()));

Expand Down
8 changes: 7 additions & 1 deletion documentation/doxygen/makeimage.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/// Generates the ImageName output of the macro MacroName

#include <stdio.h>
#include "TROOT.h"
#include "TSystem.h"
#include "TPad.h"
#include "TCanvas.h"
#include "TStyle.h"
#include "TImage.h"

void FindImageInPad(TPad *P)
{
Expand Down Expand Up @@ -37,7 +43,7 @@ void FindImageInCanvas(TCanvas *C)
void makeimage(const char *MacroName, const char *ImageName, const char *OutDir, bool cp, bool py)
{
// Execute the macro as a C++ one or a Python one.
if (!py) gROOT->ProcessLine(Form(".x %s",MacroName));
if (!py) gROOT->ProcessLine(Form(".x %s+",MacroName));
else gROOT->ProcessLine(Form("TPython::ExecScript(\"%s\");",MacroName));

// If needed, copy the macro in the documentation directory.
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/accents.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *accents()
{
TCanvas *S = new TCanvas("script","accents",400,250);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/alignment.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *alignment()
{
TCanvas *Tlva = new TCanvas("Tlva","Tlva",500,500);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/bars.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *bars()
{
TCanvas *F = new TCanvas("script","Bars",500,100);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/fractions.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *fractions()
{
TCanvas *F = new TCanvas("script","Fractions",500,100);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/greekletters.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *greekletters()
{
TCanvas *Gl = new TCanvas("greek","greek",500,700);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/itbold.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *itbold()
{
TCanvas *S = new TCanvas("script","Italic Bold",400,150);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/kerning.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *kerning()
{
TCanvas *S = new TCanvas("script","Kerning",400,250);
Expand Down
10 changes: 9 additions & 1 deletion graf2d/graf/doc/macros/legend1.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#include "TCanvas.h"
#include "TStyle.h"
#include "TH1F.h"
#include "TF1.h"
#include "TGraphErrors.h"
#include "TLegend.h"

TCanvas* legend1()
{
TCanvas *c1 = new TCanvas("c1","c1",600,500);
gStyle->SetOptStat(0);
Expand Down Expand Up @@ -31,7 +39,7 @@
gr->SetMarkerColor(7);
gr->Draw("P");

leg = new TLegend(0.1,0.7,0.48,0.9);
TLegend* leg = new TLegend(0.1,0.7,0.48,0.9);
leg->SetHeader("The Legend Title");
leg->AddEntry(h1,"Histogram filled with random numbers","f");
leg->AddEntry("f1","Function abs(#frac{sin(x)}{x})","l");
Expand Down
5 changes: 5 additions & 0 deletions graf2d/graf/doc/macros/legend2.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TH1F.h"
#include "TLegend.h"

TCanvas* legend2()
{
TCanvas *c2 = new TCanvas("c2","c2",500,300);

Expand Down
5 changes: 5 additions & 0 deletions graf2d/graf/doc/macros/legend3.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TH1F.h"
#include "TLegend.h"

TCanvas* legend3()
{
TCanvas *c3 = new TCanvas("c2","c2",500,300);

Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/mathsymbols.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *mathsymbols()
{
TCanvas *Ms = new TCanvas("mathsymb","Mathematical Symbols",800,500);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/polyline.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TPolyLine.h"

void polyline()
{
Double_t x[5] = {.2,.7,.6,.25,.2};
Double_t y[5] = {.5,.1,.9,.7,.5};
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/roots.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *roots()
{
TCanvas *S = new TCanvas("script","Roots",400,150);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/slash.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *slash()
{
TCanvas *F = new TCanvas("script","Slash",500,100);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/splitline.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *splitline()
{
TCanvas *F = new TCanvas("script","Splitline",700,100);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/style.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *style()
{
TCanvas *S = new TCanvas("script","Style",750,250);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/subsupscript.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *subsupscript()
{
TCanvas *S = new TCanvas("script","Subscripts and Superscripts",400,250);
Expand Down
3 changes: 3 additions & 0 deletions graf2d/graf/doc/macros/subsupscript2.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TLatex.h"

TCanvas *subsupscript2()
{
TCanvas *S = new TCanvas("script","Subscripts and Superscripts",400,250);
Expand Down
3 changes: 3 additions & 0 deletions html/doc/macros/testmacro.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "TCanvas.h"
#include "TH1F.h"

TObject* testmacro()
{

Expand Down
5 changes: 5 additions & 0 deletions tree/tree/doc/macros/entrylist_figure1.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TPaveText.h"
#include "TArrow.h"

void entrylist_figure1()
{
TCanvas *c = new TCanvas("c", "c",213,172,460,253);
c->Range(0,0,1,1);
Expand Down
5 changes: 5 additions & 0 deletions tree/tree/doc/macros/entrylist_figure2.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include "TCanvas.h"
#include "TPaveText.h"
#include "TArrow.h"

void entrylist_figure2()
{
TCanvas *c = new TCanvas("c", "c",172,104,447,249);
c->Range(0,0,1,1);
Expand Down
6 changes: 6 additions & 0 deletions tree/tree/doc/macros/entrylistblock_figure1.C
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#include "TCanvas.h"
#include "TPaveText.h"
#include "TArrow.h"
#include "TLine.h"

void entrylistblock_figure1()
{
TCanvas *c = new TCanvas("c", "c",49,123,752,435);
c->Range(0,0,1,1);
Expand Down
7 changes: 7 additions & 0 deletions tutorials/graphics/transparency.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
///
/// \author Olivier Couet

#include "TCanvas.h"
#include "TLatex.h"
#include "TArrow.h"
#include "TEllipse.h"
#include "TMarker.h"
#include "TGraph.h"

void transparency()
{
auto c1 = new TCanvas("c1", "c1",224,330,700,527);
Expand Down