------------------------------------------------------------
UGETv1_Geant4_Results.csv.zip:
------------------------------------------------------------
Results from simulations performed with Geant4 for the UGET v1 of a tomographic measurement device, designed in the UGET project.

Format of the comma separated file (csv) contained in the compressed archive:
   Column  1: Case: Version id, always 1
   Column  2: Case: Id (1,2 or 99999)
   Column  3: Case: Rotation angle [degrees x 1000] (integer)
   Column  4: Case: Translation along y-axis  [micrometer] (integer) 
   Column  5: Case: X index of source rod
   Column  6: Case: Y index of source rod
   Column  7: Case: Energy of source gamma [eV] (integer)
   Column  8: Field: Version id, always 1
   Column  9: Field: Device number, always 1
   Column 10: Field: Detector number (0-7)
   Column 11: Histogram: Version id, always 2
   Column 12: Histogram: Begin energy [eV] (integer)
   Column 13: Histogram: End energy [eV] (integer)
   Column 14-15: Histogram: Count vector serialized as specified below.
   Column 16: Histogram: Overflow count (hexadecimal integer)
   Column 17: Histogram: Underflow count (hexadecimal integer)

   If Case id is not 99999, then end of row
   Else more columns as follows;

   Column 18: Version id, always 1.
   Column 19: Number of following pairs (integer)
   Column 20-21: Deposited energy [eV], Count
   Column 22-23: Deposited energy [eV], Count
   Column ... (Repeated the number of times specified in column 19.)


The serializing algorithm used for columns 14-15 is specified as the following
standard C++ code. Essentially, each count which does not change between
channels in the histogram, i.e. repeated n times, is written as the string
"countPn" which stands for (count ^ n) and a space separator is written as 's'.
Each integral value is written in hexadecimal.

#include <ostream>
#include <vector>
typedef std::vector<unsigned long long int> ULLVector;
void Serialize(const ULLVector& V, std::ostream& os)
{
   os  << ' ' << std::hex << V.size() << ' ';
   if( ! V.empty() )
   {
      ULLVector::size_type pos(0), count(0);
      ULLVector::value_type prev( V[pos] );
      const ULLVector::size_type N(V.size());
      for( pos = 1; pos < N; ++pos)
      {
         if( V[pos] != prev )
         {
            if( 1 < pos )
               os << 's';
            os << prev;
            if( 1 < count )
            {
               os << 'P' << count;
            }
            count = 1;
            prev = V[pos];
         }
         else
         {
            ++count;
         }
      }
      if( 0 < count )
      {
         if( 0 < pos )
            os << 's';
         os << prev;
         if( 1 < count )
         {
            os << 'P' << count;
         }
      }
   }
}

------------------------------------------------------------
