It has been written using the TCanvas ToolBar to produce a first draft and was then modified for fine adjustments. Note also the use of C functions. They allow to simplify the macro reading and editing by avoiding code repetition or defining some graphics attributes in one single place. This technique to generate drawings may appear not very user friendly compare to all the "wysiwyg" graphics editors available. In some cases it can be more powerful than a GUI interface because it allows to generate very precise drawing and using computation to generate them.
{
}
{
}
void mass_spectrum()
{
hline(0.10, 0.25);
hline(0.10, 0.80);
hline(0.30, 0.90);
hline(0.30, 0.35);
hline(0.45, 0.60);
hline(0.58, 0.68);
hline(0.73, 0.70);
hline(0.89, 0.75);
DrawArrow(0.32, 0.90, 0.32, 0.35, 1);
DrawArrow(0.34, 0.90, 0.34, 0.35, 1);
DrawArrow(0.36, 0.90, 0.36, 0.60, 1);
DrawArrow(0.38, 0.90, 0.38, 0.70, 1);
DrawArrow(0.30, 0.90, 0.18, 0.25, 1);
DrawArrow(0.30, 0.35, 0.19, 0.25, 1);
DrawArrow(0.40, 0.90, 0.47, 0.61, 1);
DrawArrow(0.15, 0.25, 0.15, 0.19, 1);
DrawArrow(0.15, 0.80, 0.15, 0.74, 1);
DrawArrow(0.50, 0.60, 0.50, 0.54, 1);
DrawArrow(0.60, 0.68, 0.60, 0.62, 1);
DrawArrow(0.94, 0.75, 0.94, 0.69, 1);
DrawArrow(0.32, 0.35, 0.32, 0.19, 1);
DrawArrow(0.36, 0.35, 0.36, 0.19, 1);
DrawArrow(0.38, 0.35, 0.38, 0.19, 1);
DrawArrow(0.40, 0.90, 0.60, 0.68, 1);
DrawArrow(0.40, 0.90, 0.90, 0.75, 1);
DrawArrow(0.45, 0.60, 0.35, 0.35, 1);
DrawArrow(0.30, 0.90, 0.18, 0.80, 2);
DrawArrow(0.67, 0.68, 0.36, 0.35, 1);
DrawArrow(0.78, 0.70, 0.37, 0.35, 2);
DrawArrow(0.91, 0.75, 0.39, 0.35, 1);
l2.
DrawLatex(0.07, 0.08,
"#font[12]{J^{PC}} =");
l2.
DrawLatex(0.45, 0.35,
"#font[12]{J}/#psi(1S)");
l3.
DrawLatex(0.38, 0.81,
"#font[152]{g^{*}}");
l3.
DrawLatex(0.355, 0.16,
"#font[152]{g^{*}}");
}
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual void SetAngle(Float_t angle=60)
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Use the TLine constructor to create a simple line.
constexpr Double_t C()
Velocity of light in .