Index: trunk/FACT++/src/HeadersFTM.cc
===================================================================
--- trunk/FACT++/src/HeadersFTM.cc	(revision 10690)
+++ trunk/FACT++/src/HeadersFTM.cc	(revision 10691)
@@ -104,7 +104,7 @@
     out << ((fTriggerSequence>> 5)&0x1f) << ":";
     out << ((fTriggerSequence>>10)&0x1f) << " (LPint:LPext:PED)" << endl;
-    out << "Coinc. physics:    " << std::setw(2) << fCoincidencePhysics << "/N  ";
+    out << "Coinc. physics:    " << std::setw(2) << fMultiplicityPhysics << "/N  ";
     out << fWindowPhysics*4+8 << "ns" << endl;
-    out << "Coinc. calib:      " << std::setw(2) << fCoincidenceCalib << "/N  ";
+    out << "Coinc. calib:      " << std::setw(2) << fMultiplicityCalib << "/N  ";
     out << fWindowCalib*4+8 << "ns" << endl;
     out << "Trigger delay:     " << fDelayTrigger*4+8 << "ns" << endl;
Index: trunk/FACT++/src/HeadersFTM.h
===================================================================
--- trunk/FACT++/src/HeadersFTM.h	(revision 10690)
+++ trunk/FACT++/src/HeadersFTM.h	(revision 10691)
@@ -152,21 +152,19 @@
     };
 
+    /// Command codes for FTM communication
     enum Commands
     {
-        kCmdRead           = 0x0001,
-        kCmdWrite          = 0x0002,
-        kCmdStartRun       = 0x0004,
-        kCmdStopRun        = 0x0008,
-        kCmdPing           = 0x0010,
-        kCmdCrateReset     = 0x0020,
-        kCmdDisableReports = 0x0040,
+        kCmdRead           = 0x0001, ///< Request data
+        kCmdWrite          = 0x0002, ///< Send data
+        kCmdStartRun       = 0x0004, ///< Start the trigger
+        kCmdStopRun        = 0x0008, ///< Stop the trigger
+        kCmdPing           = 0x0010, ///< Ping all FTUs (get FTU list)
+        kCmdCrateReset     = 0x0020, 
+        kCmdDisableReports = 0x0040, ///< Disable transmission of rate-reports (dynamic data)
         kCmdToggleLed      = 0xc000,
 
-        kWriteStaticData   = 0x0001,
-        kWriteRegister     = 0x0004,
-
-        kReadStaticData    = 0x0001,
-        kReadDynamicData   = 0x0002,
-        kReadRegister      = 0x0004,
+        kCmdStaticData     = 0x0001, ///< Specifies that static (configuration) data is read/written
+        kCmdDynamicData    = 0x0002, ///< Specifies that dynamic data is read/written
+        kCmdRegister       = 0x0004, ///< Specifies that a register is read/written
 
         kStartRun          = 0x0001,
@@ -174,12 +172,14 @@
     };
 
+
+    /// Types sent in the header of the following data
     enum Types
     {
-        kHeader      = 0,   // Local extension to identify a header in fCounter
-        kStaticData  = 1,
-        kDynamicData = 2,
-        kFtuList     = 3,
-        kErrorList   = 4,
-        kRegister    = 5,
+        kHeader      = 0,  ///< Local extension to identify a header in fCounter
+        kStaticData  = 1,  ///< Static (configuration) data
+        kDynamicData = 2,  ///< Dynamic data (rates)
+        kFtuList     = 3,  ///< FTU list (answer of ping)
+        kErrorList   = 4,  ///< Error list (error when FTU communication failed)
+        kRegister    = 5,  ///< A requested register value
     };
 
@@ -194,14 +194,14 @@
     enum
     {
-        kDelimiterStart = 0xfb01,
-        kDelimiterEnd   = 0x04fe
+        kDelimiterStart = 0xfb01, ///< Start delimiter send before each header
+        kDelimiterEnd   = 0x04fe  ///< End delimiter send after each data block
     };
 
     struct Header
     {
-        uint16_t fDelimiter;        /// Start delimiter
-        uint16_t fType;             /// Type of the data to be received after the header
-        uint16_t fDataSize;         /// Size in words to be received after the header
-        uint16_t fState;            /// State of the FTM state machine
+        uint16_t fDelimiter;      /// Start delimiter
+        uint16_t fType;           /// Type of the data to be received after the header
+        uint16_t fDataSize;       /// Size in words to be received after the header
+        uint16_t fState;          /// State of the FTM state machine
         uint64_t fBoardId;
         uint16_t fFirmwareId;
@@ -276,5 +276,5 @@
         enum
         {
-            kMaxCoincidence     = 40,
+            kMaxMultiplicity    = 40,      ///< Maximum for required trigger multiplicity
             kMaxWindow          = 0xf,
             kMaxDeadTime        = 0xffff,
@@ -304,6 +304,6 @@
         uint16_t fTriggerSequence;         // 3x5bit
         uint64_t fDummy0;
-        uint16_t fCoincidencePhysics;
-        uint16_t fCoincidenceCalib;
+        uint16_t fMultiplicityPhysics;
+        uint16_t fMultiplicityCalib;
         uint16_t fDelayTrigger;
         uint16_t fDelayTimeMarker;
@@ -377,6 +377,6 @@
         uint16_t fTriggerSeqPed;           // only 5bits used
         //28
-        uint16_t fCoincidencePhysics;      // 0-40
-        uint16_t fCoincidenceCalib;        // 0-40
+        uint16_t fMultiplicityPhysics;      // 0-40
+        uint16_t fMultiplicityCalib;        // 0-40
         //32
         uint16_t fWindowPhysics;
@@ -421,6 +421,6 @@
             fTriggerSeqLPext((d.fTriggerSequence>>5)&0x1f),
             fTriggerSeqPed((d.fTriggerSequence>>10)&0x1f),
-            fCoincidencePhysics(d.fCoincidencePhysics),
-            fCoincidenceCalib(d.fCoincidenceCalib),
+            fMultiplicityPhysics(d.fMultiplicityPhysics),
+            fMultiplicityCalib(d.fMultiplicityCalib),
             fWindowPhysics(d.fWindowPhysics*4+8),
             fWindowCalib(d.fWindowCalib*4+8),
Index: trunk/FACT++/src/StateMachineImp.h
===================================================================
--- trunk/FACT++/src/StateMachineImp.h	(revision 10690)
+++ trunk/FACT++/src/StateMachineImp.h	(revision 10691)
@@ -18,5 +18,5 @@
     /// Derived classes must define different state-number for
     /// their purpose
-    enum
+    enum DefaultStates_t
     {
         kSM_NotReady   =     -1,  ///< Mainloop not running, state machine stopped
@@ -24,5 +24,5 @@
         kSM_Error      =  0x100,  ///< Error states should be between 0x100 and 0xffff
         kSM_FatalError = 0xffff,  ///< Fatal error: stop program
-    } defaultstates_t;
+    };
 
 private:
Index: trunk/FACT++/src/ftm.cc
===================================================================
--- trunk/FACT++/src/ftm.cc	(revision 10690)
+++ trunk/FACT++/src/ftm.cc	(revision 10691)
@@ -76,11 +76,11 @@
         fStaticData.clear();
 
-        fStaticData.fCoincidencePhysics = 1;
-        fStaticData.fCoincidenceCalib   = 40;
-        fStaticData.fWindowCalib        = 1;
-        fStaticData.fWindowPhysics      = 0;
-        fStaticData.fDelayTrigger       = 21;
-        fStaticData.fDelayTimeMarker    = 42;
-        fStaticData.fDeadTime           = 84;
+        fStaticData.fMultiplicityPhysics = 1;
+        fStaticData.fMultiplicityCalib   = 40;
+        fStaticData.fWindowCalib         = 1;
+        fStaticData.fWindowPhysics       = 0;
+        fStaticData.fDelayTrigger        = 21;
+        fStaticData.fDelayTimeMarker     = 42;
+        fStaticData.fDeadTime            = 84;
 
         fStaticData.fClockConditioner[0] = 100;
@@ -265,5 +265,5 @@
                 switch (fBufCommand[2])
                 {
-                case kReadStaticData:
+                case kCmdStaticData:
                     cout << "-> STATIC" << endl;
 
@@ -275,5 +275,5 @@
                     return;
 
-                case kReadDynamicData:
+                case kCmdDynamicData:
                     cout << "-> DYNAMIC" << endl;
 
@@ -285,5 +285,5 @@
                     return;
 
-                case kReadRegister:
+                case kCmdRegister:
                     fCommand = fBufCommand;
                     cout << "-> REGISTER" << endl;
@@ -299,5 +299,5 @@
                 switch (fBufCommand[2])
                 {
-                case kWriteRegister:
+                case kCmdRegister:
                     fCommand = fBufCommand;
                     cout << "-> REGISTER" << endl;
@@ -307,5 +307,5 @@
                     return;
 
-                case kWriteStaticData:
+                case kCmdStaticData:
                     fCommand = fBufCommand;
                     cout << "-> STATIC DATA" << endl;
@@ -376,5 +376,5 @@
             switch (fCommand[2])
             {
-            case kWriteRegister:
+            case kCmdRegister:
                 {
                     const uint16_t addr = ntohs(fBufCommand[0]);
@@ -387,5 +387,5 @@
                 break;
 
-            case kWriteStaticData:
+            case kCmdStaticData:
                 {
                     cout << "-> SET STATIC DATA" << endl;
Index: trunk/FACT++/src/ftmctrl.cc
===================================================================
--- trunk/FACT++/src/ftmctrl.cc	(revision 10690)
+++ trunk/FACT++/src/ftmctrl.cc	(revision 10691)
@@ -505,15 +505,15 @@
     void CmdReqDynDat()
     {
-        PostCmd(FTM::kCmdRead, FTM::kReadDynamicData);
+        PostCmd(FTM::kCmdRead, FTM::kCmdDynamicData);
     }
 
     void CmdReqStatDat()
     {
-        PostCmd(FTM::kCmdRead, FTM::kReadStaticData);
+        PostCmd(FTM::kCmdRead, FTM::kCmdStaticData);
     }
 
     void CmdSendStatDat()
     {
-        PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::kWriteStaticData);
+        PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::kCmdStaticData);
 
         // Request the changed configuration to ensure the
@@ -553,5 +553,5 @@
 
         const boost::array<uint16_t, 2> data = {{ addr, val }};
-        PostCmd(data, FTM::kCmdWrite, FTM::kWriteRegister);
+        PostCmd(data, FTM::kCmdWrite, FTM::kCmdRegister);
 
         // Request the changed configuration to ensure the
@@ -568,5 +568,5 @@
 
         const boost::array<uint16_t, 1> data = {{ addr }};
-        PostCmd(data, FTM::kCmdRead, FTM::kReadRegister);
+        PostCmd(data, FTM::kCmdRead, FTM::kCmdRegister);
 
         return true;
@@ -813,13 +813,13 @@
     }
 
-    bool SetTriggerCoincidence(uint16_t n)
-    {
-        if (n==0 || n>FTM::StaticData::kMaxCoincidence)
+    bool SetTriggerMultiplicity(uint16_t n)
+    {
+        if (n==0 || n>FTM::StaticData::kMaxMultiplicity)
             return false;
 
-        if (n==fStaticData.fCoincidencePhysics)
+        if (n==fStaticData.fMultiplicityPhysics)
             return true;
 
-        fStaticData.fCoincidencePhysics = n;
+        fStaticData.fMultiplicityPhysics = n;
 
         CmdSendStatDat();
@@ -843,13 +843,13 @@
     }
 
-    bool SetCalibCoincidence(uint16_t n)
-    {
-        if (n==0 || n>FTM::StaticData::kMaxCoincidence)
+    bool SetCalibMultiplicity(uint16_t n)
+    {
+        if (n==0 || n>FTM::StaticData::kMaxMultiplicity)
             return false;
 
-        if (n==fStaticData.fCoincidenceCalib)
+        if (n==fStaticData.fMultiplicityCalib)
             return true;
 
-        fStaticData.fCoincidenceCalib = n;
+        fStaticData.fMultiplicityCalib = n;
 
         CmdSendStatDat();
@@ -1264,22 +1264,22 @@
     }
 
-    int SetTriggerCoincidence(const EventImp &evt)
-    {
-        if (!CheckEventSize(evt.GetSize(), "SetTriggerCoincidence", 2))
-            return T::kSM_FatalError;
-
-        if (!fFTM.SetTriggerCoincidence(evt.GetUShort()))
-            T::Warn("SetTriggerCoincidence -  Value out of range.");
-
-        return T::GetCurrentState();
-    }
-
-    int SetCalibCoincidence(const EventImp &evt)
-    {
-        if (!CheckEventSize(evt.GetSize(), "SetCalibCoincidence", 2))
-            return T::kSM_FatalError;
-
-        if (!fFTM.SetCalibCoincidence(evt.GetUShort()))
-            T::Warn("SetCalibCoincidence -  Value out of range.");
+    int SetTriggerMultiplicity(const EventImp &evt)
+    {
+        if (!CheckEventSize(evt.GetSize(), "SetTriggerMultiplicity", 2))
+            return T::kSM_FatalError;
+
+        if (!fFTM.SetTriggerMultiplicity(evt.GetUShort()))
+            T::Warn("SetTriggerMultiplicity -  Value out of range.");
+
+        return T::GetCurrentState();
+    }
+
+    int SetCalibMultiplicity(const EventImp &evt)
+    {
+        if (!CheckEventSize(evt.GetSize(), "SetCalibMultiplicity", 2))
+            return T::kSM_FatalError;
+
+        if (!fFTM.SetCalibMultiplicity(evt.GetUShort()))
+            T::Warn("SetCalibMultiplicity -  Value out of range.");
 
         return T::GetCurrentState();
@@ -1516,7 +1516,7 @@
              "|LPext[int]:number of triggers of the external light pulser");
 
-        AddEvent("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle)
-            (boost::bind(&StateMachineFTM::SetTriggerCoincidence, this, _1))
-            ("Setup the coincidence condition for physcis triggers"
+        AddEvent("SET_TRIGGER_Multiplicity", "S:1", kStateIdle)
+            (boost::bind(&StateMachineFTM::SetTriggerMultiplicity, this, _1))
+            ("Setup the Multiplicity condition for physcis triggers"
              "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
 
@@ -1525,7 +1525,7 @@
             ("");
 
-        AddEvent("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle)
-            (boost::bind(&StateMachineFTM::SetCalibCoincidence, this, _1))
-            ("Setup the coincidence condition for artificial (calibration) triggers"
+        AddEvent("SET_CALIBRATION_Multiplicity", "S:1", kStateIdle)
+            (boost::bind(&StateMachineFTM::SetCalibMultiplicity, this, _1))
+            ("Setup the Multiplicity condition for artificial (calibration) triggers"
              "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
 
