Changeset 9425 for trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
- Timestamp:
- 04/16/09 12:04:29 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
r9420 r9425 108 108 #include "MReflector.h" 109 109 #include "MParEnv.h" 110 #include "MPulseShape.h" 110 #include "MSpline3.h" 111 #include "MParSpline.h" 111 112 #include "MGeomCam.h" 112 113 … … 152 153 //cont.Add(const_cast<MSequence*>(&fSequence)); 153 154 154 cont.Add(plist.FindObject(" MPulseShape"));155 cont.Add(plist.FindObject("PulseShape")); 155 156 cont.Add(plist.FindObject("Reflector")); 156 157 cont.Add(plist.FindObject("MGeomCam")); … … 185 186 hist.SetLog(kTRUE, kTRUE, kFALSE); 186 187 187 hist.AddHist("-MCorsikaEvtHeader.fX/100","-MCorsikaEvtHeader.fY/100"); 188 hist.SetDrawOption("colz"); 189 hist.InitName("Impact;Impact;Impact"); 190 hist.InitTitle("Impact;West <--> East [m];South <--> North [m]"); 188 /* 189 hist.AddHist("-MCorsikaEvtHeader.fX/100","-MCorsikaEvtHeader.fY/100"); 190 hist.SetDrawOption("colz"); 191 hist.InitName("Impact;Impact;Impact"); 192 hist.InitTitle("Impact;West <--> East [m];South <--> North [m]"); 193 hist.SetAutoRange(); 194 */ 195 196 hist.AddHist("MCorsikaEvtHeader.GetImpact/100"); 197 hist.InitName("Impact"); 198 hist.InitTitle("Impact;Impact [m]"); 191 199 hist.SetAutoRange(); 192 200 … … 197 205 hist.AddHist("(MCorsikaEvtHeader.fAz+MCorsikaRunHeader.fMagneticFieldAz)*TMath::RadToDeg()", "MCorsikaEvtHeader.fZd*TMath::RadToDeg()"); 198 206 hist.InitName("SkyOrigin;Az;Zd"); 199 hist.InitTitle("Sky Origin;Az [ deg];Zd [deg]");207 hist.InitTitle("Sky Origin;Az [\\deg];Zd [\\deg]"); 200 208 hist.SetDrawOption("colz"); 201 209 hist.SetAutoRange(); … … 279 287 plist.FindCreateObj("MPedPhotCam", "MPedPhotFromExtractorRndm"); 280 288 281 MP ulseShape shape;289 MParSpline shape("PulseShape"); 282 290 plist.AddToList(&shape); 283 291 … … 325 333 read.SetForceMode(fForceMode); 326 334 327 for (int i=0; i<args.GetNumArguments(); i++)335 for (int i=0; i<args.GetNumArguments(); i++) 328 336 read.AddFile(args.GetArgumentStr(i)); 329 337 330 338 MSimMMCS simmmcs; 331 339 340 MParSpline splinepde("PhotonDetectionEfficiency"); 341 MParSpline splinemirror("MirrorReflectivity"); 342 MParSpline splinecones("ConesAngularAcceptance"); 343 plist.AddToList(&splinepde); 344 plist.AddToList(&splinemirror); 345 plist.AddToList(&splinecones); 346 332 347 MSimAtmosphere simatm; 333 MSimAbsorption absapd("PhotonDetectionEfficiency"); 334 MSimAbsorption absmir("MirrorReflectivity"); 335 MSimAbsorption cones("ConesAngularAcceptance"); 348 MSimAbsorption absapd("SimPhotonDetectionEfficiency"); 349 MSimAbsorption absmir("SimMirrorReflectivity"); 350 MSimAbsorption cones("SimConesAngularAcceptance"); 351 absapd.SetParName("PhotonDetectionEfficiency"); 352 absmir.SetParName("MirrorReflectivity"); 353 cones.SetParName("ConesAngularAcceptance"); 336 354 cones.SetUseTheta(); 337 355 … … 344 362 MContinue cont1("MPhotonEvent.GetNumPhotons<1", "ContEmpty1"); 345 363 MContinue cont2("MPhotonEvent.GetNumPhotons<1", "ContEmpty2"); 364 MContinue cont3("MPhotonEvent.GetNumPhotons<2", "ContEmpty3"); 346 365 347 366 // ------------------------------------------------------------------- 348 367 349 368 MBinning binse( 100, 1, 100000, "BinningEnergy", "log"); 350 MBinning binsth( 35, 0.9, 900000, "BinningThreshold", "log");369 MBinning binsth( 70, 0.9, 900000, "BinningThreshold", "log"); 351 370 MBinning binsee( 35, 0.9, 900000, "BinningEnergyEst", "log"); 352 371 MBinning binss( 100, 1, 10000000, "BinningSize", "log"); 353 MBinning binsi( 100, -500, 500, "BinningImpact"); 372 // MBinning binsi( 100, -500, 500, "BinningImpact"); 373 MBinning binsi( 55, 0, 1100, "BinningImpact"); 354 374 MBinning binsh( 150, 0, 50, "BinningHeight"); 355 375 MBinning binsaz(720, -360, 360, "BinningAz"); … … 377 397 plist.AddToList(&binsd0); 378 398 379 MHn mhn1, mhn2, mhn3 ;399 MHn mhn1, mhn2, mhn3, mhn4; 380 400 SetupHist(mhn1); 381 401 SetupHist(mhn2); 382 402 SetupHist(mhn3); 383 384 MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth"); 403 SetupHist(mhn4); 404 405 MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-PulseShape.GetWidth"); 385 406 mhtp.SetName("TrigPos"); 386 407 mhtp.SetTitle("Trigger position w.r.t. the first photon hitting a detector"); … … 397 418 MFillH fillh2(&mhn2, "", "FillH2"); 398 419 MFillH fillh3(&mhn3, "", "FillH3"); 420 MFillH fillh4(&mhn4, "", "FillH4"); 399 421 MFillH filltp(&mhtp, "", "FillTriggerPos"); 400 422 MFillH fillew(&mhew, "", "FillEvtWidth"); … … 403 425 fillh2.SetNameTab("Detectable", "Distribution of events hit the detector"); 404 426 fillh3.SetNameTab("Triggered", "Distribution of triggered events"); 427 fillh4.SetNameTab("Cleaned", "Distribution after cleaning and cuts"); 405 428 filltp.SetNameTab("TrigPos", "TriggerPosition w.r.t the first photon"); 406 429 fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting a detector"); … … 491 514 simcal.SetNameGeomCam("GeomCones"); 492 515 493 // Dark Current: 4MHz = 0.004 GHz494 // Light of night sky at La Palma: ~ 0.2 ph / cm^2 / sr / ns495 // 5deg camera: 6e-3 sr496 // NSB = 0.2*6e-3497 498 // MAGIC: 84MHz / Pixel499 // DWARF: 14MHz-25Mhz / APD500 501 516 // FIXME: Simulate photons before cones and QE! 502 517 503 518 MSimRandomPhotons simnsb; 504 simnsb.SetFreq( 0.0015, 0.04); // 1.5MHz dark count rate, 40MHZ/cm^2 NSB519 simnsb.SetFreq(5.8, 0.004); // ph/m^2/nm/sr/ns NSB, 4MHz dark count rate 505 520 simnsb.SetNameGeomCam("GeomCones"); 506 521 … … 509 524 510 525 MSimAPD simapd; 511 //simapd.SetFreq(0.04); // Must be identical to MSimRandomPhotons!!512 526 simapd.SetNameGeomCam("GeomCones"); 513 527 … … 555 569 MFillH fillx0d(&evt0d, "MSignalCam", "FillArrTm"); 556 570 MFillH fillx1("MHHillas", "MHillas", "FillHillas"); 557 //MFillH fillx2("MHHillasExt", "", "FillHillasExt");558 571 MFillH fillx3("MHHillasSrc", "MHillasSrc", "FillHillasSrc"); 572 MFillH fillx4("MHNewImagePar", "MNewImagePar", "FillNewImagePar"); 559 573 MFillH fillth("MHThreshold", "", "FillThreshold"); 560 574 MFillH fillca("MHCollectionArea", "", "FillTrigArea"); 561 //MFillH fillx4("MHImagePar", "MImagePar", "FillImagePar");562 //MFillH fillx5("MHNewImagePar", "MNewImagePar", "FillNewImagePar");563 575 564 576 fillth.SetNameTab("Threshold"); … … 603 615 } 604 616 tasks.AddToList(&cones); 605 tasks.AddToList(&fillF2);606 617 //if (header.IsPointRun()) 607 618 // tasks.AddToList(&fillP); 608 619 tasks.AddToList(&cont1); 609 if (!header.IsPointRun())610 tasks.AddToList(&fillh2);611 620 } 612 621 // ------------------------------- … … 617 626 tasks.AddToList(&simgeom); 618 627 tasks.AddToList(&cont2); 628 if (!header.IsPointRun()) 629 { 630 tasks.AddToList(&fillF2); 631 tasks.AddToList(&fillh2); 632 } 633 tasks.AddToList(&cont3); 619 634 } 620 635 if (fCamera) … … 669 684 //tasks.AddToList(&fillx2); 670 685 tasks.AddToList(&fillx3); 671 //tasks.AddToList(&fillx4);686 tasks.AddToList(&fillx4); 672 687 //tasks.AddToList(&fillx5); 673 688 } 674 689 if (header.IsDataRun()) 675 690 { 691 tasks.AddToList(&fillh4); 676 692 tasks.AddToList(&fillth); 677 693 tasks.AddToList(&fillca); … … 695 711 696 712 if (binstr.IsDefault()) 697 binstr.SetEdgesLin(150, -shape.Get PulseWidth(),698 header.GetFreqSampling()/1000.*header.GetNumSamples()+shape.Get PulseWidth());713 binstr.SetEdgesLin(150, -shape.GetWidth(), 714 header.GetFreqSampling()/1000.*header.GetNumSamples()+shape.GetWidth()); 699 715 700 716 if (binsd.IsDefault() && cam) … … 731 747 gROOT->SetSelectedPad(0); 732 748 static_cast<MReflector*>(env0.GetCont())->DrawClone("line")->SetBit(kCanDelete); 733 734 749 } 735 750 … … 749 764 c->SetBit(kCanDelete); 750 765 c->Draw(); 751 752 766 } 753 767 … … 767 781 } 768 782 } 783 784 TCanvas &d = fDisplay->AddTab("Info2"); 785 d.Divide(2,2); 786 787 d.cd(1); 788 gPad->SetBorderMode(0); 789 gPad->SetFrameBorderMode(0); 790 gPad->SetGridx(); 791 gPad->SetGridy(); 792 gROOT->SetSelectedPad(0); 793 splinepde.DrawClone()->SetBit(kCanDelete); 794 795 d.cd(2); 796 gPad->SetBorderMode(0); 797 gPad->SetFrameBorderMode(0); 798 gPad->SetGridx(); 799 gPad->SetGridy(); 800 gROOT->SetSelectedPad(0); 801 splinemirror.DrawClone()->SetBit(kCanDelete); 802 803 d.cd(3); 804 gPad->SetBorderMode(0); 805 gPad->SetFrameBorderMode(0); 806 gPad->SetGridx(); 807 gPad->SetGridy(); 808 gROOT->SetSelectedPad(0); 809 splinecones.DrawClone()->SetBit(kCanDelete); 810 811 d.cd(4); 812 gPad->SetBorderMode(0); 813 gPad->SetFrameBorderMode(0); 814 gPad->SetGridx(); 815 gPad->SetGridy(); 816 gROOT->SetSelectedPad(0); 817 MParSpline *all = (MParSpline*)splinepde.DrawClone(); 818 //all->SetTitle("Combined acceptance"); 819 all->SetBit(kCanDelete); 820 all->Multiply(*splinemirror.GetSpline()); 769 821 } 770 822
Note:
See TracChangeset
for help on using the changeset viewer.