- Timestamp:
- 04/08/04 19:52:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3681 r3682 18 18 19 19 -*-*- END OF LINE -*-*- 20 2004/04/08: Thomas Bretz 21 22 * mfbase/MF.cc: 23 - optimized output 24 25 * mfbase/MFilterList.cc: 26 - added some comments 27 28 * mfileio/MReadMarsFile.[h,cc], mfileio/MReadTree.[h,cc]: 29 - added SortFiled-option -- RAQUEL, this is for you! 30 31 * mfileio/MWriteRootFile.cc: 32 - class AddSerialNumber in AddContainer 33 34 * mhist/MHFalseSource.[h,cc]: 35 - optimized setting of hist maximum 36 - added more source dependant cuts 37 - changed display layout 38 - scale number of entries to correct for different acceptance 39 (not perfect, but the best I can currently do) 40 41 * mimage/MHHillasExt.[h,cc]: 42 - added new histogram for fMaxDist 43 44 * mimage/MHNewImagePar.[h,cc]: 45 - added new histograms for Used/CoreArea 46 47 * mimage/MHillasCalc.cc: 48 - optimized output 49 50 * mimage/MHillasExt.cc: 51 - fMaxDist got a sign 52 53 * mimage/MNewImagePar.[h,cc]: 54 - enhanced comments 55 - added new Print() member function 56 57 * macros/readCT1.C, macros/readMagic.C, mmain/MEventDisplay.cc: 58 - forward geomcam to newimgepar.Print() 59 60 20 61 21 62 2004/04/08: Markus Gaug … … 40 81 - removed warning about low-gain saturation of Blind pixel 41 82 83 84 42 85 2004/04/07: Markus Gaug 86 43 87 * mcalib/MHGausEvents.[h,cc] 44 88 - added fBlackout events 89 45 90 46 91 -
trunk/MagicSoft/Mars/macros/readCT1.C
r2624 r3682 125 125 hillas.Print(*geomcam); 126 126 hillasext.Print(*geomcam); 127 newimgpar.Print( );127 newimgpar.Print(*geomcam); 128 128 129 129 if (!HandleInput()) -
trunk/MagicSoft/Mars/macros/readMagic.C
r3141 r3682 100 100 ((MHillas*)fParList->FindObject("MHillas"))->Print(*geom); 101 101 ((MHillasExt*)fParList->FindObject("MHillasExt"))->Print(*geom); 102 fParList->FindObject("MNewImagePar")->Print();102 ((MNewImagePar*)fParList->FindObject("MNewImagePar"))->Print(*geom); 103 103 104 104 return HandleInput(); -
trunk/MagicSoft/Mars/mfbase/MF.cc
r3573 r3682 41 41 // "MHillas.fWidth<0.5 && MHillas.fLength<0.6" 42 42 // 43 // You can also use brackets:43 // You can also use parantheses: 44 44 // "MHillas.fSize>200 || (MHillas.fWidth<0.5 && MHillas.fLength<0.6)" 45 45 // 46 46 // If you want to use mathematic expressions (as defined in MDataChain) 47 // you must encapsulate it in {}- Brackets, eg:47 // you must encapsulate it in {}-parantheses, eg: 48 48 // "{log10(MHillas.fSize)}>3" 49 49 // … … 60 60 // 61 61 // 62 // Warning: There is no priority rule build in. So better use brackets62 // Warning: There is no priority rule build in. So better use parantheses 63 63 // to get correct results. The rule is parsed/evaluated from the left 64 64 // to the right, which means: … … 120 120 fTitle = title ? title : gsDefTitle.Data(); 121 121 122 *fLog << inf << "Trying to resolve filter rule... " << endl;122 *fLog << inf << "Trying to resolve filter rule... " << flush; 123 123 if (!(fF=ParseString(text, 1))) 124 124 { … … 127 127 } 128 128 129 *fLog << inf << endl; 130 *fLog << "Using Filter rule " << fF->GetName(); 131 *fLog << " for " << fName << ":" << endl; 129 *fLog << inf << "found: "; 132 130 fF->Print(); 133 *fLog << endl << endl;131 *fLog << endl; 134 132 } 135 133 … … 178 176 { 179 177 *fLog << err << dbginf << "Syntax Error: Two coditional signs found in " << txt << endl; 180 *fLog << "Currently you have to enclose all conditions in brackets, like: \"(x<y) && (z<5)\"" << endl;178 *fLog << "Currently you have to enclose all conditions in parantheses, like: \"(x<y) && (z<5)\"" << endl; 181 179 return NULL; 182 180 } … … 226 224 { 227 225 // 228 // Search for the corresponding bracket226 // Search for the corresponding parantheses 229 227 // 230 228 Int_t first=1; … … 250 248 // 251 249 // Make a copy of the 'interieur' and delete the substringä 252 // including the brackets250 // including the parantheses 253 251 // 254 252 TString sub = txt(1, first-1); -
trunk/MagicSoft/Mars/mfbase/MFilterList.cc
r3666 r3682 79 79 // 80 80 // Options: 81 // and, &: is a bitwise and82 // or, |: is a bitwise or83 // xor, ^: is a bitwise exclusive or81 // and, & : is a bitwise and 82 // or, | : is a bitwise or 83 // xor, ^ : is a bitwise exclusive or 84 84 // land, && : is a logical and 85 // lor, || : is a logical or 85 // lor, || : is a logical or 86 // 87 // The bitwise operators are implemented for convinience. They may not 88 // make much sense. Maybe IsExpressionTrue should change its return 89 // type from Bool_t to Int_t. 86 90 // 87 91 MFilterList::MFilterList(const char *type, const char *name, const char *title) -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
r2984 r3682 116 116 // -------------------------------------------------------------------------- 117 117 // 118 // Sort the files by their file-names 119 // 120 void MReadMarsFile::SortFiles() 121 { 122 fRun->SortFiles(); 123 MReadTree::SortFiles(); 124 } 125 126 // -------------------------------------------------------------------------- 127 // 118 128 // This overload MReadTree::Notify. Before the MReadTree Notify 119 129 // TObjects are called the RunHeaders of the next files are read. -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.h
r2206 r3682 24 24 ~MReadMarsFile(); 25 25 26 void SortFiles(); 27 26 28 Int_t AddFile(const char *fname, Int_t entries=-1); 27 29 -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r3585 r3682 358 358 // -------------------------------------------------------------------------- 359 359 // 360 // Sort the files by their file-names 361 // 362 void MReadTree::SortFiles() 363 { 364 fChain->GetListOfFiles()->Sort(); 365 } 366 367 // -------------------------------------------------------------------------- 368 // 360 369 // This function is called if Branch choosing method should get enabled. 361 370 // Branch choosing means, that only the enabled branches are read into -
trunk/MagicSoft/Mars/mfileio/MReadTree.h
r2556 r3682 48 48 ~MReadTree(); 49 49 50 virtual void SortFiles(); 51 50 52 void DisableAutoScheme() { fAutoEnable = kFALSE; } 51 53 void EnableBranch(const char *name); -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r3336 r3682 198 198 // add the entry to the list. 199 199 // 200 MRootFileBranch *entry = new MRootFileBranch( cname, tname, must);200 MRootFileBranch *entry = new MRootFileBranch(AddSerialNumber(cname), tname, must); 201 201 fBranches.AddLast(entry); 202 202 203 203 if (tname && tname[0]) 204 AddToBranchList(Form("%s.%s", cname, tname));204 AddToBranchList(Form("%s.%s", AddSerialNumber(cname), tname)); 205 205 } 206 206 -
trunk/MagicSoft/Mars/mhist/MHFalseSource.cc
r3666 r3682 46 46 // pads) you can change the AlphaCut 'online' 47 47 // 48 // Each Z-Projection (Alpha-histogram) is scaled such, that the number 49 // of entries fits the maximum number of entries in all Z-Projections. 50 // This should correct for the different acceptance in the center 51 // and at the vorder of the camera. This, however, produces more noise 52 // at the border. 53 // 48 54 // Here is a slightly simplified version of the algorithm: 49 55 // ------------------------------------------------------ … … 139 145 // 140 146 MHFalseSource::MHFalseSource(const char *name, const char *title) 141 : fTime(0), fPointPos(0), fObservatory(0), fMm2Deg(-1), 142 fAlphaCut(12.5), fBgMean(55), fDistMin(-1), fDistMax(-1)147 : fTime(0), fPointPos(0), fObservatory(0), fMm2Deg(-1), fAlphaCut(12.5), 148 fBgMean(55), fMinDist(-1), fMaxDist(-1), fMinLD(-1), fMaxLD(-1) 143 149 { 144 150 // … … 155 161 fHist.SetYTitle("y [\\circ]"); 156 162 fHist.SetZTitle("\\alpha [\\circ]"); 163 } 164 165 void MHFalseSource::MakeSymmetric(TH1 *h) 166 { 167 const Float_t min = TMath::Abs(h->GetMinimum()); 168 const Float_t max = TMath::Abs(h->GetMaximum()); 169 170 const Float_t absmax = TMath::Max(min, max)*1.002; 171 172 h->SetMaximum( absmax); 173 h->SetMinimum(-absmax); 157 174 } 158 175 … … 337 354 // and/or MTaskList 338 355 // Source dependant distance cut 339 if (f DistMin>0 && hsrc.GetDist()*fMm2Deg<fDistMin)356 if (fMinDist>0 && hsrc.GetDist()*fMm2Deg<fMinDist) 340 357 continue; 341 342 if (fDistMax>0 && hil->GetLength()>fDistMax*hsrc.GetDist()) 358 if (fMaxDist>0 && hsrc.GetDist()*fMm2Deg>fMaxDist) 359 continue; 360 361 if (fMaxLD>0 && hil->GetLength()>fMaxLD*hsrc.GetDist()) 362 continue; 363 if (fMinLD>0 && hil->GetLength()<fMinLD*hsrc.GetDist()) 343 364 continue; 344 365 … … 358 379 // the same number of bins than for on-data 359 380 // 360 void MHFalseSource::ProjectOff(TH2D *h2 )381 void MHFalseSource::ProjectOff(TH2D *h2, TH2D *all) 361 382 { 362 383 TAxis &axe = *fHist.GetZaxis(); … … 379 400 // Move contents from projection to h2 380 401 h2->Reset(); 381 h2->Add(p); 402 h2->Add(p, all->GetMaximum()); 403 h2->Divide(all); 382 404 383 405 // Delete p … … 393 415 // range (0, fAlphaCut) 394 416 // 395 void MHFalseSource::ProjectOn(TH2D *h3 )417 void MHFalseSource::ProjectOn(TH2D *h3, TH2D *all) 396 418 { 397 419 TAxis &axe = *fHist.GetZaxis(); … … 410 432 // Move contents from projection to h3 411 433 h3->Reset(); 412 h3->Add(p); 434 h3->Add(p, all->GetMaximum()); 435 h3->Divide(all); 436 437 // Delete p 413 438 delete p; 414 439 … … 454 479 TH2D* h3; 455 480 TH2D* h4; 481 TH2D* h5; 456 482 457 483 // Update projection of all-events 458 padsave->GetPad( 1)->cd(3);484 padsave->GetPad(2)->cd(3); 459 485 if ((h0 = (TH2D*)gPad->FindObject("Alpha_yx_all"))) 460 486 ProjectAll(h0); 461 487 488 // Update projection of on-events 489 padsave->GetPad(1)->cd(1); 490 if ((h3 = (TH2D*)gPad->FindObject("Alpha_yx_on"))) 491 ProjectOn(h3, h0); 492 462 493 // Update projection of off-events 463 padsave->GetPad( 2)->cd(1);494 padsave->GetPad(1)->cd(3); 464 495 if ((h2 = (TH2D*)gPad->FindObject("Alpha_yx_off"))) 465 ProjectOff(h2); 466 467 // Update projection of on-events 496 ProjectOff(h2, h0); 497 468 498 padsave->GetPad(2)->cd(2); 469 if ((h3 = (TH2D*)gPad->FindObject("Alpha_yx_on"))) 470 ProjectOn(h3); 499 if ((h5 = (TH2D*)gPad->FindObject("Alpha_yx_diff"))) 500 { 501 h5->Add(h3, h2, -1); 502 MakeSymmetric(h5); 503 } 471 504 472 505 // Update projection of significance 473 padsave->GetPad( 2)->cd(3);506 padsave->GetPad(1)->cd(2); 474 507 if (h2 && h3 && (h4 = (TH2D*)gPad->FindObject("Alpha_yx_sig"))) 475 508 { … … 483 516 Int_t max = h4->GetBin(nx, ny); 484 517 485 for (int ix= 0; ix<nx; ix++)486 for (int iy= 0; iy<ny; iy++)518 for (int ix=1; ix<=nx; ix++) 519 for (int iy=1; iy<=ny; iy++) 487 520 { 488 const Int_t n = h4->GetBin(ix +1, iy+1);521 const Int_t n = h4->GetBin(ix, iy); 489 522 490 523 const Double_t s = h3->GetBinContent(n); … … 503 536 } 504 537 538 MakeSymmetric(h4); 539 505 540 // Update projection of 'the best alpha-plot' 506 padsave->GetPad( 1)->cd(1);541 padsave->GetPad(2)->cd(1); 507 542 if ((h1 = (TH1D*)gPad->FindObject("Alpha")) && max>0) 508 543 { … … 560 595 TObject *catalog = GetCatalog(); 561 596 562 // draw the 2D histogram Sigmabar versus Theta597 // Initialize upper part 563 598 pad->cd(1); 564 599 gPad->SetBorderMode(0); 565 600 gPad->Divide(3, 1); 566 delete pad->GetPad(1)->GetPad(2); 567 568 pad->GetPad(1)->cd(3); 569 gPad->SetBorderMode(0); 570 TH1 *h0 = fHist.Project3D("yx_all"); 571 h0->SetDirectory(NULL); 572 h0->SetXTitle(fHist.GetXaxis()->GetTitle()); 573 h0->SetYTitle(fHist.GetYaxis()->GetTitle()); 574 h0->Draw("colz"); 575 h0->SetBit(kCanDelete); 576 catalog->Draw("mirror same"); 577 601 602 // PAD #1 578 603 pad->GetPad(1)->cd(1); 579 gPad->SetBorderMode(0);580 581 TH1 *h1 = fHist.ProjectionZ("Alpha");582 h1->SetDirectory(NULL);583 h1->SetTitle("Distribution of \\alpha");584 h1->SetXTitle(fHist.GetZaxis()->GetTitle());585 h1->SetYTitle("Counts");586 h1->Draw(opt);587 h1->SetBit(kCanDelete);588 589 pad->cd(2);590 gPad->SetBorderMode(0);591 gPad->Divide(3, 1);592 593 pad = gPad;594 595 pad->cd(1);596 gPad->SetBorderMode(0);597 fHist.GetZaxis()->SetRangeUser(fBgMean-fAlphaCut/2, fBgMean+fAlphaCut/2);598 TH1 *h2 = fHist.Project3D("yx_off");599 h2->SetDirectory(NULL);600 h2->SetXTitle(fHist.GetXaxis()->GetTitle());601 h2->SetYTitle(fHist.GetYaxis()->GetTitle());602 h2->Draw("colz");603 h2->SetBit(kCanDelete);604 catalog->Draw("mirror same");605 606 pad->cd(2);607 604 gPad->SetBorderMode(0); 608 605 fHist.GetZaxis()->SetRangeUser(0,fAlphaCut); … … 616 613 catalog->Draw("mirror same"); 617 614 618 pad->cd(3); 615 // PAD #2 616 pad->GetPad(1)->cd(2); 619 617 gPad->SetBorderMode(0); 620 618 fHist.GetZaxis()->SetRange(0,0); … … 627 625 h4->Draw("colz"); 628 626 h4->SetBit(kCanDelete); 627 catalog->Draw("mirror same"); 628 629 // PAD #3 630 pad->GetPad(1)->cd(3); 631 gPad->SetBorderMode(0); 632 fHist.GetZaxis()->SetRangeUser(fBgMean-fAlphaCut/2, fBgMean+fAlphaCut/2); 633 TH1 *h2 = fHist.Project3D("yx_off"); 634 h2->SetDirectory(NULL); 635 h2->SetXTitle(fHist.GetXaxis()->GetTitle()); 636 h2->SetYTitle(fHist.GetYaxis()->GetTitle()); 637 h2->Draw("colz"); 638 h2->SetBit(kCanDelete); 639 catalog->Draw("mirror same"); 640 641 // Initialize lower part 642 pad->cd(2); 643 gPad->SetBorderMode(0); 644 gPad->Divide(3, 1); 645 646 // PAD #4 647 pad->GetPad(2)->cd(1); 648 gPad->SetBorderMode(0); 649 TH1 *h1 = fHist.ProjectionZ("Alpha"); 650 h1->SetDirectory(NULL); 651 h1->SetTitle("Distribution of \\alpha"); 652 h1->SetXTitle(fHist.GetZaxis()->GetTitle()); 653 h1->SetYTitle("Counts"); 654 h1->Draw(opt); 655 h1->SetBit(kCanDelete); 656 657 // PAD #5 658 pad->GetPad(2)->cd(2); 659 gPad->SetBorderMode(0); 660 TH1 *h5 = (TH1*)h3->Clone("Alpha_yx_diff"); 661 h5->Add(h2, -1); 662 h5->SetTitle("Difference of on- and off-distribution"); 663 h5->SetDirectory(NULL); 664 h5->Draw("colz"); 665 h5->SetBit(kCanDelete); 666 catalog->Draw("mirror same"); 667 668 // PAD #6 669 pad->GetPad(2)->cd(3); 670 gPad->SetBorderMode(0); 671 TH1 *h0 = fHist.Project3D("yx_all"); 672 h0->SetDirectory(NULL); 673 h0->SetXTitle(fHist.GetXaxis()->GetTitle()); 674 h0->SetYTitle(fHist.GetYaxis()->GetTitle()); 675 h0->Draw("colz"); 676 h0->SetBit(kCanDelete); 629 677 catalog->Draw("mirror same"); 630 678 } … … 729 777 Form("Fit Region: Signal<%.1f\\circ, %.1f\\circ<Bg<%.1f\\circ", 730 778 sigmax, bgmin, bgmax)); 731 hists->SetName Title("Excess", Form("Number of excess events for \\alpha<%.0f\\circ", sigint));732 histb->SetName Title("Background", Form("Number of background events for \\alpha<%.0f\\circ", sigint));779 hists->SetName("Excess"); 780 histb->SetName("Background"); 733 781 hist->SetXTitle(fHist.GetXaxis()->GetTitle()); 734 782 hists->SetXTitle(fHist.GetXaxis()->GetTitle()); … … 776 824 *fLog << "Polynom order: " << (int)polynom << endl; 777 825 *fLog << "Fitting False Source Plot..." << flush; 826 827 TH1 *h0 = fHist.Project3D("yx_entries"); 828 Float_t entries = h0->GetMaximum(); 829 delete h0; 778 830 779 831 TH1 *h=0; … … 790 842 if (alpha0==0) 791 843 continue; 844 845 h->Scale(entries/h->GetEntries()); 792 846 793 847 if (alpha0>maxalpha0) … … 887 941 h0b.GetXaxis()->SetRangeUser(0, maxalpha0*1.5); 888 942 943 hists->SetTitle(Form("Excess events for \\alpha<%.0f\\circ (N_{max}=%d)", sigint, (int)hists->GetMaximum())); 944 histb->SetTitle(Form("Background events for \\alpha<%.0f\\circ", sigint)); 945 889 946 //hists->SetMinimum(GetMinimumGT(*hists)); 890 947 histb->SetMinimum(GetMinimumGT(*histb)); 948 949 MakeSymmetric(hists); 950 MakeSymmetric(hist); 891 951 892 952 clk.Stop(); … … 950 1010 951 1011 TH1 *result = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy); 1012 result->Scale(entries/h->GetEntries()); 1013 952 1014 result->SetDirectory(NULL); 953 1015 result->SetNameTitle("Result \\alpha", title); -
trunk/MagicSoft/Mars/mhist/MHFalseSource.h
r3666 r3682 29 29 Float_t fBgMean; // Background mean 30 30 31 Float_t fDistMin; // Min dist 32 Float_t fDistMax; // Maximum distance in percent of dist 31 Float_t fMinDist; // Min dist 32 Float_t fMaxDist; // Max dist 33 34 Float_t fMinLD; // Minimum distance in percent of dist 35 Float_t fMaxLD; // Maximum distance in percent of dist 33 36 34 37 TH3D fHist; // Alpha vs. x and y … … 40 43 void Modified(); 41 44 42 void ProjectOff(TH2D *h);43 void ProjectOn(TH2D *h);44 45 void ProjectAll(TH2D *h); 46 void ProjectOff(TH2D *h, TH2D *all); 47 void ProjectOn(TH2D *h, TH2D *all); 45 48 46 49 TObject *GetCatalog(); 50 51 void MakeSymmetric(TH1 *h); 47 52 48 53 public: … … 57 62 void FitSignificanceStd() { FitSignificance(); } //*MENU* 58 63 59 void SetDistMin(Float_t dist) { fDistMin = dist; } // Absolute minimum distance 60 void SetDistMax(Float_t ratio) { fDistMax = ratio; } // Maximum ratio between length/dist 64 void SetMinDist(Float_t dist) { fMinDist = dist; } // Absolute minimum distance 65 void SetMaxDist(Float_t dist) { fMaxDist = dist; } // Absolute maximum distance 66 void SetMinLD(Float_t ratio) { fMinLD = ratio; } // Minimum ratio between length/dist 67 void SetMaxLD(Float_t ratio) { fMaxLD = ratio; } // Maximum ratio between length/dist 61 68 62 69 void SetAlphaCut(Float_t alpha); //*MENU* -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r2414 r3682 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 2001 <mailto:tbretz@uni-sw.gwdg.de>19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 218 ! Author(s): Thomas Bretz, 2001 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2004 21 21 ! 22 22 ! … … 75 75 fHM3Long.SetDirectory(NULL); 76 76 fHM3Trans.SetDirectory(NULL); 77 fHMaxDist.SetDirectory(NULL); 77 78 78 79 fHAsym.UseCurrentStyle(); 79 80 fHM3Long.UseCurrentStyle(); 80 81 fHM3Trans.UseCurrentStyle(); 82 fHMaxDist.UseCurrentStyle(); 81 83 82 84 fHAsym.SetName("Asymmetry"); 83 85 fHM3Long.SetName("3rd Mom Long"); 84 86 fHM3Trans.SetName("3rd Mom Trans"); 87 fHMaxDist.SetName("Max Dist"); 85 88 86 89 fHAsym.SetTitle("Asymmetry"); 87 90 fHM3Long.SetTitle("3^{rd} Moment Longitudinal"); 88 91 fHM3Trans.SetTitle("3^{rd} Moment Transverse"); 92 fHMaxDist.SetTitle("Distance of max distant pixel"); 89 93 90 94 fHAsym.SetXTitle("Asym [mm]"); 91 95 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 92 96 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 97 fHMaxDist.SetXTitle("D_{max} [mm]"); 93 98 94 99 fHAsym.SetYTitle("Counts"); 95 100 fHM3Long.SetYTitle("Counts"); 96 101 fHM3Trans.SetYTitle("Counts"); 102 fHMaxDist.SetYTitle("Counts"); 97 103 98 104 fHAsym.SetFillStyle(4000); 99 105 fHM3Long.SetFillStyle(4000); 100 106 fHM3Trans.SetFillStyle(4000); 107 fHMaxDist.SetFillStyle(4000); 101 108 102 109 fHM3Trans.SetLineColor(kBlue); … … 104 111 MBinning bins; 105 112 106 bins.SetEdges( 101, -326, 326);113 bins.SetEdges(51, -326, 326); 107 114 bins.Apply(fHM3Long); 108 115 bins.Apply(fHM3Trans); 109 116 110 bins.SetEdges( 101, -593, 593);117 bins.SetEdges(51, -593, 593); 111 118 bins.Apply(fHAsym); 119 120 bins.SetEdges(101, 0, 593); 121 bins.Apply(fHMaxDist); 112 122 } 113 123 … … 143 153 ApplyBinning(*plist, "M3Long", &fHM3Long); 144 154 ApplyBinning(*plist, "M3Trans", &fHM3Trans); 155 ApplyBinning(*plist, "MaxDist", &fHMaxDist); 145 156 146 157 return kTRUE; … … 161 172 fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w); 162 173 fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w); 163 //fHAsymna.Fill(scale*ext.GetAsymna()); 164 //fHAsym0.Fill(scale*ext.GetAsym0()); 174 fHMaxDist.Fill(TMath::Abs(scale*fHillasExt->GetMaxDist()), w); 165 175 166 176 return kTRUE; … … 187 197 MH::ScaleAxis(&fHM3Long, scale); 188 198 MH::ScaleAxis(&fHM3Trans, scale); 199 MH::ScaleAxis(&fHMaxDist, scale); 189 200 190 201 if (mmscale) … … 193 204 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 194 205 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 206 fHMaxDist.SetXTitle("D_{max} [mm]"); 195 207 } 196 208 else … … 199 211 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]"); 200 212 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]"); 213 fHMaxDist.SetXTitle("D_{max} [\\circ]"); 201 214 } 202 215 … … 238 251 AppendPad(""); 239 252 240 pad->Divide(2, 1);253 pad->Divide(2, 2); 241 254 242 255 pad->cd(1); … … 244 257 MH::DrawSame(fHM3Long, fHM3Trans, "3^{rd} Moments"); 245 258 259 pad->cd(3); 260 gPad->SetBorderMode(0); 261 fHAsym.Draw(); 262 246 263 pad->cd(2); 247 264 gPad->SetBorderMode(0); 248 fHAsym.Draw(); 265 fHMaxDist.Draw(); 266 267 delete pad->GetPad(4); 249 268 250 269 pad->Modified(); … … 260 279 if (name.Contains("M3Trans", TString::kIgnoreCase)) 261 280 return &fHM3Trans; 281 if (name.Contains("MaxDist", TString::kIgnoreCase)) 282 return &fHMaxDist; 262 283 263 284 return NULL; -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r2043 r3682 19 19 TH1F fHM3Long; // [mm] 3rd moment (e-weighted) along major axis 20 20 TH1F fHM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 21 TH1F fHMaxDist; // [mm] Distance between shower center maximum distant pixel 21 22 22 23 Float_t fMm2Deg; -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r3568 r3682 19 19 ! Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 321 ! Copyright: MAGIC Software Development, 2000-2004 22 22 ! 23 23 ! … … 95 95 fHistCorePix.SetFillStyle(4000); 96 96 97 fHistUsedArea.SetName("UsedArea"); 98 fHistUsedArea.SetTitle("Area of used pixels"); 99 fHistUsedArea.SetXTitle("Area [m^2]"); 100 fHistUsedArea.SetYTitle("Counts"); 101 fHistUsedArea.SetDirectory(NULL); 102 fHistUsedArea.UseCurrentStyle(); 103 fHistUsedArea.SetLineColor(kBlue); 104 fHistUsedArea.SetFillStyle(4000); 105 106 fHistCoreArea.SetName("CoreArea"); 107 fHistCoreArea.SetTitle("Area of core pixels"); 108 fHistCoreArea.SetXTitle("Area [m^2]"); 109 fHistCoreArea.SetYTitle("Counts"); 110 fHistCoreArea.SetDirectory(NULL); 111 fHistCoreArea.UseCurrentStyle(); 112 fHistCoreArea.SetLineColor(kBlack); 113 fHistCoreArea.SetFillStyle(4000); 114 97 115 fHistConc.SetDirectory(NULL); 98 116 fHistConc1.SetDirectory(NULL); … … 121 139 bins.Apply(fHistConc1); 122 140 123 bins.SetEdges( 150, 0, 150);141 bins.SetEdges(75, 0, 150); 124 142 bins.Apply(fHistUsedPix); 125 143 bins.Apply(fHistCorePix); 144 145 bins.SetEdges(75, 0, 0.249); 146 bins.Apply(fHistUsedArea); 147 bins.Apply(fHistCoreArea); 126 148 } 127 149 … … 136 158 ApplyBinning(*plist, "Leakage", &fHistLeakage2); 137 159 138 ApplyBinning(*plist, "Pixels", &fHistUsedPix); 139 ApplyBinning(*plist, "Pixels", &fHistCorePix); 140 141 ApplyBinning(*plist, "Conc", &fHistConc); 142 ApplyBinning(*plist, "Conc1", &fHistConc1); 160 ApplyBinning(*plist, "Pixels", &fHistUsedPix); 161 ApplyBinning(*plist, "Pixels", &fHistCorePix); 162 163 ApplyBinning(*plist, "Area", &fHistUsedArea); 164 ApplyBinning(*plist, "Area", &fHistCoreArea); 165 166 ApplyBinning(*plist, "Conc", &fHistConc); 167 ApplyBinning(*plist, "Conc1", &fHistConc1); 143 168 144 169 return kTRUE; … … 166 191 fHistCorePix.Fill(h.GetNumCorePixels(), w); 167 192 193 fHistUsedArea.Fill(h.GetUsedArea()/1000000, w); 194 fHistCoreArea.Fill(h.GetCoreArea()/1000000, w); 195 168 196 fHistConc.Fill(h.GetConc(), w); 169 197 fHistConc1.Fill(h.GetConc1(), w); … … 203 231 pad->cd(4); 204 232 gPad->SetBorderMode(0); 233 MH::DrawSame(fHistCoreArea, fHistUsedArea, "Area of core/used Pixels"); 205 234 206 235 pad->Modified(); … … 222 251 if (name.Contains("CorePix", TString::kIgnoreCase)) 223 252 return &fHistCorePix; 253 if (name.Contains("UsedArea", TString::kIgnoreCase)) 254 return &fHistUsedArea; 255 if (name.Contains("CoreArea", TString::kIgnoreCase)) 256 return &fHistCoreArea; 224 257 225 258 return NULL; -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
r2043 r3682 14 14 { 15 15 private: 16 TH1F fHistLeakage1; //17 TH1F fHistLeakage2; //16 TH1F fHistLeakage1; // 17 TH1F fHistLeakage2; // 18 18 19 TH1F fHistUsedPix; // Number of used pixels20 TH1F fHistCorePix; // Number of core pixels19 TH1F fHistUsedPix; // Number of used pixels 20 TH1F fHistCorePix; // Number of core pixels 21 21 22 TH1F fHistConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 23 TH1F fHistConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 22 TH1F fHistUsedArea; // Area of used pixels 23 TH1F fHistCoreArea; // Area of core pixels 24 25 TH1F fHistConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 26 TH1F fHistConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 24 27 25 28 public: … … 31 34 TH1 *GetHistByName(const TString name); 32 35 33 TH1F &GetHistLeakage1() { return fHistLeakage1; }34 TH1F &GetHistLeakage2() { return fHistLeakage2; }36 TH1F &GetHistLeakage1() { return fHistLeakage1; } 37 TH1F &GetHistLeakage2() { return fHistLeakage2; } 35 38 36 TH1F &GetHistUsedPix() { return fHistUsedPix; }37 TH1F &GetHistCorePix() { return fHistCorePix; }39 TH1F &GetHistUsedPix() { return fHistUsedPix; } 40 TH1F &GetHistCorePix() { return fHistCorePix; } 38 41 39 TH1F &GetHistConc() { return fHistConc; } 40 TH1F &GetHistConc1() { return fHistConc1; } 42 TH1F &GetHistUsedArea() { return fHistUsedArea; } 43 TH1F &GetHistCoreArea() { return fHistCoreArea; } 44 45 TH1F &GetHistConc() { return fHistConc; } 46 TH1F &GetHistConc1() { return fHistConc1; } 41 47 42 48 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r3526 r3682 196 196 *fLog << " " << setw(7) << fErrors[i] << " ("; 197 197 *fLog << setw(3) << (int)(100.*fErrors[i]/GetNumExecutions()); 198 *fLog << "%) Evts skipped due to: " << str << endl;198 *fLog << "%) Evts skipped: " << str << endl; 199 199 } 200 200 … … 212 212 *fLog << GetDescriptor() << " execution statistics:" << endl; 213 213 *fLog << dec << setfill(' '); 214 PrintSkipped(1, " Event has less than 3 pixels\n (before image cleaning)");215 PrintSkipped(2, "Calculated Size == 0 \n (no pixels survived imagecleaning)");214 PrintSkipped(1, "Less than 3 pixels (before cleaning)"); 215 PrintSkipped(2, "Calculated Size == 0 (after cleaning)"); 216 216 PrintSkipped(3, "Number of used pixels < 3"); 217 217 PrintSkipped(4, "CorrXY==0"); -
trunk/MagicSoft/Mars/mimage/MHillasExt.cc
r3666 r3682 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! Author(s): Rudolf Bock 10/2001 <mailto:Rudolf.Bock@cern.ch> 20 20 ! Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-200 222 ! Copyright: MAGIC Software Development, 2000-2004 23 23 ! 24 24 ! … … 101 101 fM3Trans = 0; 102 102 103 fMaxDist = -1;103 fMaxDist = 0; 104 104 } 105 105 … … 170 170 const Double_t dy = gpix.GetY() - hil.GetMeanY(); // [mm] 171 171 172 const Double_t dist = dx*dx+dy*dy;173 if (dist>maxdist)174 maxdist=dist; // [mm^2]175 176 172 Double_t nphot = pix.GetNumPhotons(); // [1] 177 173 178 174 const Double_t dzx = hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm] 179 175 const Double_t dzy = -hil.GetSinDelta()*dx + hil.GetCosDelta()*dy; // [mm] 176 177 const Double_t dist = dx*dx+dy*dy; 178 if (TMath::Abs(dist)>TMath::Abs(maxdist)) 179 maxdist = dzx<0 ? -dist : dist; // [mm^2] 180 180 181 181 m3x += nphot * dzx*dzx*dzx; // [mm^3] … … 210 210 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm] 211 211 212 fMaxDist = TMath::Sqrt(maxdist); // [mm] 212 const Double_t md = TMath::Sqrt(TMath::Abs(maxdist)); 213 fMaxDist = maxdist<0 ? -md : md; // [mm] 213 214 214 215 SetReadyToSave(); … … 224 225 void MHillasExt::Set(const TArrayF &arr) 225 226 { 226 if (arr.GetSize() != 3)227 if (arr.GetSize() != 4) 227 228 return; 228 229 229 fAsym = arr.At(0); // [mm] fDist minus dist: center of ellipse, highest pixel 230 fM3Long = arr.At(1); // [mm] 3rd moment (e-weighted) along major axis 231 fM3Trans = arr.At(2); // [mm] 3rd moment (e-weighted) along minor axis 232 } 230 fAsym = arr.At(0); 231 fM3Long = arr.At(1); 232 fM3Trans = arr.At(2); 233 fMaxDist = arr.At(3); 234 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r3666 r3682 17 17 ! 18 18 ! Author(s): Wolfgang Wittek 03/2003 <mailto:wittek@mppmu.mpg.de> 19 ! Author(s): Thomas Bretz <mailto:tbretz@astro.uni-wuerzburg.de> 19 20 ! 20 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 29 30 // Storage Container for new image parameters 30 31 // 31 // fLeakage1 ratio: (photons in most outer ring of pixels) over fSize 32 // fLeakage2 ratio: (photons in the 2 outer rings of pixels) over fSize 33 // fNumSaturatedPixels: number of pixels in which at least one slice 34 // of the low gain FADC was saturated. 32 // Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize 33 // Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize 34 // Float_t fInnerLeakage1; // (photons in most outer rings of inner pixels) over fInnerSize 35 // Float_t fInnerLeakage2; // (photons in the 2 outer rings of inner pixels) over fInnerSize 36 // Float_t fInnerSize; // 37 // 38 // Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 39 // Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 40 // 41 // Float_t fUsedArea; // Area of pixels which survived the image cleaning 42 // Float_t fCoreArea; // Area of core pixels 43 // Short_t fNumUsedPixels; // Number of pixels which survived the image cleaning 44 // Short_t fNumCorePixels; // number of core pixels 45 // Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains 46 // Short_t fNumSaturatedPixels; // number of pixels with saturating lo-gains 35 47 // 36 48 // Version 2: … … 46 58 // - added fUsedArea 47 59 // - added fCoreArea 48 // 49 // 60 // 61 // 50 62 ///////////////////////////////////////////////////////////////////////////// 51 63 #include "MNewImagePar.h" … … 187 199 } 188 200 189 // Compute Concetration 1 -2 190 201 // Compute Concentration 1-2 191 202 if (nphot>maxpix1) 192 203 { … … 217 228 *fLog << all; 218 229 *fLog << "New Image Parameters (" << GetName() << ")" << endl; 219 *fLog << " - Leakage1 [1] = " << fLeakage1 << endl; 220 *fLog << " - Leakage2 [1] = " << fLeakage2 << endl; 221 *fLog << " - Conc [1] = " << fConc << " (ratio)" << endl; 222 *fLog << " - Conc1 [1] = " << fConc1 << " (ratio)" << endl; 223 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 224 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 225 *fLog << " - Sat. Pixels (HG) [#] = " << fNumHGSaturatedPixels << " Pixels" << endl; 226 *fLog << " - Sat. Pixels (LG) [#] = " << fNumSaturatedPixels << " Pixels" << endl; 227 } 230 *fLog << " - Leakage1 [1] = " << fLeakage1 << endl; 231 *fLog << " - Leakage2 [1] = " << fLeakage2 << endl; 232 *fLog << " - Conc [1] = " << fConc << " (ratio)" << endl; 233 *fLog << " - Conc1 [1] = " << fConc1 << " (ratio)" << endl; 234 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 235 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 236 *fLog << " - Used Area [mm^2] = " << fUsedArea << endl; 237 *fLog << " - Core Area [mm^2] = " << fCoreArea << endl; 238 *fLog << " - Sat.Pixels/HG [#] = " << fNumHGSaturatedPixels << " Pixels" << endl; 239 *fLog << " - Sat.Pixels/LG [#] = " << fNumSaturatedPixels << " Pixels" << endl; 240 } 241 242 // ------------------------------------------------------------------------- 243 // 244 // Print contents of MNewImagePar to *fLog, depending on the geometry in 245 // units of deg. 246 // 247 void MNewImagePar::Print(const MGeomCam &geom) const 248 { 249 *fLog << all; 250 *fLog << "New Image Parameters (" << GetName() << ")" << endl; 251 *fLog << " - Leakage1 [1] = " << fLeakage1 << endl; 252 *fLog << " - Leakage2 [1] = " << fLeakage2 << endl; 253 *fLog << " - Conc [1] = " << fConc << " (ratio)" << endl; 254 *fLog << " - Conc1 [1] = " << fConc1 << " (ratio)" << endl; 255 *fLog << " - Used Pixels [#] = " << fNumUsedPixels << " Pixels" << endl; 256 *fLog << " - Core Pixels [#] = " << fNumCorePixels << " Pixels" << endl; 257 *fLog << " - Used Area [deg^2] = " << fUsedArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl; 258 *fLog << " - Core Area [deg^2] = " << fCoreArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl; 259 *fLog << " - Sat.Pixels/HG [#] = " << fNumHGSaturatedPixels << " Pixels" << endl; 260 *fLog << " - Sat.Pixels/LG [#] = " << fNumSaturatedPixels << " Pixels" << endl; 261 } -
trunk/MagicSoft/Mars/mimage/MNewImagePar.h
r3666 r3682 43 43 Short_t GetNumCorePixels() const { return fNumCorePixels; } 44 44 45 Float_t Get NumUsedArea() const { return fUsedArea; }46 Float_t Get NumCoreArea() const { return fCoreArea; }45 Float_t GetUsedArea() const { return fUsedArea; } 46 Float_t GetCoreArea() const { return fCoreArea; } 47 47 48 48 Short_t GetNumSaturatedPixels() const { return fNumSaturatedPixels; } … … 50 50 51 51 void Print(Option_t *opt=NULL) const; 52 void Print(const MGeomCam &geom) const; 52 53 53 54 void Calc(const MGeomCam &geom, const MCerPhotEvt &evt, -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r3503 r3682 82 82 #include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&) 83 83 #include "MHillasSrc.h" // MHillasSrc::Print(const MGeomCam&) 84 #include "MNewImagePar.h" // MNewImagePar::Print(const MGeomCam&) 84 85 #include "MHEvent.h" // MHEvent 85 86 #include "MHCamera.h" // MHCamera … … 511 512 // Print parameters 512 513 // 513 ((MHillas*) plist->FindObject("MHillas"))->Print(*geom);514 ((MHillasExt*) plist->FindObject("MHillasExt"))->Print(*geom);515 ((MHillasSrc*) plist->FindObject("MHillasSrc"))->Print(*geom);516 plist->FindObject("MNewImagePar")->Print();514 ((MHillas*) plist->FindObject("MHillas"))->Print(*geom); 515 ((MHillasExt*) plist->FindObject("MHillasExt"))->Print(*geom); 516 ((MHillasSrc*) plist->FindObject("MHillasSrc"))->Print(*geom); 517 ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom); 517 518 518 519 //
Note:
See TracChangeset
for help on using the changeset viewer.