Changeset 5300
- Timestamp:
- 10/21/04 09:03:53 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MLog.cc
r4732 r5300 632 632 // gcc 3.2: 633 633 char *txt = (char*)"logXXXXXX"; 634 fOut = fname ? new ofstream(fname) : new ofstream(/*mkstemp(*/txt/*)*/); 634 635 TString n(fname ? fname : txt); 636 gSystem->ExpandPathName(n); 637 fOut = new ofstream(n.Data()); 635 638 fOutAllocated = kTRUE; 636 639 } -
trunk/MagicSoft/Mars/mfbase/MF.cc
r3682 r5300 48 48 // "{log10(MHillas.fSize)}>3" 49 49 // 50 // For more details on available functions and expressions see MDataChain! 51 // 50 52 // The allowed logigal conditionals are: 51 53 // &&: logical and -
trunk/MagicSoft/Mars/mhbase/MH3.cc
r4928 r5300 478 478 479 479 // FIXME: Do it in Paint() 480 if (str.Contains("COL", TString::kIgnoreCase)) 480 /* 481 if (str.Contains("COL", TString::kIgnoreCase)) 482 { 481 483 SetColors(); 482 483 if (fHist->TestBit(kIsLogx) && fHist->GetEntries()>0) gPad->SetLogx(); 484 if (fHist->TestBit(kIsLogy) && fHist->GetEntries()>0) gPad->SetLogy(); 485 if (fHist->TestBit(kIsLogz) && fHist->GetEntries()>0) gPad->SetLogz(); 486 487 // Set pretty color palette 488 gStyle->SetPalette(1, 0); 489 490 TVirtualPad *padsave = gPad; 491 492 TProfile* h0; 493 if ((h0 = (TProfile*)gPad->FindObject(fNameProfX))) 494 { 495 // Get projection for range 496 TProfile *p = ((TH2*)fHist)->ProfileX(fNameProfX, -1, 9999, "s"); 497 498 // Move contents from projection to h3 499 h0->Reset(); 500 h0->Add(p); 501 delete p; 502 503 // Set Minimum as minimum value Greater Than 0 504 //h0->SetMinimum(GetMinimumGT(*h0)); 505 } 506 if ((h0 = (TProfile*)gPad->FindObject(fNameProfY))) 507 { 508 // Get projection for range 509 TProfile *p = ((TH2*)fHist)->ProfileY(fNameProfY, -1, 9999, "s"); 510 511 // Move contents from projection to h3 512 h0->Reset(); 513 h0->Add(p); 514 delete p; 515 516 // Set Minimum as minimum value Greater Than 0 517 //h0->SetMinimum(GetMinimumGT(*h0)); 518 } 519 520 gPad = padsave; 484 return; 485 } 486 */ 487 488 if (str.Contains("log", TString::kIgnoreCase)) 489 { 490 if (fHist->TestBit(kIsLogx) && fHist->GetEntries()>0) gPad->SetLogx(); 491 if (fHist->TestBit(kIsLogy) && fHist->GetEntries()>0) gPad->SetLogy(); 492 if (fHist->TestBit(kIsLogz) && fHist->GetEntries()>0) gPad->SetLogz(); 493 } 494 495 if (str.Contains("upd", TString::kIgnoreCase)) 496 { 497 498 // Set pretty color palette 499 // gStyle->SetPalette(1, 0); 500 501 TProfile* h0; 502 if ((h0 = (TProfile*)gPad->FindObject(fNameProfX))) 503 ((TH2*)fHist)->ProfileX(fNameProfX, -1, 9999, "s"); 504 if ((h0 = (TProfile*)gPad->FindObject(fNameProfY))) 505 ((TH2*)fHist)->ProfileY(fNameProfY, -1, 9999, "s"); 506 } 521 507 } 522 508 … … 550 536 if (!only) 551 537 fHist->Draw(str); 538 539 AppendPad("upd"); 552 540 553 541 if (str.Contains("PROFX", TString::kIgnoreCase) && fDimension==2) … … 562 550 { 563 551 TProfile *p = ((TH2*)fHist)->ProfileY(fNameProfY, -1, 9999, "s"); 552 p->UseCurrentStyle(); 564 553 p->SetLineColor(kBlue); 565 554 p->Draw(only?"":"same"); … … 568 557 } 569 558 570 AppendPad(" ");559 AppendPad("log"); 571 560 } 572 561 -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r5100 r5300 299 299 return; 300 300 301 const Int_t steps = 6;301 const Int_t steps = 10; 302 302 303 303 static int rebin = steps; … … 398 398 void MHAlpha::PaintText(Double_t val, Double_t error) const 399 399 { 400 TLatex text(0.45, 0.94, Form("N_{exc} = %.1f s \\pm %.1fs", val, error));400 TLatex text(0.45, 0.94, Form("N_{exc} = %.1f \\pm %.1f", val, error)); 401 401 text.SetBit(TLatex::kTextNDC); 402 402 text.SetTextSize(0.04); … … 463 463 if (o==(TString)"energy") 464 464 { 465 if (fHEnergy.Get Entries()>10)465 if (fHEnergy.GetMaximum()>1) 466 466 { 467 467 gPad->SetLogx(); … … 542 542 // Store the final result in fFit 543 543 TH1D *h = fHAlpha.ProjectionZ("AlphaExc_px", -1, 9999, -1, 9999, "E"); 544 h->SetDirectory(0); 544 545 fFit.Print(); 545 546 Bool_t rc = fFit.Fit(*h); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r5143 r5300 120 120 #include <TStyle.h> 121 121 #include <TCanvas.h> 122 #include <TRandom.h> 122 123 #include <TPaveText.h> 123 124 #include <TStopwatch.h> … … 146 147 using namespace std; 147 148 149 class MHillasExt; 150 148 151 // -------------------------------------------------------------------------- 149 152 // … … 152 155 MHFalseSource::MHFalseSource(const char *name, const char *title) 153 156 : fTime(0), fPointPos(0), fObservatory(0), fMm2Deg(-1), fAlphaCut(12.5), 154 fBgMean(55), fMinDist(-1), fMaxDist(-1), fMin LD(-1), fMaxLD(-1)157 fBgMean(55), fMinDist(-1), fMaxDist(-1), fMinDW(-1), fMaxDW(-1) 155 158 { 156 159 // … … 244 247 // 245 248 // Also search for MTime, MObservatory and MPointingPos 246 // 249 // 250 MHillasExt *ext=0; 247 251 Bool_t MHFalseSource::SetupFill(const MParList *plist) 248 252 { … … 251 255 { 252 256 *fLog << err << "MGeomCam not found... aborting." << endl; 257 return kFALSE; 258 } 259 ext = (MHillasExt*)plist->FindObject("MHillasExt"); 260 if (!ext) 261 { 262 *fLog << err << "MHillasExt not found... aborting." << endl; 253 263 return kFALSE; 254 264 } … … 355 365 356 366 // Source dependant hillas parameters 357 if (hsrc.Calc(*hil )>0)367 if (hsrc.Calc(*hil, ext)>0) 358 368 { 359 369 *fLog << warn << "Calculation of MHillasSrc failed for x=" << cx[ix] << " y=" << cy[iy] << endl; … … 369 379 continue; 370 380 371 if (fMax LD>0 && hil->GetLength()>fMaxLD*hsrc.GetDist())381 if (fMaxDW>0 && hsrc.GetDist()>fMaxDW*hil->GetWidth()) 372 382 continue; 373 if (fMin LD>0 && hil->GetLength()<fMinLD*hsrc.GetDist())383 if (fMinDW<0 && hsrc.GetDist()<fMinDW*hil->GetWidth()) 374 384 continue; 375 385 … … 462 472 463 473 // Get projection for range 464 TH2D *p = (TH2D*)fHist.Project3D("yx_all"); 474 TH2D *p = (TH2D*)fHist.Project3D(Form("yx_%d", gRandom->Uniform(999999))); 475 p->SetDirectory(0); 465 476 466 477 // Move contents from projection to h3 -
trunk/MagicSoft/Mars/star.cc
r5101 r5300 105 105 arg.Print("options"); 106 106 gLog << endl; 107 return -1; 107 108 } 108 109
Note:
See TracChangeset
for help on using the changeset viewer.