- Timestamp:
- 04/20/12 11:04:35 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mhist/MHCamEvent.cc
r13387 r13393 59 59 #include "MHCamEvent.h" 60 60 61 #include <TF1.h> 62 #include <TPaveStats.h> 63 61 64 #include "MLog.h" 62 65 #include "MLogManip.h" … … 323 326 } 324 327 325 void MHCamEvent::Paint(Option_t * )328 void MHCamEvent::Paint(Option_t *opt) 326 329 { 327 330 TVirtualPad *pad = gPad; … … 333 336 if (h->GetMaximum()>0) 334 337 gPad->SetLogy(); 338 339 if (TString(opt).Contains("gaus", TString::kIgnoreCase)) 340 { 341 // Create a copy of the function if it is not yet there 342 if (!h->GetFunction("gaus")) 343 h->Fit("gaus", "q"); 344 345 TF1 *f = h->GetFunction("gaus"); 346 if (f) 347 { 348 f->SetParameters(h->GetMean(), h->GetRMS(), h->GetMaximum()); 349 f->SetLineWidth(1); 350 h->Fit("gaus", "q"); 351 } 352 353 TPaveStats *s1 = dynamic_cast<TPaveStats*>(h->GetListOfFunctions()->FindObject("stats")); 354 if (s1) 355 { 356 if (s1->GetOptStat()==1111) 357 s1->SetOptStat(1000000001); 358 if (s1->GetOptFit()==1) 359 s1->SetOptFit(1111); 360 } 361 362 } 335 363 } 336 364 … … 350 378 } 351 379 352 void MHCamEvent::Draw(Option_t * )380 void MHCamEvent::Draw(Option_t *opt) 353 381 { 354 382 TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this); … … 356 384 pad->SetBorderMode(0); 357 385 358 AppendPad( );386 AppendPad(opt); 359 387 360 388 TString name = MString::Format("%s_1", pad->GetName());
Note:
See TracChangeset
for help on using the changeset viewer.