void reaction_RadiativePion(void) { TCanvas *c1 = new TCanvas("c1"); c1->Range(-1.0, -1.0, +1.0, +1.0); gStyle->SetLineWidth(6); TCurlyLine *gamma1 = new TCurlyLine(-0.8, -0.0, -0.2, 0.0); gamma1->SetWavy(); gamma1->SetWaveLength(0.08); AddEndArrowHead(gamma1); gamma1->Draw(); TEllipse *proton = new TEllipse(-0.1, 0.0, 0.03, 0.03*7.0/5.0); proton->SetFillColor(kBlack); proton->Draw(); TCurlyLine *gamma2 = new TCurlyLine(-0.1, 0.0, 0.8, 0.8); gamma2->SetWavy(); gamma2->SetWaveLength(0.08); AddEndArrowHead(gamma2); gamma2->Draw(); TArrow *pip = new TArrow(-0.1, 0.0, 0.75, +0.0, 0.05, "->"); pip->Draw(); TArrow *neutron = new TArrow(-0.1, 0.0, +0.8, -0.8, 0.05, "->"); neutron->Draw(); TLatex t; t.SetTextSize(0.2); t.DrawLatex(-0.95, -0.093, "#gamma"); t.DrawLatex(0.819, -0.932, "#it{n}"); t.DrawLatex(0.767, -0.089, "#pi^{+}"); t.DrawLatex(0.851, 0.792, "#gamma"); t.DrawLatex(-0.175, -0.314, "#it{p}"); c1->SaveAs("reaction_RadiativePion.png"); c1->SaveAs("reaction_RadiativePion.pdf"); } void AddMiddleArrowHead(TCurlyLine *cl) { double xmid = (cl->GetStartX() + cl->GetEndX())/2.0; double ymid = (cl->GetStartY() + cl->GetEndY())/2.0; double dX = (cl->GetEndX() - cl->GetStartX())/1000.0; double dY = (cl->GetEndY() - cl->GetStartY())/1000.0; xmid += 10.0*dX; ymid += 10.0*dY; TArrow *arrow = new TArrow(xmid, ymid, xmid+dX, ymid+dY, 0.05, "->-"); arrow->Draw(); } void AddEndArrowHead(TCurlyLine *cl) { double xend = cl->GetEndX(); double yend = cl->GetEndY(); double dX = (cl->GetEndX() - cl->GetStartX())/1000.0; double dY = (cl->GetEndY() - cl->GetStartY())/1000.0; TArrow *arrow = new TArrow(xend-dX, yend-dY, xend, yend, 0.05, "->-"); arrow->Draw(); }