Changeset 2288


Ignore:
Timestamp:
07/17/03 19:04:53 (21 years ago)
Author:
blanch
Message:
Some new parameters to be read have been introduced

	- FADC pedestals
	- Response outer FADC
	- Qe file

The obsolete ones have been removed.
File:
1 edited

Legend:

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

    r1756 r2288  
    1919//=
    2020//= $RCSfile: creadparam.cxx,v $
    21 //= $Revision: 1.19 $
     21//= $Revision: 1.20 $
    2222//= $Author: blanch $
    23 //= $Date: 2003-02-12 13:47:32 $
     23//= $Date: 2003-07-17 18:04:53 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    7676static char Loop_filename[PATH_MAX_LENGTH];   //@< special data filename
    7777static char CT_filename[PATH_MAX_LENGTH];     //@< name of the CT def. file
     78static char QE_filename[PATH_MAX_LENGTH];     //@< name of the qe file
    7879static char NSB_directory[PATH_MAX_LENGTH];   //@< database for NSB
     80static char NSB_outer_directory[PATH_MAX_LENGTH];   //@< database for NSB
    7981static int  Starfield_rotate = FALSE;         //@< switch on starfield rotation
    8082static int ElecNoise = TRUE;                  //@< Will we add ElecNoise?
     83static float FADC_pedestal = 50.0;            //@< Value for FADC Pedestal
    8184static float FADC_Noise = 2.0;                //@< Value for FADC ElecNoise
    8285static float Trig_Noise = 0.3;                //@< Factor for Trigger ElecNoise
     
    8992static float RiseDisc = -1.0;
    9093static float SecureDisc = 7.0;
    91 static float qTailCut;          //@< Tail Cut value
    92 static int nIslandsCut;         //@< Islands Cut value
    93 static int countIslands = TRUE; //@< Will we count the islands?
    9494static long int Seeds[2];
    9595static int *Skip;
    9696static int nSkip=0;
    9797static int Data_From_STDIN = FALSE;
    98 static int Read_Phe = FALSE;
    99 static int Read_Phe_All = FALSE;
    10098static int Write_All_Images = FALSE;
    10199static int Write_McEvt  = TRUE;
     
    107105static float Select_Energy_le = 0.0;           //@< GeV
    108106static float Select_Energy_ue = 100000.0;      //@< GeV
    109 static float Trigger_Radius;
    110 static int Set_Trigger_Radius=FALSE;
    111 static float fCorrection;
    112 static int Apply_Correction=FALSE;
    113107static int Trigger_Scan = FALSE;
    114108static int FADC_Scan = FALSE;
     
    130124static float FADC_response_ampl = MFADC_RESPONSE_AMPLITUDE;
    131125static float FADC_response_fwhm = MFADC_RESPONSE_FWHM;
    132 static float Telescope_axis_th = 0.;  //<@ Theta of the axis telescope
    133 static float Telescope_axis_ph = 90.; //<@ Phi of the axis telescope
     126static float FADC_resp_ampl_out = MFADC_RESPONSE_AMPLITUDE;
     127static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM;
    134128static float Source_offset_th=0.;     //<@  Displacement in Theta of the
    135129                                      //<@ source from the center
    136130static float Source_offset_ph=0.;     //<@  Displacement in Phi of the
    137131                                      //<@ source from the center
    138 static int Corsika_vers=5200;         //<@ Version of Corsika 
    139132
    140133//!@}
     
    261254      break;
    262255
     256    case qe_file:             //@< name of the telescope file
     257         
     258      // get the name of the ct_file from the line
     259      sscanf(line, "%s %s", token, QE_filename);
     260
     261      break;
     262
    263263    case elec_noise_off:              //@< add ElecNoise?
    264264         
     
    270270      break;
    271271
     272    case fadc_pedestal:              //@< FADC ElecNoise
     273         
     274      // value for FADC Pedestal
     275      sscanf(line, "%s %f", token, &FADC_pedestal);
     276         
     277      break;
     278
    272279    case fadc_noise:              //@< FADC ElecNoise
    273280         
     
    317324    case nsb_directory:         //@< name of the output file
    318325         
    319       // get the name of the output_file from the line
     326      // get the name of the NSB diretory for inner pixels
    320327      sscanf(line, "%s %s", token, NSB_directory);
     328
     329      break;
     330
     331    case nsb_dir_outer:         //@< name of the output file
     332         
     333      // get the name of the NSB diretory for outer pixels
     334      sscanf(line, "%s %s", token, NSB_outer_directory);
    321335
    322336      break;
     
    344358      RiseDisc=aux;
    345359      SecureDisc=aux2;
    346 
    347       break;
    348 
    349     case tail_cut:            //@< value of tail_cut (t0)
    350          
    351       // get value of tail_cut (in ph.e.)
    352       sscanf(line, "%s %f", token, &qTailCut);
    353       cerr << "Skipping unknown token in [" << line << "]\n";
    354 
    355       break;
    356 
    357     case islands_on:          //@< DO count islands
    358          
    359       // DO count islands
    360       countIslands = TRUE;
    361       cerr << "Skipping unknown token in [" << line << "]\n";
    362          
    363       break;
    364 
    365     case islands_off:         //@< do NOT count islands
    366          
    367       // do NOT count islands
    368       countIslands = FALSE;
    369       cerr << "Skipping unknown token in [" << line << "]\n";
    370          
    371       break;
    372 
    373     case islands_cut:         //@< value of islands_cut (i0)
    374          
    375       // get value of islands_cut (in ph.e.)
    376       sscanf(line, "%s %d", token, &nIslandsCut);
    377       countIslands = TRUE;
    378       cerr << "Skipping unknown token in [" << line << "]\n";
    379360
    380361      break;
     
    406387      break;
    407388
    408     case read_phe:            //@< to read PHE files
    409          
    410       // change boolean value
    411       Read_Phe = TRUE;
    412 
    413       break;
    414 
    415     case read_phe_all:        //@< to read PHE files from write_all_events
    416          
    417       // change boolean value
    418       Read_Phe_All = TRUE;
    419 
    420       break;
    421 
    422389    case write_all_events:    //@< to write ALL the images
    423390         
     
    470437      break;
    471438
    472     case trigger_radius:      //@< set radius of trigger area
    473          
    474       // get trigger radius
    475       sscanf(line, "%s %f", token, &Trigger_Radius);
    476       Set_Trigger_Radius = TRUE;
    477 
    478       break;
    479 
    480     case correction:          //@< apply a kind of correction to pixel values
    481          
    482       // get trigger radius
    483       sscanf(line, "%s %f", token, &fCorrection);
    484       Apply_Correction = TRUE;
    485 
    486       break;
    487 
    488439    case fadc_scan:
    489440
     
    497448      //  Get parameters for the fadc  response for one phe
    498449      sscanf(line, "%s %f %f", token, &FADC_response_ampl,&FADC_response_fwhm);
     450
     451      break;
     452
     453    case fadc_outer:
     454
     455      //  Get parameters for the fadc  response for one phe
     456      sscanf(line, "%s %f %f", token, &FADC_resp_ampl_out,&FADC_resp_fwhm_out);
    499457
    500458      break;
     
    548506      break;
    549507
    550      case telescope_axis:
    551 
    552       //  Get axis of the telescope
    553          sscanf(line, "%s %f %f", token, &Telescope_axis_th, &Telescope_axis_ph);
    554       cerr << "Skipping unknown token in [" << line << "]\n";
    555 
    556       break;
    557 
    558508    case source_offset:
    559509
    560510      //  Get offset of source
    561511        sscanf(line, "%s %f %f", token, &Source_offset_th, &Source_offset_ph);
    562 
    563       break;
    564 
    565     case corsika_vers:
    566 
    567       //  Get Corsika version
    568         sscanf(line, "%s %i", token, &Corsika_vers);
    569       cerr << "Skipping unknown token in [" << line << "]\n";
    570512
    571513      break;
     
    756698
    757699//!-----------------------------------------------------------
     700// @name get_qe_filename
     701//                                               
     702// @desc get name of QE definition file
     703//
     704// @return   Name of the QE definition file
     705//
     706// @date Thu Jul 10 14:10:13 CEST 2003
     707//------------------------------------------------------------
     708// @function
     709
     710//!@{
     711char *
     712get_qe_filename(void)
     713{
     714  return (QE_filename);
     715}
     716//!@}
     717
     718//!-----------------------------------------------------------
    758719// @name get_nsb_directory
    759720//                                               
     
    771732{
    772733  return (NSB_directory);
     734}
     735//!@}
     736
     737
     738
     739//!-----------------------------------------------------------
     740// @name get_nsb_directory_outer
     741//                                               
     742// @desc get name of the directory where the database for NSB is
     743//
     744// @return   Name of the NSB directory for outer pixels
     745//
     746// @date Thu Jul 10 14:10:13 CEST 2003
     747//------------------------------------------------------------
     748// @function
     749
     750//!@{
     751char *
     752get_nsb_directory_outer(void)
     753{
     754  return (NSB_outer_directory);
    773755}
    774756//!@}
     
    878860
    879861//!-----------------------------------------------------------
    880 // @name get_tail_cut   
    881 //                                               
    882 // @desc get tail cut value
    883 //
    884 // @return   Value for the Tail-cut
    885 //
    886 // @date Mon Sep 14 13:27:56 MET DST 1998
    887 //------------------------------------------------------------
    888 // @function
    889 
    890 //!@{
    891 float
    892 get_tail_cut(void)
    893 {
    894   return( qTailCut );
    895 }
    896 //!@}
    897 
    898 
    899 //!-----------------------------------------------------------
    900 // @name get_islands_cut
    901 //                                               
    902 // @desc are we going to count the islands ?
    903 //
    904 // @var  *n  Cut on islands number
    905 // @return   TRUE: we'll count the islands; FALSE: we won't
    906 //
    907 // @date Mon Sep 14 13:27:56 MET DST 1998
    908 //------------------------------------------------------------
    909 // @function
    910 
    911 //!@{
    912 int
    913 get_islands_cut(int *n)
    914 {
    915   *n = nIslandsCut;
    916   return ( countIslands );
    917 }
    918 //!@}
    919 
    920 
    921 //!-----------------------------------------------------------
    922862// @name get_ana_pixels
    923863//                                               
     
    1023963
    1024964//!-----------------------------------------------------------
    1025 // @name get_read_phe
    1026 //                                               
    1027 // @desc get whether we will read PHE files
    1028 //
    1029 // @return  TRUE: we'll read PHE files; FALSE: we won't
    1030 //
    1031 // @date Wed Nov 25 13:21:00 MET 1998
    1032 //------------------------------------------------------------
    1033 // @function
    1034 
    1035 //!@{
    1036 int
    1037 get_read_phe(void)
    1038 {
    1039   return ( Read_Phe );
    1040 }
    1041 //!@}
    1042 
    1043 
    1044 //!-----------------------------------------------------------
    1045 // @name get_read_phe_all
    1046 //                                               
    1047 // @desc get whether we will read PHE files, with write_all_events
    1048 //
    1049 // @return  TRUE: we'll do it; FALSE: we won't
    1050 //
    1051 // @date Wed Nov 25 13:21:00 MET 1998
    1052 //------------------------------------------------------------
    1053 // @function
    1054 
    1055 //!@{
    1056 int
    1057 get_read_phe_all(void)
    1058 {
    1059   return ( Read_Phe_All );
    1060 }
    1061 //!@}
    1062 
    1063 
    1064 //!-----------------------------------------------------------
    1065965// @name write_all_events
    1066966//                                               
     
    11961096//!@}
    11971097
    1198 
    1199 //!-----------------------------------------------------------
    1200 // @name get_trigger_radius                                 
    1201 //
    1202 // @desc return the radius of the trigger area in the camera (if set)
    1203 //
    1204 // @var *radius  Radius of the trigger area in the camera
    1205 // @return  TRUE: we choose a given radius for the trigger area
    1206 //
    1207 // @date Fri May  7 11:07:43 MET DST 1999
    1208 //------------------------------------------------------------
    1209 // @function
    1210 
    1211 //!@{
    1212 int get_trigger_radius(float *radius)
    1213 {
    1214   *radius = Trigger_Radius;
    1215   return ( Set_Trigger_Radius );
    1216 }
    1217 //!@}
    1218 
    1219 
    1220 //!-----------------------------------------------------------
    1221 // @name get_trigger_radius                                 
    1222 //
    1223 // @desc return the radius of the trigger area in the camera (if set)
    1224 //
    1225 // @var *radius  Radius of the trigger area in the camera
    1226 // @return  TRUE: we choose a given radius for the trigger area
    1227 //
    1228 // @date Fri May  7 11:07:43 MET DST 1999
    1229 //------------------------------------------------------------
    1230 // @function
    1231 
    1232 //!@{
    1233 int get_correction(float *corr)
    1234 {
    1235   *corr = fCorrection;
    1236   return ( Apply_Correction );
    1237 }
    1238 //!@}
    1239 
    12401098//!-----------------------------------------------------------
    12411099// @name FADC_Scan
     
    12841142//!@{
    12851143void
    1286 get_FADC_properties(float *ra, float *rf)
     1144get_FADC_properties(float *ra, float *rf, float *rao, float *rfo)
    12871145{
    12881146  *ra=FADC_response_ampl;
    12891147  *rf=FADC_response_fwhm;
     1148  *rao=FADC_resp_ampl_out;
     1149  *rfo=FADC_resp_fwhm_out;
    12901150
    12911151}
     
    13581218
    13591219//!-----------------------------------------------------------
    1360 // @name get_teles_axis
    1361 //                                               
    1362 // @desc give axis of the telescope
    1363 //
    1364 //------------------------------------------------------------
    1365 // @function
    1366 
    1367 //!@{
    1368 void get_teles_axis(float *th, float *p){
    1369     *th=Telescope_axis_th;
    1370     *p=Telescope_axis_ph;
    1371 }
    1372 //!@}
    1373 
    1374 //!-----------------------------------------------------------
    13751220// @name get_source_off
    13761221//                                               
     
    13881233
    13891234//!-----------------------------------------------------------
    1390 // @name get_corsika_vers
    1391 //                                               
    1392 // @desc give the vrsion of corsika
    1393 //
    1394 //------------------------------------------------------------
    1395 // @function
    1396 
    1397 //!@{
    1398 int get_corsika_ver(void){
    1399     return(Corsika_vers);
    1400 }
    1401 //!@}
    1402 
    1403 
     1235// @name get_FADC_pedesta
     1236//                                               
     1237// @desc get the value for the FADC pedestals
     1238//
     1239//------------------------------------------------------------
     1240// @function
     1241
     1242//!@{
     1243
     1244
     1245float get_FADC_pedestal(void){
     1246
     1247  return FADC_pedestal;
     1248
     1249}
     1250
     1251//!@}
    14041252//=------------------------------------------------------------
    14051253//!@subsection Log of this file.
     
    14081256//
    14091257// $Log: not supported by cvs2svn $
     1258// Revision 1.19  2003/02/12 13:47:32  blanch
     1259// *** empty log message ***
     1260//
    14101261// Revision 1.18  2003/01/14 13:37:47  blanch
    14111262// Option to set a dc value to rise the discriminator threshold has been added.
Note: See TracChangeset for help on using the changeset viewer.