Functions | |
| TCanvas * | NewCanvas (std::string cn="", std::string ti="") |
| TCanvas * | NewLetterCanvas (std::string cn="", std::string ti="") |
| TCanvas * | NewNHighCanvas (int NHigh, std::string cn="", std::string ti="") |
| TCanvas * | NewNWideCanvas (int NWide, std::string cn="", std::string ti="") |
| TCanvas * | NewFourByCanvas (std::string cn="", std::string ti="") |
| TCanvas * | NewSixByCanvas (std::string cn="", std::string ti="") |
| void | FixPad (TPad *pad) |
| void | UpdatePad (TPad *pad) |
| bool | PadFilled (TPad *pad) |
|
|
Definition at line 60 of file UtilCanvas.cxx. References UtilHist::HMax(), UtilHist::HMin(), and MSG. Referenced by CamEvd::FillEvent(), and CamEvd::MakeShieldPlot(). 00060 {
00061 MSG("Util",Msg::kSynopsis) << "UtilCanvas::FixPad" << endl;
00062 if(!pad) return;
00063 static vector<TH1*> histos; histos.clear();
00064
00065 pad->Modified();
00066 pad->Update();
00067
00068 TObject *obj = 0;
00069 TIterator *itr2 = pad->GetListOfPrimitives()->MakeIterator();
00070 while ( (obj = itr2->Next()) ) {
00071 TH1* h1 = dynamic_cast<TH1*>(obj);
00072 if(h1) histos.push_back(h1);
00073 TLegend *leg = dynamic_cast<TLegend*>(obj);
00074 if(leg) leg->SetBorderSize(0);
00075 TPaveText *pav = dynamic_cast<TPaveText*>(obj);
00076 if(pav) pav->SetFillStyle(0);
00077 TPad *inpad = dynamic_cast<TPad*>(obj);
00078 if(inpad) UtilCanvas::FixPad(inpad);
00079 }
00080 pad->Modified();
00081
00082 //Only concerned with 2 or more histograms on same pad
00083 if (histos.size() < 2) {
00084 MSG("Util",Msg::kSynopsis) << "This pad only has " << histos.size()
00085 << " hists, no need to fix" << endl;
00086 return;
00087 }
00088
00089 double Max = UtilHist::HMax(histos);
00090 double Min = UtilHist::HMin(histos);
00091 double Min0 = UtilHist::HMin(histos, 0);
00092
00093 //Save a handful of later divide by zero errors
00094 if((Max==0 && Min==0) || Max==Min) return;
00095
00096 if (pad->GetLogy()) {
00097 MSG("Util",Msg::kSynopsis) << "Correcting for Y Axis Log Scale" << endl;
00098
00099 //For LogY, a Min<=0 causes ugliness, fix here
00100 if(Min <= 0.0) Min = Min0;
00101
00102 double Buf = TMath::Power(Max/Min, 0.05);
00103
00104 MSG("Util",Msg::kSynopsis) << "For Max = " << Max << ", Min = " << Min
00105 << ", Using Buf = " << Buf << endl;
00106
00107 Max *= Buf;
00108 Min /= Buf;
00109 }
00110 else {
00111 MSG("Util",Msg::kSynopsis) << "Correcting for Y Axis Linear Scale" << endl;
00112 double Buf = (Max-Min) * 0.05;
00113
00114 MSG("Util",Msg::kSynopsis) << "For Max = " << Max << ", Min = " << Min
00115 << ", Using Buf = " << Buf << endl;
00116
00117 Max += Buf;
00118 if(Min<0 || Min>Buf) Min -= Buf;
00119 else Min = 0.0;
00120 }
00121
00122 histos[0]->GetYaxis()->SetRangeUser(Min, Max);
00123 pad->Modified();
00124 }
|
|
||||||||||||
|
Definition at line 17 of file UtilCanvas.cxx. References tc. Referenced by NewLetterCanvas(). 00017 {
00018 TCanvas *tc = 0;
00019 if(cn.size()==0) tc = new TCanvas();
00020 else {
00021 if(ti.size()==0) tc = new TCanvas(cn.c_str(),cn.c_str());
00022 else tc = new TCanvas(cn.c_str(),ti.c_str());
00023 }
00024 tc->SetBorderSize(2);
00025 tc->Range(0.0, 0.0, 100.0, 100.0);
00026 tc->SetFrameFillColor(0);
00027 return tc;
00028 }
|
|
||||||||||||
|
Definition at line 48 of file UtilCanvas.cxx. References NewLetterCanvas(), and tc. 00048 {
00049 TCanvas *tc = NewLetterCanvas(cn,ti);
00050 tc->Divide(2, 2);
00051 return(tc);
00052 }
|
|
||||||||||||
|
Definition at line 30 of file UtilCanvas.cxx. References NewCanvas(), and tc. Referenced by NewFourByCanvas(), NewNHighCanvas(), NewNWideCanvas(), and NewSixByCanvas(). 00030 {
00031 TCanvas *tc = NewCanvas(cn,ti);
00032 tc->SetWindowSize(930, 750);
00033 return(tc);
00034 }
|
|
||||||||||||||||
|
Definition at line 36 of file UtilCanvas.cxx. References NewLetterCanvas(), and tc. 00036 {
00037 TCanvas *tc = NewLetterCanvas(cn,ti);
00038 tc->Divide(1, NHigh);
00039 return(tc);
00040 }
|
|
||||||||||||||||
|
Definition at line 42 of file UtilCanvas.cxx. References NewLetterCanvas(), and tc. 00042 {
00043 TCanvas *tc = NewLetterCanvas(cn,ti);
00044 tc->Divide(NWide, 1);
00045 return(tc);
00046 }
|
|
||||||||||||
|
Definition at line 54 of file UtilCanvas.cxx. References NewLetterCanvas(), and tc. 00054 {
00055 TCanvas *tc = NewLetterCanvas(cn,ti);
00056 tc->Divide(3, 2);
00057 return(tc);
00058 }
|
|
|
Definition at line 140 of file UtilCanvas.cxx. Referenced by CamEvd::DoPrint(). 00140 {
00141 if(!pad) return false;
00142 TList *tl = pad->GetListOfPrimitives();
00143 TIterator *itr2 = tl->MakeIterator();
00144 TObject *obj = 0;
00145 bool IsFilled = false;
00146
00147 while ( (obj=itr2->Next()) ) {
00148 TPad* p1 = dynamic_cast<TPad*>(obj);
00149 if(p1) IsFilled = IsFilled || UtilCanvas::PadFilled(p1);
00150 if((dynamic_cast<TH1*>(obj))) IsFilled = true;;
00151 }
00152 return IsFilled;
00153 }
|
|
|
Definition at line 126 of file UtilCanvas.cxx. Referenced by CamEvd::DoTab(), CamEvd::SetPlaneRangeUser(), CamEvd::SetUStripRangeUser(), and CamEvd::SetVStripRangeUser(). 00126 {
00127 if(!pad) return;
00128 TList *tl = pad->GetListOfPrimitives();
00129 TIterator *itr2 = tl->MakeIterator();
00130 TObject *obj = 0;
00131
00132 while ( (obj=itr2->Next()) ) {
00133 TPad* p1 = dynamic_cast<TPad*>(obj);
00134 if(p1) p1->Modified();
00135 }
00136 pad->Modified();
00137 pad->Update();
00138 }
|
1.3.9.1