Changeset 2962 for trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
- Timestamp:
- 01/30/04 09:51:18 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r2453 r2962 1 // !/////////////////////////////////////////////////////////////////////1 ////!///////////////////////////////////////////////////////////////////// 2 2 // 3 3 // camera … … 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.6 6$23 // $Revision: 1.67 $ 24 24 // $Author: blanch $ 25 // $Date: 200 3-11-03 12:58:40$25 // $Date: 2004-01-30 09:51:18 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 199 199 200 200 //@: Properties of the FADC 201 static float FADC_response_ampl = MFADC_RESPONSE_ AMPLITUDE;201 static float FADC_response_ampl = MFADC_RESPONSE_INTEGRAL; 202 202 static float FADC_response_fwhm = MFADC_RESPONSE_FWHM; 203 static float FADC_resp_ampl_out = MFADC_RESPONSE_ AMPLITUDE;203 static float FADC_resp_ampl_out = MFADC_RESPONSE_INTEGRAL; 204 204 static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM; 205 205 static float FADC_noise = 2.0; … … 330 330 char GeometryName[100][50]; //@< Name of MGeomCam for each CT 331 331 int GeometryCamera[100]; //@< Identification of MGeomCam for each CT 332 int TriggerPixels[100]; //@< Num eber of pixels in the trigger region for each CT332 int TriggerPixels[100]; //@< Number of pixels in the trigger region for each CT 333 333 334 334 int reflector_file_version=0; //@< vrsion of he reflector file … … 682 682 683 683 // Look to factor for NSB respect to emi_coat PMTs 684 if( !strcmp(qe_filename,"../Data/qe-emi-coat.RFL.dat"))684 if(strstr(qe_filename,"qe-emi-coat.RFL.dat") != 0) 685 685 factorqe_NSB[ict]=EMICOAT_NSB; 686 else if( !strcmp(qe_filename,"../Data/qe-emi.RFL.dat"))686 else if(strstr(qe_filename,"qe-emi.RFL.dat") != 0) 687 687 factorqe_NSB[ict]=EMI_NSB; 688 else if( !strcmp(qe_filename, "../Data/qe-intevac_hpd.RFL.dat"))688 else if(strstr(qe_filename, "qe-intevac_hpd.RFL.dat") != 0) 689 689 factorqe_NSB[ict]=HPD_NSB; 690 690 else{ … … 852 852 853 853 for (int ict=0; ict<ct_Number;ict++){ 854 // Generate datab se for trigger electronic noise854 // Generate database for trigger electronic noise 855 855 if (addElecNoise) 856 856 Trigger_CT[ict]->SetElecNoise(Trigger_noise) ; … … 912 912 new MFadc(((MGeomCam*)(camgeom.UncheckedAt(i)))->GetNumPixels(), 913 913 FADC_response_ampl,FADC_response_fwhm, 914 FADC_resp_ampl_out,FADC_resp_fwhm_out) ; //@< A instance of the Class MFadc 914 FADC_resp_ampl_out,FADC_resp_fwhm_out, 915 get_trig_delay() 916 ) ; //@< A instance of the Class MFadc 915 917 916 918 … … 936 938 Fadc_CT[ict]->SetHigh2LowGain(FADC_high2low); 937 939 938 // Generate datab se for the Fadc electronic noise940 // Generate database for the Fadc electronic noise 939 941 if (addElecNoise){ 940 942 Fadc_CT[ict]->SetElecNoise(FADC_noise); … … 1589 1591 1590 1592 ++nshow; 1591 if((nshow+ntshow )%100 == 1)1593 if((nshow+ntshow+1)%100 == 1) 1592 1594 log(SIGNATURE, "Event %d(+%d)\n", nshow, ntshow); 1593 1595 … … 1804 1806 rho = rho*180/3.14159; 1805 1807 1806 // Rot tion of the NSB1808 // Rotation of the NSB 1807 1809 // FIXME --- We should rotate for all cameras. Is it always the same rho? 1808 1810 for(int ict=0;ict<ct_Number;ict++){ … … 1847 1849 } 1848 1850 ntcph[ict]+=ncph[ict]; 1849 if ((nshow+ntshow )%100 == 1){1851 if ((nshow+ntshow+1)%100 == 1){ 1850 1852 log(SIGNATURE, "End of this event: %d cphs(+%d). . .\n", 1851 1853 ncph[ict], ntcph[ict]); … … 2025 2027 i<((MGeomCam*)(camgeom.UncheckedAt(0))) 2026 2028 ->GetNumPixels();i++){ 2027 if(!Fadc_CT[0]->IsPixelUsed(i)) continue; 2029 // 2030 // AM 15 01 2004: commented out "continue" statement, so that also pixels 2031 // with no C-photons will be written to the output in case the camera 2032 // is run with no noise. 2033 // if(!Fadc_CT[0]->IsPixelUsed(i)) continue; 2034 // 2028 2035 for (j=0;j<FADC_SLICES;j++){ 2029 2036 fadcValues->AddAt(Fadc_CT[0]->GetFadcSignal(i,j),j); … … 2264 2271 i<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels(); 2265 2272 i++){ 2266 if(!Fadc_CT[ict]->IsPixelUsed(i)) continue; 2273 // 2274 // AM 15 01 2004 Commented out "continue" statement, so that also pixels 2275 // containing no C-photons will be written to the output in case of running 2276 // camera with no noise added to the signal. 2277 // if(!Fadc_CT[ict]->IsPixelUsed(i)) continue; 2278 // 2267 2279 for (j=0;j<FADC_SLICES;j++){ 2268 2280 fadcValues->AddAt(Fadc_CT[ict]->GetFadcSignal(i,j),j); … … 2457 2469 for(int ict=0;ict<ct_Number;ict++){ 2458 2470 read_ascii(inputfile[ict], McConfigRunHeader[ict]); 2471 2472 if (get_sigma_xy_cm_spot() > 0.) 2473 { 2474 Float_t spotsigma = McConfigRunHeader[ict]->GetPointSpread(); 2475 Float_t newsigma = sqrt(spotsigma * spotsigma + 2476 get_sigma_xy_cm_spot() * get_sigma_xy_cm_spot()); 2477 McConfigRunHeader[ict]->SetPointSpread(newsigma); 2478 } 2459 2479 } 2460 2480 if ((! Data_From_STDIN) && ( !feof(inputfile[0]) )){ … … 3077 3097 Float_t radius = -1.0; 3078 3098 Float_t focal = -1.0; 3079 Float_t stdfocal = -1.0;3080 3099 Float_t point = -1.0; 3081 Float_t stdpoint = -1.0;3082 Float_t adjust = -1.0;3083 3100 Float_t spot = -1.0; 3084 3101 Float_t camwidth = -1.0; … … 3097 3114 if((flag=fgetc(sp))==EOF) 3098 3115 break; 3116 if (flag == '\n') // skip empty lines 3117 continue; 3118 3099 3119 fgets(&line[1],500,sp); 3100 3120 line[0]=flag; 3101 if (line[0]== '#' && line[2]=='n' && line[3]=='u' && line[4]=='m' && 3102 line[5]== 'b' && line[12]=='d' && line[13]=='a' && line[14]=='t'){ 3121 3122 if ( strstr(line, "# reflectivity file") == line ) { 3123 while (strstr(line, "# number of datapoints") != line) 3124 fgets(line,500,sp); 3125 3103 3126 fgets(line,500,sp); 3104 3127 sscanf(line,"%i",&numref); 3128 3105 3129 TArrayF wavarray(numref); 3106 3130 TArrayF refarray(numref); 3107 fgets(line,500,sp); 3131 3132 while (strstr(line, "# datapoints") != line) 3133 fgets(line,500,sp); 3134 3108 3135 for(int i=0; i<numref;i++){ 3109 3136 fgets(line,500,sp); 3137 if (line[0] == '#') 3138 { 3139 i--; 3140 continue; 3141 } 3110 3142 sscanf(line,"%f %f",&wav,&ref); 3111 3143 wavarray[i]=wav; … … 3113 3145 } 3114 3146 for (int j=0; j<nummir;j++){ 3147 3115 3148 MGeomMirror &mirror = config->GetMirror(j); 3116 3149 mirror.SetArraySize(numref); … … 3127 3160 continue; 3128 3161 } 3129 if (strstr(line, "focal_std") == line){3130 sscanf(line,"%s %f",token,&stdfocal);3131 continue;3132 }3133 3162 if (strstr(line, "point_spread") == line){ 3134 3163 sscanf(line,"%s %f",token,&point); 3135 3164 continue; 3136 3165 } 3137 if (strstr(line, "point_std") == line){3138 sscanf(line,"%s %f",token,&stdpoint);3139 continue;3140 }3141 if (strstr(line, "adjustment_dev") == line){3142 sscanf(line,"%s %f",token,&adjust);3143 continue;3144 }3145 3166 if (strstr(line, "black_spot") == line){ 3146 3167 sscanf(line,"%s %f",token,&spot); … … 3151 3172 continue; 3152 3173 } 3174 // 3175 // Skip obsolete magic.def entries: 3176 // 3153 3177 if (strstr(line, "n_pixels") == line) 3154 3178 continue; … … 3159 3183 if (strstr(line, "n_gappixels") == line) 3160 3184 continue; 3185 3161 3186 if (strstr(line, "n_mirrors") == line){ 3162 3187 sscanf(line,"%s %i",token,&nummir); … … 3178 3203 } 3179 3204 fgets(line,500,sp); 3180 while(line[2]!='w' || line[3]!='i' || line[4]!='t' || line[5]!='h'){ 3205 3206 while ( ! strstr(line, "axis deviation")) 3181 3207 fgets(line,500,sp); 3182 } 3183 fgets(line,500,sp); 3208 3184 3209 for(int i=0;i<nummir;i++){ 3185 fgets(line,500,sp); 3210 fgets(line,500,sp); 3211 if (line[0] == '#') 3212 { 3213 i--; 3214 continue; 3215 } 3186 3216 sscanf(line,"%f %f",&dx,&dy); 3187 3217 MGeomMirror &mirror = config->GetMirror(i); … … 3191 3221 } 3192 3222 } 3193 config->SetMagicDef(radius, focal, stdfocal, point, 3194 stdpoint, adjust, spot, camwidth); 3223 config->SetMagicDef(radius, focal, point, spot, camwidth); 3195 3224 } 3196 3225 … … 3708 3737 int *itotnphe, // total number of produced photoelectrons 3709 3738 float nphe[iMAXNUMPIX], // number of photoelectrons in each pixel 3710 int *incph, // total number of cph read3739 int *incph, // total number of cph within camera 3711 3740 float *tmin_ns, // minimum arrival time of all phes 3712 3741 float *tmax_ns, // maximum arrival time of all phes … … 3735 3764 radius_mm = camgeom->GetMaxRadius(); 3736 3765 3766 TRandom random; 3767 random.SetSeed((Int_t)(get_seeds(0)*get_seeds(1))); 3768 3769 float spotsigma = get_sigma_xy_cm_spot(); 3737 3770 3738 3771 //- - - - - - - - - - - - - - - - - - - - - - - - - … … 3761 3794 3762 3795 3763 // increase number of photons 3764 3765 (*incph)++; 3766 3767 // Chceck if photon is inside trigger time range 3796 // Check if photon is inside trigger time range 3768 3797 3769 3798 t = photon.get_t() ; … … 3780 3809 cy = photon.get_y(); 3781 3810 3811 3812 if (spotsigma > 0.) 3813 { 3814 cx += random.Gaus(0.,spotsigma); 3815 cy += random.Gaus(0.,spotsigma); 3816 } 3817 3782 3818 // get wavelength 3783 3819 … … 3800 3836 continue; 3801 3837 } 3838 3839 // AM changed meaning of incph: before it was all photons read from 3840 // reflector file, now only those within a valid pixel: 3841 // 3842 // increase number of photons 3843 (*incph)++; 3802 3844 3803 3845 //+++ … … 4230 4272 // The seeds in the input card are used to initilize the random numbers. 4231 4273 // The Amplitud stored in the MMcFadcHeader is the amplitud of the sphe reponse. 4232 // The Pedestal rms is simu alted in a artificail empty event.4274 // The Pedestal rms is simulated in an artificial empty event. 4233 4275 // 4234 4276 // Revision 1.62 2003/09/26 11:25:07 blanch
Note:
See TracChangeset
for help on using the changeset viewer.