Index: /trunk/MagicSoft/Mars/mhbase/MH.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 3152)
+++ /trunk/MagicSoft/Mars/mhbase/MH.cc	(revision 3153)
@@ -1116,4 +1116,49 @@
     if (!h1)
     {
+        h1 = new TH1I(name, title, nbins, min, max);
+        h1->SetXTitle("");
+        h1->SetYTitle("Counts");
+        h1->SetDirectory(gROOT);
+    }
+
+    // Second loop to fill the histogram
+    for (Int_t i=0;i<size;i++)
+        h1->Fill(array[i]);
+
+    return h1;
+}
+
+// --------------------------------------------------------------------------
+//
+// M.Gaug added this withouz Documentation
+//
+TH1I* MH::ProjectArray(const TArrayD &array, Int_t nbins, const char* name, const char* title)
+{
+    const Int_t size = array.GetSize();
+    TH1I *h1=0;
+
+    //check if histogram with identical name exist
+    TObject *h1obj = gROOT->FindObject(name);
+    if (h1obj && h1obj->InheritsFrom("TH1I"))
+    {
+        h1 = (TH1I*)h1obj;
+        h1->Reset();
+    }
+
+    Double_t min = size>0 ? array[0] : 0;
+    Double_t max = size>0 ? array[0] : 1;
+
+    // first loop over array to find the min and max
+    for (Int_t i=1; i<size;i++)
+    {
+        max = TMath::Max(array[i], max);
+        min = TMath::Min(array[i], min);
+    }
+
+    Int_t newbins = 0;
+    FindGoodLimits(nbins, newbins, min, max, kFALSE);
+
+    if (!h1)
+    {
         h1 = new TH1I(name, title, newbins, min, max);
         h1->SetXTitle("");
@@ -1129,47 +1174,2 @@
 }
 
-// --------------------------------------------------------------------------
-//
-// M.Gaug added this withouz Documentation
-//
-TH1I* MH::ProjectArray(const TArrayD &array, Int_t nbins, const char* name, const char* title)
-{
-    const Int_t size = array.GetSize();
-    TH1I *h1=0;
-
-    //check if histogram with identical name exist
-    TObject *h1obj = gROOT->FindObject(name);
-    if (h1obj && h1obj->InheritsFrom("TH1I"))
-    {
-        h1 = (TH1I*)h1obj;
-        h1->Reset();
-    }
-
-    Double_t min = size>0 ? array[0] : 0;
-    Double_t max = size>0 ? array[0] : 1;
-
-    // first loop over array to find the min and max
-    for (Int_t i=1; i<size;i++)
-    {
-        max = TMath::Max(array[i], max);
-        min = TMath::Min(array[i], min);
-    }
-
-    Int_t newbins = 0;
-    FindGoodLimits(nbins, newbins, min, max, kFALSE);
-
-    if (!h1)
-    {
-        h1 = new TH1I(name, title, newbins, min, max);
-        h1->SetXTitle("");
-        h1->SetYTitle("Counts");
-        h1->SetDirectory(gROOT);
-    }
-
-    // Second loop to fill the histogram
-    for (Int_t i=0;i<size;i++)
-        h1->Fill(array[i]);
-
-    return h1;
-}
-
