Changeset 1685 for trunk/MagicSoft/Simulation
- Timestamp:
- 12/13/02 10:12:01 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r1684 r1685 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.4 8$23 // $Revision: 1.49 $ 24 24 // $Author: blanch $ 25 // $Date: 2002-12-1 2 17:40:50$25 // $Date: 2002-12-13 10:04:07 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 2030 2030 0); 2031 2031 2032 // Store qe for each PMT in output file 2033 TArrayF qe_pmt; 2034 TArrayF wav_pmt; 2035 McConfigRunHeader->InitSizePMTs(ct_NPixels); 2036 for(int i=0; i<ct_NPixels;i++){ 2037 McConfigRunHeader->AddPMT(i); 2038 MGeomPMT &pmt = McConfigRunHeader->GetPMT(i); 2039 qe_pmt.Set(pointsQE,QE[i][1]); 2040 wav_pmt.Set(pointsQE,QElambda); 2041 pmt.SetArraySize(pointsQE); 2042 pmt.SetPMTContent(i,wav_pmt,qe_pmt); 2043 } 2044 2045 // Store Light Guides factors in the output file 2046 TArrayF theta_lg; 2047 TArrayF factor_lg; 2048 theta_lg.Set(pointsWC,WC[0]); 2049 factor_lg.Set(pointsWC,WC[1]); 2050 McConfigRunHeader->SetLightGuides(theta_lg,factor_lg); 2051 2032 2052 // Fill the Header Tree with the current leaves of each branch 2033 2053 HeaderTree.Fill() ; … … 2605 2625 2606 2626 if ( wcfile.bad() ) 2607 error( "read_WC", "Cannot open \"%s\". Exiting.\n", QE_FILE );2627 error( "read_WC", "Cannot open \"%s\". Exiting.\n", WC_FILE ); 2608 2628 2609 2629 // read file … … 2854 2874 Float_t camwidth = -1.0; 2855 2875 2876 Int_t imir; 2877 Float_t f,sx,sy,x,y,z,thetan,phin,xn,yn,zn; 2878 Float_t dx,dy; 2879 Int_t nummir, numref; 2880 Float_t wav,ref; 2881 2856 2882 Char_t token[40]; 2857 2883 Char_t line[511]; 2858 2884 Char_t flag; 2859 cout<<"To be implemented..."<<endl; 2885 2860 2886 while(1){ 2861 2887 if((flag=fgetc(sp))==EOF) … … 2863 2889 fgets(&line[1],500,sp); 2864 2890 line[0]=flag; 2891 if (line[0]== '#' && line[2]=='n' && line[3]=='u' && line[4]=='m' && 2892 line[5]== 'b' && line[12]=='d' && line[13]=='a' && line[14]=='t'){ 2893 fgets(line,500,sp); 2894 sscanf(line,"%i",&numref); 2895 for(int i=0; i<numref;i++){ 2896 fgets(line,500,sp); 2897 sscanf(line,"%f %f",&wav,&ref); 2898 } 2899 continue; 2900 } 2865 2901 if (line[0]== '#') 2866 2902 continue; 2867 2903 if (strstr(line, "type") == line) 2868 2904 continue; 2869 if (strstr(line, "focal_distance") == line) 2905 if (strstr(line, "focal_distance") == line){ 2870 2906 sscanf(line,"%s %f",token,&focal); 2871 2907 continue; 2872 if (strstr(line, "focal_std") == line) 2908 } 2909 if (strstr(line, "focal_std") == line){ 2910 sscanf(line,"%s %f",token,&stdfocal); 2873 2911 continue; 2874 if (strstr(line, "point_spread") == line) 2912 } 2913 if (strstr(line, "point_spread") == line){ 2914 sscanf(line,"%s %f",token,&point); 2875 2915 continue; 2876 if (strstr(line, "point_std") == line) 2916 } 2917 if (strstr(line, "point_std") == line){ 2918 sscanf(line,"%s %f",token,&stdpoint); 2877 2919 continue; 2878 if (strstr(line, "adjustment_dev") == line) 2920 } 2921 if (strstr(line, "adjustment_dev") == line){ 2922 sscanf(line,"%s %f",token,&adjust); 2879 2923 continue; 2880 if (strstr(line, "black_spot") == line) 2924 } 2925 if (strstr(line, "black_spot") == line){ 2926 sscanf(line,"%s %f",token,&spot); 2881 2927 continue; 2882 if (strstr(line, "camera_width") == line) 2928 } 2929 if (strstr(line, "camera_width") == line){ 2930 sscanf(line,"%s %f",token,&camwidth); 2883 2931 continue; 2932 } 2884 2933 if (strstr(line, "n_pixels") == line) 2885 2934 continue; … … 2890 2939 if (strstr(line, "n_gappixels") == line) 2891 2940 continue; 2892 if (strstr(line, "n_mirrors") == line) 2941 if (strstr(line, "n_mirrors") == line){ 2942 sscanf(line,"%s %i",token,&nummir); 2943 config->InitSizeMirror(nummir); 2893 2944 continue; 2894 if (strstr(line, "r_mirror") == line) 2945 } 2946 if (strstr(line, "r_mirror") == line){ 2947 sscanf(line,"%s %f",token,&radius); 2895 2948 continue; 2896 if (strstr(line, "define_mirrors") == line) 2897 break; 2898 } 2949 } 2950 if (strstr(line, "define_mirrors") == line){ 2951 for(int i=0;i<nummir;i++){ 2952 fgets(line,500,sp); 2953 sscanf(line,"%i %f %f %f %f %f %f %f %f %f %f %f", 2954 &imir,&f,&sx,&sy,&x,&y,&z,&thetan,&phin,&xn,&yn,&zn); 2955 config->AddMirror(i); 2956 MGeomMirror &mirror = config->GetMirror(i); 2957 mirror.SetMirrorContent(imir,f,sx,sy,x,y,z,thetan,phin,xn,yn,zn); 2958 } 2959 fgets(line,500,sp); 2960 while(line[2]!='w' || line[3]!='i' || line[4]!='t' || line[5]!='h'){ 2961 fgets(line,500,sp); 2962 } 2963 fgets(line,500,sp); 2964 for(int i=0;i<nummir;i++){ 2965 fgets(line,500,sp); 2966 sscanf(line,"%f %f",&dx,&dy); 2967 MGeomMirror &mirror = config->GetMirror(i); 2968 mirror.SetMirrorDeviations(dx,dy); 2969 } 2970 continue; 2971 } 2972 } 2973 config->SetMagicDef(radius, focal, stdfocal, point, 2974 stdpoint, adjust, spot, camwidth); 2899 2975 } 2900 2976 … … 3857 3933 // 3858 3934 // $Log: not supported by cvs2svn $ 3935 // Revision 1.48 2002/12/12 17:40:50 blanch 3936 // *** empty log message *** 3937 // 3859 3938 // Revision 1.47 2002/12/10 17:19:31 blanch 3860 3939 // *** empty log message *** … … 4002 4081 // 4003 4082 // $Log: not supported by cvs2svn $ 4083 // Revision 1.48 2002/12/12 17:40:50 blanch 4084 // *** empty log message *** 4085 // 4004 4086 // Revision 1.47 2002/12/10 17:19:31 blanch 4005 4087 // *** empty log message ***
Note:
See TracChangeset
for help on using the changeset viewer.