Index: trunk/MagicSoft/Mars/macros/MagicHillas.C
===================================================================
--- trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/MagicHillas.C	(revision 2377)
@@ -41,11 +41,4 @@
 
     //
-    // The geometry container must be created by yourself to make sure
-    // that you don't choos a wrong geometry by chance
-    //
-    MGeomCamMagic geomcam;
-    plist.AddToList(&geomcam);
-
-    //
     // Use this if you want to change the binning of one of
     // the histograms. You can use:
@@ -86,4 +79,6 @@
     MReadMarsFile read("Events", filename);
     read.DisableAutoScheme();
+
+    MGeomApply geomapl;
 
     MMcPedestalCopy pcopy;
@@ -127,4 +122,5 @@
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&pcopy);
     tlist.AddToList(&pnsb);
Index: trunk/MagicSoft/Mars/macros/pedestalvstime.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pedestalvstime.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/pedestalvstime.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -48,7 +45,10 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
+
     MCerPhotAnal2 ncalc;
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/pixfirerate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pixfirerate.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/pixfirerate.C	(revision 2377)
@@ -61,10 +61,4 @@
     plist.AddToList(&tlist);
 
-    // The geometry container must be created by yourself to make sure
-    // that you don't choose a wrong geometry by mistake
-    //
-    MGeomCamMagic geomcam;
-    plist.AddToList(&geomcam);
-
     //
     // Now setup the tasks and tasklist:
@@ -75,4 +69,7 @@
     read.AddFile(filename);
     tlist.AddToList(&read);
+
+    MGeomApply geomapl;
+    tlist.AddToList(&geomapl);
 
     Double_t threshold[] = { 10, 20, 100, 200, -1 };
Index: trunk/MagicSoft/Mars/macros/pixsatrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/pixsatrate.C	(revision 2377)
@@ -61,10 +61,4 @@
     plist.AddToList(&tlist);
 
-    // The geometry container must be created by yourself to make sure
-    // that you don't choose a wrong geometry by mistake
-    //
-    MGeomCamMagic geomcam;
-    plist.AddToList(&geomcam);
-
     //
     // Now setup the tasks and tasklist:
@@ -75,4 +69,7 @@
     read.AddFile(filename);
     tlist.AddToList(&read);
+
+    MGeomApply geomapl;
+    tlist.AddToList(&geomapl);
 
     MHTriggerLvl0 trighi(254, "SaturationHi", "Saturation Rate of Hi Gains");
Index: trunk/MagicSoft/Mars/macros/plot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/plot.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/plot.C	(revision 2377)
@@ -23,5 +23,5 @@
 !
 \* ======================================================================== */
-#include <MH.h>
+
 // -------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/macros/readCT1.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readCT1.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/readCT1.C	(revision 2377)
@@ -62,4 +62,5 @@
 
     MCT1ReadAscii read(fname);
+    MGeomApply    geomapl;
     MClone        clone("MCerPhotEvt");
     MImgCleanStd  clean;
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 2377)
@@ -50,5 +50,4 @@
     MParList plist;
 
-    MGeomCamMagic geomcam;
     MHillas       hillas;
     MHillasExt    hillasext;
@@ -56,5 +55,4 @@
     MTaskList     tlist;
 
-    plist.AddToList(&geomcam);
     plist.AddToList(&hillas);
     plist.AddToList(&hillasext);
@@ -65,4 +63,5 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
     MPrint print1("MMcEvt");
     MPrint print2("MRawEvtHeader");
@@ -80,4 +79,5 @@
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&print1);
     tlist.AddToList(&print2);
Index: trunk/MagicSoft/Mars/macros/starplot.C
===================================================================
--- trunk/MagicSoft/Mars/macros/starplot.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/starplot.C	(revision 2377)
@@ -42,11 +42,4 @@
 
     //
-    // The geometry container must be created by yourself to make sure
-    // that you don't choos a wrong geometry by chance
-    //
-    MGeomCamMagic geomcam;
-    plist.AddToList(&geomcam);
-
-    //
     // Use this if you want to change the binning of one of
     // the histograms. You can use:
@@ -79,4 +72,6 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
+
     MFillH hfill1("MHHillas", "MHillas");
     MFillH hfill2("MHHillasExt");
@@ -86,4 +81,5 @@
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&hfill1);
     tlist.AddToList(&hfill2);
Index: trunk/MagicSoft/Mars/macros/status.C
===================================================================
--- trunk/MagicSoft/Mars/macros/status.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/status.C	(revision 2377)
@@ -57,11 +57,4 @@
     plist.AddToList(&tlist);
 
-    //
-    // The geometry container must be created by yourself to make sure
-    // that you don't choose a wrong geometry by mistake
-    //
-    MGeomCamMagic geomcam;
-    plist.AddToList(&geomcam);
-
     /*
      MSrcPosCam src;
@@ -79,4 +72,6 @@
     // ------------- user change -----------------
     read.AddFile(fname);
+
+    MGeomApply        geomapl;
 
     MMcPedestalCopy   pcopy;
@@ -117,4 +112,5 @@
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&pcopy);
     tlist.AddToList(&pnsb);
Index: trunk/MagicSoft/Mars/macros/sumevents.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumevents.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/sumevents.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -48,7 +45,9 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
     MCerPhotAnal2 ncalc;
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/sumeventserr.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumeventserr.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/sumeventserr.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -51,7 +48,9 @@
     //MCerPhotCalc  ncalc;
     //MCerPhotAnal  ncalc;
+    MGeomApply geomapl;
     MCerPhotAnal2 ncalc;
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/sumeventsrms.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumeventsrms.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/sumeventsrms.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -48,4 +45,5 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
     MPedestalSum  ncalc;
     //MCerPhotCalc  ncalc;
@@ -54,4 +52,5 @@
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/sumpedestalrms.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumpedestalrms.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/sumpedestalrms.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -48,7 +45,9 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
     MCerPhotAnal2 ncalc;
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/sumpedestals.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumpedestals.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/sumpedestals.C	(revision 2377)
@@ -39,7 +39,4 @@
     //
 
-    MGeomCamMagic geom;
-    plist.AddToList(&geom);
-
     // First Task: Read file with image parameters
     // (created with the star.C macro)
@@ -48,7 +45,9 @@
     read.DisableAutoScheme();
 
+    MGeomApply geomapl;
     MCerPhotAnal2 ncalc;
 
     tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
     tlist.AddToList(&ncalc);
 
Index: trunk/MagicSoft/Mars/macros/threshold.C
===================================================================
--- trunk/MagicSoft/Mars/macros/threshold.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/threshold.C	(revision 2377)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
Index: trunk/MagicSoft/Mars/macros/trigrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/trigrate.C	(revision 2370)
+++ trunk/MagicSoft/Mars/macros/trigrate.C	(revision 2377)
@@ -16,24 +16,24 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2001
 !
-!   Modified 4/7/2002, Abelardo Moralejo:
-!   Added one optional input parameter: a camera .root file containing
-!   pure NSB events. One such file is generated running the camera over an
-!   "empty" reflector file, with the NSB option on, and asking the camera
-!   program (see camera program manual) to do the simulation even if no 
-!   photoelectron from the shower arrives at the camera. One also needs to
-!   write to the output file all the events, both triggered and untriggered
-!   (see again camera manual). These nsb camera files must contain the same 
-!   trigger conditions as the proton file.
-!
-!   If no nsb file is supplied, the macro will assume no triggers from 
-!   pure NSB fluctuations.
-!
 \* ======================================================================== */
 
-
+/*
+ !   Modified 4/7/2002, Abelardo Moralejo:
+ !   Added one optional input parameter: a camera .root file containing
+ !   pure NSB events. One such file is generated running the camera over an
+ !   "empty" reflector file, with the NSB option on, and asking the camera
+ !   program (see camera program manual) to do the simulation even if no
+ !   photoelectron from the shower arrives at the camera. One also needs to
+ !   write to the output file all the events, both triggered and untriggered
+ !   (see again camera manual). These nsb camera files must contain the same
+ !   trigger conditions as the proton file.
+ !
+ !   If no nsb file is supplied, the macro will assume no triggers from
+ !   pure NSB fluctuations.
+ */
 
 Float_t GetNSBEvents(TString name, Float_t *BgR, int dim)
@@ -138,5 +138,5 @@
     if (dim < 0)
       ((MHMcRate*)(hists[0]))->SetTriggerCondNum((Short_t)(-dim));
-    else if (dim > 0)
+    if (dim > 0)
       for (Short_t i = from ; i <= to; i++)
 	((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i);
