- Timestamp:
- 06/23/03 15:00:09 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2216 r2217 132 132 - added -I../mhist 133 133 134 * macros/sumcurrents.C: 135 - adapted to changes 136 - added filename to canvas 137 134 138 135 139 -
trunk/MagicSoft/Mars/macros/sumcurrents.C
r2192 r2217 47 47 tlist.AddToList(&read); 48 48 49 MFillH fill("MHC urrents");49 MFillH fill("MHCamEvent", "MCurrents"); 50 50 tlist.AddToList(&fill); 51 51 … … 64 64 tlist.PrintStatistics(); 65 65 66 MHCurrents &h = *(MHCurrents*)plist->FindObject("MHCurrents"); 66 MHCamEvent &h2 = *(MHCamEvent*)plist->FindObject("MHCamEvent"); 67 MHCamera &h = *(MHCamera*)h2.GetHistByName(); 68 ; 67 69 68 70 TCanvas *c = MH::MakeDefCanvas(); 69 71 c->Divide(3, 2); 70 72 71 MCamDisplay *disp1=new MCamDisplay(&geom); 72 MCamDisplay *disp2=new MCamDisplay(&geom); 73 MCamDisplay *disp3=new MCamDisplay(&geom); 74 disp1->Fill(h.GetSum()); 75 disp2->Fill(h.GetRms()); 73 h.SetXTitle("Pixel Index"); 76 74 77 TArrayF arr(577); 78 for (int i=0;i<577;i++) 79 { 80 TArrayF &r = h.GetRms(); 81 TArrayF &v = h.GetSum(); 82 arr[i] = (v[i]==0 ? 0 : r[i]/v[i]); 83 } 84 disp3->Fill(arr); 75 MHCamera *disp1=h.Clone(); 76 MHCamera *disp2=h.Clone(); 77 MHCamera *disp3=h.Clone(); 78 disp2->SetCamContent(h, 1); 79 disp3->SetCamContent(h, 2); 80 81 disp1->SetYTitle("I [nA]"); 82 disp2->SetYTitle("\\sigma_{I} [nA]"); 83 disp3->SetYTitle("\\sigma_{I} [%]"); 84 disp1->SetName("Currents;avg"); 85 disp2->SetName("Currents;err"); 86 disp3->SetName("Currents;rel"); 87 disp1->SetTitle("Currents Average"); 88 disp2->SetTitle("Currents error"); 89 disp3->SetTitle("Currents relative error"); 85 90 86 91 c->cd(1); 92 TText text(0.1, 0.95, &fname[fname.Last('/')+1]); 93 text.SetTextSize(0.03); 94 text.DrawClone(); 87 95 gPad->SetBorderMode(0); 88 96 gPad->Divide(1,1); 89 97 gPad->cd(1); 90 gPad->SetLog z();98 gPad->SetLogy(); 91 99 disp1->Draw(); 92 100 disp1->SetBit(kCanDelete); … … 95 103 gPad->Divide(1,1); 96 104 gPad->cd(1); 97 gPad->SetLog z();105 gPad->SetLogy(); 98 106 disp2->Draw(); 99 107 disp2->SetBit(kCanDelete); … … 102 110 gPad->Divide(1,1); 103 111 gPad->cd(1); 104 gPad->SetLog z();112 gPad->SetLogy(); 105 113 disp3->Draw(); 106 114 disp3->SetBit(kCanDelete); 107 115 c->cd(4); 108 116 gPad->SetBorderMode(0); 109 h.GetHist().SetStats(kFALSE); 110 h.GetHist().DrawCopy(); 117 disp1->Draw("EPhist"); 111 118 c->cd(5); 112 119 gPad->SetBorderMode(0); 113 120 gPad->SetLogy(); 114 TH1F h1("currents;rms", "Currents Rms", 577, -0.5, 576.5); 115 h1.SetXTitle("Pixel Index"); 116 h1.SetStats(kFALSE); 117 for (int i=1;i<=577; i++) 118 h1.SetBinContent(i, h.GetHist().GetBinError(i)); 119 h1.DrawCopy(); 121 disp2->Draw("Phist"); 120 122 c->cd(6); 121 123 gPad->SetBorderMode(0); 122 124 gPad->SetLogy(); 123 TH1F h2("currents;relerr", "Currents rel. Error [%]", 577, -0.5, 576.5); 124 h2.SetXTitle("Pixel Index"); 125 h2.SetStats(kFALSE); 126 for (int i=1;i<=577; i++) 127 h2.SetBinContent(i, arr[i-1]*100); 128 h2.DrawCopy(); 125 disp3->Draw("Phist"); 129 126 130 127 c->SaveAs(fname(0, fname.Last('.')+1) + "ps");
Note:
See TracChangeset
for help on using the changeset viewer.