Ignore:
Timestamp:
01/28/00 09:19:54 (25 years ago)
Author:
harald
Message:
A new version from JoseCarlosGonzalez. The old routine for random_pointing
was not correct. This one should be okay!!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Reflector/readparam.cxx

    r292 r348  
    1919//=
    2020//= $RCSfile: readparam.cxx,v $
    21 //= $Revision: 1.1.1.1 $
     21//= $Revision: 1.2 $
    2222//= $Author: harald $
    23 //= $Date: 1999-10-29 07:00:33 $
     23//= $Date: 2000-01-28 09:19:54 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
     
    120120static int Data_To_STDOUT = FALSE;
    121121
     122//@: number of times a shower is going to be processed
     123static int nRepeat_Random = 1;
     124
    122125//!@}
    123126
     
    148151// @desc  read parameters from the stdin / parameters file
    149152//
    150 // @var   *filename  Name of the parameters file (NULL->STDIN)
     153// @var   *filename  Name of the parameters file (0->STDIN)
    151154//
    152155// @date Mon Sep 14 13:27:56 MET DST 1998
     
    166169
    167170  // use cin or ifile (reading from STDIN or from parameters file?
    168   if ( filename != NULL )
     171  if ( filename != 0 )
    169172    ifile.open( filename );
    170173
    171174  // get signature
    172   if ( filename != NULL )
     175  if ( filename != 0 )
    173176    ifile.getline(line, LINE_MAX_LENGTH);
    174177  else
     
    188191
    189192    // get line from file or stdin
    190     if ( filename != NULL )
     193    if ( filename != 0 )
    191194      ifile.getline(line, LINE_MAX_LENGTH);
    192195    else
     
    233236      for (i=0; i<Num_of_paths; i++) {
    234237
    235         if ( filename != NULL )
     238        if ( filename != 0 )
    236239          ifile.getline(Paths_list[i], PATH_MAX_LENGTH);
    237240        else
     
    358361     
    359362      break;
    360      
    361363   
    362364    case random_pointing:     // uses a random CT pointing for each shower
     
    369371      cerr << "random_pointing: " << Random_Pointing_MaxDist << ' ';
    370372      Random_Pointing_MaxDist = RAD(Random_Pointing_MaxDist);
    371       cerr << Random_Pointing_MaxDist << " radians \n";
    372 
    373       break;
    374      
     373      cerr << Random_Pointing_MaxDist << " radians \n" << flush;
     374
     375      break;
     376     
     377    case repeat_random:       // number of times a random pointing is to be done
     378         
     379      // set nRepeat_Random
     380      sscanf(line, "%s %d", token, &nRepeat_Random);
     381
     382      cerr << "repeat_random: " << nRepeat_Random << '\n' << flush;
     383
     384      break;
    375385   
    376386    case block:               // analyzes data in blocks
     
    410420  } // while (! is_end)
    411421
    412   if ( filename != NULL ) {
     422  if ( filename != 0 ) {
    413423    ifile.close();
    414424  }
     
    821831
    822832
     833//!---------------------------------------------------------------------
     834// @name get_repeat_random
     835//       
     836// @desc get number of times a random displacement is going to be done
     837//
     838// @return   number of times
     839//
     840// @date
     841//----------------------------------------------------------------------
     842// @function
     843
     844//!@{
     845int
     846get_repeat_random(void)
     847{
     848  return ( nRepeat_Random );
     849}
     850//!@}
     851
     852
    823853//=------------------------------------------------------------
    824854//!@subsection Log of this file.
     
    827857//
    828858// $Log: not supported by cvs2svn $
     859// Revision 1.14  2000/01/27  10:47:54  gonzalez
     860// JAN2000-STABLE
     861//
    829862// Revision 1.13  1999/10/05  11:06:38  gonzalez
    830863// Sep. 1999
Note: See TracChangeset for help on using the changeset viewer.