Index: /fact/tools/marsmacros/mc2csv/MonteCarlo.C
===================================================================
--- /fact/tools/marsmacros/mc2csv/MonteCarlo.C	(revision 14726)
+++ /fact/tools/marsmacros/mc2csv/MonteCarlo.C	(revision 14727)
@@ -1,4 +1,7 @@
 #include "MonteCarlo.h"
 
+// --------------------------------------------------------------------------
+// Default constructor. Initiates Pointers and Variables to NULL or 0
+//
 MonteCarlo::MonteCarlo()
 {
@@ -68,4 +71,7 @@
 }
 
+// --------------------------------------------------------------------------
+// Destructor
+//
 MonteCarlo::~MonteCarlo(void)
 {
@@ -79,4 +85,7 @@
 }
 
+// --------------------------------------------------------------------------
+// Initiates Pointers and Variables to NULL or 0
+//
 void
 MonteCarlo::InitVariables()
@@ -121,4 +130,8 @@
 }
 
+// ==========================================================================
+// Setters
+//
+
 void
 MonteCarlo::SetVerbosityLevel(int verbLvl)
@@ -128,4 +141,8 @@
     return;
 }
+
+// ==========================================================================
+// Getters
+//
 
 int
@@ -134,4 +151,8 @@
     return mVerbosityLvl;
 }
+
+// ==========================================================================
+// Root file handling
+//
 
 void
@@ -159,26 +180,4 @@
     mpRootFile->Close("R");
     mpRootFile=NULL;
-
-    return;
-}
-
-void
-MonteCarlo::OpenCsvFile(TString fileName)
-{
-    mCsvFileName    = fileName;
-
-    if (mVerbosityLvl > 0) cout << "...opening csv file: " << mCsvFileName << endl;
-
-    mCsv.open( mCsvFileName );
-
-    return;
-}
-
-void
-MonteCarlo::CloseCsvFile()
-{
-    if (mVerbosityLvl > 0) cout << "...closing csv file: " << mCsvFileName << endl;
-
-    mCsv.close();
 
     return;
@@ -563,5 +562,4 @@
 
     int pix_first_sample;
-//    int pix_last_sample;
 
     // -----------------------------------------------------------------------
@@ -572,4 +570,12 @@
     {
         all_raw_data    = (unsigned short*) mpRawEventData->GetSamples();
+//  FADC samples (hi gain) of all pixels
+//  This is an array of Byte_t variables. The value of a FADC sample has a
+//  size of n=fNumBytesPerSample bytes. Therefore, a FADC sample value will
+//  occupy n consecutive elements of this array (little endian ordering, i.e,
+//  less significant bits (and bytes) go first.
+//  If m = GetNumHiGainSamples(), the n bytes corresponding to the value of the
+//  i-th FADC sample of the j-th pixel are stored in the n consecutive
+//  positions of this array, starting from fHiGainFadcSamples[j*n*m+i*n]
     }
     else cout << "...cannot read event raw data" << endl;
@@ -608,4 +614,5 @@
         // of pixel's first sample's adress
         mpPixel[i].rawData      = &(all_raw_data[pix_first_sample]);
+
     }
 
@@ -630,4 +637,30 @@
     ReadEventMetaData();
     ReadEventRawData();
+
+    return;
+}
+
+// ==========================================================================
+// csv file handling
+//
+
+void
+MonteCarlo::OpenCsvFile(TString fileName)
+{
+    mCsvFileName    = fileName;
+
+    if (mVerbosityLvl > 0) cout << "...opening csv file: " << mCsvFileName << endl;
+
+    mCsv.open( mCsvFileName );
+
+    return;
+}
+
+void
+MonteCarlo::CloseCsvFile()
+{
+    if (mVerbosityLvl > 0) cout << "...closing csv file: " << mCsvFileName << endl;
+
+    mCsv.close();
 
     return;
@@ -903,18 +936,8 @@
 
 
-//--------------------------------------------------------------------------------
-//
-//
-//
-//  FADC samples (hi gain) of all pixels
-//  This is an array of Byte_t variables. The value of a FADC sample has a
-//  size of n=fNumBytesPerSample bytes. Therefore, a FADC sample value will
-//  occupy n consecutive elements of this array (little endian ordering, i.e,
-//  less significant bits (and bytes) go first.
-//  If m = GetNumHiGainSamples(), the n bytes corresponding to the value of the
-//  i-th FADC sample of the j-th pixel are stored in the n consecutive
-//  positions of this array, starting from fHiGainFadcSamples[j*n*m+i*n]
-
-
-
-
+
+
+
+
+
+
