Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1006)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1007)
@@ -88,12 +88,15 @@
      manalysis/MPedCalcPedRun.cc, manalysis/MPedestalCam.cc,
      mbase/MClone.cc, mbase/MPrint.cc, mbase/MTime.h,
-     mbase/MWriteAsciiFile.cc, mgui/MGeomCam.cc,
-     mhist/MHFadcCam.cc, mhist/MHMcRate.cc,
-     mmc/MMcTrig.cxx, mmontecarlo/MMcThresholdCalc.cc,
-     mmontecarlo/MMcTriggerRateCalc.cc,
-     mraw/MRawCrateArray.cc, mraw/MRawEvtData.cc,
-     mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc:
+     mbase/MWriteAsciiFile.cc, mgui/MGeomCam.cc, mhist/MHFadcCam.cc, 
+     mhist/MHMcRate.cc, mmc/MMcTrig.cxx, mraw/MRawCrateArray.cc, 
+     mraw/MRawEvtData.cc, mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc:
      - changed fName, fTitle from pointer to static object
 
+   * mmontecarlo/MMcThresholdCalc.[h,cc], 
+     mmontecarlo/MMcTriggerRateCalc.[h,cc], 
+     mmontecarlo/MMcCollectionAreaCalc.[h,cc]:
+     - changed fName, fTitle from pointer to static object
+     - changed to use auto enabling scheme
+     
    * mraw/MRawFileWrite.cc:
      - changed fName, fTitle from pointer to static object
Index: trunk/MagicSoft/Mars/macros/collarea.C
===================================================================
--- trunk/MagicSoft/Mars/macros/collarea.C	(revision 1006)
+++ trunk/MagicSoft/Mars/macros/collarea.C	(revision 1007)
@@ -25,7 +25,4 @@
 void collarea(char *filename = "data/camera.root")
 { 
-    // FIXME: Harald, you should tell the people what the result of
-    // this macro really is.
-
     //
     // first we have to create our empty lists
@@ -42,14 +39,8 @@
     //
     MReadTree reader("Events", filename);
-    reader.UseLeaf("fImpact");
-    reader.UseLeaf("fEnergy");
-    reader.UseLeaf("fNumFirstLevel");
+    MMcCollectionAreaCalc effi;
+
     tasklist.AddToList(&reader);
-
-    MMcCollectionAreaCalc effi;
     tasklist.AddToList(&effi);
-
-    MTask task;
-    tasklist.AddToList(&task);
 
     //
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 1006)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 1007)
@@ -44,5 +44,17 @@
     fTitle = title ? title : "Task to calculate the collection area";
 
-    fObjName = input ? input : "MMcTrig";
+    if (input)
+    {
+        fObjName = input;
+        AddToBranchList(Form("%s.fNumFirstLevel", input));
+    }
+    else
+    {
+        fObjName = "MMcTrig";
+        AddToBranchList("fNumFirstLevel");
+    }
+
+    AddToBranchList("fEnergy");
+    AddToBranchList("fImpact");
 } 
 
@@ -74,5 +86,5 @@
 Bool_t MMcCollectionAreaCalc::Process()
 { 
-    const Float_t energy = log10(fMcEvt->GetEnergy());
+    const Float_t energy = fMcEvt->GetEnergy();
     const Float_t impact = fMcEvt->GetImpact()/100.;
 
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 1006)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 1007)
@@ -67,8 +67,16 @@
 MMcThresholdCalc::MMcThresholdCalc(const Int_t dim, const char* name,
                                    const char* title)
-    : fDimension(dim), fMcTrig(NULL), fEnergy(NULL)
+    : fMcTrig(NULL), fEnergy(NULL)
 {
     fName  = name  ? name  : "MMcThresholdCalc";
     fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
+
+    fFirst = dim>0 ?   1 : -dim;
+    fLast  = dim>0 ? dim : -dim;
+
+    fNum = fLast-fFirst+1;
+
+    AddToBranchList("fEnergy");
+    AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
 }
 
@@ -103,12 +111,7 @@
     }
 
-    UInt_t from = fDimension>0 ?          1 : -fDimension;
-    UInt_t to   = fDimension>0 ? fDimension : -fDimension;
+    UInt_t num;
 
-    fNum = to-from+1;
-
-    Int_t num;
-
-    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to));
+    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast));
     num = fMcTrig->GetEntriesFast();
     if (num != fNum)
@@ -119,5 +122,5 @@
     }
 
-    fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, to));
+    fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", fFirst, fLast));
     num = fMcTrig->GetEntriesFast();
     if (num != fNum)
@@ -143,5 +146,5 @@
     const Float_t reciproc = 1./energy;
 
-    for (Int_t i=0; i<fNum; i++)
+    for (UInt_t i=0; i<fNum; i++)
         if (GetTrig(i)->GetFirstLevel()>0)
             GetHEnergy(i)->Fill(lg10, reciproc);
@@ -157,5 +160,5 @@
 Bool_t MMcThresholdCalc::PostProcess()
 {
-    for (Int_t i=0; i<fNum; i++)
+    for (UInt_t i=0; i<fNum; i++)
     {
         MHMcEnergy &hist = *GetHEnergy(i);
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h	(revision 1006)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.h	(revision 1007)
@@ -24,6 +24,8 @@
 {
 private:
-    Int_t fDimension;
-    Int_t fNum;
+    UInt_t fFirst;
+    UInt_t fLast;
+
+    UInt_t fNum;
 
     const MMcEvt  *fMcEvt;       // Container with Monte Carlo information
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1006)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1007)
@@ -47,6 +47,4 @@
     fMcRate = NULL;
 
-    fDimension = dim;
-
     for (int i=0;i<10;i++)
         fTrigger[i] = dim&&trigbg ? trigbg[i] : 0;
@@ -56,4 +54,17 @@
 
     fPartId=part;
+
+
+    fFirst = dim>0 ?   1 : -dim;
+    fLast  = dim>0 ? dim : -dim;
+
+    fNum = fLast-fFirst+1;
+
+    AddToBranchList("fImpact");
+    AddToBranchList("fEnergy");
+    AddToBranchList("fPhi");
+    AddToBranchList("fTheta");
+    AddToBranchList("fPhotElfromShower");
+    AddToBranchList("MMcTrig", "fNumFirstLevel", fFirst, fLast);
 }
 
@@ -124,12 +135,7 @@
     }
 
-    UInt_t from = fDimension>0 ?          1 : -fDimension;
-    UInt_t to   = fDimension>0 ? fDimension : -fDimension;
-
-    fNum = to-from+1;
-
-    Int_t num;
-
-    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, to));
+    UInt_t num;
+
+    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", fFirst, fLast));
     num = fMcTrig->GetEntriesFast();
     if (num != fNum)
@@ -140,5 +146,5 @@
     }
 
-    fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", from, to));
+    fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", fFirst, fLast));
     num = fMcRate->GetEntriesFast();
     if (num != fNum)
@@ -149,5 +155,5 @@
     }
 
-    for (int i=0; i<fNum; i++)
+    for (UInt_t i=0; i<fNum; i++)
     {
         MHMcRate &rate = *GetRate(i);
@@ -191,5 +197,5 @@
     //  Counting number of triggers
     //
-    for (int i=0; i<fNum; i++)
+    for (UInt_t i=0; i<fNum; i++)
     {
         fTrigger[i] += GetTrig(i)->GetFirstLevel();
@@ -210,5 +216,5 @@
     // Computing trigger rate
     //
-    for (int i=0; i<fNum; i++)
+    for (UInt_t i=0; i<fNum; i++)
         GetRate(i)->CalcRate(fTrigger[i], fAnalShow, fShowers);
 
Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 1006)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 1007)
@@ -25,7 +25,7 @@
     TObjArray *fMcTrig;
 
-    Int_t      fDimension;     // Information about the trigger conditions
-                               // in the root file to be read.
-    Int_t      fNum;           // decoded dimension
+    UInt_t     fNum;           // decoded dimension
+    UInt_t     fFirst;
+    UInt_t     fLast;
 
     Float_t    fTrigger[10];   // Number of triggered showers
