void bcal_drpde_tradeoff2(void) { // // plot the number of fits to a cdc segment that result in prob > prob_cut (currently set to 0.01). // #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kFALSE); // gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; Int_t j,jj; #define npts 8; Int_t ngen=10000; // input data set first point (actually -3) to -10 so that it is not plotted. // use offset on x-axis to make data visible and give negative y-values for reference (not plotted) Double_t combins[npts]={0,4.25*16,8*16,8*20,3.88*16,5*16,10*16,200}; Double_t threshold[npts]={-1,-0.09,-0.135,-0.186,-0.06,-0.10,-0.132,-1}; Double_t xmin=0; Double_t xmax=200; Double_t ymin=0; Double_t ymax=0.4; // TCanvas *c1 = new TCanvas("c1","PDE vs DR tradeoff in resolution",200,10,700,700); c1->SetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); c1->SetBorderMode(0); c1->SetFillColor(0); TGraph *thresh = new TGraph (npts,combins,threshold); TLegend *leg = new TLegend(0.15,0.60,0.35,0.9); TLegend *leg1 = new TLegend(0.49,0.70,0.85,0.78); // leg->AddEntry(thresh,"Combinations","p"); // Temperature dependent factors // Pick temperature in deg C. Double_t kpde_sensl = -0.075; Double_t kpde_photonique = -0.025; Double_t kpde_lightfoot = 0; Double_t kpde = kpde_sensl; // Double_t kpde = kpde_photonique; // Double_t kpde = kpde_lightfoot; Double_t kdr_sensl = 0.057; Double_t kdr_photonique =0.038; Double_t kdr_lightfoot =0.103; Double_t kdr = kdr_sensl; // Double_t kdr = kdr_photonique; // Double_t kdr = kdr_lightfoot; Double_t T0 = 20; Double_t T = 20; Double_t DeltaT = T-T0; TMarker *p1 = new TMarker (4.25*16*exp(kdr*DeltaT),0.095*(1+kpde*DeltaT),20); TMarker *p2 = new TMarker (8*16*exp(kdr*DeltaT),0.135*(1+kpde*DeltaT),21); TMarker *p3 = new TMarker (20*16*exp(kdr*DeltaT),0.186*(1+kpde*DeltaT),22); TMarker *p4 = new TMarker (3.88*16*exp(kdr*DeltaT),0.06*(1+kpde*DeltaT),24); TMarker *p5 = new TMarker (5*16*exp(kdr*DeltaT),0.10*(1+kpde*DeltaT),25); TMarker *p6 = new TMarker (10*16*exp(kdr*DeltaT),0.132*(1+kpde*DeltaT),26); TMarker *p7 = new TMarker (0,0.13*0.80,24); TMarker *p8 = new TMarker (2*6*16*exp(kdr*DeltaT),0.175*(1+kpde*DeltaT),20); TMarker *p9 = new TMarker (40*exp(kdr*DeltaT),0.13*(1+kpde*DeltaT),24); TMarker *p10 = new TMarker (40*exp(kdr*DeltaT),0.17*(1+kpde*DeltaT),25); TMarker *p11 = new TMarker (95*exp(kdr*DeltaT),0.23*(1+kpde*DeltaT),20); TMarker *p12 = new TMarker (95*exp(kdr*DeltaT),0.28*(1+kpde*DeltaT),21); TMarker *cal1 = new TMarker (144,0.13,5); TMarker *cal2 = new TMarker (72,0.27,3); leg->AddEntry(p1,"A35H, Getter 2","p"); leg->AddEntry(p2,"A35H, Getter 1","p"); leg->AddEntry(p3,"A36H, No Getter","p"); leg->AddEntry(p4,"A20H, Getter 2","p"); leg->AddEntry(p5,"A20H, Getter 1","p"); leg->AddEntry(p6,"A20H, No Getter","p"); // leg->AddEntry(p7,"Fine Mesh PMT","p"); leg->AddEntry(p8,"SSPM-0606BC4-PCB","p"); leg->AddEntry(p9,"MPPC@520 nm (25 #mum)","p"); leg->AddEntry(p10,"MPPC@470 nm (25 #mum)","p"); leg->AddEntry(p11,"MPPC@520 nm (50 #mum)","p"); leg->AddEntry(p12,"MPPC@470 nm (50 #mum)","p"); leg1->AddEntry(cal2,"Cal Rev, Thresh=40 MeV","p"); leg1->AddEntry(cal1,"Cal Rev, Thresh=52 MeV","p"); thresh->SetTitle(""); thresh->GetXaxis()->SetRangeUser(xmin,xmax); thresh->GetYaxis()->SetRangeUser(ymin,ymax); thresh->GetXaxis()->SetTitleSize(0.04); thresh->GetYaxis()->SetTitleSize(0.04); thresh->GetYaxis()->SetTitleOffset(1.5); thresh->GetXaxis()->SetTitle("Dark Current Array (MHz)"); thresh->GetYaxis()->SetTitle("PDE"); thresh->GetXaxis()->SetNdivisions(5); thresh->SetMarkerColor(1); thresh->SetMarkerStyle(21); thresh->Draw("AP"); p1->SetMarkerColor(2); p2->SetMarkerColor(2); p3->SetMarkerColor(2); p4->SetMarkerColor(2); p5->SetMarkerColor(2); p6->SetMarkerColor(2); p7->SetMarkerColor(4); p8->SetMarkerColor(4); p9->SetMarkerColor(1); p10->SetMarkerColor(1); p11->SetMarkerColor(1); p12->SetMarkerColor(1); cal1->SetMarkerColor(2); cal2->SetMarkerColor(2); p1->SetMarkerSize(1.5); p2->SetMarkerSize(1.5); p3->SetMarkerSize(1.5); p4->SetMarkerSize(1.5); p5->SetMarkerSize(1.5); p6->SetMarkerSize(1.5); p7->SetMarkerSize(1.5); p8->SetMarkerSize(1.5); p9->SetMarkerSize(1.5); p10->SetMarkerSize(1.5); p11->SetMarkerSize(1.5); p12->SetMarkerSize(1.5); cal1->SetMarkerSize(2); cal2->SetMarkerSize(2); p1->Draw(); p2->Draw(); p3->Draw(); p4->Draw(); p5->Draw(); p6->Draw(); // p7->Draw(); p8->Draw(); p9->Draw(); p10->Draw(); p11->Draw(); p12->Draw(); leg->Draw(); cal1->Draw(); cal2->Draw(); leg1->Draw(); // update parameters 4/28/09 Double_t b = 0.69; // units of % Double_t c = 0.067; // units of % Double_t DeE = 8.75; // units of % Double_t E = .06; // units of GeV TF1 *tradeoff = new TF1("tradeoff",tradeoff,0,200,4); tradeoff->SetParameters(b,c,DeE,E); tradeoff->SetLineColor(1); tradeoff->DrawCopy("same"); /* sprintf(string,"thresh: ); printf("string=%s\n",string);*/ // plot tradeoff function original Double_t b = 0.69; // units of % Double_t c = 0.12; // units of % Double_t DeE = 13.4; // units of % Double_t E = .06; // units of GeV tradeoff->SetParameters(b,c,DeE,E); tradeoff->SetLineColor(4); tradeoff->DrawCopy("same"); sprintf(string,"Constant overvoltage #Delta V=2V\n",T); t1 = new TLatex(0.4,0.85,string); t1->SetTextColor(1); t1->SetNDC(); t1->SetTextSize(0.035); //t1->Draw(); sprintf(string,"T = %0.f deg C\n",T); t1 = new TLatex(0.55,0.8,string); t1->SetTextColor(1); t1->SetNDC(); t1->SetTextSize(0.035); t1->Draw(); sprintf(string,"kpde=%.4f\n",kpde); t1 = new TLatex(0.55,0.75,string); t1->SetTextColor(1); t1->SetNDC(); t1->SetTextSize(0.03); //t1->Draw(); sprintf(string,"kdr=%.4f\n",kdr); t1 = new TLatex(0.55,0.7,string); t1->SetTextColor(1); t1->SetNDC(); t1->SetTextSize(0.03); //t1->Draw(); // c1->SaveAs("bcal_drpde_tradeoff2.eps"); c1->SaveAs("bcal_drpde_tradeoff2.gif"); } Double_t tradeoff (Double_t *x, Double_t *par) { Double_t b=par[0]; Double_t c=par[1]; Double_t DeE=par[2]; Double_t E=par[3]; Double_t x1=x[0]/100; char string[256]; Double_t P = b*b/(DeE*DeE*E); Double_t pde = P/2 + sqrt(P*P/4 + x1*c*c/(DeE*DeE*E*E)); /*sprintf (string,"tradeoff=%f b=%f c=%f DeE=%f E=%f\n",pde,b,c,DeE,E); printf ("string=%s",string);*/ return pde; }