Index: fact/tools/marsmacros/mc2csv/MonteCarlo.C
===================================================================
--- fact/tools/marsmacros/mc2csv/MonteCarlo.C	(revision 14657)
+++ fact/tools/marsmacros/mc2csv/MonteCarlo.C	(revision 14658)
@@ -116,5 +116,5 @@
     mNumberOfEvents = 2;
 
-    mVerbosityLvl   = 2;
+    mVerbosityLvl   = 3;
 
     return;
@@ -209,4 +209,5 @@
         mpHeaderTree->SetBranchAddress("MGeomCam.",         &mpGeomCam);
     }
+    else cout << "...could not load branch: MGeomCam" << endl;
 
     // -----------------------------------------------------------------------
@@ -218,4 +219,5 @@
         mpHeaderTree->SetBranchAddress("IntendedPulsePos.", &mpIntendedPulsePos);
     }
+    else cout << "...could not load branch: IntendedPulsePos" << endl;
 
     // -----------------------------------------------------------------------
@@ -227,4 +229,5 @@
         mpHeaderTree->SetBranchAddress("MMcRunHeader.",     &mpMcRunHeader);
     }
+    else cout << "...could not load branch: MMcRunHeader" << endl;
 
     // -----------------------------------------------------------------------
@@ -236,4 +239,5 @@
         mpHeaderTree->SetBranchAddress("ElectronicNoise.",  &mpElectronicNoise);
     }
+    else cout << "...could not load branch: ElectronicNoise" << endl;
 
     // -----------------------------------------------------------------------
@@ -245,4 +249,5 @@
         mpHeaderTree->SetBranchAddress("MRawRunHeader.",    &mpRawRunHeader);
     }
+    else cout << "...could not load branch: MRawRunHeader" << endl;
 
     // -----------------------------------------------------------------------
@@ -254,4 +259,5 @@
         mpHeaderTree->SetBranchAddress("MCorsikaRunHeader.",&mpCorsikaRunHeader);
     }
+    else cout << "...could not load branch: MCorsikaRunHeader" << endl;
 
     // =======================================================================
@@ -350,4 +356,32 @@
     else if (mVerbosityLvl > 2)
         cout << "...could not read data from: MCorsikaRunHeader" << endl;
+
+    // -----------------------------------------------------------------------
+
+    // delete Pixel Array before you set refferences for a new one
+    if (mpPixel != NULL)
+    {
+        delete[] mpPixel;
+    }
+    mpPixel = new pixel_t[mNumberOfPixels];
+
+    // -----------------------------------------------------------------------
+
+    //Get Pedestal from "ElectronicNoise" Branch
+    if ( mpElectronicNoise != NULL)
+    {
+        if (mVerbosityLvl > 1) cout << "   ...reading pedestal offsets" << endl;
+
+        // Read Pedestal Offset
+        for ( int i = 0; i < mNumberOfPixels; i++ )
+        {
+            if ( &(mpElectronicNoise[0][i]) != NULL)
+                mpPixel[i].pedestal   = mpElectronicNoise[0][i].GetPedestal();
+            else if (mVerbosityLvl > 2)
+                cout << "   ...cannot read pedestal offset" << endl;
+        }
+    }
+    else if (mVerbosityLvl > 2)
+        cout << "...could not read data from: ElectronicNoise" << endl;
 
     return;
@@ -844,8 +878,8 @@
 MonteCarlo::WritePedestalInfo2Csv()
 {
-    mCsv << "### [Pedestal info]" << endl;
-    mCsv << "# SoftID" ;
-    mCsv << mSeparator ;
-    mCsv << "Pedestal" << endl;
+    mCsv << "### [Pedestal]" << endl;
+//    mCsv << "# SoftID" ;
+//    mCsv << mSeparator ;
+//    mCsv << "Pedestal" << endl;
 }
 
@@ -857,8 +891,8 @@
     for (int pixelID = 0; pixelID < mNumberOfPixels; pixelID++)
     {
-        mCsv << mpPixel[pixelID].SoftId;
-        mCsv << mSeparator;
+//        mCsv << mpPixel[pixelID].SoftId;
         mCsv << mpPixel[pixelID].pedestal;
-        mCsv << endl;
+        if (pixelID < mNumberOfPixels -1)
+            mCsv << mSeparator;
     }
     mCsv << endl;
