- Timestamp:
- 10/26/04 15:04:42 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
r5248 r5319 74 74 // 75 75 76 fwhm_resp = RESPONSE_FWHM 77 ampl_resp = RESPONSE_AMPLITUDE 76 fwhm_resp = RESPONSE_FWHM; 77 ampl_resp = RESPONSE_AMPLITUDE; 78 78 79 79 overlaping_time = TRIGGER_OVERLAPING; 80 80 81 threshold = CHANNEL_THRESHOLD 82 83 84 gate_leng = TRIGGER_GATE 85 trigger_multi = TRIGGER_MULTI 86 trigger_geometry = TRIGGER_GEOM 81 threshold = CHANNEL_THRESHOLD; 82 83 84 gate_leng = TRIGGER_GATE; 85 trigger_multi = TRIGGER_MULTI; 86 trigger_geometry = TRIGGER_GEOM; 87 87 88 88 // … … 234 234 235 235 236 // 237 // the amplitude of one single photo electron is not a constant. 238 // There exists a measured distribution from Razmik. This distribution 239 // is used to simulate the noise of the amplitude. 240 // For this a histogramm (histPmt) is created and filled with the 241 // values. 242 // 243 244 histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ; 245 246 Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08, 2.15, 247 2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20, 2.10, 248 1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65, 0.50, 249 0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 250 0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ; 251 252 histMean = histPmt->GetMean() ; 253 254 for (i=0;i<41;i++){ 255 histPmt->SetBinContent(i,ValRazmik[i]); 256 } 257 258 histMean = histPmt->GetMean() ; 236 // Initialize histogram histPmt which represents the distribution of amplitudes 237 // of the PMT response to a single photpelectron. 238 239 InitGainFluctuations(); 240 259 241 260 242 // … … 481 463 peak_time = ( (Float_t) imax ) / ( (Float_t) TRIG_SLICES_PER_NSEC ) ; 482 464 483 // 484 // the amplitude of one single photo electron is not a constant. 485 // There exists a measured distribution from Razmik. This distribution 486 // is used to simulate the noise of the amplitude. 487 // For this a histogramm (histPmt) is created and filled with the 488 // values. 489 // 490 465 466 // Initialize histogram histPmt which represents the distribution of amplitudes 467 // of the PMT response to a single photpelectron. 468 469 InitGainFluctuations(); 470 471 // 472 // Change name of histogram (tag with CT id) to avoid confusion in the case of 473 // multi-telescope simulations. 474 // 491 475 char histname[32]; 492 476 sprintf(histname, "histPmt_%d", ct_id); 493 histPmt = new TH1F (histname,"Noise of PMT", 40, 0., 40.) ; 494 495 Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08, 2.15, 496 2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20, 2.10, 497 1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65, 0.50, 498 0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 499 0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ; 500 501 histMean = histPmt->GetMean() ; 502 503 for (i=0;i<41;i++){ 504 histPmt->SetBinContent(i,ValRazmik[i]); 505 } 506 507 histMean = histPmt->GetMean() ; 477 histPmt->SetName(histname); 478 508 479 509 480 // … … 644 615 // 645 616 646 fwhm_resp = fwhm 647 ampl_resp = ampl 617 fwhm_resp = fwhm; 618 ampl_resp = ampl; 648 619 649 620 overlaping_time = overt; 650 621 651 622 652 threshold = CHANNEL_THRESHOLD 653 654 655 gate_leng = gate 656 trigger_multi = TRIGGER_MULTI 657 trigger_geometry = TRIGGER_GEOM 623 threshold = CHANNEL_THRESHOLD; 624 625 626 gate_leng = gate; 627 trigger_multi = TRIGGER_MULTI; 628 trigger_geometry = TRIGGER_GEOM; 658 629 659 630 cout << endl … … 710 681 peak_time = ( (Float_t) imax ) / ( (Float_t) TRIG_SLICES_PER_NSEC ) ; 711 682 712 // 713 // the amplitude of one single photo electron is not a constant. 714 // There exists a measured distribution from Razmik. This distribution 715 // is used to simulate the noise of the amplitude. 716 // For this a histogramm (histPmt) is created and filled with the 717 // values. 718 // 719 720 histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ; 721 722 Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08, 2.15, 723 2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20, 2.10, 724 1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65, 0.50, 725 0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 726 0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ; 727 728 histMean = histPmt->GetMean() ; 729 730 for (i=0;i<41;i++){ 731 histPmt->SetBinContent(i,ValRazmik[i]); 732 } 733 734 histMean = histPmt->GetMean() ; 683 684 // Initialize histogram histPmt which represents the distribution of amplitudes 685 // of the PMT response to a single photpelectron. 686 687 InitGainFluctuations(); 688 735 689 736 690 // … … 931 885 // the FADC simulation 932 886 // 933 PmtAmp = (histPmt->GetRandom()/histMean) ; 887 if (fGainFluctuations) 888 PmtAmp = (histPmt->GetRandom()/histMean) ; 889 else 890 PmtAmp = 1.0; 934 891 935 892 // AM April 2004: removed updating of counters nphotshow, nphotnsb, … … 960 917 961 918 // 962 // get the randomized amplitude 963 // 964 PmtAmp = (histPmt->GetRandom()/histMean) ; 919 // get the randomized amplitude (unless fGainFluctuations == kFALSE) 920 // 921 if (fGainFluctuations) 922 PmtAmp = (histPmt->GetRandom()/histMean) ; 923 else 924 PmtAmp = 1.0; 965 925 966 926 // … … 1061 1021 Float_t rausch ; 1062 1022 1063 rausch = RESPONSE_AMPLITUDE* factor ;1023 rausch = ampl_resp * factor ; 1064 1024 1065 1025 cout<<"MTrigger::SetElecNoise ... generating database for electronic noise." … … 1080 1040 // to the signal 1081 1041 // 1082 Float_t rausch ;1083 1084 rausch = RESPONSE_AMPLITUDE * factor ;1085 1042 1086 1043 UInt_t startslice; … … 1900 1857 1901 1858 } 1859 1860 //================================================================= 1861 1862 void MTrigger::InitGainFluctuations() 1863 { 1864 // 1865 // The amplitude of one single photo electron is not a constant. 1866 // There exists a measured distribution from Razmik. This distribution 1867 // is used to simulate the noise of the amplitude. 1868 // For this a histogramm (histPmt) is created and filled with the 1869 // values. 1870 // 1871 1872 histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ; 1873 1874 Stat_t ValRazmik[40] = { 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08, 2.15, 1875 2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20, 2.10, 1876 1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65, 0.50, 1877 0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 1878 0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ; 1879 1880 for (Int_t i = 0; i < 40; i++) 1881 histPmt->SetBinContent(i+1 ,ValRazmik[i]); 1882 1883 histMean = histPmt->GetMean() ; 1884 1885 fGainFluctuations = kTRUE; // Default value 1886 1887 return; 1888 }
Note:
See TracChangeset
for help on using the changeset viewer.