Changeset 2336 for trunk


Ignore:
Timestamp:
09/15/03 11:17:09 (21 years ago)
Author:
blanch
Message:
Some modifications in the input card has been done for the multitelescope
configuration.
File:
1 edited

Legend:

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

    r2288 r2336  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.20 $
     21//= $Revision: 1.21 $
    2222//= $Author: blanch $
    23 //= $Date: 2003-07-17 18:04:53 $
     23//= $Date: 2003-09-15 10:17:09 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    6868//!@{
    6969
    70 static char Input_filename[PATH_MAX_LENGTH];  //@< input filename
     70static char Input_filename[100][PATH_MAX_LENGTH];  //@< input filename
    7171static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
    7272static int Starfield_center[6];               //@< center of the starfield FOV
     
    7676static char Loop_filename[PATH_MAX_LENGTH];   //@< special data filename
    7777static 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
     78static int  CT_geometry = 0;                  //@< CT camera geometry
     79static int  CT_number = 1;                    //@< Number of CT
     80static char QE_filename[100][PATH_MAX_LENGTH];     //@< name of the qe file
    7981static char NSB_directory[PATH_MAX_LENGTH];   //@< database for NSB
    8082static char NSB_outer_directory[PATH_MAX_LENGTH];   //@< database for NSB
     
    8890static float meanNSB;           //@< NSB mean value (per pixel)
    8991static int nphe2NSB=0;          //@< Number of phe from shower to do NSB simulation
    90 static float qThreshold[CAMERA_PIXELS];     //@< Threshold values
     92static float qThreshold[100][CAMERA_PIXELS];     //@< Threshold values
    9193static int Individual_Thres = FALSE;
    9294static float RiseDisc = -1.0;
     
    112114static float Trigger_response_ampl = 1.0;
    113115static 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;
     116static float Trigger_threshold[100];
     117static int Trigger_multiplicity[100];
     118static int Trigger_topology[100];
    117119static float Trigger_loop_lthres = 3.0;
    118120static float Trigger_loop_uthres = 10.0;
     
    155157  int i, j, k;                      //@< dummy counters
    156158  float aux, aux2;                    //@< auxiliar variable
     159  int aux3, aux4;                    //@< auxiliar variable
    157160  ifstream ifile;
    158 
     161  char filename_tmp[PATH_MAX_LENGTH];
    159162  // use cin or ifile (reading from STDIN or from parameters file?
    160163  if ( filename != NULL )
     
    214217         
    215218      // 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]);
    218221      break;
    219222
     
    247250      break;
    248251
     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
    249266    case ct_file:             //@< name of the telescope file
    250267         
     
    257274         
    258275      // 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]);
    260278
    261279      break;
     
    347365      // get value of threshold (in ph.e.)
    348366      sscanf(line, "%s %i %f", token,&k, &aux);
    349       qThreshold[k]=aux;
     367      qThreshold[0][k]=aux;
    350368      Individual_Thres = TRUE;
    351369
     
    479497      // Set qThreshold to a global value
    480498      for(k=0;k<CAMERA_PIXELS;k++){
    481         qThreshold[k]=Trigger_loop_lthres;
     499        qThreshold[0][k]=Trigger_loop_lthres;
    482500      }
    483501
     
    492510
    493511      //  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;
    495516
    496517      // Set qThreshold to a global value
    497518      for(k=0;k<CAMERA_PIXELS;k++){
    498         qThreshold[k]=Trigger_threshold;
     519        qThreshold[j][k]=Trigger_threshold[j];
    499520      }
    500521
     
    554575//!@{
    555576char *
    556 get_input_filename(void)
    557 {
    558   return (Input_filename);
     577get_input_filename(int i)
     578{
     579  return (Input_filename[i]);
    559580}
    560581//!@}
     
    698719
    699720//!-----------------------------------------------------------
     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//!@{
     732int
     733get_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//!@{
     751int
     752get_ct_geometry(void)
     753{
     754  return (CT_geometry);
     755}
     756//!@}
     757
     758//!-----------------------------------------------------------
    700759// @name get_qe_filename
    701760//                                               
     
    710769//!@{
    711770char *
    712 get_qe_filename(void)
    713 {
    714   return (QE_filename);
     771get_qe_filename(int ict)
     772{
     773  return (QE_filename[ict]);
    715774}
    716775//!@}
     
    816875{
    817876  for(int i=0;i<CAMERA_PIXELS;i++)
    818     t[i]=qThreshold[i];
     877    t[i]=qThreshold[0][i];
    819878}
    820879//!@}
     
    12071266//!@{
    12081267void
    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 
     1268get_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  }
    12161276}
    12171277//!@}
     
    12561316//
    12571317// $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//
    12581327// Revision 1.19  2003/02/12 13:47:32  blanch
    12591328// *** empty log message ***
Note: See TracChangeset for help on using the changeset viewer.