Changeset 5318 for trunk/MagicSoft/Simulation/Detector
- Timestamp:
- 10/26/04 15:02:32 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r5305 r5318 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.7 8$23 // $Revision: 1.79 $ 24 24 // $Author: moralejo $ 25 // $Date: 2004-10-2 1 17:44:07$25 // $Date: 2004-10-26 14:02:32 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 827 827 828 828 log(SIGNATURE, 829 "%s:\n\t%20s: %s\n\t%20s: %s\n\t%20s: %s\n\t%20s: %s %3.2f, %s %3.2f (%s), %3.2f (%s) + %3.2f (%s) %s\n",829 "%s:\n\t%20s: %s\n\t%20s: %s\n\t%20s: %s\n\t%20s: %s\n\t\t %s %3.2f,\n\t\t %s %3.2f (%s), %3.2f (%s) \n\t\t + %3.2f (%s)\n\n", 830 830 "Flags", 831 831 "Data_From_STDIN", ONoff(Data_From_STDIN), 832 832 "Write_All_Events", ONoff(Write_All_Images), 833 833 "Rotate Starfield", ONoff(Starfield_rotate), 834 "Electronic Noise", "trigger (rel. noise): ", Trigger_noise, 835 "FADC (ADC counts): ", FADC_noise_inner, "inner pixels", 836 FADC_noise_outer, "outer pixels", 837 DIGITAL_noise, "added digital noise at FADC", ONoff(addElecNoise) 834 "Electronic Noise", ONoff(addElecNoise), 835 "Trigger noise (amplitude relative to that of single phe): ", 836 Trigger_noise, 837 "FADC noise (ADC counts): ", FADC_noise_inner, "inner p.", 838 FADC_noise_outer, "outer p.", 839 DIGITAL_noise, "added digital noise at FADC" 838 840 ); 841 842 if (! apply_gain_fluctuations()) 843 log(SIGNATURE, "PMT gain fluctuations have been switched OFF in the input card.\n\n"); 839 844 840 845 // log flags information … … 931 936 Trigger_response_fwhm, i); //@< A instance of the Class MTrigger 932 937 Trigger_CT[i]->SetSeed(UInt_t(i+get_seeds(0))); 938 939 if ( ! apply_gain_fluctuations()) 940 Trigger_CT[i]->SetGainFluctuations(kFALSE); 933 941 } 934 942 … … 4033 4041 // totally equivalent to having made +- 1 FADC slice 4034 4042 4035 float fadc_jitter = (1./fadc->GetFadcSlicesPerNanosec()) * random.Uniform(0., 1.); 4043 float fadc_jitter = (1./fadc->GetFadcSlicesPerNanosec()) * random.Uniform(0., 1.); //ns 4036 4044 4037 4045 //- - - - - - - - - - - - - - - - - - - - - - - - - … … 4471 4479 int *ntotphot = new int[ct_Number]; 4472 4480 float *nphe_from_nsb = new float[ct_Number]; 4473 4474 float timefirst = 0.; 4475 float timelast = 0.; 4481 float *pulsetime = new float[ct_Number]; 4476 4482 4477 4483 float lambda, sigma_lambda, phot_per_pix, sigma_time; 4478 4484 UInt_t *first_pixel, *last_pixel; 4479 4485 int selected_pixel; 4486 4487 TRandom random; 4488 random.SetSeed((UInt_t)(get_seeds(0)*get_seeds(0))); 4489 4490 for (int ict = 0; ict < ct_Number; ict++) 4491 pulsetime[ict] = 0.; 4480 4492 4481 4493 // Get parameters of the calibration: … … 4534 4546 // Produce the photoelectrons 4535 4547 for(int ict = 0; ict < ct_Number; ict++) 4536 produce_calib_phes( (MGeomCam*)(camgeom.UncheckedAt(ict)), 4537 Trigger_CT[ict], 4538 Fadc_CT[ict], 4539 &(ntotphe[ict]), 4540 pheinpix, 4541 &(ntotphot[ict]), 4542 ict, 4543 lambda, 4544 sigma_lambda, 4545 phot_per_pix, 4546 sigma_time, 4547 selected_pixel 4548 ); 4548 { 4549 // Obtain the FADC jitter of 1 FADC slice. This is a time to be added to the 4550 // time of all photons in an event, before digitalization of the signal. It is 4551 // therefore the same time shift for all pixels in a CT. 4552 4553 float fadc_jitter = 4554 (1./Fadc_CT[ict]->GetFadcSlicesPerNanosec()) * random.Uniform(0., 1.); //ns 4555 4556 4557 produce_calib_phes( (MGeomCam*)(camgeom.UncheckedAt(ict)), 4558 Trigger_CT[ict], 4559 Fadc_CT[ict], 4560 &(ntotphe[ict]), 4561 pheinpix, 4562 &(ntotphot[ict]), 4563 ict, 4564 lambda, 4565 sigma_lambda, 4566 phot_per_pix, 4567 sigma_time, 4568 selected_pixel, 4569 fadc_jitter 4570 ); 4571 4572 pulsetime[ict] = fadc_jitter; // Keep value for writing it to output. 4573 } 4549 4574 4550 4575 // NSB simulation … … 4612 4637 // The additional value 3*sigma_time makes that the pulse maximum is, in 4613 4638 // average, in the same position no matter of the time width of the pulse 4614 // (see in produce_calib_phes(...) thatin order to avoid negative times4639 // (see that, in produce_calib_phes(...), in order to avoid negative times 4615 4640 // we shift the time of the photons by this same amount!) 4616 4641 4617 4642 Fadc_CT[ict]->TriggeredFadc(3.+3*sigma_time); 4643 4644 // Add the "digital noise": electronic noise intrinsic to the FADC and which 4645 // therefore is not scaled down in the low gain slices! 4646 4647 Fadc_CT[ict]->DigitalNoise(); 4618 4648 4619 4649 // … … 4623 4653 4624 4654 McEvt[ict]->Fill( 0, 0, 0., -1.0, -1.0, -1.0, 0., 0., 0., 0., 0., 4625 0., 0., 0., timefirst, timelast, 0., 0., 0.,4655 0., 0., 0., pulsetime[ict], 0., 0., 0., 0., 4626 4656 0., 0., 0., 0., 0, 0, 0, 4627 4657 (UInt_t) ntotphot[ict], … … 4677 4707 float phot_per_pix, // Average # of photons per inner pixel 4678 4708 float sigma_time, // Sigma of time spread of photons 4679 int selected_pixel // if >= 0, only this pixel is used! 4709 int selected_pixel,// if >= 0, only this pixel is used! 4710 float fadc_jitter // Random shift (max 1 slice) of pulses in 4711 // FADC, to simulate FADC clock noise. 4680 4712 ) 4681 4713 { … … 4698 4730 TRandom random; 4699 4731 random.SetSeed(seed); 4700 4701 // Introduce the FADC jitter of 1 FADC slice. This is a time to be added to the4702 // time of all photons in an event, before digitalization of the signal. We use4703 // a positive value between 0 and 1 slice for technical reasons, but it is4704 // totally equivalent to having made +- 1 FADC slice4705 4706 float fadc_jitter = (1./fadc->GetFadcSlicesPerNanosec()) * random.Uniform(0., 1.);4707 4732 4708 4733 // … … 4733 4758 for (int iph = 0; iph < total_photons; iph++) 4734 4759 { 4735 4736 // time 4760 // 4761 // Simulate arrival times of photons to camera plane. We do not simulate the small 4762 // delays between pixels due to the different distances to the pulser. 4763 // 4737 4764 // We do not want negative times, so center the gaussian at 3 sigma 4738 4765 // and reject negative values: … … 4883 4910 // 4884 4911 // $Log: not supported by cvs2svn $ 4912 // Revision 1.78 2004/10/21 17:44:07 moralejo 4913 // 4914 // Fixed error recently introduced in MLons::GetResponse. The NSB database 4915 // was not correclt ycopied to the FADC when the randomly selected time was 4916 // too close to the end of the database. This happened about 2% of times and 4917 // produced some repetitive noise peaks in the FADC. 4918 // Changed in camera.cxx the arguments of lons.SetSeed y lons_outer.SetSeed 4919 // 4885 4920 // Revision 1.77 2004/10/19 10:35:05 moralejo 4886 4921 // *** empty log message ***
Note:
See TracChangeset
for help on using the changeset viewer.