Ignore:
Timestamp:
10/17/03 20:40:24 (21 years ago)
Author:
blanch
Message:
The gain ratio between the high and low FADC gain is controlled from the
input card.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx

    r2355 r2391  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.23 $
     21//= $Revision: 1.24 $
    2222//= $Author: blanch $
    23 //= $Date: 2003-09-23 17:38:48 $
     23//= $Date: 2003-10-17 19:40:24 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    7070static char Input_filename[100][PATH_MAX_LENGTH];  //@< input filename
    7171static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
    72 static int Starfield_center[6];              //@< center of the starfield FOV
     72static int Starfield_center[6]={0,0,0,0,0,0}; //@< center of the starfield FOV
    7373                                              //@< RA(H,M,S) & DEC (D,M,S)
    7474static char Data_filename[PATH_MAX_LENGTH];   //@< data filename
     
    8282static int  Starfield_rotate = FALSE;         //@< switch on starfield rotation
    8383static int ElecNoise = TRUE;                  //@< Will we add ElecNoise?
    84 static float FADC_pedestal = 50.0;            //@< Value for FADC Pedestal
     84static float FADC_pedestal = 10.0;            //@< Value for FADC Pedestal
    8585static float FADC_Noise = 2.0;                //@< Value for FADC ElecNoise
     86static float Digital_Noise = 1.0;            //@< Value for FADC  digital Noise
    8687static float Trig_Noise = 0.3;                //@< Factor for Trigger ElecNoise
    8788static int simulateNSB = TRUE;                //@< Will we simulate NSB?
     
    9293static float RiseDisc = -1.0;
    9394static float SecureDisc = 7.0;
    94 static long int Seeds[2];
     95static long int Seeds[2]={69184,10406};
    9596static int *Skip;
    9697static int nSkip=0;
     
    126127static float FADC_resp_ampl_out = MFADC_RESPONSE_AMPLITUDE;
    127128static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM;
    128 static float Source_offset_th=0.;     //<@  Displacement in Theta of the
    129                                       //<@ source from the center
    130 static float Source_offset_ph=0.;     //<@  Displacement in Phi of the
    131                                       //<@ source from the center
     129static float High_to_Low = 10.0;      //@< Low gain channel respct to High
     130static float Source_offset_th=0.;     //@<  Displacement in Theta of the
     131                                      //@< source from the center
     132static float Source_offset_ph=0.;     //@<  Displacement in Phi of the
     133                                      //@< source from the center
    132134
    133135//!@}
     
    215217      // get the name of the input_file from the line
    216218      sscanf(line, "%s %i %s", token,&k, filename_tmp);
     219      if(k>99 || k<0){
     220        printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
     221        exit(1);
     222      }
    217223      strcpy(&Input_filename[k][0],&filename_tmp[0]);
    218224      break;
     
    285291      break;
    286292
     293    case high_to_low:              //@< FADC ElecNoise
     294         
     295      // Value for the Low Gain channel respect to the High gain
     296      sscanf(line, "%s %f", token, &High_to_Low);
     297         
     298      break;
     299
    287300    case fadc_noise:              //@< FADC ElecNoise
    288301         
    289302      // value for FADC Elec Noise
    290       sscanf(line, "%s %f", token, &FADC_Noise);
     303      sscanf(line, "%s %f %f", token, &FADC_Noise, &Digital_Noise);
    291304      ElecNoise = TRUE;
    292305         
     
    348361      // get value of threshold (in ph.e.)
    349362      sscanf(line, "%s %i %f", token,&k, &aux);
     363      if(k>99 || k<0){
     364        printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
     365        exit(1);
     366      }
    350367      qThreshold[0][k]=aux;
    351368      Individual_Thres = TRUE;
     
    494511      //  Get trigger conditions
    495512      sscanf(line, "%s %d %f %d %d", token, &j, &aux, &aux3, &aux4);
     513      if(j>99 || j<0){
     514        printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
     515        exit(1);
     516      }
    496517      Trigger_threshold[j]=aux;
    497518      Trigger_multiplicity[j]=aux3;
     
    793814//!@{
    794815int
    795 add_elec_noise(float *fadc, float *trig)
     816add_elec_noise(float *fadc, float *digi, float *trig)
    796817{
    797818  *fadc = FADC_Noise;
     819  *digi = Digital_Noise;
    798820  *trig = Trig_Noise;
     821 
    799822  return ( ElecNoise);
    800823}
     
    12551278
    12561279//!@}
     1280//!-----------------------------------------------------------
     1281// @name get_High_to_Low
     1282//                                               
     1283// @desc get the conversion factor between high and low gain
     1284//
     1285//------------------------------------------------------------
     1286// @function
     1287
     1288//!@{
     1289
     1290
     1291float get_High_to_Low(void){
     1292
     1293  return High_to_Low;
     1294
     1295}
     1296
     1297//!@}
    12571298//=------------------------------------------------------------
    12581299//!@subsection Log of this file.
     
    12611302//
    12621303// $Log: not supported by cvs2svn $
     1304// Revision 1.23  2003/09/23 17:38:48  blanch
     1305// ana_pixels command has been removed.
     1306//
    12631307// Revision 1.22  2003/09/23 16:52:07  blanch
    12641308// We do not read ct_file anymore.
Note: See TracChangeset for help on using the changeset viewer.