Changeset 7971
- Timestamp:
- 09/26/06 11:45:32 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7970 r7971 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2006/09/26 Thomas Bretz 22 23 * mbase/MMath.h: 24 - added new function ModF 25 26 * mhist/MHRate.cc, mhist/MHWeather.cc, mhvstime/MHPixVsTime.cc, 27 mhvstime/MHSectorVsTime.cc, mhvstime/MHVsTime.cc, 28 mpointing/MHPointing.cc: 29 - made the update of the axis ranges work again 30 31 32 20 33 2006/09/26 Daniela Dorner 21 34 -
trunk/MagicSoft/Mars/mbase/MMath.h
r7899 r7971 52 52 TArrayD LeastSqFitPowerLaw(Int_t n, Double_t *x, Double_t *y); 53 53 54 inline Int_t ModF(Double_t dbl, Double_t &frac) { Double_t rc; frac = modf(dbl, &rc); return TMath::Nint(rc); } 55 54 56 inline Double_t Sgn(Double_t d) { return d<0 ? -1 : 1; } 55 57 } -
trunk/MagicSoft/Mars/mhist/MHRate.cc
r7841 r7971 182 182 void MHRate::DrawGraph(TGraph &g, const char *y) const 183 183 { 184 // If this is set to early the plot remains empty in root 5.12/00 185 if (g.GetN()>0) 186 g.SetMinimum(0); 187 188 // This is not done automatically anymore since root 5.12/00 189 // and it is necessary to force a proper update of the axis. 184 190 TH1 *h = g.GetHistogram(); 185 191 if (h) 186 192 { 193 delete h; 194 g.SetHistogram(0); 195 h = g.GetHistogram(); 196 } 197 198 if (h) 199 { 200 cout << "Y"; 187 201 TAxis *axe = h->GetXaxis(); 188 202 axe->SetLabelSize(0.033); … … 287 301 void MHRate::Paint(Option_t *o) 288 302 { 289 // If this is set to early the plot remains empty in root 5.12/00290 if (fRateTime.GetN()>0)291 fRateTime.SetMinimum(0);292 293 303 DrawGraph(fRateTime, "f [Hz]"); 294 304 /* -
trunk/MagicSoft/Mars/mhist/MHWeather.cc
r7841 r7971 160 160 if (h) 161 161 { 162 delete h; 163 g.SetHistogram(0); 164 h = g.GetHistogram(); 165 } 166 if (h) 167 { 162 168 TAxis *axe = h->GetXaxis(); 163 169 axe->SetLabelSize(0.033); -
trunk/MagicSoft/Mars/mhvstime/MHPixVsTime.cc
r7091 r7971 224 224 TString str(opt); 225 225 226 // This is not done automatically anymore since root 5.12/00 227 // and it is necessary to force a proper update of the axis. 226 228 TH1 *h = fGraph->GetHistogram(); 229 if (h) 230 { 231 delete h; 232 fGraph->SetHistogram(0); 233 h = fGraph->GetHistogram(); 234 } 227 235 228 236 h->SetXTitle("Time"); -
trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc
r7841 r7971 291 291 } 292 292 293 // This is not done automatically anymore since root 5.12/00 294 // and it is necessary to force a proper update of the axis. 293 295 TH1 *h = fGraph->GetHistogram(); 296 if (h) 297 { 298 delete h; 299 fGraph->SetHistogram(0); 300 h = fGraph->GetHistogram(); 301 } 294 302 295 303 h->SetXTitle("Time"); -
trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc
r7842 r7971 264 264 while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << endl; 265 265 */ 266 267 266 if (!fGraph) 268 267 return; … … 284 283 } 285 284 286 // SetPoint deletes the histogram! 287 if (fUseEventNumber) 288 fGraph->GetHistogram()->SetXTitle("Event Number"); 289 else 290 { 291 fGraph->GetHistogram()->SetXTitle("Time"); 292 fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033); 293 fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 294 fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1); 285 // This is not done automatically anymore since root 5.12/00 286 // and it is necessary to force a proper update of the axis. 287 TH1 *h = fGraph->GetHistogram(); 288 if (h) 289 { 290 delete h; 291 fGraph->SetHistogram(0); 292 h = fGraph->GetHistogram(); 293 } 294 if (h) 295 { 296 TAxis *axe = h->GetXaxis(); 297 // SetPoint deletes the histogram! 298 if (fUseEventNumber) 299 axe->SetTitle("Event Number"); 300 else 301 { 302 axe->SetTitle("Time"); 303 axe->SetLabelSize(0.033); 304 axe->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT"); 305 axe->SetTimeDisplay(1); 306 } 295 307 } 296 308 … … 300 312 // This is a workaround if the TGraph has only one point. 301 313 // Otherwise MStatusDisplay::Update hangs. 302 gPad->GetListOfPrimitives()->Remove(fGraph);303 fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data());314 // gPad->GetListOfPrimitives()->Remove(fGraph); 315 // fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data()); 304 316 //gPad->GetListOfPrimitives()->Add(fGraph, fGraph->GetN()<2 ? "A" : opt); 305 317 // AppendPad(str); … … 319 331 pad->SetBorderMode(0); 320 332 AppendPad(opt); 333 334 fGraph->Draw("A"); 321 335 } 322 336 -
trunk/MagicSoft/Mars/mpointing/MHPointing.cc
r7842 r7971 214 214 void MHPointing::DrawGraph(TGraph &g, const char *y) const 215 215 { 216 // This is not done automatically anymore since root 5.12/00 217 // and it is necessary to force a proper update of the axis. 216 218 TH1 *h = g.GetHistogram(); 219 if (h) 220 { 221 delete h; 222 g.SetHistogram(0); 223 h = g.GetHistogram(); 224 } 217 225 if (h) 218 226 {
Note:
See TracChangeset
for help on using the changeset viewer.