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!!
Location:
trunk/MagicSoft/Simulation/Detector/Reflector
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Reflector/Makefile

    r318 r348  
    1919#
    2020# $RCSfile: Makefile,v $
    21 # $Revision: 1.3 $
     21# $Revision: 1.4 $
    2222# $Author: harald $
    23 # $Date: 1999-11-11 20:29:30 $
     23# $Date: 2000-01-28 09:19:54 $
    2424#
    2525##################################################################
     
    180180../include-CORSIKA/COREventHeader.o: ../include-CORSIKA/COREventHeader.hxx
    181181../include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
    182 ../include-CORSIKA/COREventHeader.o: /usr/include/features.h
    183 ../include-CORSIKA/COREventHeader.o: /usr/include/sys/cdefs.h
    184 ../include-CORSIKA/COREventHeader.o: /usr/include/gnu/stubs.h
    185 ../include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     182../include-CORSIKA/COREventHeader.o: /usr/include/standards.h
     183../include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
    186184../include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
    187 ../include-CORSIKA/COREventHeader.o: /usr/include/gnu/types.h
    188 ../include-CORSIKA/COREventHeader.o: /usr/include/time.h
    189 ../include-CORSIKA/COREventHeader.o: /usr/include/endian.h
    190 ../include-CORSIKA/COREventHeader.o: /usr/include/bytesex.h
     185../include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
    191186../include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
    192 ../include-CORSIKA/COREventHeader.o: /usr/include/selectbits.h
    193 ../include-CORSIKA/COREventHeader.o: /usr/include/alloca.h
    194187../include-CORSIKA/COREventHeader.o: /usr/include/math.h
    195 ../include-CORSIKA/COREventHeader.o: /usr/include/huge_val.h
    196 ../include-CORSIKA/COREventHeader.o: /usr/include/mathcalls.h
    197 ../include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    198188../include-CORSIKA/CORParticle.o: ../include-CORSIKA/CORParticle.hxx
    199189../include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
    200 ../include-CORSIKA/CORParticle.o: /usr/include/features.h
    201 ../include-CORSIKA/CORParticle.o: /usr/include/sys/cdefs.h
    202 ../include-CORSIKA/CORParticle.o: /usr/include/gnu/stubs.h
    203 ../include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     190../include-CORSIKA/CORParticle.o: /usr/include/standards.h
     191../include-CORSIKA/CORParticle.o: /usr/include/getopt.h
    204192../include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
    205 ../include-CORSIKA/CORParticle.o: /usr/include/gnu/types.h
    206 ../include-CORSIKA/CORParticle.o: /usr/include/time.h /usr/include/endian.h
    207 ../include-CORSIKA/CORParticle.o: /usr/include/bytesex.h
     193../include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
    208194../include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
    209 ../include-CORSIKA/CORParticle.o: /usr/include/selectbits.h
    210 ../include-CORSIKA/CORParticle.o: /usr/include/alloca.h /usr/include/math.h
    211 ../include-CORSIKA/CORParticle.o: /usr/include/huge_val.h
    212 ../include-CORSIKA/CORParticle.o: /usr/include/mathcalls.h
    213 ../include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     195../include-CORSIKA/CORParticle.o: /usr/include/math.h
    214196../include-CORSIKA/CORStatfile.o: ../include-CORSIKA/CORStatfile.hxx
    215197../include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
    216 ../include-CORSIKA/CORStatfile.o: /usr/include/features.h
    217 ../include-CORSIKA/CORStatfile.o: /usr/include/sys/cdefs.h
    218 ../include-CORSIKA/CORStatfile.o: /usr/include/gnu/stubs.h
    219 ../include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
     198../include-CORSIKA/CORStatfile.o: /usr/include/standards.h
     199../include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
    220200../include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
    221 ../include-CORSIKA/CORStatfile.o: /usr/include/gnu/types.h
    222 ../include-CORSIKA/CORStatfile.o: /usr/include/time.h /usr/include/endian.h
    223 ../include-CORSIKA/CORStatfile.o: /usr/include/bytesex.h
     201../include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
    224202../include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
    225 ../include-CORSIKA/CORStatfile.o: /usr/include/selectbits.h
    226 ../include-CORSIKA/CORStatfile.o: /usr/include/alloca.h /usr/include/math.h
    227 ../include-CORSIKA/CORStatfile.o: /usr/include/huge_val.h
    228 ../include-CORSIKA/CORStatfile.o: /usr/include/mathcalls.h
    229 ../include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     203../include-CORSIKA/CORStatfile.o: /usr/include/math.h
    230204../include-MC/MCEventHeader.o: ../include-MC/MCEventHeader.hxx
    231 ../include-MC/MCEventHeader.o: /usr/include/stdlib.h /usr/include/features.h
    232 ../include-MC/MCEventHeader.o: /usr/include/sys/cdefs.h
    233 ../include-MC/MCEventHeader.o: /usr/include/gnu/stubs.h
    234 ../include-MC/MCEventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    235 ../include-MC/MCEventHeader.o: /usr/include/sys/types.h
    236 ../include-MC/MCEventHeader.o: /usr/include/gnu/types.h /usr/include/time.h
    237 ../include-MC/MCEventHeader.o: /usr/include/endian.h /usr/include/bytesex.h
    238 ../include-MC/MCEventHeader.o: /usr/include/sys/select.h
    239 ../include-MC/MCEventHeader.o: /usr/include/selectbits.h
    240 ../include-MC/MCEventHeader.o: /usr/include/alloca.h /usr/include/math.h
    241 ../include-MC/MCEventHeader.o: /usr/include/huge_val.h
    242 ../include-MC/MCEventHeader.o: /usr/include/mathcalls.h
    243 ../include-MC/MCEventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
     205../include-MC/MCEventHeader.o: /usr/include/stdlib.h /usr/include/standards.h
     206../include-MC/MCEventHeader.o: /usr/include/getopt.h /usr/include/sys/types.h
     207../include-MC/MCEventHeader.o: /usr/include/mach/machine/vm_types.h
     208../include-MC/MCEventHeader.o: /usr/include/sys/select.h /usr/include/math.h
    244209../include-MC/MCEventHeader.o: ../include-CORSIKA/COREventHeader.hxx
    245210../include-MC/MCCphoton.o: ../include-MC/MCCphoton.hxx /usr/include/stdlib.h
    246 ../include-MC/MCCphoton.o: /usr/include/features.h /usr/include/sys/cdefs.h
    247 ../include-MC/MCCphoton.o: /usr/include/gnu/stubs.h
    248 ../include-MC/MCCphoton.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    249 ../include-MC/MCCphoton.o: /usr/include/sys/types.h /usr/include/gnu/types.h
    250 ../include-MC/MCCphoton.o: /usr/include/time.h /usr/include/endian.h
    251 ../include-MC/MCCphoton.o: /usr/include/bytesex.h /usr/include/sys/select.h
    252 ../include-MC/MCCphoton.o: /usr/include/selectbits.h /usr/include/alloca.h
    253 ../include-MC/MCCphoton.o: /usr/include/string.h /usr/include/math.h
    254 ../include-MC/MCCphoton.o: /usr/include/huge_val.h /usr/include/mathcalls.h
    255 ../include-MC/MCCphoton.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    256 atm.o: atm.h /usr/include/stdlib.h /usr/include/features.h
    257 atm.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
    258 atm.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    259 atm.o: /usr/include/sys/types.h /usr/include/gnu/types.h /usr/include/time.h
    260 atm.o: /usr/include/endian.h /usr/include/bytesex.h /usr/include/sys/select.h
    261 atm.o: /usr/include/selectbits.h /usr/include/alloca.h /usr/include/stdio.h
    262 atm.o: /usr/include/libio.h /usr/include/_G_config.h
    263 atm.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
    264 atm.o: /usr/include/stdio_lim.h /usr/include/string.h /usr/include/math.h
    265 atm.o: /usr/include/huge_val.h /usr/include/mathcalls.h
    266 atm.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h reflector-v.h
    267 readparam.o: readparam.h /usr/include/stdlib.h /usr/include/features.h
    268 readparam.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
    269 readparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    270 readparam.o: /usr/include/sys/types.h /usr/include/gnu/types.h
    271 readparam.o: /usr/include/time.h /usr/include/endian.h /usr/include/bytesex.h
    272 readparam.o: /usr/include/sys/select.h /usr/include/selectbits.h
    273 readparam.o: /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h
    274 readparam.o: /usr/include/_G_config.h
    275 readparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
    276 readparam.o: /usr/include/stdio_lim.h /usr/include/string.h
    277 readparam.o: /usr/include/math.h /usr/include/huge_val.h
    278 readparam.o: /usr/include/mathcalls.h
    279 readparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    280 readparam.o: /usr/include/unistd.h /usr/include/posix_opt.h
    281 readparam.o: /usr/include/confname.h reflector-v.h atm.h
    282 reflector.o: reflector.h /usr/include/stdlib.h /usr/include/features.h
    283 reflector.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
    284 reflector.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
    285 reflector.o: /usr/include/sys/types.h /usr/include/gnu/types.h
    286 reflector.o: /usr/include/time.h /usr/include/endian.h /usr/include/bytesex.h
    287 reflector.o: /usr/include/sys/select.h /usr/include/selectbits.h
    288 reflector.o: /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h
    289 reflector.o: /usr/include/_G_config.h
    290 reflector.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
    291 reflector.o: /usr/include/stdio_lim.h /usr/include/string.h
    292 reflector.o: /usr/include/math.h /usr/include/huge_val.h
    293 reflector.o: /usr/include/mathcalls.h
    294 reflector.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
    295 reflector.o: /usr/include/dirent.h /usr/include/direntry.h
    296 reflector.o: /usr/include/posix1_lim.h /usr/include/local_lim.h
    297 reflector.o: /usr/include/linux/limits.h /usr/include/unistd.h
    298 reflector.o: /usr/include/posix_opt.h /usr/include/confname.h reflector-v.h
    299 reflector.o: readparam.h atm.h ../include-CORSIKA/COREventHeader.hxx
     211../include-MC/MCCphoton.o: /usr/include/standards.h /usr/include/getopt.h
     212../include-MC/MCCphoton.o: /usr/include/sys/types.h
     213../include-MC/MCCphoton.o: /usr/include/mach/machine/vm_types.h
     214../include-MC/MCCphoton.o: /usr/include/sys/select.h /usr/include/string.h
     215../include-MC/MCCphoton.o: /usr/include/strings.h /usr/include/math.h
     216atm.o: atm.h /usr/include/stdlib.h /usr/include/standards.h
     217atm.o: /usr/include/getopt.h /usr/include/sys/types.h
     218atm.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
     219atm.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
     220atm.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
     221atm.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
     222atm.o: /usr/include/sys/rt_limits.h /usr/include/string.h
     223atm.o: /usr/include/strings.h /usr/include/math.h reflector-v.h
     224readparam.o: readparam.h /usr/include/stdlib.h /usr/include/standards.h
     225readparam.o: /usr/include/getopt.h /usr/include/sys/types.h
     226readparam.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
     227readparam.o: /usr/include/stdio.h /usr/include/sys/seek.h
     228readparam.o: /usr/include/va_list.h /usr/include/sys/limits.h
     229readparam.o: /usr/include/sys/machine/machlimits.h
     230readparam.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
     231readparam.o: /usr/include/sys/rt_limits.h /usr/include/string.h
     232readparam.o: /usr/include/strings.h /usr/include/math.h /usr/include/float.h
     233readparam.o: /usr/include/fp_class.h /usr/include/unistd.h
     234readparam.o: /usr/include/sys/access.h reflector-v.h atm.h
     235reflector.o: reflector.h /usr/include/stdlib.h /usr/include/standards.h
     236reflector.o: /usr/include/getopt.h /usr/include/sys/types.h
     237reflector.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
     238reflector.o: /usr/include/stdio.h /usr/include/sys/seek.h
     239reflector.o: /usr/include/va_list.h /usr/include/sys/limits.h
     240reflector.o: /usr/include/sys/machine/machlimits.h
     241reflector.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
     242reflector.o: /usr/include/sys/rt_limits.h /usr/include/string.h
     243reflector.o: /usr/include/strings.h /usr/include/stdarg.h /usr/include/math.h
     244reflector.o: /usr/include/dirent.h /usr/include/unistd.h
     245reflector.o: /usr/include/sys/access.h reflector-v.h readparam.h
     246reflector.o: /usr/include/float.h /usr/include/fp_class.h atm.h
     247reflector.o: ../include-CORSIKA/COREventHeader.hxx
    300248reflector.o: ../include-CORSIKA/CORParticle.hxx
    301249reflector.o: ../include-CORSIKA/CORStatfile.hxx
    302250reflector.o: ../include-MC/MCEventHeader.hxx ../include-MC/MCCphoton.hxx
     251reflector.o: /usr/include/ranlib.h /usr/include/ar.h
  • trunk/MagicSoft/Simulation/Detector/Reflector/param

    r318 r348  
    66# Sample parameters file
    77#
    8 verbose_level 2
     8verbose_level 1
    99#
    1010#fixed_target  0. 0.
     
    1212#skip 1 2946
    1313#range_events 381 382
    14 #max_events   2
     14max_events   10000
    1515#energy_cuts   800. 1000.
    1616#
    1717ct_file        ../Data/magic.def
    1818#
    19 output_file   /data/reflect/test.rfl
     19output_file   /hd02/Maggi/RefData/prot.rfl
    2020#
    2121atm_model     ATM_CORSIKA
     
    2323#
    2424data_paths 1
    25 /data/mmcs
     25/hd02/Maggi/Data/mmcs_prod_14_2003_30:30000
    2626#
    2727#data_from_stdin
  • 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
  • trunk/MagicSoft/Simulation/Detector/Reflector/readparam.h

    r292 r348  
    1919//=
    2020//= $RCSfile: readparam.h,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//=//////////////////////////////////////////////////////////////////////
     
    123123T(block),           /* size of the block of files, when 'blocking' */ \
    124124T(random_pointing), /* random CT pointing from each shower (hadrons) */ \
     125T(repeat_random),   /* number of times a random pointing is to be done */ \
    125126T(data_from_stdin), /* read data from STDIN */ \
    126127T(data_to_stdout),  /* read data from STDIN */ \
     
    193194int get_data_to_stdout(void);
    194195int get_random_pointing(float *maxdist);
     196int get_repeat_random(void);
    195197
    196198//!@}
     
    209211/*
    210212 * $Log: not supported by cvs2svn $
     213 * Revision 1.14  2000/01/27  10:47:54  gonzalez
     214 * JAN2000-STABLE
     215 *
    211216 * Revision 1.13  1999/10/05  11:06:37  gonzalez
    212217 * Sep. 1999
  • trunk/MagicSoft/Simulation/Detector/Reflector/reflector.cxx

    r347 r348  
    2020//
    2121// $RCSfile: reflector.cxx,v $
    22 // $Revision: 1.8 $
     22// $Revision: 1.9 $
    2323// $Author: harald $
    24 // $Date: 2000-01-28 08:59:49 $
     24// $Date: 2000-01-28 09:19:54 $
    2525//
    2626////////////////////////////////////////////////////////////////////////
     
    795795int Random_Pointing = FALSE;
    796796
     797//@: number of times a shower is going to be processed
     798int nRepeat_Random;
     799
     800//@: number of times a shower is already processed
     801int nRepeated;
     802
    797803//@: maximum random pointing distance
    798804float Random_Pointing_MaxDist; // [radians]
     
    921927  parname[0] = '\0';
    922928
    923   optarg = NULL;
     929  optarg = 0;
    924930  while ( !errflg && ((ch = getopt(argc, argv, COMMAND_LINE_OPTIONS)) != -1) )
    925931    switch (ch) {
     
    945951
    946952  if ( strlen(parname) < 1 )
    947     readparam(NULL);
     953    readparam(0);
    948954  else
    949955    readparam(parname);
     
    11651171    outputfile.write( SIGNATURE, sizeof(SIGNATURE) );
    11661172
     1173  // get random pointing variables
     1174 
     1175  Random_Pointing = get_random_pointing( &Random_Pointing_MaxDist );
     1176
    11671177  // generate a sort of log information
    11681178
    11691179  if ( verbose >= VERBOSE_MINIMAL ) {
     1180    log( SIGNATURE, "Random poi.:       %f\n", Random_Pointing_MaxDist );
    11701181    log( SIGNATURE, "Atmospheric model: %s\n", get_atm_mod() );
    11711182    log( SIGNATURE, "Number of paths:   %d\n", get_num_of_paths() );
     
    11771188
    11781189  get_energy_cuts( &lE, &uE );
     1190
     1191  // get number of times which a shower is going to be used
     1192  // at different pointing directions
     1193  nRepeat_Random = get_repeat_random();   
    11791194
    11801195  /*!@'
     
    12021217    directory = opendir(pathname);
    12031218
    1204     if ( directory == NULL )
     1219    if ( directory == 0 )
    12051220      error( SIGNATURE,
    12061221             "Cannot open directory %s\n", pathname );
     
    12321247        log(SIGNATURE, " * * * READING DATA FROM STDIN * * *\n");
    12331248
    1234       get_stdin_files( 0, lE, uE, TRUE);
     1249      get_stdin_files(0, lE, uE, TRUE);
    12351250
    12361251    }
     
    12461261    //            maximum number is not reached ) )
    12471262
     1263    nRepeated = 0;
     1264
    12481265    while ( (
    1249              ((de = readdir( directory )) != NULL) &&
     1266             ((de = readdir( directory )) != 0) &&
    12501267             (num_cer_files < max_num_cer_files)
    12511268             )
     
    12551272             (num_cer_files < max_num_cer_files)
    12561273             ) ) {
    1257      
     1274        /*
     1275      // increment the number of times this files is used
     1276      nRepeated++;
     1277        */
     1278
    12581279      // if Block > 0, then we wait till a file __DOIT is present
    12591280     
     
    14401461       
    14411462      mcevth.put_times ( stat.get_tfirst(), stat.get_tlast() );
    1442 
     1463       
    14431464      // get direction where the CT is pointing to
    14441465      // (or, better, from when the shower is coming from)
     
    14511472
    14521473      // do we want random pointing (around shower axis) ?
    1453       if ( get_random_pointing( &Random_Pointing_MaxDist ) == TRUE ) {
     1474      if ( Random_Pointing == TRUE ) {
    14541475
    14551476        // we do, then get a random position
     
    19862007        // the photon actually hit the mirror!!
    19872008
     2009       
    19882010        t = t + ((( xm[2] > 0. ) ? -1.0 : +1.0) *
    19892011                 sqrt( SQR(xm[0] - xcut[0]) +
    19902012                       SQR(xm[1] - xcut[1]) +
    19912013                       SQR(xm[2] - xcut[2]) ) / Speed_of_Light_air_cmns);
    1992 
    1993         // add path from the mirror till the camera
     2014                 
     2015        // add path from the mirror till the camera
    19942016
    19952017        t = t + sqrt( SQR(xcutCT[0] - xcam[0]) +
     
    22122234
    22132235  delete [] ct_Focal;       
    2214   ct_Focal = NULL;
     2236  ct_Focal = 0;
    22152237
    22162238  // delete reflectivity table
     
    22212243 
    22222244  delete [] Reflectivity;   
    2223   Reflectivity = NULL;
     2245  Reflectivity = 0;
    22242246
    22252247  // delete mirrors' data table
     
    22302252 
    22312253  delete [] ct_data;
    2232   ct_data = NULL;
     2254  ct_data = 0;
    22332255}
    22342256//!@}
     
    34923514{
    34933515  float distance;
    3494   float it, ip,Nit;
     3516  float it, ip;
    34953517  float sin_theta, cos_theta;
    34963518  float sin_newtheta, cos_newtheta;
    34973519  float sin_iphi, cos_iphi;
    34983520  float iphi;
    3499   float range_aux;
    3500   int i;
    3501 
    3502   //Random position of the CT. It is the distance
    3503   //between shower axis and CT position and its 
    3504   //distribution follows sin(it).
    3505 
    3506   range_aux=1.0-sin(M_PI/2-range);
    3507   Nit = RandomNumber * range_aux;
     3521
     3522  // for the moment, we only simulate an uniform distribution,
     3523  // since our theta distribution in the generation of events is
     3524  // already uniform for hadrons, which are the main targets for
     3525  // using this option
     3526
     3527  it = RandomNumber * range;
    35083528  ip = RandomNumber * 2.0 * M_PI;
    3509   it = M_PI/2-asin((1.0-Nit));
    3510 
    3511   sin_theta = sin(theta);
    3512   cos_theta = cos(theta);
    3513 
    3514   cos_newtheta = cos_theta*cos(it) - sin_theta*sin(it)*cos(ip);
    3515   *newtheta = acos( cos_newtheta );
    3516   sin_newtheta = sin( *newtheta );
    3517  
    3518   if(theta!=0){
    3519     sin_iphi = sin(it)*sin(ip)/sin_newtheta;
    3520     cos_iphi = ((cos(it)-cos_newtheta*cos_theta)/(sin_newtheta*sin_theta));
     3529
     3530  if ( theta == 0.0 ) {
     3531
     3532    *newtheta = it;
     3533    *newphi = ip;
     3534
     3535  } else {
     3536   
     3537    sin_theta = sin(theta);
     3538    cos_theta = cos(theta);
     3539
     3540    cos_newtheta = cos_theta*cos(it) + sin_theta*sin(it)*cos(ip);
     3541    *newtheta = acos( cos_newtheta );
     3542    sin_newtheta = sin( *newtheta );
     3543   
     3544    sin_iphi = sin(it)*sin(ip) / sin_newtheta;
     3545    cos_iphi = (( cos(it) - cos_newtheta * cos_theta ) /
     3546                ( sin_newtheta * sin_theta ));
    35213547   
    35223548    iphi = atan2( sin_iphi, cos_iphi );
     3549   
     3550    *newphi = phi + iphi;
     3551
    35233552  }
    3524   else iphi=ip;
    3525 
    3526   *newphi = phi + iphi;
    35273553
    35283554  return( it );
     
    35363562//!@{
    35373563//
    3538 // Revision 1.3  2000/01/03 12:41:26  harald
    3539 // There was a small mistake with +/- signs in the prevois versions. This
    3540 // line was founded by Jose Carlos. His remark is following:
    3541 //
    3542 // Look for the comment I include here in this block: you will see that
    3543 // now the following expression has a +- sign, where before it was only
    3544 // + (or -, I don't remember, but only one)
    3545 //
    3546 // Revision 1.2  1999/11/01 11:05:54  harald
    3547 // Small changes to comile the reflector program under linux.
    3548 // (Different use of NULL on DECalphas-osf1 and on linux)
    3549 //
    3550 // Revision 1.1.1.1  1999/10/29  07:00:33  harald
    3551 // This is the startpoint for the futher development of the Reflector program
    3552 // of Jose Carlos. For all developments use this CVS-controlled directory.
     3564// $Log: not supported by cvs2svn $
     3565// Revision 1.20  2000/01/27  10:47:54  gonzalez
     3566// JAN2000-STABLE
     3567//
     3568// Revision 1.19  1999/11/19  20:52:31  gonzalez
     3569// *** empty log message ***
    35533570//
    35543571// Revision 1.18  1999/10/05  11:11:12  gonzalez
  • trunk/MagicSoft/Simulation/Detector/Reflector/reflector.h

    r292 r348  
    1919//=
    2020//= $RCSfile: reflector.h,v $
    21 //= $Revision: 1.1.1.1 $
     21//= $Revision: 1.2 $
    2222//= $Author: harald $
    23 //= $Date: 1999-10-29 07:00:34 $
     23//= $Date: 2000-01-28 09:19:54 $
    2424//=
    2525//=//////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.