ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
feynman.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// \notebook
4
/// \preview Draw Feynman diagrams.
5
///
6
/// \macro_image
7
/// \macro_code
8
///
9
/// \author Otto Schaile
10
11
void
feynman()
12
{
13
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"A canvas"
, 10, 10, 600, 300);
14
c1
->Range(0, 0, 140, 60);
15
Int_t
linsav =
gStyle
->GetLineWidth();
16
gStyle
->SetLineWidth(3);
17
TLatex
t;
18
t.
SetTextAlign
(22);
19
t.
SetTextSize
(0.1);
20
TLine
*
l
;
21
l
=
new
TLine
(10, 10, 30, 30);
22
l
->Draw();
23
l
=
new
TLine
(10, 50, 30, 30);
24
l
->Draw();
25
TCurlyArc
*ginit =
new
TCurlyArc
(30, 30, 12.5 *
sqrt
(2), 135, 225);
26
ginit->
SetWavy
();
27
ginit->
Draw
();
28
t.
DrawLatex
(7, 6,
"e^{-}"
);
29
t.
DrawLatex
(7, 55,
"e^{+}"
);
30
t.
DrawLatex
(7, 30,
"#gamma"
);
31
32
TCurlyLine
*
Gamma
=
new
TCurlyLine
(30, 30, 55, 30);
33
Gamma
->SetWavy();
34
Gamma
->Draw();
35
t.
DrawLatex
(42.5, 37.7,
"#gamma"
);
36
37
TArc
*
a
=
new
TArc
(70, 30, 15);
38
a
->Draw();
39
t.
DrawLatex
(55, 45,
"#bar{q}"
);
40
t.
DrawLatex
(85, 15,
"q"
);
41
TCurlyLine
*gluon =
new
TCurlyLine
(70, 45, 70, 15);
42
gluon->
Draw
();
43
t.
DrawLatex
(77.5, 30,
"g"
);
44
45
TCurlyLine
*z0 =
new
TCurlyLine
(85, 30, 110, 30);
46
z0->
SetWavy
();
47
z0->
Draw
();
48
t.
DrawLatex
(100, 37.5,
"Z^{0}"
);
49
50
l
=
new
TLine
(110, 30, 130, 10);
51
l
->Draw();
52
l
=
new
TLine
(110, 30, 130, 50);
53
l
->Draw();
54
55
TCurlyArc
*gluon1 =
new
TCurlyArc
(110, 30, 12.5 *
sqrt
(2), 315, 45);
56
gluon1->
Draw
();
57
58
t.
DrawLatex
(135, 6,
"#bar{q}"
);
59
t.
DrawLatex
(135, 55,
"q"
);
60
t.
DrawLatex
(135, 30,
"g"
);
61
c1
->Update();
62
gStyle
->SetLineWidth(linsav);
63
}
a
#define a(i)
Definition
RSha256.hxx:99
Int_t
int Int_t
Signed integer 4 bytes (int).
Definition
RtypesCore.h:59
gStyle
externTStyle * gStyle
Definition
TStyle.h:442
TArc
Create an Arc.
Definition
TArc.h:26
TAttText::SetTextAlign
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition
TAttText.h:48
TAttText::SetTextSize
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition
TAttText.h:53
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TCurlyArc
Definition
TCurlyArc.h:16
TCurlyLine
Definition
TCurlyLine.h:19
TCurlyLine::SetWavy
virtual void SetWavy()
TLatex
Definition
TLatex.h:20
TLatex::DrawLatex
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
TLine
Use the TLine constructor to create a simple line.
Definition
TLine.h:22
TPolyLine::Draw
void Draw(Option_t *option="") override
Default Draw method for all objects.
c1
return c1
Definition
legend1.C:41
ROOT::Math::sqrt
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Definition
UnaryOperators.h:281
RooBatchCompute::Gamma
@ Gamma
Definition
RooBatchCompute.h:90
l
TLine l
Definition
textangle.C:4
tutorials
visualisation
graphics
feynman.C
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1