void AddMiddleArrowHead(TCurlyLine *cl); void feynman_ComptonPion(void) { TCanvas *c1 = new TCanvas("c1", "", 600, 600); c1->Range(-1.0, -1.0, +1.0, +1.0); gStyle->SetLineWidth(6); #if 1 // Draw with time going from left to right TCurlyLine *gamma1 = new TCurlyLine(0.0, 0.0, +0.7, +0.7); gamma1->SetWavy(); gamma1->SetWaveLength(0.08); gamma1->Draw(); TCurlyLine *gamma2 = new TCurlyLine(-0.7, +0.7, 0.0, 0.0); gamma2->SetWavy(); gamma2->SetWaveLength(0.08); gamma2->Draw(); AddMiddleArrowHead(gamma1); AddMiddleArrowHead(gamma2); TArrow *pip = new TArrow(-0.7, -0.7, 0.0, 0.0, 0.05, "->-"); pip->Draw(); TArrow *pim = new TArrow(0.0, 0.0, +0.7, -0.7, 0.05, "->-"); pim->Draw(); TEllipse *exchange = new TEllipse(0.0, 0.0, 0.1, 0.1); exchange->SetFillColor(kCyan); // TLine *exchange = new TLine(0.0, -0.2, 0.0, +0.2); exchange->Draw(); TLatex t; t.SetTextAlign(22); t.SetTextSize(0.2); t.DrawLatex(-0.830, +0.80, "#gamma"); t.DrawLatex(-0.860, -0.80, "#pi^{#pm}"); t.DrawLatex(+0.830, +0.80, "#gamma"); t.DrawLatex(+0.830, -0.80, "#pi^{#pm}"); #else // Draw with time going from bottom to top TCurlyLine *gamma1 = new TCurlyLine(-0.9, -0.9, -0.2, 0.0); gamma1->SetWavy(); gamma1->SetWaveLength(0.08); gamma1->Draw(); TCurlyLine *gamma2 = new TCurlyLine(+0.2, 0.0, +0.9, +0.9); gamma2->SetWavy(); gamma2->SetWaveLength(0.08); gamma2->Draw(); //AddMiddleArrowHead(gamma1); //AddMiddleArrowHead(gamma2); TArrow *pi1 = new TArrow(+0.9, -0.9, +0.2, 0.0, 0.05, "->-"); pi1->Draw(); TArrow *pi2 = new TArrow(-0.2, 0.0, -0.9, +0.9, 0.05, "->-"); pi2->Draw(); TLine *exchange = new TLine(-0.2, 0.0, +0.2, 0.0); exchange->Draw(); TLatex t; t.SetTextSize(0.2); t.DrawLatex(-0.951, -0.771, "#gamma"); t.DrawLatex(+0.759, -0.712, "#pi*"); t.DrawLatex(-0.805, +0.784, "#pi"); t.DrawLatex(+0.618, +0.75, "#gamma"); #endif c1->SaveAs("feynman_ComptonPion.png"); c1->SaveAs("feynman_ComptonPion.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(); }