#include <Plotter.h>
Inheritance diagram for Plotter:

Public Member Functions | |
| virtual | ~Plotter () |
| virtual void | Book (PlotterManager &) |
| Implement this to book histograms or o.w. one time setup. | |
| virtual bool | Fill (PlotterManager &) |
| virtual void | NewFile (const char *) |
| Implement to get notice of when a new tree is loaded. | |
| Plotter (VldContext vld) | |
| virtual | ~Plotter () |
| void | BasicPlot (int plane, int strip) |
| TGraphErrors * | Plot (int yplane, int ystrip, StripEnd::StripEnd_t yend, int xplane, int xstrip, StripEnd::StripEnd_t xend, int led, char *draw_opt) |
| TGraphErrors * | Plot (int plane, int strip, StripEnd::StripEnd_t end, float *x, float *ex, char *xtitle, int led, char *draw_opt) |
| TGraphErrors * | Plot (int plane, int strip, StripEnd::StripEnd_t end, int gain, int led, char *draw_opt) |
| TGraphErrors * | Plot (int gain, float *x, float *ex, char *xtitle, int led, char *draw_opt) |
| TGraphErrors * | Plot (int gain, int gain2, int led, char *draw_opt) |
| void | Residuals (TGraphErrors *g) |
Private Member Functions | |
| std::pair< PlexPinDiodeId, PlexPinDiodeId > | myGetPinDiodeIds (PlexHandle plex, PlexLedId led) |
| PlexLedId | myGetLedId (PlexHandle plex, PlexStripEndId seid) |
| int | getLed (int crate, int strip, int plane) |
Private Attributes | |
| VldContext | fVld |
| DbiResultPtr< PulserRawGainPin > | fPinRP |
| DbiResultPtr< PulserRawGain > | fNearRP |
| DbiResultPtr< PulserRawGainF > | fFarRP |
| PlexHandle | fPlex |
| TCanvas * | fRes |
|
|
Definition at line 10 of file BeamData/ana/bmnt/Plotter.h. 00010 {};
|
|
|
Definition at line 19 of file Plotter.cxx. References fFarRP, fNearRP, fPinRP, fRes, fVld, and DbiResultPtr< T >::GetNumRows(). 00019 : fPinRP(vld), fNearRP(vld), fFarRP(vld), fPlex(vld) 00020 { 00021 fVld = vld; 00022 fRes = 0; 00023 cout<<"Got Tables for "<<vld<<endl; 00024 cout<<"Pin: "<<fPinRP.GetNumRows()<<" rows"<<endl; 00025 cout<<"Near: "<<fNearRP.GetNumRows()<<" rows"<<endl; 00026 cout<<"Far: "<<fFarRP.GetNumRows()<<" rows"<<endl; 00027 }
|
|
|
Definition at line 24 of file PulserCalibration/Plotter.h. 00024 {};
|
|
||||||||||||
|
Definition at line 29 of file Plotter.cxx. References PlexStripEndId::BuildPlnStripEndKey(), fFarRP, fNearRP, fPinRP, fPlex, PulserRawGainF::GetError(), PulserRawGain::GetError(), PulserRawGainPin::GetError(), PulserRawGainF::GetMean(), PulserRawGain::GetMean(), PulserRawGainPin::GetMean(), PulserRawGainF::GetNumPoints(), PulserRawGain::GetNumPoints(), DbiResultPtr< T >::GetRowByIndex(), myGetLedId(), and myGetPinDiodeIds(). 00030 {
00031 // Make Ids...
00032 PlexStripEndId seid(Detector::kCalDet, plane, strip, StripEnd::kEast);
00033 PlexStripEndId other(Detector::kCalDet, plane, strip, StripEnd::kWest);
00034
00035 PlexLedId led = myGetLedId(fPlex,seid);
00036 PlexLedId otherled = myGetLedId(fPlex,other);
00037
00038 std::pair<PlexPinDiodeId,PlexPinDiodeId> pins = myGetPinDiodeIds(fPlex,led);
00039 std::pair<PlexPinDiodeId,PlexPinDiodeId> otherpins = myGetPinDiodeIds(fPlex,otherled);
00040
00041 const PulserRawGainPin* nph = fPinRP.GetRowByIndex(pins.first.GetEncoded());
00042 const PulserRawGainPin* npl = fPinRP.GetRowByIndex(pins.second.GetEncoded());
00043 const PulserRawGainPin* fph = fPinRP.GetRowByIndex(otherpins.first.GetEncoded());
00044 const PulserRawGainPin* fpl = fPinRP.GetRowByIndex(otherpins.second.GetEncoded());
00045 cout<<"PIN Ids: "<<pins.first.GetEncoded()<<" "<<pins.second.GetEncoded()
00046 <<" "<<otherpins.first.GetEncoded()<<" "<<otherpins.second.GetEncoded()
00047 <<endl;
00048 TVirtualPad *parent = gPad;
00049 if (!parent) {
00050 //TCanvas *canvas =
00051 new TCanvas("plotter","Plotter",0,0,700,700);
00052 parent = gPad;
00053 }
00054 parent->Clear();
00055 parent->Divide(2,2,0,0,0);
00056
00057
00058 const PulserRawGain* near = fNearRP.GetRowByIndex(seid.BuildPlnStripEndKey());
00059 const PulserRawGainF* far = fFarRP.GetRowByIndex(other.BuildPlnStripEndKey());
00060 if (near && far) {
00061 parent->cd(1);
00062 TGraphErrors *g1h =
00063 new TGraphErrors(near->GetNumPoints(),
00064 nph->GetMean(),near->GetMean(),
00065 nph->GetError(),near->GetError());
00066 g1h->SetMarkerStyle(2);
00067 g1h->SetMarkerColor(2);
00068 g1h->Draw("AP");
00069 TGraphErrors *g1l =
00070 new TGraphErrors(near->GetNumPoints(),
00071 npl->GetMean(),near->GetMean(),
00072 npl->GetError(),near->GetError());
00073 g1l->SetMarkerStyle(2);
00074 g1l->SetMarkerColor(4);
00075 g1l->Draw("P");
00076
00077 parent->cd(2);
00078 TGraphErrors *g2h =
00079 new TGraphErrors(far->GetNumPoints(),
00080 nph->GetMean(),far->GetMean(),
00081 nph->GetError(),far->GetError());
00082 g2h->SetMarkerStyle(2);
00083 g2h->SetMarkerColor(2);
00084 g2h->Draw("AP");
00085 TGraphErrors *g2l =
00086 new TGraphErrors(far->GetNumPoints(),
00087 npl->GetMean(),far->GetMean(),
00088 npl->GetError(),far->GetError());
00089 g2l->SetMarkerStyle(2);
00090 g2l->SetMarkerColor(4);
00091 g2l->Draw("P");
00092 }
00093 near = fNearRP.GetRowByIndex(other.BuildPlnStripEndKey());
00094 far = fFarRP.GetRowByIndex(seid.BuildPlnStripEndKey());
00095 if (near && far) {
00096 parent->cd(4);
00097 TGraphErrors *g4h =
00098 new TGraphErrors(near->GetNumPoints(),
00099 fph->GetMean(),near->GetMean(),
00100 fph->GetError(),near->GetError());
00101 g4h->SetMarkerStyle(2);
00102 g4h->SetMarkerColor(2);
00103 g4h->Draw("AP");
00104 TGraphErrors *g4l =
00105 new TGraphErrors(near->GetNumPoints(),
00106 fpl->GetMean(),near->GetMean(),
00107 fpl->GetError(),near->GetError());
00108 g4l->SetMarkerStyle(2);
00109 g4l->SetMarkerColor(4);
00110 g4l->Draw("P");
00111
00112 parent->cd(3);
00113 TGraphErrors *g3h =
00114 new TGraphErrors(far->GetNumPoints(),
00115 fph->GetMean(),far->GetMean(),
00116 fph->GetError(),far->GetError());
00117 g3h->SetMarkerStyle(2);
00118 g3h->SetMarkerColor(2);
00119 g3h->Draw("AP");
00120 TGraphErrors *g3l =
00121 new TGraphErrors(far->GetNumPoints(),
00122 fpl->GetMean(),far->GetMean(),
00123 fpl->GetError(),far->GetError());
00124 g3l->SetMarkerStyle(2);
00125 g3l->SetMarkerColor(4);
00126 g3l->Draw("P");
00127 }
00128
00129 parent->cd(0);
00130
00131
00132 }
|
|
|
Implement this to book histograms or o.w. one time setup.
Reimplemented in Cuts, DeltaT, MaxDaeDt, Npot, and ProtonDist. Definition at line 13 of file BeamData/ana/bmnt/Plotter.h. 00013 {}
|
|
|
Implement this to get notified each time a new event is read in. Return true to stop analyzing this event. Reimplemented in Cuts, DeltaT, MaxDaeDt, Npot, and ProtonDist. Definition at line 17 of file BeamData/ana/bmnt/Plotter.h. 00017 { return true; }
|
|
||||||||||||||||
|
Definition at line 467 of file Plotter.cxx. Referenced by myGetLedId(). 00468 {
00469 switch (crate)
00470 {
00471 case 0:
00472 if (strip<5) {
00473 if (plane==40) return 2;
00474 if ((plane%4)==0||(plane%4)==1) return 1;
00475 return 2;
00476 } else if (strip<15) {
00477 if (plane==50) return 3;
00478 if (plane==40) return 1;
00479 if ((plane%4)==0||(plane%4)==1) return 2;
00480 return 1;
00481 } else {
00482 if (plane==50) return 1;
00483 return 3;
00484 }
00485 case 1:
00486 if (strip<11) {
00487 if (plane==56||plane==58) return 4;
00488 return 6;
00489 } else if (strip<21) {
00490 if (plane==58) return 6;
00491 if ((plane%4)==0||(plane%4)==1) return 5;
00492 return 4;
00493 } else {
00494 if ((plane%4)==0||(plane%4)==1) return 4;
00495 return 5;
00496 }
00497 default:
00498 return 0;
00499 }
00500
00501 }
|
|
||||||||||||
|
Definition at line 460 of file Plotter.cxx. References RawChannelId::GetCrate(), getLed(), PlexPlaneId::GetPlane(), PlexHandle::GetRawChannelId(), and PlexStripEndId::GetStrip(). Referenced by BasicPlot(), and Plot(). 00461 {
00462 int led = getLed(plex.GetRawChannelId(seid).GetCrate(),seid.GetStrip(),seid.GetPlane());
00463 return PlexLedId(Detector::kCalDet, 0 , led);
00464
00465 }
|
|
||||||||||||
|
Definition at line 445 of file Plotter.cxx. References PlexLedId::GetLedInBox(), and PlexHandle::GetPinDiodeId(). Referenced by BasicPlot(), and Plot(). 00446 {
00447 Int_t highpinchads[6]={4274,4146,4402,4786,4914,5042};
00448 Int_t lowpinchads[6]={4242,4114,4370,4626,4882,5010};
00449 PlexPinDiodeId high =
00450 plex.GetPinDiodeId(RawChannelId(Detector::kCalDet,ElecType::kVA,
00451 0,highpinchads[led.GetLedInBox()-1]));
00452
00453 PlexPinDiodeId low =
00454 plex.GetPinDiodeId(RawChannelId(Detector::kCalDet,ElecType::kVA,
00455 0,lowpinchads[led.GetLedInBox()-1]));
00456
00457 return std::make_pair(high,low);
00458 }
|
|
|
Implement to get notice of when a new tree is loaded.
Reimplemented in DeltaT. Definition at line 20 of file BeamData/ana/bmnt/Plotter.h. 00020 { }
|
|
||||||||||||||||||||
|
Definition at line 378 of file Plotter.cxx. References fPinRP, fPlex, PlexPinDiodeId::GetEncoded(), PulserRawGainPin::GetError(), PulserRawGainPin::GetMean(), PulserRawGainPin::GetNumPoints(), DbiResultPtr< T >::GetRowByIndex(), and myGetPinDiodeIds(). 00381 {
00382 const float *x = 0;
00383 const float *ex = 0;
00384 const float *y = 0;
00385 const float *ey = 0;
00386 int num;
00387
00388 // Get Pin (Y)
00389 PlexLedId ledid(Detector::kCalDet, 0, led);
00390 cout<<ledid<<endl;
00391 std::pair<PlexPinDiodeId,PlexPinDiodeId> pinids = myGetPinDiodeIds(fPlex,ledid);
00392 cout<<pinids.first<<" "<<pinids.second<<endl;
00393 PlexPinDiodeId pinid;
00394 if (gain==1) {
00395 pinid = pinids.first; // high
00396 } else {
00397 pinid = pinids.second; // low
00398 }
00399
00400 const PulserRawGainPin *thepin = fPinRP.GetRowByIndex(pinid.GetEncoded());
00401 cout<<"PIN Id: "<<pinid.GetEncoded()<<endl;
00402 if (!thepin) cout<<"Oh Bugger"<<endl;
00403 y = thepin->GetMean();
00404 ey = thepin->GetError();
00405 num = thepin->GetNumPoints();
00406
00407 // Get Pin (X)
00408 {
00409 PlexLedId ledid(Detector::kCalDet, 0, led);
00410 cout<<ledid<<endl;
00411 std::pair<PlexPinDiodeId,PlexPinDiodeId> pinids = myGetPinDiodeIds(fPlex,ledid);
00412 cout<<pinids.first<<" "<<pinids.second<<endl;
00413 PlexPinDiodeId pinid;
00414 if (gain2==1) {
00415 pinid = pinids.first; // high
00416 } else {
00417 pinid = pinids.second; // low
00418 }
00419
00420 const PulserRawGainPin *thepin = fPinRP.GetRowByIndex(pinid.GetEncoded());
00421 cout<<"PIN Id: "<<pinid.GetEncoded()<<endl;
00422 if (!thepin) cout<<"Oh Bugger"<<endl;
00423 x = thepin->GetMean();
00424 ex = thepin->GetError();
00425 }
00426 TGraphErrors *g = new TGraphErrors(num,x,y,ex,ey);
00427 g->SetMarkerStyle(2);
00428 g->SetMarkerColor(2);
00429 g->SetTitle("");
00430 g->Draw(draw_opt);
00431 char name[100];
00432 sprintf(name,"PIN Diode, LED %d gain %d",led,gain);
00433 if (g->GetYaxis()) g->GetYaxis()->SetTitle(name);
00434 sprintf(name,"PIN Diode, LED %d gain %d",led,gain2);
00435 if (g->GetXaxis()) g->GetXaxis()->SetTitle(name);
00436 g->Draw(draw_opt);
00437 return g;
00438
00439
00440
00441 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 335 of file Plotter.cxx. References fPinRP, fPlex, PlexPinDiodeId::GetEncoded(), PulserRawGainPin::GetError(), PulserRawGainPin::GetMean(), PulserRawGainPin::GetNumPoints(), DbiResultPtr< T >::GetRowByIndex(), and myGetPinDiodeIds(). 00338 {
00339
00340 const float *y = 0;
00341 const float *ey = 0;
00342 int num;
00343 // Get Pin (Y)
00344 PlexLedId ledid(Detector::kCalDet, 0, led);
00345 cout<<ledid<<endl;
00346 std::pair<PlexPinDiodeId,PlexPinDiodeId> pinids = myGetPinDiodeIds(fPlex,ledid);
00347 cout<<pinids.first<<" "<<pinids.second<<endl;
00348 PlexPinDiodeId pinid;
00349 if (gain==1) {
00350 pinid = pinids.first; // high
00351 } else {
00352 pinid = pinids.second; // low
00353 }
00354
00355 const PulserRawGainPin *thepin = fPinRP.GetRowByIndex(pinid.GetEncoded());
00356 cout<<"PIN Id: "<<pinid.GetEncoded()<<endl;
00357 if (!thepin) cout<<"Oh Bugger"<<endl;
00358 y = thepin->GetMean();
00359 ey = thepin->GetError();
00360 num = thepin->GetNumPoints();
00361
00362 TGraphErrors *g = new TGraphErrors(num,x,y,ex,ey);
00363 g->SetMarkerStyle(2);
00364 g->SetMarkerColor(2);
00365 g->SetTitle("");
00366 g->Draw(draw_opt);
00367 char name[100];
00368 sprintf(name,"PIN Diode, LED %d gain %d",led,gain);
00369 if (g->GetYaxis()) g->GetYaxis()->SetTitle(name);
00370
00371 if (g->GetXaxis()) g->GetXaxis()->SetTitle(xtitle);
00372 g->Draw(draw_opt);
00373 return g;
00374
00375
00376 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 268 of file Plotter.cxx. References PlexStripEndId::BuildPlnStripEndKey(), fFarRP, fNearRP, fPinRP, fPlex, PlexPinDiodeId::GetEncoded(), PulserRawGainPin::GetError(), PulserRawGainF::GetError(), PulserRawGain::GetError(), PlexLedId::GetLedInBox(), PulserRawGainPin::GetMean(), PulserRawGainF::GetMean(), PulserRawGain::GetMean(), PulserRawGainF::GetNumPoints(), PulserRawGain::GetNumPoints(), PlexStripEndId::GetOppositeSEId(), DbiResultPtr< T >::GetRowByIndex(), myGetLedId(), and myGetPinDiodeIds(). 00271 {
00272 const float *x = 0;
00273 const float *ex = 0;
00274 const float *y = 0;
00275 const float *ey = 0;
00276 int num;
00277 // Get Y
00278 PlexStripEndId yid(Detector::kCalDet, plane, strip, end);
00279
00280
00281 if (myGetLedId(fPlex,yid).GetLedInBox() == led) {
00282 // Near end
00283 const PulserRawGain *yn = fNearRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00284 if (!yn) cout<<" Oh Bugger!"<<endl;
00285 y = yn->GetMean();
00286 ey = yn->GetError();
00287 num = yn->GetNumPoints();
00288 }
00289 else if (myGetLedId(fPlex,yid.GetOppositeSEId()).GetLedInBox() == led) {
00290 // Far end
00291 const PulserRawGainF *yn = fFarRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00292 if (!yn) cout<<" Oh Bugger!"<<endl;
00293 y = yn->GetMean();
00294 ey = yn->GetError();
00295 num = yn->GetNumPoints();
00296 }
00297 else {
00298 cout<<" No Y data for this LED"<<endl;
00299 return 0;
00300 }
00301
00302 // Get Pin (X)
00303 PlexLedId ledid(Detector::kCalDet, 0, led);
00304 cout<<ledid<<endl;
00305 std::pair<PlexPinDiodeId,PlexPinDiodeId> pinids = myGetPinDiodeIds(fPlex,ledid);
00306 cout<<pinids.first<<" "<<pinids.second<<endl;
00307 PlexPinDiodeId pinid;
00308 if (gain==1) {
00309 pinid = pinids.first; // high
00310 } else {
00311 pinid = pinids.second; // low
00312 }
00313
00314 const PulserRawGainPin *thepin = fPinRP.GetRowByIndex(pinid.GetEncoded());
00315 cout<<"PIN Id: "<<pinid.GetEncoded()<<endl;
00316 if (!thepin) cout<<"Oh Bugger"<<endl;
00317 x = thepin->GetMean();
00318 ex = thepin->GetError();
00319
00320 TGraphErrors *g = new TGraphErrors(num,x,y,ex,ey);
00321 g->SetMarkerStyle(2);
00322 g->SetMarkerColor(2);
00323 g->SetTitle("");
00324 g->Draw(draw_opt);
00325 char name[100];
00326 sprintf(name,"PIN Diode, LED %d gain %d",led,gain);
00327 if (g->GetXaxis()) g->GetXaxis()->SetTitle(name);
00328 sprintf(name,"Plane %d Strip %d %s",plane,strip,StripEnd::AsString(end));
00329 if (g->GetXaxis()) g->GetYaxis()->SetTitle(name);
00330 g->Draw(draw_opt);
00331 return g;
00332
00333 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 216 of file Plotter.cxx. References PlexStripEndId::BuildPlnStripEndKey(), fFarRP, fNearRP, fPlex, PulserRawGainF::GetError(), PulserRawGain::GetError(), PlexLedId::GetLedInBox(), PulserRawGainF::GetMean(), PulserRawGain::GetMean(), PulserRawGainF::GetNumPoints(), PulserRawGain::GetNumPoints(), PlexStripEndId::GetOppositeSEId(), DbiResultPtr< T >::GetRowByIndex(), and myGetLedId(). 00219 {
00220 TPad *parent = dynamic_cast<TPad *>(gPad);
00221 if (!parent) {
00222 //TCanvas *canvas =
00223 new TCanvas("plotter","Plotter",0,0,700,700);
00224 parent = dynamic_cast<TPad *>(gPad);
00225 }
00226 const float *y = 0;
00227 const float *ey = 0;
00228 int num;
00229
00230 // Get Y
00231 PlexStripEndId yid(Detector::kCalDet, plane, strip, end);
00232
00233
00234 if (myGetLedId(fPlex,yid).GetLedInBox() == led) {
00235 // Near end
00236 const PulserRawGain *yn = fNearRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00237 if (!yn) cout<<" Oh Bugger!"<<endl;
00238 y = yn->GetMean();
00239 ey = yn->GetError();
00240 num = yn->GetNumPoints();
00241 }
00242 else if (myGetLedId(fPlex,yid.GetOppositeSEId()).GetLedInBox() == led) {
00243 // Far end
00244 const PulserRawGainF *yn = fFarRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00245 if (!yn) cout<<" Oh Bugger!"<<endl;
00246 y = yn->GetMean();
00247 ey = yn->GetError();
00248 num = yn->GetNumPoints();
00249 }
00250 else {
00251 cout<<" No Y data for this LED"<<endl;
00252 return 0;
00253 }
00254 TGraphErrors *g = new TGraphErrors(num,x,y,ex,ey);
00255 g->SetMarkerStyle(2);
00256 g->SetMarkerColor(2);
00257 g->SetTitle("");
00258 g->Draw(draw_opt);
00259 char name[100];
00260 if (g->GetXaxis()) g->GetXaxis()->SetTitle(xtitle);
00261 sprintf(name,"Plane %d Strip %d %s",plane,strip,StripEnd::AsString(end));
00262 if (g->GetXaxis()) g->GetYaxis()->SetTitle(name);
00263 g->Draw(draw_opt);
00264 return g;
00265
00266 }
|
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 136 of file Plotter.cxx. References PlexStripEndId::BuildPlnStripEndKey(), fFarRP, fNearRP, fPlex, PulserRawGainF::GetError(), PulserRawGain::GetError(), PlexLedId::GetLedInBox(), PulserRawGainF::GetMean(), PulserRawGain::GetMean(), PulserRawGainF::GetNumPoints(), PulserRawGain::GetNumPoints(), PlexStripEndId::GetOppositeSEId(), DbiResultPtr< T >::GetRowByIndex(), and myGetLedId(). 00139 {
00140 TPad *parent = dynamic_cast<TPad *>(gPad);
00141 if (!parent) {
00142 //TCanvas *canvas =
00143 new TCanvas("plotter","Plotter",0,0,700,700);
00144 parent = dynamic_cast<TPad *>(gPad);
00145 }
00146
00147
00148 const float *x=0;
00149 const float *ex = 0;
00150 const float *y = 0;
00151 const float *ey = 0;
00152 int num;
00153
00154 // Get X
00155 PlexStripEndId xid(Detector::kCalDet, xplane, xstrip, xend);
00156
00157 PlexLedId tryled = myGetLedId(fPlex, xid);
00158 if (tryled.GetLedInBox() == led) {
00159 // Near end
00160 const PulserRawGain *xn = fNearRP.GetRowByIndex(xid.BuildPlnStripEndKey());
00161 if (!xn) cout<<" Oh Bugger!"<<endl;
00162 x = xn->GetMean();
00163 ex = xn->GetError();
00164 num = xn->GetNumPoints();
00165 }
00166 else if (myGetLedId(fPlex,xid.GetOppositeSEId()).GetLedInBox() == led) {
00167 // Far end
00168 const PulserRawGainF *xn = fFarRP.GetRowByIndex(xid.BuildPlnStripEndKey());
00169 if (!xn) cout<<" Oh Bugger!"<<endl;
00170 x = xn->GetMean();
00171 ex = xn->GetError();
00172 num = xn->GetNumPoints();
00173 }
00174 else {
00175 cout<<" No X data for this LED"<<endl;
00176 return 0;
00177 }
00178
00179 // Get Y
00180 PlexStripEndId yid(Detector::kCalDet, yplane, ystrip, yend);
00181
00182
00183 if (myGetLedId(fPlex,yid).GetLedInBox() == led) {
00184 // Near end
00185 const PulserRawGain *yn = fNearRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00186 if (!yn) cout<<" Oh Bugger!"<<endl;
00187 y = yn->GetMean();
00188 ey = yn->GetError();
00189 }
00190 else if (myGetLedId(fPlex,yid.GetOppositeSEId()).GetLedInBox() == led) {
00191 // Far end
00192 const PulserRawGainF *yn = fFarRP.GetRowByIndex(yid.BuildPlnStripEndKey());
00193 if (!yn) cout<<" Oh Bugger!"<<endl;
00194 y = yn->GetMean();
00195 ey = yn->GetError();
00196 }
00197 else {
00198 cout<<" No Y data for this LED"<<endl;
00199 return 0;
00200 }
00201
00202 TGraphErrors *g = new TGraphErrors(num,x,y,ex,ey);
00203 g->SetMarkerStyle(2);
00204 g->SetMarkerColor(2);
00205 g->SetTitle("");
00206 g->Draw(draw_opt);
00207 char name[100];
00208 sprintf(name,"Plane %d Strip %d %s",xplane,xstrip,StripEnd::AsString(xend));
00209 if (g->GetXaxis()) g->GetXaxis()->SetTitle(name);
00210 sprintf(name,"Plane %d Strip %d %s",yplane,ystrip,StripEnd::AsString(yend));
00211 if (g->GetXaxis()) g->GetYaxis()->SetTitle(name);
00212 g->Draw(draw_opt);
00213 return g;
00214 }
|
|
|
Definition at line 503 of file Plotter.cxx. References fRes. 00504 {
00505 // Canvas...
00506 // if (!fRes)
00507 fRes = new TCanvas("residuals","Residuals",600,0,600,600);
00508 //fRes->cd();
00509
00510 double *x = g->GetX();
00511 double *y = g->GetY();
00512 int num = g->GetN();
00513
00514 // Don't fit above 8000 ADCs
00515 int pos;
00516 for (pos = num-1;;pos--) {
00517 if (y[pos]<8000) break;
00518 }
00519 for (;;pos--) {
00520 if (x[pos]<8000) break;
00521 }
00522 double xmax = x[pos];
00523 TF1 *func = new TF1("func","[0] + [1]*x",0,xmax);
00524 g->Fit("func","R");
00525
00526 // residuals.
00527 double *resx = new double[num];
00528 double *resy = new double[num];
00529
00530 for (int i=0;i<num;i++) {
00531 resx[i] = x[i];
00532 resy[i] = y[i] - func->GetParameter(0) - x[i]*func->GetParameter(1);
00533 if (y[i]>0.1) {
00534 resy[i]/=y[i];
00535 } else {
00536 resy[i] = 0;
00537 }
00538 }
00539
00540 TGraph *gres = new TGraph(num,resx,resy);
00541 gres->SetMarkerStyle(2);
00542 gres->SetMarkerColor(4);
00543 gres->SetMaximum(0.1);
00544 gres->SetMinimum(-0.1);
00545 gres->SetTitle("Residuals");
00546 gres->Draw("AP");
00547 if (g->GetXaxis()) {
00548 gres->GetXaxis()->SetTitle(g->GetXaxis()->GetTitle());
00549 gres->GetYaxis()->SetTitle(g->GetYaxis()->GetTitle());
00550 gres->Draw("AP");
00551 }
00552
00553 delete [] resx;
00554 delete [] resy;
00555 }
|
|
|
Definition at line 59 of file PulserCalibration/Plotter.h. Referenced by BasicPlot(), Plot(), and Plotter(). |
|
|
Definition at line 58 of file PulserCalibration/Plotter.h. Referenced by BasicPlot(), Plot(), and Plotter(). |
|
|
Definition at line 57 of file PulserCalibration/Plotter.h. Referenced by BasicPlot(), Plot(), and Plotter(). |
|
|
Definition at line 60 of file PulserCalibration/Plotter.h. Referenced by BasicPlot(), and Plot(). |
|
|
Definition at line 63 of file PulserCalibration/Plotter.h. Referenced by Plotter(), and Residuals(). |
|
|
Definition at line 56 of file PulserCalibration/Plotter.h. Referenced by Plotter(). |
1.3.9.1