#include "StandardLabels.C" //----------------------- // min_angle_by_package //----------------------- void min_angle_by_package(void) { TColor::CreateColorWheel(); TGraph *fdc1 = MakeGraph(184.5, 3.0, kBlue); TGraph *fdc2 = MakeGraph(242.9, 3.0, kMagenta); TGraph *fdc3 = MakeGraph(301.4, 3.9, kOrange); TGraph *fdc4 = MakeGraph(339.8, 3.9, kRed); TCanvas *c1 = new TCanvas("c1"); c1->SetTicks(); c1->SetGridy(); TH2D *axes = new TH2D("axes", "FDC Fiducial angle vs. z-vertex", 100, 0.0, 80.0, 100, 0.0, 2.0); axes->SetStats(0); axes->SetXTitle("z vertex (cm)"); axes->Draw(); fdc1->Draw("Lsame"); fdc2->Draw("Lsame"); fdc3->Draw("Lsame"); fdc4->Draw("Lsame"); TLegend *leg = new TLegend(0.139, 0.629, 0.489, 0.857); leg->SetFillColor(kWhite); leg->AddEntry(fdc1, "FDC package 1"); leg->AddEntry(fdc2, "FDC package 2"); leg->AddEntry(fdc3, "FDC package 3"); leg->AddEntry(fdc4, "FDC package 4"); leg->Draw(); StandardLabels(axes, "", "", ""); c1->SaveAs("min_angle_by_package.pdf"); c1->SaveAs("min_angle_by_package.png"); } //----------------------- // MakeGraph //----------------------- TGraph* MakeGraph(double z_first_wire, double r_dead_zone, int color) { double z[80]; double theta[80]; for(int i=1; i<=80; i++){ z[i-1] = (double)i; double dZ = z_first_wire - z[i-1]; theta[i-1] = atan(r_dead_zone/dZ)*57.3; } TGraph *g = new TGraph(80, z, theta); g->SetLineColor(color); g->SetMarkerColor(color); g->SetFillColor(kWhite); g->SetLineWidth(3); return g; }