Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.h	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.h	(revision 5103)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: camera.h,v $
-//= $Revision: 1.21 $
+//= $Revision: 1.22 $
 //= $Author: moralejo $ 
-//= $Date: 2004-09-16 15:24:53 $
+//= $Date: 2004-09-17 14:48:21 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -40,9 +40,9 @@
 //!@{
 
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
+#include <string>
 #include <stdarg.h>
 #include <math.h>
@@ -350,4 +350,7 @@
 /*
  *$Log: not supported by cvs2svn $
+ *Revision 1.21  2004/09/16 15:24:53  moralejo
+ *Updated on CVS after long time...
+ *
  *
  *Revision 1.19  2003/10/17 19:39:30  blanch
Index: trunk/MagicSoft/Simulation/Detector/Camera/config.mk.Linux
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.Linux	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/config.mk.Linux	(revision 5103)
@@ -18,7 +18,7 @@
 #---------------------------------------------------------------
 # $RCSfile: config.mk.Linux,v $
-# $Revision: 1.9 $
+# $Revision: 1.10 $
 # $Author: moralejo $ 
-# $Date: 2004-09-17 10:32:54 $
+# $Date: 2004-09-17 14:48:21 $
 ##################################################################
 # @maintitle
@@ -57,5 +57,5 @@
 
 
-OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual -Wno-deprecated
+OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
 
 DEBUG    = -g 
Index: trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux	(revision 5103)
@@ -18,7 +18,7 @@
 #---------------------------------------------------------------
 # $RCSfile: config.mk.linux,v $
-# $Revision: 1.6 $
+# $Revision: 1.7 $
 # $Author: moralejo $ 
-# $Date: 2004-09-17 10:32:54 $
+# $Date: 2004-09-17 14:48:21 $
 ##################################################################
 # @maintitle
@@ -56,5 +56,5 @@
 INCLUDE_MARS_MRAW   = ../../../Mars/mraw
 
-OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual -Wno-deprecated
+OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
 DEBUG    = -g 
 
Index: trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu	(revision 5103)
@@ -18,7 +18,7 @@
 #---------------------------------------------------------------
 # $RCSfile: config.mk.linux-gnu,v $
-# $Revision: 1.10 $
+# $Revision: 1.11 $
 # $Author: moralejo $ 
-# $Date: 2004-09-17 10:32:54 $
+# $Date: 2004-09-17 14:48:21 $
 ##################################################################
 # @maintitle
@@ -56,5 +56,6 @@
 INCLUDE_MARS_MRAW   = ../../../Mars/mraw
 
-OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual -Wno-deprecated
+OPTIM    = -O5 -Wall -fno-exceptions -fPIC -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Woverloaded-virtual
+
 DEBUG    = -g 
 
Index: trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx	(revision 5103)
@@ -19,53 +19,16 @@
 //=
 //= $RCSfile: creadparam.cxx,v $
-//= $Revision: 1.28 $
+//= $Revision: 1.29 $
 //= $Author: moralejo $ 
-//= $Date: 2004-09-16 15:27:08 $
+//= $Date: 2004-09-17 14:48:21 $
 //=
 //=//////////////////////////////////////////////////////////////////////
 
-// @T \newpage
-
-//!@section Source code of |creadparam.cxx|.
-
-/*!@"
-  
-  This section describes briefly the source code for the file
-  |creadparam.cxx|. This file is very closely related to the file
-  |readparams.cxx| from the |reflector| program. Actually, this later
-  file was the ancestror of the file you are looking at.
-
-  All the defines it uses are located in the file |creadparam.h|. In
-  the first one we can see the definitions of the commands available
-  for the parameters file. We describe these commands in a later
-  section.
-  
-  @"*/
-
-//!@subsection Includes and Global variables definition.
-
-/*!@"
-  
-  All the defines are located in the file {\tt creadparam.h}.
-
-  @"*/
- 
-//!@{
 
 #include "creadparam.h"
 #include "camera.h"      // Needed for MAX_NUMBER_OF_CTS
 
-//!@}
-
-//!@subsection Definition of global variables.
-
-/*!@"
-
-  Here we define the global variables where the values from the
-  parameters file are stored.
-  
-  @"*/
-
-//!@{
+//  Here we define the global variables where the values from the
+//  parameters file are stored.
 
 static char **Input_filename;  //@< input filename
@@ -147,20 +110,4 @@
 // Coordinates of CT locations, in centimeters, in the Corsika system.
 
-//!@}
-
-//!@subsection The function |readparam()|.
-
-//!-----------------------------------------------------------
-// @name  creadparam
-//                                                
-// @desc  read parameters from the stdin / parameters file
-//
-// @var   *filename  Name of the parameters file (NULL->STDIN)
-//
-// @date Mon Sep 14 13:27:56 MET DST 1998
-//------------------------------------------------------------
-// @function
-
-//!@{ 
 void 
 readparam(char * filename)
@@ -336,5 +283,5 @@
       //
 
-      if (fmod(FADC_pedestal, 1.) > 1.e-4)
+      if (fmod((double)FADC_pedestal, (double)1.) > 1.e-4)
       {
 	  printf("ERROR :  requested average FADC pedestal (%f) is not integer. Please use an integer value.\n", FADC_pedestal);
@@ -1409,7 +1356,4 @@
 }
 
-
-
-//!@}
 //=------------------------------------------------------------
 //!@subsection Log of this file.
@@ -1418,4 +1362,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.28  2004/09/16 15:27:08  moralejo
+// Updated in CVS after some time (see changes below)
+//
 //
 // Revision 1.27  2004/05/12 A. Moralejo
Index: trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h	(revision 5103)
@@ -19,90 +19,9 @@
 //=
 //= $RCSfile: creadparam.h,v $
-//= $Revision: 1.25 $
+//= $Revision: 1.26 $
 //= $Author: moralejo $ 
-//= $Date: 2004-09-16 15:27:08 $
+//= $Date: 2004-09-17 14:48:21 $
 //=
 //=//////////////////////////////////////////////////////////////////////
-
-// @T \newpage
-
-//!@section Source code of |creadparam.h|.
-
-/*!@"
-
-  In this section you can find the source code for the file
-  |creadparam.h|.  This file is mainly needed by
-  |creadparam.cxx|. Here is located the definition of the commands you
-  can use in the parameters file. In this file, the first line must be
-  |camera 'version'|, where |'version'| is the appropiate version of
-  the output format (NOT the version of the camera program) which can
-  read the commands written in that parameters file. You cannot mix
-  parameters files and executables with different versions. The
-  current version is |camera 0.2|.
-
-  The commands now available for the parameters file are:
-
-  @itemize
-  
-  @- |input_file| filename :    
-     Sets the name of the input file (|.rfl|).
-  @- |starfield_file| filename :    
-     Sets the name of the starfield input file (|.rfl|).
-  @- |ct_file| filename :    
-     Sets the name of the CT definition file (|.def|).
-  @- |data_file| filename :    
-     Sets the name of the output data file (|.dat|).
-  @- |elec_noise_off| :    
-     De-activates ElecNoise for FADC and Trigger channels. By default it is on.
-  @- |fadc_noise_off| :    
-     Sets the  ElecNoise for FADC.
-  @- |trig_noise_off| :    
-     Sets the  ElecNoise for trigger system.
-  @- |nsb_on| :    
-     Activates the NSB simulation. This is the default.
-  @- |nsb_off| :    
-     De-activates the NSB simulation.
-  @- |nsb_mean| number :    
-     Sets the mean value for the NSB.
-     Default value: 6 for CT1, 6 for MAGIC.
-     This implies always |nsb_on|.
-  @- |threshold| number :    
-     Sets the Threshold value q0. Default value: 10.
-  @- |tail_cut| number : 
-     Sets the Tail-Cut value.
-     Default value: 7.
-  @- |islands_cut| number :    
-     Sets the Islands-Cut value i0.
-     Default value: 10.
-  @- |end_file|
-     Last command in the parameters file.
-
-  @enditemize
-
-  @ignoreHTML
-  A parameters file (a small one) looks like this:
-
-  |camera 0.2|
-
-  |input_file    gm100-500.rfl|
-
-  |output_file   gm100-500.phe|
-
-  |output_file   gm100-500.dat|
-
-  |ct_file       magic.def|
-
-  |threshold     10.0|
-
-  |tail_cut      7.0|
-
-  |nsb_mean      5.0|
-
-  |end_file|
-  @endignoreHTML
-
-@"*/
-
-//!@{
 
 #ifndef _creadparam_
@@ -119,9 +38,10 @@
 //!@{
 
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
+#include <string>
+
 #include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
 #include <math.h>
 #include <float.h>
@@ -283,4 +203,7 @@
 /*
  * $Log: not supported by cvs2svn $
+ * Revision 1.25  2004/09/16 15:27:08  moralejo
+ * Updated in CVS after some time (see changes below)
+ *
  *
  * Revision 1.23  2004/01/30 09:55:33  blanch
Index: trunk/MagicSoft/Simulation/Detector/Camera/moments.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/moments.h	(revision 5097)
+++ trunk/MagicSoft/Simulation/Detector/Camera/moments.h	(revision 5103)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: moments.h,v $
-//= $Revision: 1.1.1.1 $
-//= $Author: harald $ 
-//= $Date: 1999-11-05 11:59:33 $
+//= $Revision: 1.2 $
+//= $Author: moralejo $ 
+//= $Date: 2004-09-17 14:48:21 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -51,11 +51,12 @@
 //!@{
 
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
+#include <string>
+
 #include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <math.h>
 #include <float.h>
+#include <stdio.h>
 
 #include "jcmacros.h"
@@ -144,4 +145,227 @@
 /*
  *$Log: not supported by cvs2svn $
+ *Revision 1.1.1.1  1999/11/05 11:59:33  harald
+ *This the starting point for CVS controlled further developments of the
+ *camera program. The program was originally written by Jose Carlos. 
+ *But here you can find a "rootified" version to the program. This means 
+ *that there is no hbook stuff in it now. Also the output of the
+ *program changed to the MagicRawDataFormat. 
+ *
+ *The "rootification" was done by Dirk Petry and Harald Kornmayer. 
+ *
+ *In the following you can see the README file of that version:
+ *
+ *==================================================
+ *
+ *Fri Oct 22  1999   D.P.
+ *
+ *The MAGIC Monte Carlo System
+ *
+ *Camera Simulation Programme
+ *---------------------------
+ *
+ *1) Description
+ *
+ *This version is the result of the fusion of H.K.'s
+ *root_camera which is described below (section 2)
+ *and another version by D.P. which had a few additional
+ *useful features.
+ *
+ *The version compiles under Linux with ROOT 2.22 installed
+ *(variable ROOTSYS has to be set).
+ *
+ *Compile as before simply using "make" in the root_camera
+ *directory.
+ *
+ *All features of H.K.'s root_camera were retained.
+ *
+ *Additional features of this version are:
+ *
+ *  a) HBOOK is no longer used and all references are removed.
+ *
+ *  b) Instead of HBOOK, the user is given now the possibility of 
+ *     having Diagnostic data in ROOT format as a complement
+ *     to the ROOT Raw data.
+ *
+ *     This data is written to the file which is determined by
+ *     the new input parameter "diag_file" in the camera parameter
+ *     file.
+ *
+ *     All source code file belonging to this part have filenames
+ *     starting with "MDiag".
+ *
+ *     The user can read the output file using the following commands
+ *     in an interactive ROOT session:
+ *
+ *       	root [0] .L MDiag.so
+ *	root [1] new TFile("diag.root");
+ *	root [2] new TTreeViewer("T");
+ *	
+ *     This brings up a viewer from which all variables of the
+ *     TTree can be accessed and histogrammed. This example
+ *     assumes that you have named the file "diag.root", that
+ *     you are using ROOT version 2.22 or later and that you have
+ *     the shared object library "MDiag.so" which is produced
+ *     by the Makefile along with the executable "camera".
+ *       
+ * !   The contents of the so-called diag file is not yet fixed.
+ * !   At the moment it is what J.C.G. used to put into the HBOOK
+ * !   ntuple. In future versions the moments calculation can be
+ * !   removed and the parameter list be modified correspondingly.
+ *
+ *  c) Now concatenated reflector files can be read. This is useful
+ *     if you have run the reflector with different parameters but
+ *     you want to continue the analysis with all reflector data
+ *     going into ONE ROOT outputfile.
+ *
+ *     The previous camera version contained a bug which made reading 
+ *     of two or more concatenated reflector files impossible.
+ *
+ *  d) The reflector output format was changed. It is now version
+ *     0.4 .
+ *     The change solely consists in a shortening of the flag
+ *     definition in the file 
+ *
+ *           include-MC/MCCphoton.hxx  
+ *
+ * !   IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
+ * !   do so by recompiling camera with the previous version of
+ * !   include-MC/MCCphoton.hxx.
+ *
+ *     The change was necessary for saving space and better
+ *     debugging. From now on, this format can be frozen.
+ *
+ * !   For producing reflector output in the new format, you
+ * !   of course have to recompile your reflector with the
+ * !   new include-MC/MCCphoton.hxx .
+ *
+ *  e) A first version of the pixelization with the larger
+ *     outer pixels is implemented. THIS IS NOT YET FULLY
+ *     TESTED, but first rough tests show that it works
+ *     at least to a good approximation.
+ *
+ *     The present version implements the camera outline
+ *     with 18 "gap-pixels" and 595 pixels in total as
+ *     shown in 
+ *
+ *        http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
+ *
+ *     This change involved 
+ *
+ *	(i) The file pixels.dat is no longer needed. Instead
+ *          the coordinates are generated by the program itself
+ *          (takes maybe 1 second). In the file 
+ *
+ *		pixel-coords.txt
+ *
+ *	  in the same directory as this README, you find a list
+ *          of the coordinates generated by this new routine. It
+ *          has the format
+ *
+ *              number   i   j   x  y  size-factor
+ *
+ *          where i and j are J.C.G.'s so called biaxis hexagonal
+ *          coordinates (for internal use) and x and y are the
+ *          coordinates of the pixel centers in the standard camera
+ *          coordinate system in units of centimeters. The value
+ *          of "size-factor" determines the linear size of the pixel
+ *          relative to the central pixels. 
+ *
+ *        (ii) The magic.def file has two additional parameters
+ *          which give the number of central pixels and the
+ *          number of gap pixels
+ *
+ *        (iii) In camera.h and camera.cxx several changes were 
+ *          necessary, among them the introduction of several
+ *          new functions 
+ *
+ *     The newly suggested outline with asymmetric Winston cones
+ *     will be implemented in a later version.
+ *
+ *  f) phe files can no longer be read since this contradicts
+ *     our philosophy that the analysis should be done with other
+ *     programs like e.g. EVITA and not with "camera" itself.
+ *     This possibility was removed. 
+ *
+ *  g) ROOT is no longer invoked with an interactive interface.
+ *     In this way, camera can better be run as a batch program and
+ *     it uses less memory.
+ *
+ *  h) small changes concerning the variable "t_chan" were necessary in
+ *     order to avoid segmentation faults: The variable is used as an
+ *     index and it went sometimes outside the limits when camera
+ *     was reading proton data. This is because the reflector files
+ *     don't contain the photons in a chronological order and also
+ *     the timespread can be considerably longer that the foreseen
+ *     digitisation timespan. Please see the source code of camera.cxx
+ *     round about line 1090.
+ *
+ *  j) several unused variables were removed, a few warning messages
+ *     occur when you compile camera.cxx but these can be ignored at
+ *     the moment.
+ *
+ *In general the program is of course not finished. It still needs
+ *debugging, proper trigger simulation, simulation of the asymmetric
+ *version of the outer pixels, proper NSB simulation, adaption of
+ *the diag "ntuple" contents to our need and others small improvements.
+ *
+ *In the directory rfl-files there is now a file in reflector format 0.4
+ *containing a single event produced by the starfiled adder. It has
+ *a duration of 30 ns and represents the region around the Crab Nebula.
+ *Using the enclosed input parameter file, camera should process this
+ *file without problems.
+ *
+ *2) The README for the previous version of root_camera
+ *
+ *README for a preliminary version of the 
+ *root_camera program. 
+ *
+ *root_camera is based on the program "camera"of Jose Carlos
+ *Gonzalez. It was changed in the way that only the pixelisation 
+ *and the distibution of the phe to the FADCs works in a 
+ *first version. 
+ *
+ *Using the #undef command most possibilities of the orignal 
+ *program are switched of. 
+ *
+ *The new parts are signed by 
+ *
+ *- ROOT or __ROOT__ 
+ *  nearly all  important codelines for ROOT output are enclosed 
+ *  in structures like 
+ *  #ifdef __ROOT__ 
+ *  
+ *    code 
+ *
+ *  #endif __ROOT__ 
+ *
+ *  In same case the new lines are signed by a comment with the word 
+ *  ROOT in it. 
+ *
+ *  For timing of the pulse some variable names are changed. 
+ *  (t0, t1, t  -->  t_ini, t_fin, t_1st, t_chan,...) 
+ *  Look also for this changes. 
+ *
+ *  For the new root-file is also a change in readparm-files
+ *
+ *
+ *- __DETAIL_TRIGGER__
+ *
+ *  This is for the implementation of the current work on trigger 
+ *  studies. Because the class MTrigger is not well documented it 
+ *  isn´t a part of this tar file. Only a dummy File exists. 
+ *
+ *
+ *
+ *With all files in the archive, the root_camera program should run. 
+ *
+ *A reflector file is in the directory rfl-files
+ *
+ *==================================================
+ *
+ *From now on, use CVS for development!!!!
+ *
+ *
+ *
  *Revision 1.1.1.1  1999/10/21 16:35:10  petry
  *first synthesised version
