Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7879)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7880)
@@ -19,4 +19,41 @@
                                                  -*-*- END OF LINE -*-*-
  2006/08/16 Thomas Bretz
+
+   * Makefile.conf.general:
+     - fixed usage of substitutions
+
+   * MMcConfigRunHeader.[h,cc]:
+     - added fParaboloidFocal
+     - increased class version by 1
+     - updated comments
+
+   * MMcEvt.[hxx,cxx]:
+     - added fEventReuse
+     - increased class version by 1
+     - updates to comments
+
+   * MMcEvtBasic.h:
+     - replaced private by protected
+
+   * MMcFadcHeader.hxx:
+     - updates to comments
+     - update to global ifdef
+
+   * MMcRunHeader.[hxx,cxx]:
+     - added fRandomPointingConeSemiAngle
+     - increased class version by 1
+     - upadted comments
+     - removed empty destructor
+
+   * MMcTrig.hxx:
+     - updated preprocessor directives
+
+   * MMcTrigHeader.[hxx,cxx]:
+     - updated comments
+     - removed empty destructor
+     - updated preprocessor directives
+
+   * MTriggerDefine.h, Mdefine.h:
+     - updated preprocessor directives
 
    * manalysis/MMcCalibrationUpdate.cc, 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.cc	(revision 7880)
@@ -29,15 +29,40 @@
 // Root storage container for the MONTE CARLO CONFIGURATION information
 //
-// It saves in a root file all the infromation about values in the configuration
-// files used in the Monte Carlo production: MagicDef (definition of the teslescope),
-// Reflectivity.dat (mirror reflectivities), qe.dat (PMT QEs), axisdev.dat (mirrors 
-// deviations) and lightguides.dat (Effect of the Light Guides).
+// It saves in a root file all the infromation about values in the
+// configuration files used in the Monte Carlo production: MagicDef
+// (definition of the teslescope), Reflectivity.dat (mirror reflectivities),
+// qe.dat (PMT QEs), axisdev.dat (mirrors deviations) and lightguides.dat
+// (Effect of the Light Guides).
 //
 //
-// Version 2: 
-// -----------
+// Class Version 2:
+// ----------------
 // removed obsolete variables which are no longer used by reflector, 
 // nor present in the magic.def file:  fFocalStdev, fPointStdev, fDevAdjust
 //
+// Class Version 3:
+// ----------------
+// Added member fLightCollectionFactorOuter so that we can store
+// the data on the simulatedlight collection efficiency (light
+// guides + plexiglas +...) as a function of incidence angle for
+// outer and inner pixels independently.
+//
+// Class Version 4:
+// ----------------
+// Added member fMirrorFraction, the "active" fraction of the
+// mirror dish, to account for reflectivity losses, missing
+// mirrors, etc.
+//
+// Class Version 5:
+// ----------------
+// Added member fPmtTimeJitter, the time jitter of the PMTs (sigma
+// of gaussian) for each photoelectron.
+//
+// Class Version 6:
+// ----------------
+// Added fParaboloidFocal
+//
+/////////////////////////////////////////////////////////////////////////////////
+
 //
 ////////////////////////////////////////////////////////////////////////////
@@ -67,9 +92,10 @@
     fTitle = title ? title : "Mc Configuration Information";
 
-    fRadiusMirror=-1;
-    fFocalDist   =-1;
-    fPointSpread =-1;
-    fBlackSpot   =-1;
-    fCameraWidth =-1;
+    fRadiusMirror    = -1;
+    fFocalDist       = -1;
+    fPointSpread     = -1;
+    fBlackSpot       = -1;
+    fCameraWidth     = -1;
+    fParaboloidFocal = -1;
 
     fMirrors = new TClonesArray("MGeomMirror", 0);
@@ -93,5 +119,4 @@
     fBlackSpot=spot;
     fCameraWidth=camwidth;
-    
 }
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.h	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcConfigRunHeader.h	(revision 7880)
@@ -16,26 +16,4 @@
 class MGeomPMT;
 
-//////////////////////////////////////////////////////////////////////////////////
-//
-// class MMcConfigRunHeader
-//
-// Authors: O. Blanch, A. Moralejo 
-//
-// Container to keep some data on the used MC simulation parameters
-// 
-// Version 3: Added member fLightCollectionFactorOuter so that we can store 
-//            the data on the simulatedlight collection efficiency (light
-//            guides + plexiglas +...) as a function of incidence angle for 
-//            outer and inner pixels independently.
-//
-// Version 4: Added member fMirrorFraction, the "active" fraction of the 
-//            mirror dish, to account for reflectivity losses, missing 
-//            mirrors, etc.
-//
-// Version 5: Added member fPmtTimeJitter, the time jitter of the PMTs
-//            (sigma of gaussian) for each photoelectron.
-//
-/////////////////////////////////////////////////////////////////////////////////
-
 class MMcConfigRunHeader : public MParContainer
 {
@@ -51,7 +29,8 @@
     // Magic Def Parameters
     Float_t fFocalDist;         // [cm] Focal distance
+    Float_t fParaboloidFocal;   // [cm] True focal of the paraboloid on which the mirror centers are placed
     Float_t fPointSpread;       // [cm] Point spread function, sigma in x and y on the camera as simualted in the Reflector
-    Float_t fPointSpreadX;       // [cm] Point spread function, sigma in x on the camera adding gaussian in the Camera
-    Float_t fPointSpreadY;       // [cm] Point spread function, sigma in y on the camera adding gaussian in the Camera
+    Float_t fPointSpreadX;      // [cm] Point spread function, sigma in x on the camera adding gaussian in the Camera
+    Float_t fPointSpreadY;      // [cm] Point spread function, sigma in y on the camera adding gaussian in the Camera
     Float_t fBlackSpot;         // [cm] Radius of black spot in the mirror center
     Float_t fCameraWidth;       // [cm] Radius on the camera plain 
@@ -79,5 +58,5 @@
 
     void SetMagicDef(Float_t radius, Float_t focal, Float_t point,
-		     Float_t spot, Float_t camwidth);
+                     Float_t spot, Float_t camwidth);
     void SetLightCollection(const TArrayF &theta, const TArrayF &factor, 
 			    const TArrayF &factor_outer);
@@ -133,5 +112,5 @@
     Float_t GetPmtTimeJitter() const { return fPmtTimeJitter; }
 
-    ClassDef(MMcConfigRunHeader, 5)  // class for monte carlo configuration information
+    ClassDef(MMcConfigRunHeader, 6)  // class for monte carlo configuration information
 };
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 7880)
@@ -49,4 +49,7 @@
 //   - moved ParticleId_t to base class MMcEvtBasic
 //
+// Version 6:
+//   - added fEventReuse
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MMcEvt.hxx"
@@ -58,5 +61,4 @@
 
 using namespace std;
-
 
 // --------------------------------------------------------------------------
@@ -89,5 +91,6 @@
                UInt_t   uiPat,     UInt_t   uiPre,     UInt_t   uiPco,
                UInt_t   uiPelS,    UInt_t   uiPelC,    Float_t  elec,
-               Float_t  muon,      Float_t  other,     Float_t  fadc_jitter)
+               Float_t  muon,      Float_t  other,     Float_t  fadc_jitter,
+               Int_t    reuse)
 {
     fName  = "MMcEvt";
@@ -98,5 +101,5 @@
 	 fTLast, fL_Nmax, fL_t0, fL_tmax, fL_a, fL_b, fL_c, fL_chi2,
 	 uiPin, uiPat, uiPre, uiPco, uiPelS, uiPelC, elec, muon, other,
-	 fadc_jitter);
+	 fadc_jitter, reuse);
 }
 
@@ -128,4 +131,6 @@
     fMuonCphFraction=0;
     fOtherCphFraction=0;
+
+    fEventReuse = 0;    
 }
 
@@ -147,5 +152,6 @@
 		   UInt_t   uiPat,     UInt_t   uiPre,     UInt_t   uiPco,  
 		   UInt_t   uiPelS,    UInt_t   uiPelC,    Float_t  elec,
-                   Float_t  muon,      Float_t  other,     Float_t  fadc_jitter)
+                   Float_t  muon,      Float_t  other,     Float_t  fadc_jitter,
+                   Int_t    reuse)
 {
     //
@@ -193,4 +199,6 @@
 
     fFadcTimeJitter = fadc_jitter;
+    
+    fEventReuse = reuse;
 }
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 7880)
@@ -55,4 +55,9 @@
 
     Float_t  fFadcTimeJitter;
+    
+    Int_t    fEventReuse; // Number running from 0 to N-1, being N the number
+                          // of times a Corsika event has been reused, by
+                          // orienting the telescope in different ways or by
+                          // setting it at a different location on the ground.
 
 public:
@@ -63,5 +68,5 @@
            Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
            UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t,
-           Float_t, Float_t, Float_t, Float_t) ;
+           Float_t, Float_t, Float_t, Float_t, Int_t ireuse=0) ;
 
     // Getter
@@ -107,5 +112,5 @@
                Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
                UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t,
-               Float_t, Float_t, Float_t, Float_t) ;
+               Float_t, Float_t, Float_t, Float_t, Int_t ireuse=0);
 
     // TObject
@@ -113,5 +118,5 @@
     void Clear(Option_t *opt=NULL);
 
-    ClassDef(MMcEvt, 5)  //Stores Montecarlo Information of one event (eg. the energy)
+    ClassDef(MMcEvt, 6)  //Stores Montecarlo Information of one event (eg. the energy)
 };
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 7880)
@@ -26,5 +26,5 @@
     };
 
-private:
+protected:
   ParticleId_t fPartId;  // Type of particle
   Float_t      fEnergy;  // [GeV] Energy
@@ -36,5 +36,5 @@
   Float_t      fTelescopeTheta;  // [rad]
   
- public:
+public:
   MMcEvtBasic();
   MMcEvtBasic(ParticleId_t, Float_t, Float_t, Float_t, Float_t);
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx	(revision 7880)
@@ -1,4 +1,4 @@
-#ifndef __MMcFadcHeader__
-#define __MMcFadcHeader__
+#ifndef MARS_MMcFadcHeader
+#define MARS_MMcFadcHeader
 
 #ifndef MARS_MParContainer
@@ -10,15 +10,4 @@
 
 #include "MFadcDefine.h"
-
-//
-// Version 5:
-//   Added member fGainFluctuations
-//
-// Version 6:
-//   Added member fNoiseGainFluctuations
-//
-// Version 7:
-//   Derived class from MCamEvent
-//
 
 class MMcFadcHeader : public MParContainer, public MCamEvent {
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.cxx	(revision 7880)
@@ -53,5 +53,6 @@
 //  Third version:
 //
-//  Byte_t fOpticLinksNoise;   Flag to state if the optic noise is simualted or not
+//  Byte_t fOpticLinksNoise;   Flag to state if the optic noise is simualted
+//                             or not
 //
 //
@@ -61,6 +62,18 @@
 // from the north direction, anticlockwise (i.e, west is phi=90 degrees).
 //
+//                                                     
+// Class Version 5: 
+// ----------------
+// removed members fSourceOffsetTheta, fSourceOffsetPhi (were no longer used)                                  //
+//                   
+// Class Version 6: 
+// ----------------
+// removed members fTelesTheta, fTelesPhi (were no longer used)                                  //
+//
+// Class Version 7:
+// ----------------
+// + Float_t fRandomPointingConeSemiAngle;
+//
 ////////////////////////////////////////////////////////////////////////////
-
 #include "MMcRunHeader.hxx"
 
@@ -128,13 +141,5 @@
     fOpticLinksNoise= 0;
 
-}
-
-// --------------------------------------------------------------------------
-//
-// Destructor.
-//
-MMcRunHeader::~MMcRunHeader()
-{
-
+    fRandomPointingConeSemiAngle=0;
 }
 
@@ -178,5 +183,6 @@
 			const UInt_t   refl,
 			const UInt_t   cam,
-			const Byte_t   opticnoise)
+                        const Byte_t   opticnoise,
+                        const Float_t  conesmiangle)
 {
     fMcRunNumber =runnumber;
@@ -225,4 +231,6 @@
     fCamVersion = cam;
     fOpticLinksNoise= opticnoise;
+
+    fRandomPointingConeSemiAngle=conesmiangle;
 }
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcRunHeader.hxx	(revision 7880)
@@ -1,15 +1,4 @@
 #ifndef MARS_MMcRunHeader
 #define MARS_MMcRunHeader
-///////////////////////////////////////////////////////////////////////
-//                                                                   //
-// MMcRunHeader                                                      //
-//                                                                   //
-// Version 5: removed members fSourceOffsetTheta, fSourceOffsetPhi   //
-//            (were no longer used)                                  //
-//                                                                   //
-// Version 6: removed members fTelesTheta, fTelesPhi                 //
-//            (were no longer used)                                  //
-//                                                                   //
-///////////////////////////////////////////////////////////////////////
 
 #ifndef MARS_MParContainer
@@ -65,5 +54,5 @@
   UShort_t fCamVersion;
 
-  /* ---- Run Header Informations ---- */
+  // ---- Run Header Informations ----
   Float_t fMcRunNumber;     // Run Number
   UInt_t  fProductionSite;  // code to know where the run was generated
@@ -91,7 +80,12 @@
   Byte_t  fOpticLinksNoise;  // Noise from Optic Links simualted or not.
 
+  // Semiaperture of the cone around the direction of the primary within which the
+  // orientation of the telescope axis is scattered (deg). This is used in reflector
+  // simulation to re-use each Corsika event more than once.
+  Float_t fRandomPointingConeSemiAngle;
+
+
 public:
   MMcRunHeader(const char *name=NULL, const char *title=NULL);
-  ~MMcRunHeader();
 
   void Fill(const Float_t  runnumber,
@@ -127,8 +121,9 @@
 	    const UInt_t   num0bslev,
 	    const Float_t  heightlev[10],
-	    const UInt_t   corsika,
+	    const UInt_t   corsika,                
 	    const UInt_t   refl,
 	    const UInt_t   cam,
-	    const Byte_t   opticnoise 
+            const Byte_t   opticnoise,
+            const Float_t  conesmiangle=0
 	    );
   
@@ -151,7 +146,6 @@
   Float_t GetImpactMax() const            {return fImpactMax;}
 
-  ClassDef(MMcRunHeader, 6)	// storage container for general run info
+  ClassDef(MMcRunHeader, 7)	// storage container for general run info
 };
+
 #endif
-
-
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx	(revision 7880)
@@ -1,11 +1,14 @@
-#ifndef __MMcTrig__
-#define __MMcTrig__
+#ifndef MARS_MMcTrig
+#define MARS_MMcTrig
 
 #ifndef MARS_MParContainer
 #include "MParContainer.h"
 #endif
-
+#ifndef MARS_MTriggerDefine
 #include "MTriggerDefine.h"
+#endif
+#ifndef MARS_Mdefine
 #include "Mdefine.h"
+#endif
 
 class MMcTrig : public MParContainer {
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 7880)
@@ -23,4 +23,8 @@
 //                             the amplitude of the single phe response 
 //                             for the trigger 
+//
+// Version 4
+//   Added data members fGainFluctuations and fNoiseGainFluctuations
+//
 //
 /////////////////////////
@@ -54,11 +58,4 @@
 }
 
-MMcTrigHeader::~MMcTrigHeader() {
-  //
-  //  default destructor
-  //
-}
-
-
 void MMcTrigHeader::Print(Option_t *opt) const {
   //
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx	(revision 7880)
@@ -1,16 +1,14 @@
-#ifndef __MMcTrigHeader__
-#define __MMcTrigHeader__
+#ifndef MARS_MMcTrigHeader
+#define MARS_MMcTrigHeader
 
 #ifndef MARS_MParContainer
 #include "MParContainer.h"
 #endif
-
+#ifndef MARS_MTriggerDefine
 #include "MTriggerDefine.h"
+#endif
+#ifndef MARS_Mdefine
 #include "Mdefine.h"
-
-//
-// Version 4
-//   Added data members fGainFluctuations and fNoiseGainFluctuations
-//
+#endif
 
 class MMcTrigHeader : public MParContainer{
@@ -48,6 +46,4 @@
  public:
   MMcTrigHeader() ;
-
-  ~MMcTrigHeader(); 
 
   void Print(Option_t *opt=NULL) const;
Index: trunk/MagicSoft/include-Classes/MMcFormat/MTriggerDefine.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MTriggerDefine.h	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MTriggerDefine.h	(revision 7880)
@@ -1,2 +1,4 @@
+#ifndef MARS_MTriggerDefine
+#define MARS_MTriggerDefine
 //
 //
@@ -110,2 +112,3 @@
 //         2 means trigger_multi closed neighbours
 //
+#endif
Index: trunk/MagicSoft/include-Classes/MMcFormat/Mdefine.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/Mdefine.h	(revision 7879)
+++ trunk/MagicSoft/include-Classes/MMcFormat/Mdefine.h	(revision 7880)
@@ -1,2 +1,4 @@
+#ifndef MARS_Mdefine
+#define MARS_Mdefine
 //
 //     Mdefine.h
@@ -37,2 +39,3 @@
 #define MAX_PH_EL 500 //upper limit for colortable
 
+#endif
