| 1 | //=//////////////////////////////////////////////////////////////////////
|
|---|
| 2 | //=
|
|---|
| 3 | //= creadparam
|
|---|
| 4 | //=
|
|---|
| 5 | //= @file creadparam.cxx
|
|---|
| 6 | //= @desc Reading of parameters file
|
|---|
| 7 | //= @author J C Gonzalez
|
|---|
| 8 | //= @email gonzalez@mppmu.mpg.de
|
|---|
| 9 | //= @date Thu May 7 16:24:22 1998
|
|---|
| 10 | //=
|
|---|
| 11 | //=----------------------------------------------------------------------
|
|---|
| 12 | //=
|
|---|
| 13 | //= Created: Thu May 7 16:24:22 1998
|
|---|
| 14 | //= Author: Jose Carlos Gonzalez
|
|---|
| 15 | //= Purpose: Program for reflector simulation
|
|---|
| 16 | //= Notes: See files README for details
|
|---|
| 17 | //=
|
|---|
| 18 | //=----------------------------------------------------------------------
|
|---|
| 19 | //=
|
|---|
| 20 | //= $RCSfile: creadparam.cxx,v $
|
|---|
| 21 | //= $Revision: 1.1.1.1 $
|
|---|
| 22 | //= $Author: harald $
|
|---|
| 23 | //= $Date: 1999-11-05 11:59:34 $
|
|---|
| 24 | //=
|
|---|
| 25 | //=//////////////////////////////////////////////////////////////////////
|
|---|
| 26 |
|
|---|
| 27 | // @T \newpage
|
|---|
| 28 |
|
|---|
| 29 | //!@section Source code of |creadparam.cxx|.
|
|---|
| 30 |
|
|---|
| 31 | /*!@"
|
|---|
| 32 |
|
|---|
| 33 | This section describes briefly the source code for the file
|
|---|
| 34 | |creadparam.cxx|. This file is very closely related to the file
|
|---|
| 35 | |readparams.cxx| from the |reflector| program. Actually, this later
|
|---|
| 36 | file was the ancestror of the file you are looking at.
|
|---|
| 37 |
|
|---|
| 38 | All the defines it uses are located in the file |creadparam.h|. In
|
|---|
| 39 | the first one we can see the definitions of the commands available
|
|---|
| 40 | for the parameters file. We describe these commands in a later
|
|---|
| 41 | section.
|
|---|
| 42 |
|
|---|
| 43 | @"*/
|
|---|
| 44 |
|
|---|
| 45 | //!@subsection Includes and Global variables definition.
|
|---|
| 46 |
|
|---|
| 47 | /*!@"
|
|---|
| 48 |
|
|---|
| 49 | All the defines are located in the file {\tt creadparam.h}.
|
|---|
| 50 |
|
|---|
| 51 | @"*/
|
|---|
| 52 |
|
|---|
| 53 | //!@{
|
|---|
| 54 |
|
|---|
| 55 | #include "creadparam.h"
|
|---|
| 56 |
|
|---|
| 57 | //!@}
|
|---|
| 58 |
|
|---|
| 59 | //!@subsection Definition of global variables.
|
|---|
| 60 |
|
|---|
| 61 | /*!@"
|
|---|
| 62 |
|
|---|
| 63 | Here we define the global variables where the values from the
|
|---|
| 64 | parameters file are stored.
|
|---|
| 65 |
|
|---|
| 66 | @"*/
|
|---|
| 67 |
|
|---|
| 68 | //!@{
|
|---|
| 69 |
|
|---|
| 70 | static char Input_filename[PATH_MAX_LENGTH]; //@< input filename
|
|---|
| 71 | static char Output_filename[PATH_MAX_LENGTH]; //@< output filename
|
|---|
| 72 | static char Data_filename[PATH_MAX_LENGTH]; //@< data filename
|
|---|
| 73 | static char DIAG_filename[PATH_MAX_LENGTH]; //@< data filename
|
|---|
| 74 | static char ROOT_filename[PATH_MAX_LENGTH]; //@< data filename
|
|---|
| 75 | static char CT_filename[PATH_MAX_LENGTH]; //@< name of the CT def. file
|
|---|
| 76 | static int simulateNSB = TRUE; //@< Will we simulate NSB?
|
|---|
| 77 | static int anaPixels = -1; //@< number of pixels for the analysis
|
|---|
| 78 | static float meanNSB; //@< NSB mean value (per pixel)
|
|---|
| 79 | static float qThreshold; //@< Threshold value
|
|---|
| 80 | static float qTailCut; //@< Tail Cut value
|
|---|
| 81 | static int nIslandsCut; //@< Islands Cut value
|
|---|
| 82 | static int countIslands = TRUE; //@< Will we count the islands?
|
|---|
| 83 | static long int Seeds[2];
|
|---|
| 84 | static int *Skip;
|
|---|
| 85 | static int nSkip=0;
|
|---|
| 86 | static int Data_From_STDIN = FALSE;
|
|---|
| 87 | static int Read_Phe = FALSE;
|
|---|
| 88 | static int Read_Phe_All = FALSE;
|
|---|
| 89 | static int Write_All_Images = FALSE;
|
|---|
| 90 | static int Write_All_Data = FALSE;
|
|---|
| 91 | static int Select_Energy = TRUE;
|
|---|
| 92 | static float Select_Energy_le = 0.0; //@< GeV
|
|---|
| 93 | static float Select_Energy_ue = 100000.0; //@< GeV
|
|---|
| 94 | static float Trigger_Radius;
|
|---|
| 95 | static int Set_Trigger_Radius=FALSE;
|
|---|
| 96 | static float fCorrection;
|
|---|
| 97 | static int Apply_Correction=FALSE;
|
|---|
| 98 | //!@}
|
|---|
| 99 |
|
|---|
| 100 | //!@subsection The function |readparam()|.
|
|---|
| 101 |
|
|---|
| 102 | //!-----------------------------------------------------------
|
|---|
| 103 | // @name creadparam
|
|---|
| 104 | //
|
|---|
| 105 | // @desc read parameters from the stdin / parameters file
|
|---|
| 106 | //
|
|---|
| 107 | // @var *filename Name of the parameters file (NULL->STDIN)
|
|---|
| 108 | //
|
|---|
| 109 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 110 | //------------------------------------------------------------
|
|---|
| 111 | // @function
|
|---|
| 112 |
|
|---|
| 113 | //!@{
|
|---|
| 114 | void
|
|---|
| 115 | readparam(char * filename)
|
|---|
| 116 | {
|
|---|
| 117 | char sign[] = GLUE_postp( PROGRAM, VERSION ); //@< initialize sign
|
|---|
| 118 | char line[LINE_MAX_LENGTH]; //@< line to get from the stdin
|
|---|
| 119 | char token[ITEM_MAX_LENGTH]; //@< a single token
|
|---|
| 120 | int i, j; //@< dummy counters
|
|---|
| 121 | ifstream ifile;
|
|---|
| 122 |
|
|---|
| 123 | // use cin or ifile (reading from STDIN or from parameters file?
|
|---|
| 124 | if ( filename != NULL )
|
|---|
| 125 | ifile.open( filename );
|
|---|
| 126 |
|
|---|
| 127 | // get signature
|
|---|
| 128 | if ( filename != NULL )
|
|---|
| 129 | ifile.getline(line, LINE_MAX_LENGTH);
|
|---|
| 130 | else
|
|---|
| 131 | cin.getline(line, LINE_MAX_LENGTH);
|
|---|
| 132 | line[strlen(SIGNATURE)] = '\0';
|
|---|
| 133 | strcpy(line, sign);
|
|---|
| 134 | if (strcmp(sign, SIGNATURE) != 0) {
|
|---|
| 135 | cerr << "ERROR: Signature of parameters file is not correct\n";
|
|---|
| 136 | cerr << '"' << sign << '"' << '\n';
|
|---|
| 137 | cerr << "should be: " << SIGNATURE << '\n';
|
|---|
| 138 | exit(1);
|
|---|
| 139 | }
|
|---|
| 140 |
|
|---|
| 141 | // loop till the "end" directive is reached
|
|---|
| 142 | int is_end = FALSE;
|
|---|
| 143 | while (! is_end) {
|
|---|
| 144 |
|
|---|
| 145 | // get line from file or stdin
|
|---|
| 146 | if ( filename != NULL )
|
|---|
| 147 | ifile.getline(line, LINE_MAX_LENGTH);
|
|---|
| 148 | else
|
|---|
| 149 | cin.getline(line, LINE_MAX_LENGTH);
|
|---|
| 150 |
|
|---|
| 151 | // skip comments (start with '#')
|
|---|
| 152 | if (line[0] == '#')
|
|---|
| 153 | continue;
|
|---|
| 154 |
|
|---|
| 155 | // show user comments (start with '>')
|
|---|
| 156 | if (line[0] == '>') {
|
|---|
| 157 | cout << line << endl << flush;
|
|---|
| 158 | continue;
|
|---|
| 159 | }
|
|---|
| 160 |
|
|---|
| 161 | // look for each item at the beginning of the line
|
|---|
| 162 | for (i=0; i<=end_file; i++)
|
|---|
| 163 | if (strstr(line, ITEM_NAMES[i]) == line)
|
|---|
| 164 | break;
|
|---|
| 165 |
|
|---|
| 166 | // if it is not a valid line, just ignore it
|
|---|
| 167 | if (i == end_file+1) {
|
|---|
| 168 | cerr << "Skipping unknown token in [" << line << "]\n";
|
|---|
| 169 | continue;
|
|---|
| 170 | }
|
|---|
| 171 |
|
|---|
| 172 | // case block for each directive
|
|---|
| 173 | switch ( i ) {
|
|---|
| 174 |
|
|---|
| 175 | case input_file: //@< name of the input file
|
|---|
| 176 |
|
|---|
| 177 | // get the name of the input_file from the line
|
|---|
| 178 | sscanf(line, "%s %s", token, Input_filename);
|
|---|
| 179 |
|
|---|
| 180 | break;
|
|---|
| 181 |
|
|---|
| 182 | case output_file: //@< name of the output file
|
|---|
| 183 |
|
|---|
| 184 | // get the name of the output_file from the line
|
|---|
| 185 | sscanf(line, "%s %s", token, Output_filename);
|
|---|
| 186 |
|
|---|
| 187 | break;
|
|---|
| 188 |
|
|---|
| 189 | case data_file: //@< name of the data file
|
|---|
| 190 |
|
|---|
| 191 | // get the name of the data_file from the line
|
|---|
| 192 | sscanf(line, "%s %s", token, Data_filename);
|
|---|
| 193 |
|
|---|
| 194 | break;
|
|---|
| 195 |
|
|---|
| 196 | case diag_file: //@< name of the DIAG file
|
|---|
| 197 |
|
|---|
| 198 | // get the name of the data_file from the line
|
|---|
| 199 | sscanf(line, "%s %s", token, DIAG_filename);
|
|---|
| 200 | cout << '[' << DIAG_filename << ']' << endl << flush;
|
|---|
| 201 |
|
|---|
| 202 | break;
|
|---|
| 203 |
|
|---|
| 204 | case root_file: //@< name of the ROOT file
|
|---|
| 205 |
|
|---|
| 206 | // get the name of the data_file from the line
|
|---|
| 207 | sscanf(line, "%s %s", token, ROOT_filename);
|
|---|
| 208 | cout << '[' << ROOT_filename << ']' << endl << flush;
|
|---|
| 209 |
|
|---|
| 210 | break;
|
|---|
| 211 |
|
|---|
| 212 | case ct_file: //@< name of the telescope file
|
|---|
| 213 |
|
|---|
| 214 | // get the name of the ct_file from the line
|
|---|
| 215 | sscanf(line, "%s %s", token, CT_filename);
|
|---|
| 216 |
|
|---|
| 217 | break;
|
|---|
| 218 |
|
|---|
| 219 | case nsb_on: //@< simulate NSB?
|
|---|
| 220 |
|
|---|
| 221 | // we will simulate NSB
|
|---|
| 222 | simulateNSB = TRUE;
|
|---|
| 223 |
|
|---|
| 224 | break;
|
|---|
| 225 |
|
|---|
| 226 | case nsb_off: //@< simulate NSB?
|
|---|
| 227 |
|
|---|
| 228 | // we will NOT simulate NSB
|
|---|
| 229 | simulateNSB = FALSE;
|
|---|
| 230 |
|
|---|
| 231 | break;
|
|---|
| 232 |
|
|---|
| 233 | case nsb_mean: //@< value of <NSB> per pixel
|
|---|
| 234 |
|
|---|
| 235 | // get value of <NSB> (in photons)
|
|---|
| 236 | sscanf(line, "%s %f", token, &meanNSB);
|
|---|
| 237 | simulateNSB = TRUE;
|
|---|
| 238 |
|
|---|
| 239 | break;
|
|---|
| 240 |
|
|---|
| 241 | case ana_pixels: //@< number of pixels for analysis
|
|---|
| 242 |
|
|---|
| 243 | // number of pixels for analysis
|
|---|
| 244 | sscanf(line, "%s %d", token, &anaPixels);
|
|---|
| 245 |
|
|---|
| 246 | break;
|
|---|
| 247 |
|
|---|
| 248 | case threshold: //@< value of threshold for trigger (q0)
|
|---|
| 249 |
|
|---|
| 250 | // get value of threshold (in ph.e.)
|
|---|
| 251 | sscanf(line, "%s %f", token, &qThreshold);
|
|---|
| 252 |
|
|---|
| 253 | break;
|
|---|
| 254 |
|
|---|
| 255 | case tail_cut: //@< value of tail_cut (t0)
|
|---|
| 256 |
|
|---|
| 257 | // get value of tail_cut (in ph.e.)
|
|---|
| 258 | sscanf(line, "%s %f", token, &qTailCut);
|
|---|
| 259 |
|
|---|
| 260 | break;
|
|---|
| 261 |
|
|---|
| 262 | case islands_on: //@< DO count islands
|
|---|
| 263 |
|
|---|
| 264 | // DO count islands
|
|---|
| 265 | countIslands = TRUE;
|
|---|
| 266 |
|
|---|
| 267 | break;
|
|---|
| 268 |
|
|---|
| 269 | case islands_off: //@< do NOT count islands
|
|---|
| 270 |
|
|---|
| 271 | // do NOT count islands
|
|---|
| 272 | countIslands = FALSE;
|
|---|
| 273 |
|
|---|
| 274 | break;
|
|---|
| 275 |
|
|---|
| 276 | case islands_cut: //@< value of islands_cut (i0)
|
|---|
| 277 |
|
|---|
| 278 | // get value of islands_cut (in ph.e.)
|
|---|
| 279 | sscanf(line, "%s %d", token, &nIslandsCut);
|
|---|
| 280 | countIslands = TRUE;
|
|---|
| 281 |
|
|---|
| 282 | break;
|
|---|
| 283 |
|
|---|
| 284 | case seeds: //@< values of seeds for random numbers
|
|---|
| 285 |
|
|---|
| 286 | // get seeds
|
|---|
| 287 | sscanf(line, "%s %ld %ld", token, &Seeds[0], &Seeds[1]);
|
|---|
| 288 |
|
|---|
| 289 | break;
|
|---|
| 290 |
|
|---|
| 291 | case skip: //@< skip pathological showers
|
|---|
| 292 |
|
|---|
| 293 | // get showers to skip
|
|---|
| 294 | cin >> nSkip;
|
|---|
| 295 | Skip = new int[nSkip];
|
|---|
| 296 | for (j=0; j<nSkip; ++j) {
|
|---|
| 297 | cin >> Skip[j];
|
|---|
| 298 | cout << Skip[j] << endl << flush;
|
|---|
| 299 | }
|
|---|
| 300 |
|
|---|
| 301 | break;
|
|---|
| 302 |
|
|---|
| 303 | case data_from_stdin: //@< to read data from stdin
|
|---|
| 304 |
|
|---|
| 305 | // change boolean value
|
|---|
| 306 | Data_From_STDIN = TRUE;
|
|---|
| 307 |
|
|---|
| 308 | break;
|
|---|
| 309 |
|
|---|
| 310 | case read_phe: //@< to read PHE files
|
|---|
| 311 |
|
|---|
| 312 | // change boolean value
|
|---|
| 313 | Read_Phe = TRUE;
|
|---|
| 314 |
|
|---|
| 315 | break;
|
|---|
| 316 |
|
|---|
| 317 | case read_phe_all: //@< to read PHE files from write_all_images
|
|---|
| 318 |
|
|---|
| 319 | // change boolean value
|
|---|
| 320 | Read_Phe_All = TRUE;
|
|---|
| 321 |
|
|---|
| 322 | break;
|
|---|
| 323 |
|
|---|
| 324 | case write_all_images: //@< to write ALL the images
|
|---|
| 325 |
|
|---|
| 326 | // change boolean value
|
|---|
| 327 | Write_All_Images = TRUE;
|
|---|
| 328 |
|
|---|
| 329 | break;
|
|---|
| 330 |
|
|---|
| 331 | case write_all_data: //@< to write single pixel data
|
|---|
| 332 |
|
|---|
| 333 | // change boolean value
|
|---|
| 334 | Write_All_Data = TRUE;
|
|---|
| 335 |
|
|---|
| 336 | break;
|
|---|
| 337 |
|
|---|
| 338 | case select_energy: //@< value of islands_cut (i0)
|
|---|
| 339 |
|
|---|
| 340 | // get energy range
|
|---|
| 341 | sscanf(line, "%s %f %f", token, &Select_Energy_le, &Select_Energy_ue);
|
|---|
| 342 | Select_Energy = TRUE;
|
|---|
| 343 |
|
|---|
| 344 | break;
|
|---|
| 345 |
|
|---|
| 346 | case trigger_radius: //@< set radius of trigger area
|
|---|
| 347 |
|
|---|
| 348 | // get trigger radius
|
|---|
| 349 | sscanf(line, "%s %f", token, &Trigger_Radius);
|
|---|
| 350 | Set_Trigger_Radius = TRUE;
|
|---|
| 351 |
|
|---|
| 352 | break;
|
|---|
| 353 |
|
|---|
| 354 | case correction: //@< apply a kind of correction to pixel values
|
|---|
| 355 |
|
|---|
| 356 | // get trigger radius
|
|---|
| 357 | sscanf(line, "%s %f", token, &fCorrection);
|
|---|
| 358 | Apply_Correction = TRUE;
|
|---|
| 359 |
|
|---|
| 360 | break;
|
|---|
| 361 |
|
|---|
| 362 | case end_file: //@< end of the parameters file
|
|---|
| 363 |
|
|---|
| 364 | // show a short message
|
|---|
| 365 | is_end = TRUE;
|
|---|
| 366 |
|
|---|
| 367 | break;
|
|---|
| 368 |
|
|---|
| 369 | } // switch ( i )
|
|---|
| 370 |
|
|---|
| 371 | } // while (! is_end)
|
|---|
| 372 |
|
|---|
| 373 | // after the loop is finished, return to the main function
|
|---|
| 374 | return;
|
|---|
| 375 | }
|
|---|
| 376 | //!@}
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 | //!-----------------------------------------------------------
|
|---|
| 380 | // @name get_input_filename
|
|---|
| 381 | //
|
|---|
| 382 | // @desc get name of the input file
|
|---|
| 383 | //
|
|---|
| 384 | // @return Name of the Input file
|
|---|
| 385 | //
|
|---|
| 386 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 387 | //------------------------------------------------------------
|
|---|
| 388 | // @function
|
|---|
| 389 |
|
|---|
| 390 | //!@{
|
|---|
| 391 | char *
|
|---|
| 392 | get_input_filename(void)
|
|---|
| 393 | {
|
|---|
| 394 | return (Input_filename);
|
|---|
| 395 | }
|
|---|
| 396 | //!@}
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 | //!-----------------------------------------------------------
|
|---|
| 400 | // @name get_output_filename
|
|---|
| 401 | //
|
|---|
| 402 | // @desc get name of the output file
|
|---|
| 403 | //
|
|---|
| 404 | // @return Name of the Output file
|
|---|
| 405 | //
|
|---|
| 406 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 407 | //------------------------------------------------------------
|
|---|
| 408 | // @function
|
|---|
| 409 |
|
|---|
| 410 | //!@{
|
|---|
| 411 | char *
|
|---|
| 412 | get_output_filename(void)
|
|---|
| 413 | {
|
|---|
| 414 | return (Output_filename);
|
|---|
| 415 | }
|
|---|
| 416 | //!@}
|
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 | //!-----------------------------------------------------------
|
|---|
| 420 | // @name get_data_filename
|
|---|
| 421 | //
|
|---|
| 422 | // @desc get name of the data file
|
|---|
| 423 | //
|
|---|
| 424 | // @return Name of the Data file
|
|---|
| 425 | //
|
|---|
| 426 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 427 | //------------------------------------------------------------
|
|---|
| 428 | // @function
|
|---|
| 429 |
|
|---|
| 430 | //!@{
|
|---|
| 431 | char *
|
|---|
| 432 | get_data_filename(void)
|
|---|
| 433 | {
|
|---|
| 434 | return (Data_filename);
|
|---|
| 435 | }
|
|---|
| 436 | //!@}
|
|---|
| 437 |
|
|---|
| 438 |
|
|---|
| 439 | //!-----------------------------------------------------------
|
|---|
| 440 | // @name get_diag_filename
|
|---|
| 441 | //
|
|---|
| 442 | // @desc get name of the diagnostic output file
|
|---|
| 443 | //
|
|---|
| 444 | // @return Name of the DIAG file
|
|---|
| 445 | //
|
|---|
| 446 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 447 | //------------------------------------------------------------
|
|---|
| 448 | // @function
|
|---|
| 449 |
|
|---|
| 450 | //!@{
|
|---|
| 451 | char *
|
|---|
| 452 | get_diag_filename(void)
|
|---|
| 453 | {
|
|---|
| 454 | return (DIAG_filename);
|
|---|
| 455 | }
|
|---|
| 456 | //!@}
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 | //!-----------------------------------------------------------
|
|---|
| 460 | // @name get_root_filename
|
|---|
| 461 | //
|
|---|
| 462 | // @desc get name of the ROOT file
|
|---|
| 463 | //
|
|---|
| 464 | // @return Name of the ROOT file
|
|---|
| 465 | //
|
|---|
| 466 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 467 | //------------------------------------------------------------
|
|---|
| 468 | // @function
|
|---|
| 469 |
|
|---|
| 470 | //!@{
|
|---|
| 471 | char *
|
|---|
| 472 | get_root_filename(void)
|
|---|
| 473 | {
|
|---|
| 474 | return (ROOT_filename);
|
|---|
| 475 | }
|
|---|
| 476 | //!@}
|
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 | //!-----------------------------------------------------------
|
|---|
| 481 | // @name get_ct_filename
|
|---|
| 482 | //
|
|---|
| 483 | // @desc get name of CT definition file
|
|---|
| 484 | //
|
|---|
| 485 | // @return Name of the CT definition file
|
|---|
| 486 | //
|
|---|
| 487 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 488 | //------------------------------------------------------------
|
|---|
| 489 | // @function
|
|---|
| 490 |
|
|---|
| 491 | //!@{
|
|---|
| 492 | char *
|
|---|
| 493 | get_ct_filename(void)
|
|---|
| 494 | {
|
|---|
| 495 | return (CT_filename);
|
|---|
| 496 | }
|
|---|
| 497 | //!@}
|
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 | //!-----------------------------------------------------------
|
|---|
| 501 | // @name get_nsb
|
|---|
| 502 | //
|
|---|
| 503 | // @desc are we going to simulate NSB ?
|
|---|
| 504 | //
|
|---|
| 505 | // @var *n Mean value for the NSB (ph.e./pixel)
|
|---|
| 506 | // @return TRUE: we'll simulate NSB; FALSE: we won't
|
|---|
| 507 | //
|
|---|
| 508 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 509 | //------------------------------------------------------------
|
|---|
| 510 | // @function
|
|---|
| 511 |
|
|---|
| 512 | //!@{
|
|---|
| 513 | int
|
|---|
| 514 | get_nsb(float *n)
|
|---|
| 515 | {
|
|---|
| 516 | *n = meanNSB;
|
|---|
| 517 | return ( simulateNSB );
|
|---|
| 518 | }
|
|---|
| 519 | //!@}
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 | //!-----------------------------------------------------------
|
|---|
| 523 | // @name get_threshold
|
|---|
| 524 | //
|
|---|
| 525 | // @desc get threshold value
|
|---|
| 526 | //
|
|---|
| 527 | // @return Value of the threshold q$_0$
|
|---|
| 528 | //
|
|---|
| 529 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 530 | //------------------------------------------------------------
|
|---|
| 531 | // @function
|
|---|
| 532 |
|
|---|
| 533 | //!@{
|
|---|
| 534 | float
|
|---|
| 535 | get_threshold(void)
|
|---|
| 536 | {
|
|---|
| 537 | return( qThreshold );
|
|---|
| 538 | }
|
|---|
| 539 | //!@}
|
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 | //!-----------------------------------------------------------
|
|---|
| 543 | // @name get_tail_cut
|
|---|
| 544 | //
|
|---|
| 545 | // @desc get tail cut value
|
|---|
| 546 | //
|
|---|
| 547 | // @return Value for the Tail-cut
|
|---|
| 548 | //
|
|---|
| 549 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 550 | //------------------------------------------------------------
|
|---|
| 551 | // @function
|
|---|
| 552 |
|
|---|
| 553 | //!@{
|
|---|
| 554 | float
|
|---|
| 555 | get_tail_cut(void)
|
|---|
| 556 | {
|
|---|
| 557 | return( qTailCut );
|
|---|
| 558 | }
|
|---|
| 559 | //!@}
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 | //!-----------------------------------------------------------
|
|---|
| 563 | // @name get_islands_cut
|
|---|
| 564 | //
|
|---|
| 565 | // @desc are we going to count the islands ?
|
|---|
| 566 | //
|
|---|
| 567 | // @var *n Cut on islands number
|
|---|
| 568 | // @return TRUE: we'll count the islands; FALSE: we won't
|
|---|
| 569 | //
|
|---|
| 570 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 571 | //------------------------------------------------------------
|
|---|
| 572 | // @function
|
|---|
| 573 |
|
|---|
| 574 | //!@{
|
|---|
| 575 | int
|
|---|
| 576 | get_islands_cut(int *n)
|
|---|
| 577 | {
|
|---|
| 578 | *n = nIslandsCut;
|
|---|
| 579 | return ( countIslands );
|
|---|
| 580 | }
|
|---|
| 581 | //!@}
|
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 | //!-----------------------------------------------------------
|
|---|
| 585 | // @name get_ana_pixels
|
|---|
| 586 | //
|
|---|
| 587 | // @desc number of pixels for the analysis
|
|---|
| 588 | //
|
|---|
| 589 | // @return Number of pixels to use in the image parameters
|
|---|
| 590 | //
|
|---|
| 591 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 592 | //------------------------------------------------------------
|
|---|
| 593 | // @function
|
|---|
| 594 |
|
|---|
| 595 | //!@{
|
|---|
| 596 | int
|
|---|
| 597 | get_ana_pixels(void)
|
|---|
| 598 | {
|
|---|
| 599 | return ( anaPixels );
|
|---|
| 600 | }
|
|---|
| 601 | //!@}
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 | //!-----------------------------------------------------------
|
|---|
| 605 | // @name get_seeds
|
|---|
| 606 | //
|
|---|
| 607 | // @desc are we going to count the islands ?
|
|---|
| 608 | //
|
|---|
| 609 | // @var *n Number of the seed
|
|---|
| 610 | // @return N-th random-number Seed
|
|---|
| 611 | //
|
|---|
| 612 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 613 | //------------------------------------------------------------
|
|---|
| 614 | // @function
|
|---|
| 615 |
|
|---|
| 616 | //!@{
|
|---|
| 617 | long int
|
|---|
| 618 | get_seeds(int n)
|
|---|
| 619 | {
|
|---|
| 620 | return ( Seeds[n] );
|
|---|
| 621 | }
|
|---|
| 622 | //!@}
|
|---|
| 623 |
|
|---|
| 624 |
|
|---|
| 625 | //!-----------------------------------------------------------
|
|---|
| 626 | // @name get_skip_showers
|
|---|
| 627 | //
|
|---|
| 628 | // @desc get list of showers to skip
|
|---|
| 629 | //
|
|---|
| 630 | // @var *s1 Pointer to a vector of number of showers
|
|---|
| 631 | //
|
|---|
| 632 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 633 | //------------------------------------------------------------
|
|---|
| 634 | // @function
|
|---|
| 635 |
|
|---|
| 636 | //!@{
|
|---|
| 637 | void
|
|---|
| 638 | get_skip_showers( int *s )
|
|---|
| 639 | {
|
|---|
| 640 | int i;
|
|---|
| 641 | for (i=0; i<nSkip; ++i)
|
|---|
| 642 | s[i] = Skip[i];
|
|---|
| 643 | }
|
|---|
| 644 | //!@}
|
|---|
| 645 |
|
|---|
| 646 |
|
|---|
| 647 | //!-----------------------------------------------------------
|
|---|
| 648 | // @name get_nskip_showers
|
|---|
| 649 | //
|
|---|
| 650 | // @desc get number of showers to skip
|
|---|
| 651 | //
|
|---|
| 652 | // @return Number of showers to be skipped
|
|---|
| 653 | //
|
|---|
| 654 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 655 | //------------------------------------------------------------
|
|---|
| 656 | // @function
|
|---|
| 657 |
|
|---|
| 658 | //!@{
|
|---|
| 659 | int
|
|---|
| 660 | get_nskip_showers( void )
|
|---|
| 661 | {
|
|---|
| 662 | return( nSkip );
|
|---|
| 663 | }
|
|---|
| 664 | //!@}
|
|---|
| 665 |
|
|---|
| 666 |
|
|---|
| 667 | //!-----------------------------------------------------------
|
|---|
| 668 | // @name get_data_from_stdin
|
|---|
| 669 | //
|
|---|
| 670 | // @desc get whether we will read the data from the STDIN
|
|---|
| 671 | //
|
|---|
| 672 | // @return TRUE: we'll read data from STDIN; FALSE: we won't
|
|---|
| 673 | //
|
|---|
| 674 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 675 | //------------------------------------------------------------
|
|---|
| 676 | // @function
|
|---|
| 677 |
|
|---|
| 678 | //!@{
|
|---|
| 679 | int
|
|---|
| 680 | get_data_from_stdin(void)
|
|---|
| 681 | {
|
|---|
| 682 | return ( Data_From_STDIN );
|
|---|
| 683 | }
|
|---|
| 684 | //!@}
|
|---|
| 685 |
|
|---|
| 686 |
|
|---|
| 687 | //!-----------------------------------------------------------
|
|---|
| 688 | // @name get_read_phe
|
|---|
| 689 | //
|
|---|
| 690 | // @desc get whether we will read PHE files
|
|---|
| 691 | //
|
|---|
| 692 | // @return TRUE: we'll read PHE files; FALSE: we won't
|
|---|
| 693 | //
|
|---|
| 694 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 695 | //------------------------------------------------------------
|
|---|
| 696 | // @function
|
|---|
| 697 |
|
|---|
| 698 | //!@{
|
|---|
| 699 | int
|
|---|
| 700 | get_read_phe(void)
|
|---|
| 701 | {
|
|---|
| 702 | return ( Read_Phe );
|
|---|
| 703 | }
|
|---|
| 704 | //!@}
|
|---|
| 705 |
|
|---|
| 706 |
|
|---|
| 707 | //!-----------------------------------------------------------
|
|---|
| 708 | // @name get_read_phe_all
|
|---|
| 709 | //
|
|---|
| 710 | // @desc get whether we will read PHE files, with write_all_images
|
|---|
| 711 | //
|
|---|
| 712 | // @return TRUE: we'll do it; FALSE: we won't
|
|---|
| 713 | //
|
|---|
| 714 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 715 | //------------------------------------------------------------
|
|---|
| 716 | // @function
|
|---|
| 717 |
|
|---|
| 718 | //!@{
|
|---|
| 719 | int
|
|---|
| 720 | get_read_phe_all(void)
|
|---|
| 721 | {
|
|---|
| 722 | return ( Read_Phe_All );
|
|---|
| 723 | }
|
|---|
| 724 | //!@}
|
|---|
| 725 |
|
|---|
| 726 |
|
|---|
| 727 | //!-----------------------------------------------------------
|
|---|
| 728 | // @name write_all_images
|
|---|
| 729 | //
|
|---|
| 730 | // @desc write all images to .phe, even those without trigger
|
|---|
| 731 | //
|
|---|
| 732 | // @return TRUE: we'll write everything; FALSE: we won't
|
|---|
| 733 | //
|
|---|
| 734 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 735 | //------------------------------------------------------------
|
|---|
| 736 | // @function
|
|---|
| 737 |
|
|---|
| 738 | //!@{
|
|---|
| 739 | int
|
|---|
| 740 | get_write_all_images(void)
|
|---|
| 741 | {
|
|---|
| 742 | return ( Write_All_Images );
|
|---|
| 743 | }
|
|---|
| 744 | //!@}
|
|---|
| 745 |
|
|---|
| 746 |
|
|---|
| 747 | //!-----------------------------------------------------------
|
|---|
| 748 | // @name write_all_data
|
|---|
| 749 | //
|
|---|
| 750 | // @desc write single pixel data to file .dat
|
|---|
| 751 | //
|
|---|
| 752 | // @return TRUE: we'll write everything; FALSE: we won't
|
|---|
| 753 | //
|
|---|
| 754 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 755 | //------------------------------------------------------------
|
|---|
| 756 | // @function
|
|---|
| 757 |
|
|---|
| 758 | //!@{
|
|---|
| 759 | int
|
|---|
| 760 | get_write_all_data(void)
|
|---|
| 761 | {
|
|---|
| 762 | return ( Write_All_Data );
|
|---|
| 763 | }
|
|---|
| 764 | //!@}
|
|---|
| 765 |
|
|---|
| 766 |
|
|---|
| 767 | //!-----------------------------------------------------------
|
|---|
| 768 | // @name get_select_energy
|
|---|
| 769 | //
|
|---|
| 770 | // @desc return energy range allowed for showers from .phe file
|
|---|
| 771 | //
|
|---|
| 772 | // @var *le Lower limit in the allowed energy range
|
|---|
| 773 | // @var *ue Lower limit in the allowed energy range
|
|---|
| 774 | // @return TRUE: we make selection on the energy; FALSE: we don't
|
|---|
| 775 | //
|
|---|
| 776 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 777 | //------------------------------------------------------------
|
|---|
| 778 | // @function
|
|---|
| 779 |
|
|---|
| 780 | //!@{
|
|---|
| 781 | int
|
|---|
| 782 | get_select_energy(float *le, float *ue)
|
|---|
| 783 | {
|
|---|
| 784 | *le = Select_Energy_le;
|
|---|
| 785 | *ue = Select_Energy_ue;
|
|---|
| 786 | return ( Select_Energy );
|
|---|
| 787 | }
|
|---|
| 788 | //!@}
|
|---|
| 789 |
|
|---|
| 790 |
|
|---|
| 791 | //!-----------------------------------------------------------
|
|---|
| 792 | // @name get_trigger_radius
|
|---|
| 793 | //
|
|---|
| 794 | // @desc return the radius of the trigger area in the camera (if set)
|
|---|
| 795 | //
|
|---|
| 796 | // @var *radius Radius of the trigger area in the camera
|
|---|
| 797 | // @return TRUE: we choose a given radius for the trigger area
|
|---|
| 798 | //
|
|---|
| 799 | // @date Fri May 7 11:07:43 MET DST 1999
|
|---|
| 800 | //------------------------------------------------------------
|
|---|
| 801 | // @function
|
|---|
| 802 |
|
|---|
| 803 | //!@{
|
|---|
| 804 | int get_trigger_radius(float *radius)
|
|---|
| 805 | {
|
|---|
| 806 | *radius = Trigger_Radius;
|
|---|
| 807 | return ( Set_Trigger_Radius );
|
|---|
| 808 | }
|
|---|
| 809 | //!@}
|
|---|
| 810 |
|
|---|
| 811 |
|
|---|
| 812 | //!-----------------------------------------------------------
|
|---|
| 813 | // @name get_trigger_radius
|
|---|
| 814 | //
|
|---|
| 815 | // @desc return the radius of the trigger area in the camera (if set)
|
|---|
| 816 | //
|
|---|
| 817 | // @var *radius Radius of the trigger area in the camera
|
|---|
| 818 | // @return TRUE: we choose a given radius for the trigger area
|
|---|
| 819 | //
|
|---|
| 820 | // @date Fri May 7 11:07:43 MET DST 1999
|
|---|
| 821 | //------------------------------------------------------------
|
|---|
| 822 | // @function
|
|---|
| 823 |
|
|---|
| 824 | //!@{
|
|---|
| 825 | int get_correction(float *corr)
|
|---|
| 826 | {
|
|---|
| 827 | *corr = fCorrection;
|
|---|
| 828 | return ( Apply_Correction );
|
|---|
| 829 | }
|
|---|
| 830 | //!@}
|
|---|
| 831 |
|
|---|
| 832 |
|
|---|
| 833 | //=------------------------------------------------------------
|
|---|
| 834 | //!@subsection Log of this file.
|
|---|
| 835 |
|
|---|
| 836 | //!@{
|
|---|
| 837 | //
|
|---|
| 838 | // $Log: not supported by cvs2svn $
|
|---|
| 839 | // Revision 1.2 1999/10/22 15:01:28 petry
|
|---|
| 840 | // version sent to H.K. and N.M. on Fri Oct 22 1999
|
|---|
| 841 | //
|
|---|
| 842 | // Revision 1.1.1.1 1999/10/21 16:35:11 petry
|
|---|
| 843 | // first synthesised version
|
|---|
| 844 | //
|
|---|
| 845 | // Revision 1.6 1999/03/15 14:59:08 gonzalez
|
|---|
| 846 | // camera-1_1
|
|---|
| 847 | //
|
|---|
| 848 | // Revision 1.5 1999/03/02 09:56:12 gonzalez
|
|---|
| 849 | // *** empty log message ***
|
|---|
| 850 | //
|
|---|
| 851 | // Revision 1.4 1999/01/14 17:32:41 gonzalez
|
|---|
| 852 | // Added to camera the STDIN input option (data_from_input)
|
|---|
| 853 | //
|
|---|
| 854 | //!@}
|
|---|
| 855 |
|
|---|
| 856 | //=EOF
|
|---|