Changeset 9317 for trunk/MagicSoft
- Timestamp:
- 02/11/09 12:36:28 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9313 r9317 55 55 - added Print 56 56 - added a circle around the mirror showing fMaxR 57 58 * mastro/MAstro.cc: 59 - updated some typos in comments 60 61 * mbase/MEnv.cc: 62 - replaced Form by MString::Format 63 64 * mbase/MTask.cc: 65 - made the total number of executions really count the total 66 number 67 68 * mcalib/MCalibrationPatternDecode.cc: 69 - some cosmetics 70 - corrected the use of a wrong FindCreateObj 71 72 * mcorsika/MCorsikaRead.cc: 73 - added a comment 74 75 * mfileio/MWriteRootFile.cc: 76 - improved output 77 - improved the copy of a tree (now done without unpacking) 78 - made sure that copied trees are shown in the summary 79 - made sure that the copied trees are nevertheless deleted 80 81 * mfilter/MFDeltaT.cc: 82 - adapted to change in GetNumExecutions 83 84 * mhbase/MFillH.cc: 85 - set the number of executions (as it is in MTask) before the 86 execution 87 88 * mhbase/MH.cc: 89 - improved the statistics output 90 91 * mhist/MHCamera.[h,cc]: 92 - don't create an own pad anymore 93 - removed SetRange 94 - SetRange now done via MH::SetPadRange 95 - some sanity checks if fGeomCam is set 96 - some adaptions to the new layout scheme without 97 an own pad 98 - Changed DrawProjection to a more commonly usable scheme 99 - Removed all dependencies from MGeomCamMagic 100 - start the gaus fit with the maximum not the integral 101 102 * mjobs/MJCalibrateSignal.cc: 103 - If the input files contain an OriginalMC tree 104 copy it 105 - consequently we make the MMcEvtBasic from the 106 parameter-list optional 107 - fixed the rule (MC files with .root as extension could not 108 be processed) 109 110 * mjobs/MJCalibration.[h,cc], mjobs/MJPedestal.[h,cc]: 111 - Use MHCamera::CamDraw more extensively 112 - replace use of Form by MString::Format 113 114 * mjobs/MJSimulation.cc: 115 - added an option to switch the cmaera electronics off 116 - write some more containers to output file (for easy access) 117 - set the MC bit in the header 118 - now use MSimMMCS to "fake" the correct file structure 119 - added three new writers to write the MMcEvtBasic information 120 - added a display of the most important things 121 122 * mmain/MEventDisplay.cc: 123 - don't change into the not more existing pad of a MHCamera 124 125 * msimcamera/MSimCalibrationSignal.cc: 126 - adapted GetNumExecution 127 - SetReadyToSave for the run header 128 - jitter the number of emitted photons 129 - corrected the emitted trigger positon 130 - (re)set calibration pattern 57 131 58 132 -
trunk/MagicSoft/Mars/NEWS
r9308 r9317 41 41 42 42 * The daq event number now represents the readout number 43 44 * The camera ''electronics'' can now be ''switched off'' 45 46 * A new tab ''info'' now display basic things like the reflector 47 layout 43 48 44 49 -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r9316 r9317 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.11 5 2009-02-11 12:17:43tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.116 2009-02-11 12:25:42 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 2325 2325 } 2326 2326 } 2327 /* 2327 2328 2328 // -------------------------------------------------------------------------- 2329 2329 // … … 2339 2339 obj2->Draw(); 2340 2340 obj2->SetBit(kCanDelete); 2341 2341 /* 2342 2342 if (GetGeomCam().InheritsFrom("MGeomCamMagic")) 2343 2343 { … … 2375 2375 } 2376 2376 } 2377 */ 2377 2378 } 2378 2379 … … 2392 2393 obj2->Fit("pol0","Q",""); 2393 2394 obj2->GetFunction("pol0")->SetLineWidth(1); 2394 2395 /* 2395 2396 if (GetGeomCam().InheritsFrom("MGeomCamMagic")) 2396 2397 { … … 2415 2416 } 2416 2417 } 2417 }2418 2418 */ 2419 } 2420 2419 2421 // -------------------------------------------------------------------------- 2420 2422 // … … 2435 2437 // 2436 2438 void MHCamera::CamDraw(TCanvas &c, const Int_t x, const Int_t y, 2437 const Int_t fit, /*const Int_t rad, const Int_t azi,*/2439 const Int_t fit, const Int_t rad, const Int_t azi, 2438 2440 TObject *notify) 2439 2441 { … … 2455 2457 2456 2458 Int_t cnt = 2; 2457 /* 2459 2458 2460 if (rad) 2459 2461 { … … 2473 2475 cnt++; 2474 2476 } 2475 */ 2477 2476 2478 if (fit<0) 2477 2479 return; -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r9316 r9317 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.6 8 2009-02-11 12:17:43tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.h,v 1.69 2009-02-11 12:25:42 tbretz Exp $ 3 3 \* ======================================================================== */ 4 4 #ifndef MARS_MHCamera … … 230 230 TObject *DrawClone(Option_t *option="") const; 231 231 void DrawProjection (Int_t fit=0) const; 232 //void DrawRadialProfile() const;233 //void DrawAzimuthProfile() const;232 void DrawRadialProfile() const; 233 void DrawAzimuthProfile() const; 234 234 235 235 void SavePrimitive(ostream &out, Option_t *); … … 319 319 320 320 void CamDraw(TCanvas &c, const Int_t x, const Int_t y, 321 const Int_t fit, /*const Int_t rad=0, const Int_t azi=0,*/321 const Int_t fit, const Int_t rad=0, const Int_t azi=0, 322 322 TObject *notify=NULL); 323 323 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r9294 r9317 380 380 read->AddFiles(iter); 381 381 382 const TString fname(Form("s/([0-9]+(_M[12])?_[0-9.]+)_D_(.*[.])(raw ([.]gz)?)$/%s\\/$1_Y_$3root/",382 const TString fname(Form("s/([0-9]+(_M[12])?_[0-9.]+)_D_(.*[.])(raw|raw[.]gz|root)$/%s\\/$1_Y_$3root/", 383 383 Esc(fPathOut).Data())); 384 384 … … 758 758 MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW", "Calibrated Data"); 759 759 writemc.SetName("WriteMC"); 760 writemc.AddContainer("MMcEvtBasic", "OriginalMC"); 760 writemc.AddContainer("MMcEvtBasic", "OriginalMC", kFALSE); 761 if (fSequence.IsMonteCarlo()) 762 writemc.AddCopySource("OriginalMC"); 761 763 762 764 // Write the special calib tree -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r9017 r9317 19 19 ! Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 821 ! Copyright: MAGIC Software Development, 2000-2009 22 22 ! 23 23 ! … … 105 105 106 106 #include "MEnv.h" 107 #include "MString.h" 107 108 #include "MDirIter.h" 108 109 #include "MSequence.h" … … 551 552 if (fDisplayType == kDataCheckDisplay) 552 553 { 554 // -------------------- FitCharge ------------------- 553 555 554 556 TCanvas &c1 = fDisplay->AddTab("FitCharge"); 555 557 c1.Divide(3, 3); 556 558 557 // 558 // MEAN CHARGES 559 // 560 c1.cd(1); 561 gPad->SetBorderMode(0); 562 gPad->SetTicks(); 563 MHCamera *obj1=(MHCamera*)disp1.DrawCopy("hist"); 564 FixDataCheckHist(*obj1/*, fChargeMin, fChargeMax*/); 565 // DisplayReferenceLines(obj1,0); 566 567 c1.cd(4); 568 gPad->SetBorderMode(0); 569 obj1->SetPrettyPalette(); 570 obj1->Draw(); 571 572 c1.cd(7); 573 gPad->SetBorderMode(0); 574 gPad->SetTicks(); 575 TH1D *obj2 = (TH1D*)obj1->Projection(); 576 obj2->SetBit(kCanDelete); 577 obj2->Draw(); 578 FixDataCheckHist(*obj2); 579 //obj2->SetStats(1); 580 581 // 582 // RMS per Charge 583 // 584 c1.cd(2); 585 gPad->SetBorderMode(0); 586 gPad->SetTicks(); 587 MHCamera *obj3=(MHCamera*)disp36.DrawCopy("hist"); 588 FixDataCheckHist(*obj3/*, 0, fChargeMax*/); 589 // DisplayReferenceLines(obj3,0); 590 591 c1.cd(5); 592 gPad->SetBorderMode(0); 593 obj3->SetPrettyPalette(); 594 obj3->Draw(); 595 596 c1.cd(8); 597 gPad->SetBorderMode(0); 598 if (geomcam.InheritsFrom("MGeomCamMagic")) 599 DisplayDoubleProject(disp36/*, "dead", "noisy"*/); 600 601 // 602 // PHOTO ELECTRONS 603 // 604 c1.cd(3); 605 gPad->SetBorderMode(0); 606 gPad->SetTicks(); 607 MHCamera *obj4=(MHCamera*)disp5.DrawCopy("hist"); 608 FixDataCheckHist(*obj4/*, fChargeMin, fChargeMax*/); 609 // DisplayReferenceLines(obj3,0); 610 611 c1.cd(6); 612 gPad->SetBorderMode(0); 613 obj4->SetPrettyPalette(); 614 obj4->Draw(); 615 616 c1.cd(9); 617 gPad->SetBorderMode(0); 618 if (geomcam.InheritsFrom("MGeomCamMagic")) 619 DisplayDoubleProject(disp5/*, "dead", "noisy"*/); 620 621 // 622 // CONVERSION FACTORS 623 // 559 disp1.CamDraw( c1, 1, 3, 6); // MEAN CHARGES 560 disp36.CamDraw(c1, 2, 3, 6); // RMS per Charge 561 disp5.CamDraw( c1, 3, 3, 6); // PHOTO ELECTRONS 562 563 // -------------------- Conversion ------------------- 564 624 565 TCanvas &c2 = fDisplay->AddTab("Conversion"); 625 566 c2.Divide(3,3); 626 567 568 disp6.SetMinMax(fConvFADC2PheMin, fConvFADC2PheMax); 569 disp8.SetMinMax(fQEMin, fQEMax); 570 disp37.SetMinMax(fConvFADC2PheMin, fConvFADC2PheMax); 571 572 disp6.CamDraw( c2, 1, 3, 6); // CONVERSION FACTORS 573 disp8.CamDraw( c2, 2, 3, 6); // QUANTUM EFFICIENCY 574 disp37.CamDraw(c2, 3, 3, 6); // CONVERSION FADC TO PHOTONS 575 627 576 c2.cd(1); 628 gPad->SetBorderMode(0); 629 gPad->SetTicks(); 630 MHCamera *obj5=(MHCamera*)disp6.DrawCopy("hist"); 631 FixDataCheckHist(*obj5, fConvFADC2PheMin, fConvFADC2PheMax); 632 DisplayReferenceLines(obj5,2); 633 634 c2.cd(4); 635 gPad->SetBorderMode(0); 636 obj5->SetPrettyPalette(); 637 obj5->Draw(); 638 639 c2.cd(7); 640 gPad->SetBorderMode(0); 641 if (geomcam.InheritsFrom("MGeomCamMagic")) 642 DisplayDoubleProject(disp6/*, "noisy", "dead"*/); 643 644 // 645 // QUANTUM EFFICIENCY 646 // 577 DisplayReferenceLines(disp6, 2); 578 647 579 c2.cd(2); 648 gPad->SetBorderMode(0); 649 gPad->SetTicks(); 650 MHCamera *obj6=(MHCamera*)disp8.DrawCopy("hist"); 651 FixDataCheckHist(*obj6, fQEMin, fQEMax); 652 DisplayReferenceLines(obj6,0); 653 654 c2.cd(5); 655 gPad->SetBorderMode(0); 656 obj6->SetPrettyPalette(); 657 obj6->Draw(); 658 659 c2.cd(8); 660 gPad->SetBorderMode(0); 661 if (geomcam.InheritsFrom("MGeomCamMagic")) 662 DisplayDoubleProject(disp8/*, "noisy", "dead"*/); 663 664 // 665 // CONVERSION FADC TO PHOTONS 666 // 580 DisplayReferenceLines(disp8, 0); 581 667 582 c2.cd(3); 668 gPad->SetBorderMode(0); 669 gPad->SetTicks(); 670 MHCamera *obj7=(MHCamera*)disp37.DrawCopy("hist"); 671 FixDataCheckHist(*obj7, fConvFADC2PheMin, fConvFADC2PheMax); 672 DisplayReferenceLines(obj7,1); 673 674 c2.cd(6); 675 gPad->SetBorderMode(0); 676 obj7->SetPrettyPalette(); 677 obj7->Draw(); 678 c2.cd(9); 679 gPad->SetBorderMode(0); 680 if (geomcam.InheritsFrom("MGeomCamMagic")) 681 DisplayDoubleProject(disp37/*, "noisy", "dead"*/); 682 683 // 684 // ARRIVAL TIMES 685 // 583 DisplayReferenceLines(disp37, 1); 584 585 // -------------------- AbsTimes ------------------- 586 686 587 TCanvas &c3 = fDisplay->AddTab("AbsTimes"); 687 588 c3.Divide(2,3); 688 589 590 disp28.SetMinMax(fArrivalTimeMin, fArrivalTimeMax); 591 592 disp28.CamDraw(c3, 1, 2, 6); // Arrival times 593 disp29.CamDraw(c3, 2, 2, 6); // Arrival times rms 594 689 595 c3.cd(1); 690 gPad->SetBorderMode(0); 691 gPad->SetTicks(); 692 MHCamera *obj10=(MHCamera*)disp28.DrawCopy("hist"); 693 FixDataCheckHist(*obj10, fArrivalTimeMin, fArrivalTimeMax); 694 DisplayReferenceLines(obj10,3); 695 696 c3.cd(3); 697 gPad->SetBorderMode(0); 698 obj10->SetPrettyPalette(); 699 obj10->Draw(); 700 701 c3.cd(5); 702 gPad->SetBorderMode(0); 703 if (geomcam.InheritsFrom("MGeomCamMagic")) 704 DisplayDoubleProject(disp28/*, "early", "late"*/); 705 706 // 707 // ARRIVAL TIMES JITTER 708 // 596 DisplayReferenceLines(disp28, 3); 597 709 598 c3.cd(2); 710 gPad->SetBorderMode(0); 711 gPad->SetTicks(); 712 MHCamera *obj11=(MHCamera*)disp29.DrawCopy("hist"); 713 FixDataCheckHist(*obj11/*, fArrivalTimeMin, fArrivalTimeMax*/); 714 DisplayReferenceLines(obj11,4); 715 716 c3.cd(4); 717 gPad->SetBorderMode(0); 718 obj11->SetPrettyPalette(); 719 obj11->Draw(); 720 721 c3.cd(6); 722 gPad->SetBorderMode(0); 723 if (geomcam.InheritsFrom("MGeomCamMagic")) 724 DisplayDoubleProject(disp29/*, "", "jittering"*/); 599 DisplayReferenceLines(disp29, 4); 600 601 if (IsRelTimes()) 602 { 603 // -------------------- RelTimes ------------------- 604 605 TCanvas &c5 = fDisplay->AddTab("RelTimes"); 606 c5.Divide(2,3); 607 608 disp30.SetMinMax(fTimeOffsetMin, fTimeOffsetMax); 609 disp31.SetMinMax(fTimeResolutionMin, fTimeResolutionMax); 610 611 disp30.CamDraw(c5, 1, 2, 6); // MEAN REL. ARR. TIMES 612 disp31.CamDraw(c5, 2, 2, 6); // JITTER Rel. Arr. Times 613 614 c5.cd(1); 615 DisplayReferenceLines(disp30, 5); 616 617 c5.cd(2); 618 DisplayReferenceLines(disp31, 6); 619 } 620 621 // -------------------- Unsuitable ------------------- 725 622 726 623 // … … 754 651 obj9->SetPrettyPalette(); 755 652 obj9->Draw(); 756 757 if (IsRelTimes())758 {759 TCanvas &c5 = fDisplay->AddTab("RelTimes");760 c5.Divide(2,3);761 762 //763 // MEAN REL. ARR. TIMES764 //765 c5.cd(1);766 gPad->SetBorderMode(0);767 gPad->SetTicks();768 MHCamera *obj12=(MHCamera*)disp30.DrawCopy("hist");769 FixDataCheckHist(*obj12, fTimeOffsetMin, fTimeOffsetMax);770 DisplayReferenceLines(obj12,5);771 772 c5.cd(3);773 gPad->SetBorderMode(0);774 obj10->SetPrettyPalette();775 obj10->Draw();776 777 c5.cd(5);778 gPad->SetBorderMode(0);779 if (geomcam.InheritsFrom("MGeomCamMagic"))780 DisplayDoubleProject(disp30/*, "early", "late"*/);781 782 //783 // JITTER Rel. Arr. Times784 //785 c5.cd(2);786 gPad->SetBorderMode(0);787 gPad->SetTicks();788 MHCamera *obj13=(MHCamera*)disp31.DrawCopy("hist");789 FixDataCheckHist(*obj13, fTimeResolutionMin, fTimeResolutionMax);790 DisplayReferenceLines(obj13,6);791 792 c5.cd(4);793 gPad->SetBorderMode(0);794 obj13->SetPrettyPalette();795 obj13->Draw();796 797 c5.cd(6);798 gPad->SetBorderMode(0);799 if (geomcam.InheritsFrom("MGeomCamMagic"))800 DisplayDoubleProject(disp31/*, "too stable", "jittering"*/);801 802 }803 653 return; 804 654 } … … 989 839 } 990 840 } 991 992 993 void MJCalibration::DisplayReferenceLines(const MHCamera *cam, const Int_t what) const 841 842 void MJCalibration::DisplayReferenceLines(const MHCamera &hist, const Int_t what) const 994 843 { 844 MHCamera *cam = dynamic_cast<MHCamera*>(gPad->FindObject(hist.GetName())); 845 if (!cam) 846 return; 995 847 996 848 const MGeomCam *geom = cam->GetGeometry(); 997 849 998 Double_t x = geom->InheritsFrom("MGeomCamMagic") ? 397 : cam->GetNbinsX() ;850 const Double_t x = geom->InheritsFrom("MGeomCamMagic") ? 397 : cam->GetNbinsX() ; 999 851 1000 852 TLine line; … … 1728 1580 SetUsePINDiode(kFALSE); 1729 1581 1582 // Only display result if PreProcessing was successfull 1730 1583 const Int_t numexec = !fSequence.IsMonteCarlo() ? rawread.GetNumExecutions() : read.GetNumExecutions(); 1731 1584 if (numexec>0) … … 1877 1730 } 1878 1731 1732 1879 1733 void MJCalibration::DisplayDoubleProject(const MHCamera &cam) 1880 1734 { 1735 const UInt_t n = cam.GetGeometry()->GetNumAreas(); 1736 1881 1737 TVirtualPad *pad = gPad; 1882 pad->Divide( 2, 1, 1e-5, 1e-5);;1883 1884 for ( int i=0; i<2; i++)1738 pad->Divide(n, 1, 1e-5, 1e-5);; 1739 1740 for (UInt_t i=0; i<n; i++) 1885 1741 { 1886 1742 pad->cd(i+1); … … 1888 1744 gPad->SetTicks(); 1889 1745 1890 TH1D &h = *cam.ProjectionS(TArrayI(), TArrayI(1, &i), Form("%s_%s", cam.GetName(), i==0?"Inner":"Outer"));1746 TH1D &h = *cam.ProjectionS(TArrayI(), TArrayI(1, (Int_t*)&i), MString::Format("%s_%d", cam.GetName(), i)); 1891 1747 FixDataCheckHist(h); 1892 h.SetTitle( Form("%s %s",cam.GetTitle(), i==0?"Inner":"Outer"));1748 h.SetTitle(MString::Format("%s %d",cam.GetTitle(), i)); 1893 1749 h.SetDirectory(NULL); 1894 1750 h.SetBit(kCanDelete); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.h
r8990 r9317 122 122 123 123 void DisplayResult(MParList &plist); 124 void DisplayReferenceLines(const MHCamera *cam, const Int_t what) const;124 void DisplayReferenceLines(const MHCamera &hist, const Int_t what) const; 125 125 //void DisplayOutliers ( TH1D *hist, const char* whatsmall, const char* whatbig ) const; 126 126 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r9157 r9317 93 93 #include "MFDataMember.h" 94 94 95 // Display helpers96 #include "MJCalibration.h"97 98 95 ClassImp(MJPedestal); 99 96 … … 365 362 */ 366 363 if (fDisplayType == kDisplayDataCheck) 367 364 { 368 365 369 366 TCanvas &c3 = fDisplay->AddTab(fExtractionType!=kFundamental/*fExtractorResolution*/ ? "PedExtrd" : "Ped"); 370 367 c3.Divide(2,3); 371 368 369 if (fExtractionType==kFundamental) 370 disp0.SetMinMax(fPedestalMin, fPedestalMax); 371 disp1.SetMinMax(fPedRmsMin, fPedRmsMax); 372 373 disp0.CamDraw(c3, 1, 2, 0); // Don't devide, don't fit 374 disp1.CamDraw(c3, 2, 2, 6); // Divide, fit 375 372 376 c3.cd(1); 373 gPad->SetBorderMode(0); 374 gPad->SetTicks(); 375 MHCamera *obj1=(MHCamera*)disp0.DrawCopy("hist"); 376 // 377 // for the datacheck, fix the ranges!! 378 // 379 if (fExtractionType==kFundamental/*!fExtractorResolution*/) 380 { 381 obj1->SetMinimum(fPedestalMin); 382 obj1->SetMaximum(fPedestalMax); 383 } 384 // 385 // Set the datacheck sizes: 386 // 387 FixDataCheckHist((TH1D*)obj1); 388 // 389 // set reference lines 390 // 391 DisplayReferenceLines(obj1,0); 392 // 393 // end reference lines 394 // 395 c3.cd(3); 396 gPad->SetBorderMode(0); 397 obj1->SetPrettyPalette(); 398 obj1->Draw(); 399 400 c3.cd(5); 401 gPad->SetBorderMode(0); 402 gPad->SetTicks(); 403 TH1D *obj2 = (TH1D*)obj1->Projection(); 404 obj2->Draw(); 405 obj2->SetBit(kCanDelete); 406 obj2->Fit("gaus","Q"); 407 obj2->GetFunction("gaus")->SetLineColor(kYellow); 408 // 409 // Set the datacheck sizes: 410 // 411 FixDataCheckHist(obj2); 412 obj2->SetStats(1); 377 if (fExtractionType==kFundamental) 378 DisplayReferenceLines(disp0, 0); 413 379 414 380 c3.cd(2); 415 gPad->SetBorderMode(0); 416 gPad->SetTicks(); 417 MHCamera *obj3=(MHCamera*)disp1.DrawCopy("hist"); 418 // 419 // for the datacheck, fix the ranges!! 420 // 421 obj3->SetMinimum(fPedRmsMin); 422 obj3->SetMaximum(fPedRmsMax); 423 // 424 // Set the datacheck sizes: 425 // 426 FixDataCheckHist((TH1D*)obj3); 427 // 428 // set reference lines 429 // 430 DisplayReferenceLines(obj3,1); 431 432 c3.cd(4); 433 gPad->SetBorderMode(0); 434 obj3->SetPrettyPalette(); 435 obj3->Draw(); 436 437 c3.cd(6); 438 gPad->SetBorderMode(0); 439 440 if (geomcam.InheritsFrom("MGeomCamMagic")) 441 { 442 MJCalibration::DisplayDoubleProject(disp1); 443 return; 444 } 445 } 381 DisplayReferenceLines(disp1, 1); 382 383 return; 384 } 446 385 447 386 if (fExtractionType!=kFundamental/*fExtractorResolution*/) 448 387 { 449 388 450 389 TCanvas &c3 = fDisplay->AddTab(fExtractionType==kWithExtractor?"PedExtrd":"PedRndm"); 451 390 c3.Divide(2,3); 452 391 453 disp0.CamDraw(c3, 1, 2, 1); 454 disp1.CamDraw(c3, 2, 2, 6); 392 disp0.CamDraw(c3, 1, 2, 1); // Don't divide, fit 393 disp1.CamDraw(c3, 2, 2, 6); // Divide, fit 455 394 456 395 TCanvas &c13 = fDisplay->AddTab(fExtractionType==kWithExtractor?"DiffExtrd":"DiffRndm"); 457 396 c13.Divide(2,3); 458 397 459 disp9.CamDraw(c13, 1, 2, 5);460 disp10.CamDraw(c13, 2, 2, 5);461 return;462 463 } 464 465 void MJPedestal::DisplayReferenceLines(MHCamera *cam, const Int_t what) const 466 { 467 468 Double_t x = cam->GetNbinsX();469 398 disp9.CamDraw(c13, 1, 2, 1); 399 disp10.CamDraw(c13, 2, 2, 1); 400 } 401 } 402 403 void MJPedestal::DisplayReferenceLines(const MHCamera &hist, const Int_t what) const 404 { 405 MHCamera *cam = dynamic_cast<MHCamera*>(gPad->FindObject(hist.GetName())); 406 if (!cam) 407 return; 408 470 409 const MGeomCam *geom = cam->GetGeometry(); 471 410 472 if (geom->InheritsFrom("MGeomCamMagic")) 473 x = what ? 397 : cam->GetNbinsX(); 411 const Double_t x = geom->InheritsFrom("MGeomCamMagic") && what ? 397 : cam->GetNbinsX() ; 474 412 475 413 TLine line; … … 478 416 line.SetLineColor(kBlue); 479 417 480 TLegend *leg = new TLegend(0. 6,0.75,0.9,0.99);418 TLegend *leg = new TLegend(0.75,0.75,0.999,0.99); 481 419 leg->SetBit(kCanDelete); 482 420 … … 522 460 523 461 524 leg->AddEntry(l1, "Galactic Source","l");525 leg->AddEntry(l2, "Extra-Galactic Source","l");462 leg->AddEntry(l1, "Galactic","l"); 463 leg->AddEntry(l2, "Extra-Galactic","l"); 526 464 leg->AddEntry(l3, "Closed Lids","l"); 527 465 leg->Draw(); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r9157 r9317 87 87 88 88 void DisplayResult(const MParList &plist); 89 void DisplayReferenceLines( MHCamera *cam, const Int_t what) const;89 void DisplayReferenceLines(const MHCamera &hist, const Int_t what) const; 90 90 //void DisplayOutliers(TH1D *hist) const; 91 91 void FixDataCheckHist(TH1D *hist) const; -
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9309 r9317 34 34 // 35 35 // 36 // To switch off the simulation of the camera electronics, use: 37 // 38 // Camera: Off 39 // 40 // Note, that the border of the camera and the propertied of the cones 41 // are still simulated (simply because it is fast). Furthermore, this 42 // switches off the trigger for the output, i.e. all data which deposits 43 // at least one photon in at least one pixel is written to the output file. 44 // 45 // 36 46 // In case of a pedestal or calibration run the artificial trigger can 37 47 // be "switched off" and the cosmics trrigger "switched on" by setting … … 45 55 46 56 #include <TEnv.h> 57 #include <TCanvas.h> 47 58 48 59 // Core … … 86 97 87 98 #include "MHn.h" 99 #include "MHCamera.h" 88 100 #include "MHCamEvent.h" 89 101 #include "MHPhotonEvent.h" … … 95 107 #include "MParEnv.h" 96 108 #include "MPulseShape.h" 109 #include "MGeomCam.h" 97 110 98 111 #include "MPedestalCam.h" … … 110 123 // 111 124 MJSimulation::MJSimulation(const char *name, const char *title) 112 : fForceMode(kFALSE), f ForceTrigger(kFALSE)125 : fForceMode(kFALSE), fCamera(kTRUE) ,fForceTrigger(kFALSE) 113 126 { 114 127 fName = name ? name : "MJSimulation"; … … 120 133 fForceMode = GetEnv("ForceMode", fForceMode); 121 134 fForceTrigger = GetEnv("ForceTrigger", fForceTrigger); 135 fCamera = GetEnv("Camera", fCamera); 122 136 123 137 return kTRUE; 124 138 } 125 139 126 Bool_t MJSimulation::WriteResult( )140 Bool_t MJSimulation::WriteResult(const MParList &plist) 127 141 { 128 142 if (fPathOut.IsNull()) … … 135 149 cont.Add(const_cast<TEnv*>(GetEnv())); 136 150 //cont.Add(const_cast<MSequence*>(&fSequence)); 151 152 cont.Add(plist.FindObject("MPulseShape")); 153 cont.Add(plist.FindObject("MReflector")); 154 cont.Add(plist.FindObject("MGeomCam")); 155 cont.Add(plist.FindObject("GeomAPDs")); 137 156 138 157 if (fDisplay) … … 246 265 plist.AddToList(&shape); 247 266 267 // *** FIXME *** FIXME *** FIXME *** 268 plist.FindCreateObj("MMcRunHeader"); 269 248 270 MRawRunHeader header; 249 271 header.SetValidMagicNumber(); 250 272 //header.InitFadcType(3); 251 273 252 header.SetRun Info(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTData, 1, 1);274 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData); 253 275 if (args.GetNumArguments()==1) 254 276 { 255 277 if (!args.GetArgumentStr(0).CompareTo("pedestal", TString::kIgnoreCase)) 256 278 { 257 header.SetRun Info(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPedestal, 1, 1);279 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal); 258 280 header.SetSourceInfo("Pedestal"); 259 281 } 260 282 if (!args.GetArgumentStr(0).CompareTo("calibration", TString::kIgnoreCase)) 261 283 { 262 header.SetRun Info(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTCalibration, 1, 1);284 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration); 263 285 header.SetSourceInfo("Calibration"); 264 286 } 265 287 if (!args.GetArgumentStr(0).CompareTo("pointrun", TString::kIgnoreCase)) 266 header.SetRun Info(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPointRun, 1, 1);288 header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPointRun); 267 289 } 268 290 269 291 // FIXME: Move to MSimPointingPos, MSimCalibrationSignal 292 // Can we use this as input for MSimPointingPos? 270 293 header.SetObservation("On", "MonteCarlo"); 271 294 plist.AddToList(&header); … … 287 310 for (int i=0; i<args.GetNumArguments();i ++) 288 311 read.AddFile(args.GetArgumentStr(i)); 312 313 MSimMMCS simmmcs; 289 314 290 315 MSimAbsorption absapd("AbsorptionAPDs"); … … 385 410 const TString rule3(Form("s/cer([0-9]+)/%s\\/cam$1.root/", Esc(fPathOut).Data())); 386 411 387 MWriteRootFile write1( 2, rule1, fOverwrite?"RECREATE":"NEW", "Reflector file"); 388 MWriteRootFile write2( 2, rule2, fOverwrite?"RECREATE":"NEW", "Signal file"); 389 MWriteRootFile write3( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file"); 390 391 write1.SetName("WriteRef"); 392 write2.SetName("WriteSig"); 393 write3.SetName("WriteCam"); 394 395 write1.AddContainer("MCorsikaEvtHeader", "Events", kFALSE); 396 write1.AddContainer("MPhotonEvent", "Events"); 397 398 write2.AddContainer("MRawRunHeader", "RunHeaders"); 399 write2.AddContainer("MGeomCam", "RunHeaders"); 400 write2.AddContainer("MSignalCam", "Events"); 401 write2.AddContainer("MRawEvtHeader", "Events"); 402 write2.AddContainer("MPedPhotFromExtractorRndm", "RunHeaders"); 412 MWriteRootFile write3a( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file"); 413 MWriteRootFile write3b( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file"); 414 MWriteRootFile write2a( 2, rule2, fOverwrite?"RECREATE":"NEW", "Signal file"); 415 MWriteRootFile write2b( 2, rule2, fOverwrite?"RECREATE":"NEW", "Signal file"); 416 MWriteRootFile write1a( 2, rule1, fOverwrite?"RECREATE":"NEW", "Reflector file"); 417 MWriteRootFile write1b( 2, rule1, fOverwrite?"RECREATE":"NEW", "Reflector file"); 418 419 write1a.SetName("WriteRefData"); 420 write1b.SetName("WriteRefMC"); 421 write2a.SetName("WriteSigData"); 422 write2b.SetName("WriteSigMC"); 423 write3a.SetName("WriteCamData"); 424 write3b.SetName("WriteCamMC"); 425 426 write1a.AddContainer("MCorsikaEvtHeader", "Events", kFALSE); 427 write1a.AddContainer("MPhotonEvent", "Events"); 428 429 write2a.AddContainer("MCorsikaRunHeader", "RunHeaders", kFALSE); 430 write2a.AddContainer("MRawRunHeader", "RunHeaders"); 431 write2a.AddContainer("MGeomCam", "RunHeaders"); 432 write2a.AddContainer("MSignalCam", "Events"); 433 write2a.AddContainer("MRawEvtHeader", "Events", kFALSE); 434 write2a.AddContainer("MPedPhotFromExtractorRndm", "RunHeaders"); // FIXME: Needed for the signal files to be display in MARS 435 write2a.AddContainer("MMcRunHeader", "RunHeaders"); 403 436 /* Monte Carlo Headers 404 437 write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE); … … 417 450 //write.AddContainer("MTriggerPattern", "Events"); 418 451 419 write3.AddContainer("MRawEvtData", "Events"); 420 write3.AddContainer("MRawRunHeader", "RunHeaders"); 421 write3.AddContainer("MGeomCam", "RunHeaders"); 422 write3.AddContainer("MRawEvtHeader", "Events"); 423 write3.AddContainer("MPedestalCam", "RunHeaders", kFALSE); 452 write3a.AddContainer("MRawEvtData", "Events"); 453 write3a.AddContainer("MRawRunHeader", "RunHeaders"); 454 write3a.AddContainer("MGeomCam", "RunHeaders"); 455 write3a.AddContainer("MRawEvtHeader", "Events", kFALSE); 456 //write3.AddContainer("MPedestalCam", "RunHeaders", kFALSE); 457 write3a.AddContainer("MMcRunHeader", "RunHeaders"); 458 write3a.AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE); 459 write3a.AddContainer("MMcEvt", "Events", kFALSE); 460 461 write1b.AddContainer("MMcEvtBasic", "OriginalMC"); 462 write2b.AddContainer("MMcEvtBasic", "OriginalMC"); 463 write3b.AddContainer("MMcEvtBasic", "OriginalMC"); 424 464 425 465 // ------------------------------------------------------------------- … … 500 540 tasks.AddToList(&read); 501 541 tasks.AddToList(&pointing); 542 tasks.AddToList(&simmmcs); 543 if (!fPathOut.IsNull() && !HasNullOut()) 544 { 545 tasks.AddToList(&write1b); 546 tasks.AddToList(&write2b); 547 if (fCamera) 548 tasks.AddToList(&write3b); 549 } 502 550 // if (header.IsPointRun()) 503 551 // tasks.AddToList(&stars); … … 536 584 tasks.AddToList(&cont2); 537 585 } 538 if (header.IsPedestalRun() || header.IsCalibrationRun()) 539 tasks.AddToList(&simcal); 540 tasks.AddToList(&simnsb); 541 tasks.AddToList(&simapd); 542 tasks.AddToList(&simexcnoise); 586 if (fCamera) 587 { 588 if (header.IsPedestalRun() || header.IsCalibrationRun()) 589 tasks.AddToList(&simcal); 590 tasks.AddToList(&simnsb); 591 tasks.AddToList(&simapd); 592 tasks.AddToList(&simexcnoise); 593 } 543 594 tasks.AddToList(&simsum); 544 tasks.AddToList(&simcam); 545 if (header.IsDataRun() || fForceTrigger) 546 tasks.AddToList(&simtrig); 547 tasks.AddToList(&conttrig); 595 if (fCamera) 596 { 597 tasks.AddToList(&simcam); 598 if (header.IsDataRun() || fForceTrigger) 599 tasks.AddToList(&simtrig); 600 tasks.AddToList(&conttrig); 601 tasks.AddToList(&simdaq); 602 } 548 603 tasks.AddToList(&simsignal); // What do we do if signal<0? 549 tasks.AddToList(&simdaq);550 604 if (!fPathOut.IsNull() && !HasNullOut()) 551 605 { 552 tasks.AddToList(&write1 );606 tasks.AddToList(&write1a); 553 607 if (!header.IsPedestalRun()) 554 tasks.AddToList(&write2); 555 tasks.AddToList(&write3); 608 tasks.AddToList(&write2a); 609 if (fCamera) 610 tasks.AddToList(&write3a); 556 611 } 557 612 // ------------------------------- 558 if (header.IsDataRun()) 559 tasks.AddToList(&fillh3); 560 tasks.AddToList(&filltp); 613 if (fCamera) 614 { 615 if (header.IsDataRun()) 616 tasks.AddToList(&fillh3); 617 tasks.AddToList(&filltp); 618 } 561 619 if (header.IsDataRun()) 562 620 tasks.AddToList(&fillew); … … 574 632 //tasks.AddToList(&fillx5); 575 633 } 576 577 634 //------------------------------------------- 578 635 … … 587 644 return kFALSE; 588 645 646 //------------------------------------------- 647 589 648 if (binstr.IsDefault()) 590 649 binstr.SetEdgesLin(150, -shape.GetPulseWidth(), … … 592 651 593 652 header.Print(); 653 654 if (fDisplay) 655 { 656 TCanvas &c = fDisplay->AddTab("Info"); 657 c.Divide(2,2); 658 659 c.cd(1); 660 gPad->SetBorderMode(0); 661 gPad->SetFrameBorderMode(0); 662 gPad->SetGridx(); 663 gPad->SetGridy(); 664 gROOT->SetSelectedPad(0); 665 shape.DrawClone()->SetBit(kCanDelete); 666 667 if (header.IsDataRun() || header.IsPointRun()) 668 { 669 c.cd(3); 670 gPad->SetBorderMode(0); 671 gPad->SetFrameBorderMode(0); 672 gPad->SetGridx(); 673 gPad->SetGridy(); 674 gROOT->SetSelectedPad(0); 675 reflector.DrawClone("line")->SetBit(kCanDelete); 676 677 } 678 679 if (fCamera) 680 { 681 if (dynamic_cast<MGeomCam*>(env1.GetCont())) 682 { 683 c.cd(2); 684 gPad->SetBorderMode(0); 685 gPad->SetFrameBorderMode(0); 686 gPad->SetGridx(); 687 gPad->SetGridy(); 688 gROOT->SetSelectedPad(0); 689 MHCamera *c = new MHCamera(static_cast<MGeomCam&>(*env1.GetCont())); 690 c->SetStats(kFALSE); 691 c->SetBit(MHCamera::kNoLegend); 692 c->SetBit(kCanDelete); 693 c->Draw(); 694 695 } 696 697 if (dynamic_cast<MGeomCam*>(env2.GetCont())) 698 { 699 c.cd(4); 700 gPad->SetBorderMode(0); 701 gPad->SetFrameBorderMode(0); 702 gPad->SetGridx(); 703 gPad->SetGridy(); 704 gROOT->SetSelectedPad(0); 705 MHCamera *c = new MHCamera(static_cast<MGeomCam&>(*env2.GetCont())); 706 c->SetStats(kFALSE); 707 c->SetBit(MHCamera::kNoLegend); 708 c->SetBit(kCanDelete); 709 c->Draw(); 710 } 711 } 712 } 713 714 //------------------------------------------- 594 715 595 716 // Execute first analysis … … 607 728 //------------------------------------------- 608 729 609 if (!WriteResult( ))730 if (!WriteResult(plist)) 610 731 return kFALSE; 611 732 -
trunk/MagicSoft/Mars/mjobs/MJSimulation.h
r9309 r9317 8 8 class MHn; 9 9 class MArgs; 10 class MParList; 10 11 11 12 class MJSimulation : public MJob 12 13 { 13 14 private: 14 Bool_t fForceMode; // Force execution even if RUNE-section was not found 15 Bool_t fForceMode; // Force execution even if RUNE-section was not foundm 15 16 17 Bool_t fCamera; // Switch on/off camera (for fast reflector processing) 16 18 Bool_t fForceTrigger; // Force the use of the trigger "electronics" 17 19 18 Bool_t WriteResult( );20 Bool_t WriteResult(const MParList &plist); 19 21 Bool_t CheckEnvLocal(); 20 22 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r9303 r9317 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.6 7 2009-02-07 20:47:44tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.68 2009-02-11 12:31:47 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 717 717 { 718 718 TCanvas *c = GetCanvas(i); 719 c-> GetPad(1)->cd(1);719 c->cd(1); 720 720 721 721 TList *list = gPad->GetListOfPrimitives(); … … 839 839 if (!o) 840 840 break; 841 fCanvas->SetName(MString::Format("%p;%p;PixelContent", o->GetHist(), c->GetPad(1) ->GetPad(1)));841 fCanvas->SetName(MString::Format("%p;%p;PixelContent", o->GetHist(), c->GetPad(1))); 842 842 } 843 843 break; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r9309 r9317 105 105 void InitCamera(UShort_t type, UShort_t pix=0); 106 106 void InitPixels(UShort_t pix) { InitCamera((UShort_t)-1, pix); } 107 void SetRunInfo(UShort_t type, UShort_t tel, UInt_t run, UInt_t file=0); 108 void SetSourceInfo(const char src[80], char epoch='J', UShort_t date=2000); 107 void SetRunType(UShort_t type) { fRunType=type; } 108 void SetRunInfo(UShort_t tel, UInt_t run, UInt_t file=0); 109 void SetSourceInfo(const TString src, char epoch='J', UShort_t date=2000); 109 110 void SetRunTime(const MTime &start, const MTime &end); 110 111 void SetRunTimeMjd(Float_t start, Float_t stop) { fRunStart.SetMjd(start); fRunStop.SetMjd(stop); } 111 void SetObservation(const char mode[60], const char proj[100]);112 void SetObservation(const TString mode, const TString proj); 112 113 void SetNumEvents(UInt_t num); 113 114 void SetValidMagicNumber() { fMagicNumber=kMagicNumber; } -
trunk/MagicSoft/Mars/msimcamera/MSimCalibrationSignal.cc
r9306 r9317 160 160 Bool_t MSimCalibrationSignal::CallReInit() 161 161 { 162 if (GetNumExecutions() >0)162 if (GetNumExecutions()!=1) 163 163 return kTRUE; 164 164 … … 170 170 } 171 171 172 fRunHeader->SetReadyToSave(); 173 172 174 return tlist->ReInit(fParList); 173 175 } … … 190 192 for (UInt_t idx=0; idx<fGeom->GetNumPixels(); idx++) 191 193 { 194 const Int_t num = TMath::Nint(gRandom->Gaus(fNumPhotons, fNumPhotons/10)); 195 192 196 // FIXME: How does the distribution look like? Poissonian? 193 for ( UInt_t i=0; i<fNumPhotons; i++)197 for (Int_t i=0; i<num; i++) 194 198 { 195 199 MPhotonData &ph = fEvt->Add(cnt++); … … 212 216 // -------------------- MSimGeomCam --------------------- 213 217 218 // =====> Move to MSimReadoutWindow ? 219 214 220 const Double_t freq = fRunHeader->GetFreqSampling()/1000.; 215 221 … … 230 236 231 237 // FIXME: Jitter! (Own class?) 232 fTrigger->SetVal( pp*freq);238 fTrigger->SetVal((pp+pw)*freq); 233 239 fTrigger->SetReadyToSave(); 234 240 … … 236 242 const UInt_t p = fRunHeader->IsCalibrationRun() ? MTriggerPattern::kCalibration : MTriggerPattern::kPedestal; 237 243 fEvtHeader->SetTriggerPattern(~(p | (p<<8))); 244 fEvtHeader->SetCalibrationPattern(0/*BIT(16)<<16*/); // CT1 Pulser, see MCalibrationPatternDecode 238 245 fEvtHeader->SetReadyToSave(); 239 246
Note:
See TracChangeset
for help on using the changeset viewer.