void plot_monitoring_xtalk (void) { // // plot the results of light transmission for various light guide wrappings // // #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kTRUE); gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; char filename[80]; Int_t j,jj; #define npts 4; Double_t dummyx[npts]={-1,0,16,20}; Double_t dummyy[npts]={-1,100,100,-1}; Double_t chT2[npts]={1,5,9,13}; Double_t chT3[npts]={2,6,10,14}; Double_t r305_signal_Dsum[npts]={3202,7128,5704,9063}; Double_t r305_signal_Dadc[npts]={250,547,441,650}; Double_t r305_signal_Usum[npts]={5131,14130,14490,20060}; Double_t r305_signal_Uadc[npts]={411,1081,1070,1487}; Double_t r305_left_Dsum[npts]={36,57,47,77}; Double_t r305_left_Dadc[npts]={7,5.8,4.9,6.8}; Double_t r305_left_Usum[npts]={7.1,20,15,17}; Double_t r305_left_Uadc[npts]={3.6,5.3,4.2,4.5}; Double_t r305_right_Dsum[npts]={41,69,69,103}; Double_t r305_right_Dadc[npts]={4.6,6.7,6.2,7.9}; Double_t r305_right_Usum[npts]={215,564,580,861}; Double_t r305_right_Uadc[npts]={16.7,42,42.2,64.1}; Double_t f305_left_Dsum[npts]; Double_t f305_left_Dadc[npts]; Double_t f305_left_Usum[npts]; Double_t f305_left_Uadc[npts]; Double_t f305_right_Dsum[npts]; Double_t f305_right_Dadc[npts]; Double_t f305_right_Usum[npts]; Double_t f305_right_Uadc[npts]; Double_t r306_signal_Dsum[npts]={3223,8366,7436,7610}; Double_t r306_signal_Dadc[npts]={233,607,520,550}; Double_t r306_signal_Usum[npts]={3513,16640,16640,19970}; Double_t r306_signal_Uadc[npts]={274,1244,1221,1501}; Double_t r306_left_Dsum[npts]={30,52,52,61}; Double_t r306_left_Dadc[npts]={4,5,5,5}; Double_t r306_left_Usum[npts]={9,14,4,21}; Double_t r306_left_Uadc[npts]={3.3,4.3,4.0,3.5}; Double_t r306_right_Dsum[npts]={25,63,64,80}; Double_t r306_right_Dadc[npts]={4,6,6,6}; Double_t r306_right_Usum[npts]={351,598,618,812}; Double_t r306_right_Uadc[npts]={27,44,45,59}; Double_t f306_left_Dsum[npts]; Double_t f306_left_Dadc[npts]; Double_t f306_left_Usum[npts]; Double_t f306_left_Uadc[npts]; Double_t f306_right_Dsum[npts]; Double_t f306_right_Dadc[npts]; Double_t f306_right_Usum[npts]; Double_t f306_right_Uadc[npts]; Double_t r317_signal_Usum[npts]={4098,24240,24510,20450}; Double_t r317_signal_Uadc[npts]={368,1981,2004,1737}; Double_t r317_left_Usum[npts]={7.2,36,32,13}; Double_t r317_left_Uadc[npts]={4.7,6.2,6.3,6.5}; Double_t r317_right_Usum[npts]={362,1090,1099,1374}; Double_t r317_right_Uadc[npts]={30,85,87,110}; Double_t f317_left_Usum[npts]; Double_t f317_left_Uadc[npts]; Double_t f317_right_Usum[npts]; Double_t f317_right_Uadc[npts]; Double_t r320_signal_Usum[npts]={389,13350,16600,18570}; Double_t r320_signal_Uadc[npts]={32.3,1068,1421,1572}; Double_t r320_left_Usum[npts]={-1,15,15,34}; Double_t r320_left_Uadc[npts]={40,5,6,6}; Double_t r320_right_Usum[npts]={27,461,697,680}; Double_t r320_right_Uadc[npts]={4,34,54,51}; Double_t f320_left_Usum[npts]; Double_t f320_left_Uadc[npts]; Double_t f320_right_Usum[npts]; Double_t f320_right_Uadc[npts]; // compute fractions for (j=1;jSetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); c1->SetLogy(); Double_t xmin=0; Double_t xmax=16; Double_t ymin=0.0001; Double_t ymax=1; TLegend *leg = new TLegend(0.15,0.70,0.70,0.95); gdummy->SetTitle(""); gdummy->GetXaxis()->SetRangeUser(xmin,xmax); gdummy->GetYaxis()->SetRangeUser(ymin,ymax); gdummy->GetXaxis()->SetTitleSize(0.04); gdummy->GetYaxis()->SetTitleSize(0.04); gdummy->GetYaxis()->SetTitleOffset(1.5); // gdummy->GetYaxis()->SetTitleOffset(2.0); gdummy->GetXaxis()->SetTitle("Channel Number"); // gdummy->GetYaxis()->SetTitle("Cross Talk Fraction"); gdummy->GetYaxis()->SetTitle("Cross Talk Fraction (Sum)"); gdummy->GetXaxis()->SetNdivisions(505); gdummy->SetMarkerColor(4); gdummy->SetMarkerStyle(21); gdummy->Draw("Ap"); leg->AddEntry(g305_left_Usum,"Run 305, LED pocket, Left, T2 trigger","p"); g305_left_Usum->SetMarkerColor(4); g305_left_Usum->SetMarkerStyle(21); g305_left_Usum->Draw("samep"); leg->AddEntry(g305_right_Usum,"Run 305, LED pocket, Right, T2 trigger","p"); g305_right_Usum->SetMarkerColor(2); g305_right_Usum->SetMarkerStyle(21); g305_right_Usum->Draw("samep"); leg->AddEntry(g306_left_Usum,"Run 306, LED pocket, Left, T3 trigger","p"); g306_left_Usum->SetMarkerColor(4); g306_left_Usum->SetMarkerStyle(20); g306_left_Usum->Draw("samep"); leg->AddEntry(g306_right_Usum,"Run 306, LED pocket, Right, T3 trigger","p"); g306_right_Usum->SetMarkerColor(2); g306_right_Usum->SetMarkerStyle(20); g306_right_Usum->Draw("samep"); leg->AddEntry(g317_left_Usum,"Run 317, LED Center, Left, T2 trigger","p"); g317_left_Usum->SetMarkerColor(4); g317_left_Usum->SetMarkerStyle(25); g317_left_Usum->Draw("samep"); leg->AddEntry(g317_right_Usum,"Run 317, LED Center, Right, T2 trigger","p"); g317_right_Usum->SetMarkerColor(2); g317_right_Usum->SetMarkerStyle(25); g317_right_Usum->Draw("samep"); leg->AddEntry(g320_left_Usum,"Run 320, LED Center, Left, T3 trigger","p"); g320_left_Usum->SetMarkerColor(4); g320_left_Usum->SetMarkerStyle(24); g320_left_Usum->Draw("samep"); leg->AddEntry(g320_right_Usum,"Run 320, LED Center, Right, T3 trigger","p"); g320_right_Usum->SetMarkerColor(2); g320_right_Usum->SetMarkerStyle(24); g320_right_Usum->Draw("samep"); leg->Draw(); TCanvas *c2 = new TCanvas("c2","c2 plot_monitoring_xtalk",200,10,700,700); c2->SetBorderMode(0); c2->SetFillColor(0); c2->SetGridx(); c2->SetGridy(); c2->SetLogy(); Double_t xmin=0; Double_t xmax=16; Double_t ymin=0.0001; Double_t ymax=1; TLegend *leg = new TLegend(0.15,0.70,0.70,0.95); TGraph *gdummy2 = new TGraph(npts,dummyx,dummyy); gdummy2->SetTitle(""); gdummy2->GetXaxis()->SetRangeUser(xmin,xmax); gdummy2->GetYaxis()->SetRangeUser(ymin,ymax); gdummy2->GetXaxis()->SetTitleSize(0.04); gdummy2->GetYaxis()->SetTitleSize(0.04); gdummy2->GetYaxis()->SetTitleOffset(1.5); // gdummy2->GetYaxis()->SetTitleOffset(2.0); gdummy2->GetXaxis()->SetTitle("Channel Number"); // gdummy2->GetYaxis()->SetTitle("Cross Talk Fraction"); gdummy2->GetYaxis()->SetTitle("Cross Talk Fraction (ADC)"); gdummy2->GetXaxis()->SetNdivisions(505); gdummy2->SetMarkerColor(4); gdummy2->SetMarkerStyle(21); gdummy2->Draw("Ap"); leg->AddEntry(g305_left_Uadc,"Run 305, LED pocket, Left, T2 trigger","p"); g305_left_Uadc->SetMarkerColor(4); g305_left_Uadc->SetMarkerStyle(21); g305_left_Uadc->Draw("samep"); leg->AddEntry(g305_right_Uadc,"Run 305, LED pocket, Right, T2 trigger","p"); g305_right_Uadc->SetMarkerColor(2); g305_right_Uadc->SetMarkerStyle(21); g305_right_Uadc->Draw("samep"); leg->AddEntry(g306_left_Uadc,"Run 306, LED pocket, Left, T3 trigger","p"); g306_left_Uadc->SetMarkerColor(4); g306_left_Uadc->SetMarkerStyle(20); g306_left_Uadc->Draw("samep"); leg->AddEntry(g306_right_Uadc,"Run 306, LED pocket, Right, T3 trigger","p"); g306_right_Uadc->SetMarkerColor(2); g306_right_Uadc->SetMarkerStyle(20); g306_right_Uadc->Draw("samep"); leg->AddEntry(g317_left_Uadc,"Run 317, LED Center, Left, T2 trigger","p"); g317_left_Uadc->SetMarkerColor(4); g317_left_Uadc->SetMarkerStyle(25); g317_left_Uadc->Draw("samep"); leg->AddEntry(g317_right_Uadc,"Run 317, LED Center, Right, T2 trigger","p"); g317_right_Uadc->SetMarkerColor(2); g317_right_Uadc->SetMarkerStyle(25); g317_right_Uadc->Draw("samep"); leg->AddEntry(g320_left_Uadc,"Run 320, LED Center, Left, T3 trigger","p"); g320_left_Uadc->SetMarkerColor(4); g320_left_Uadc->SetMarkerStyle(24); g320_left_Uadc->Draw("samep"); leg->AddEntry(g320_right_Uadc,"Run 320, LED Center, Right, T3 trigger","p"); g320_right_Uadc->SetMarkerColor(2); g320_right_Uadc->SetMarkerStyle(24); g320_right_Uadc->Draw("samep"); leg->Draw(); sprintf(filename,"plot_monitoring_xtalk_c1.pdf"); c1->SaveAs(filename); sprintf(filename,"plot_monitoring_xtalk_c1.png"); c1->SaveAs(filename); sprintf(filename,"plot_monitoring_xtalk_c2.pdf"); c2->SaveAs(filename); sprintf(filename,"plot_monitoring_xtalk_c2.png"); c2->SaveAs(filename); } Double_t fit_func (Double_t *x, Double_t *par) { // Fit ln(thermal conductivity) as a funciton of ln(Temperature) Double_t p0=par[0]; Double_t p1=par[1]; Double_t p2=par[2]; Double_t p3=par[3]; Double_t p4=par[4]; Double_t x1=log(x[0]); Double_t pi=3.14159; char string[256]; Double_t func; func = p0 + p1*x1 + p2*x1*x1 + p3*x1*x1*x1 + p4*x1*x1*x1*x1; /*sprintf (string,"x1=%f func=%f\n",x1,func); printf ("string=%s",string);*/ if (func < 50) { return exp(func); } else { return exp(50); } }