Changeset 2336 for trunk/MagicSoft/Simulation/Detector
- Timestamp:
- 09/15/03 11:17:09 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx
r2288 r2336 19 19 //= 20 20 //= $RCSfile: creadparam.cxx,v $ 21 //= $Revision: 1.2 0$21 //= $Revision: 1.21 $ 22 22 //= $Author: blanch $ 23 //= $Date: 2003-0 7-17 18:04:53$23 //= $Date: 2003-09-15 10:17:09 $ 24 24 //= 25 25 //=////////////////////////////////////////////////////////////////////// … … 68 68 //!@{ 69 69 70 static char Input_filename[ PATH_MAX_LENGTH]; //@< input filename70 static char Input_filename[100][PATH_MAX_LENGTH]; //@< input filename 71 71 static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename 72 72 static int Starfield_center[6]; //@< center of the starfield FOV … … 76 76 static char Loop_filename[PATH_MAX_LENGTH]; //@< special data filename 77 77 static char CT_filename[PATH_MAX_LENGTH]; //@< name of the CT def. file 78 static char QE_filename[PATH_MAX_LENGTH]; //@< name of the qe file 78 static int CT_geometry = 0; //@< CT camera geometry 79 static int CT_number = 1; //@< Number of CT 80 static char QE_filename[100][PATH_MAX_LENGTH]; //@< name of the qe file 79 81 static char NSB_directory[PATH_MAX_LENGTH]; //@< database for NSB 80 82 static char NSB_outer_directory[PATH_MAX_LENGTH]; //@< database for NSB … … 88 90 static float meanNSB; //@< NSB mean value (per pixel) 89 91 static int nphe2NSB=0; //@< Number of phe from shower to do NSB simulation 90 static float qThreshold[ CAMERA_PIXELS]; //@< Threshold values92 static float qThreshold[100][CAMERA_PIXELS]; //@< Threshold values 91 93 static int Individual_Thres = FALSE; 92 94 static float RiseDisc = -1.0; … … 112 114 static float Trigger_response_ampl = 1.0; 113 115 static float Trigger_response_fwhm = 2.0; 114 static float Trigger_threshold = 7.0;115 static int Trigger_multiplicity = 4;116 static int Trigger_topology = 2;116 static float Trigger_threshold[100]; 117 static int Trigger_multiplicity[100]; 118 static int Trigger_topology[100]; 117 119 static float Trigger_loop_lthres = 3.0; 118 120 static float Trigger_loop_uthres = 10.0; … … 155 157 int i, j, k; //@< dummy counters 156 158 float aux, aux2; //@< auxiliar variable 159 int aux3, aux4; //@< auxiliar variable 157 160 ifstream ifile; 158 161 char filename_tmp[PATH_MAX_LENGTH]; 159 162 // use cin or ifile (reading from STDIN or from parameters file? 160 163 if ( filename != NULL ) … … 214 217 215 218 // get the name of the input_file from the line 216 sscanf(line, "%s % s", token, Input_filename);217 219 sscanf(line, "%s %i %s", token,&k, filename_tmp); 220 strcpy(&Input_filename[k][0],&filename_tmp[0]); 218 221 break; 219 222 … … 247 250 break; 248 251 252 case ct_num: //@< name of the telescope file 253 254 // get the name of the ct_file from the line 255 sscanf(line, "%s %i", token, &CT_number); 256 257 break; 258 259 case ct_geom: //@< name of the telescope file 260 261 // get the name of the ct_file from the line 262 sscanf(line, "%s %i", token, &CT_geometry); 263 264 break; 265 249 266 case ct_file: //@< name of the telescope file 250 267 … … 257 274 258 275 // get the name of the ct_file from the line 259 sscanf(line, "%s %s", token, QE_filename); 276 sscanf(line, "%s %i %s", token, &k, filename_tmp); 277 strcpy(&QE_filename[k][0],&filename_tmp[0]); 260 278 261 279 break; … … 347 365 // get value of threshold (in ph.e.) 348 366 sscanf(line, "%s %i %f", token,&k, &aux); 349 qThreshold[ k]=aux;367 qThreshold[0][k]=aux; 350 368 Individual_Thres = TRUE; 351 369 … … 479 497 // Set qThreshold to a global value 480 498 for(k=0;k<CAMERA_PIXELS;k++){ 481 qThreshold[ k]=Trigger_loop_lthres;499 qThreshold[0][k]=Trigger_loop_lthres; 482 500 } 483 501 … … 492 510 493 511 // Get trigger conditions 494 sscanf(line, "%s %f %d %d", token, &Trigger_threshold, &Trigger_multiplicity, &Trigger_topology); 512 sscanf(line, "%s %d %f %d %d", token, &j, &aux, &aux3, &aux4); 513 Trigger_threshold[j]=aux; 514 Trigger_multiplicity[j]=aux3; 515 Trigger_topology[j]=aux4; 495 516 496 517 // Set qThreshold to a global value 497 518 for(k=0;k<CAMERA_PIXELS;k++){ 498 qThreshold[ k]=Trigger_threshold;519 qThreshold[j][k]=Trigger_threshold[j]; 499 520 } 500 521 … … 554 575 //!@{ 555 576 char * 556 get_input_filename( void)557 { 558 return (Input_filename );577 get_input_filename(int i) 578 { 579 return (Input_filename[i]); 559 580 } 560 581 //!@} … … 698 719 699 720 //!----------------------------------------------------------- 721 // @name get_ct_number 722 // 723 // @desc get number of CT 724 // 725 // @return number of CT 726 // 727 // @date Tue Jul 29 01:48:26 CEST 2003 728 //------------------------------------------------------------ 729 // @function 730 731 //!@{ 732 int 733 get_ct_number(void) 734 { 735 return (CT_number); 736 } 737 //!@} 738 739 //!----------------------------------------------------------- 740 // @name get_ct_geometry 741 // 742 // @desc get geometry of CT 743 // 744 // @return geometry of CT 745 // 746 // @date Mon Sep 14 13:27:56 MET DST 1998 747 //------------------------------------------------------------ 748 // @function 749 750 //!@{ 751 int 752 get_ct_geometry(void) 753 { 754 return (CT_geometry); 755 } 756 //!@} 757 758 //!----------------------------------------------------------- 700 759 // @name get_qe_filename 701 760 // … … 710 769 //!@{ 711 770 char * 712 get_qe_filename( void)713 { 714 return (QE_filename );771 get_qe_filename(int ict) 772 { 773 return (QE_filename[ict]); 715 774 } 716 775 //!@} … … 816 875 { 817 876 for(int i=0;i<CAMERA_PIXELS;i++) 818 t[i]=qThreshold[ i];877 t[i]=qThreshold[0][i]; 819 878 } 820 879 //!@} … … 1207 1266 //!@{ 1208 1267 void 1209 get_Trigger_Single(float *t, int *m, int *g) 1210 { 1211 for(int i=0;i<CAMERA_PIXELS;i++) 1212 t[i]=qThreshold[i]; 1213 *m=Trigger_multiplicity; 1214 *g=Trigger_topology; 1215 1268 get_Trigger_Single(float **t, int *m, int *g) 1269 { 1270 for(int j=0;j<100;j++){ 1271 for(int i=0;i<CAMERA_PIXELS;i++) 1272 t[j][i]=qThreshold[j][i]; 1273 m[j]=Trigger_multiplicity[j]; 1274 g[j]=Trigger_topology[j]; 1275 } 1216 1276 } 1217 1277 //!@} … … 1256 1316 // 1257 1317 // $Log: not supported by cvs2svn $ 1318 // Revision 1.20 2003/07/17 18:04:53 blanch 1319 // Some new parameters to be read have been introduced 1320 // 1321 // - FADC pedestals 1322 // - Response outer FADC 1323 // - Qe file 1324 // 1325 // The obsolete ones have been removed. 1326 // 1258 1327 // Revision 1.19 2003/02/12 13:47:32 blanch 1259 1328 // *** empty log message ***
Note:
See TracChangeset
for help on using the changeset viewer.