Changeset 10691


Ignore:
Timestamp:
05/12/11 22:55:23 (14 years ago)
Author:
tbretz
Message:
Added some docu; renamed Coincidence to multiplicity.
Location:
trunk/FACT++
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r10678 r10691  
    10071007
    10081008        fTriggerInterval->setValue(sdata.fTriggerInterval);
    1009         fPhysicsCoincidence->setValue(sdata.fCoincidencePhysics);
    1010         fCalibCoincidence->setValue(sdata.fCoincidenceCalib);
     1009        fPhysicsCoincidence->setValue(sdata.fMultiplicityPhysics);
     1010        fCalibCoincidence->setValue(sdata.fMultiplicityCalib);
    10111011        fPhysicsWindow->setValue(sdata.fWindowPhysics);
    10121012        fCalibWindow->setValue(sdata.fWindowCalib);
  • trunk/FACT++/src/HeadersFTM.cc

    r10649 r10691  
    104104    out << ((fTriggerSequence>> 5)&0x1f) << ":";
    105105    out << ((fTriggerSequence>>10)&0x1f) << " (LPint:LPext:PED)" << endl;
    106     out << "Coinc. physics:    " << std::setw(2) << fCoincidencePhysics << "/N  ";
     106    out << "Coinc. physics:    " << std::setw(2) << fMultiplicityPhysics << "/N  ";
    107107    out << fWindowPhysics*4+8 << "ns" << endl;
    108     out << "Coinc. calib:      " << std::setw(2) << fCoincidenceCalib << "/N  ";
     108    out << "Coinc. calib:      " << std::setw(2) << fMultiplicityCalib << "/N  ";
    109109    out << fWindowCalib*4+8 << "ns" << endl;
    110110    out << "Trigger delay:     " << fDelayTrigger*4+8 << "ns" << endl;
  • trunk/FACT++/src/HeadersFTM.h

    r10622 r10691  
    152152    };
    153153
     154    /// Command codes for FTM communication
    154155    enum Commands
    155156    {
    156         kCmdRead           = 0x0001,
    157         kCmdWrite          = 0x0002,
    158         kCmdStartRun       = 0x0004,
    159         kCmdStopRun        = 0x0008,
    160         kCmdPing           = 0x0010,
    161         kCmdCrateReset     = 0x0020,
    162         kCmdDisableReports = 0x0040,
     157        kCmdRead           = 0x0001, ///< Request data
     158        kCmdWrite          = 0x0002, ///< Send data
     159        kCmdStartRun       = 0x0004, ///< Start the trigger
     160        kCmdStopRun        = 0x0008, ///< Stop the trigger
     161        kCmdPing           = 0x0010, ///< Ping all FTUs (get FTU list)
     162        kCmdCrateReset     = 0x0020, 
     163        kCmdDisableReports = 0x0040, ///< Disable transmission of rate-reports (dynamic data)
    163164        kCmdToggleLed      = 0xc000,
    164165
    165         kWriteStaticData   = 0x0001,
    166         kWriteRegister     = 0x0004,
    167 
    168         kReadStaticData    = 0x0001,
    169         kReadDynamicData   = 0x0002,
    170         kReadRegister      = 0x0004,
     166        kCmdStaticData     = 0x0001, ///< Specifies that static (configuration) data is read/written
     167        kCmdDynamicData    = 0x0002, ///< Specifies that dynamic data is read/written
     168        kCmdRegister       = 0x0004, ///< Specifies that a register is read/written
    171169
    172170        kStartRun          = 0x0001,
     
    174172    };
    175173
     174
     175    /// Types sent in the header of the following data
    176176    enum Types
    177177    {
    178         kHeader      = 0,   // Local extension to identify a header in fCounter
    179         kStaticData  = 1,
    180         kDynamicData = 2,
    181         kFtuList     = 3,
    182         kErrorList   = 4,
    183         kRegister    = 5,
     178        kHeader      = 0,  ///< Local extension to identify a header in fCounter
     179        kStaticData  = 1,  ///< Static (configuration) data
     180        kDynamicData = 2,  ///< Dynamic data (rates)
     181        kFtuList     = 3,  ///< FTU list (answer of ping)
     182        kErrorList   = 4,  ///< Error list (error when FTU communication failed)
     183        kRegister    = 5,  ///< A requested register value
    184184    };
    185185
     
    194194    enum
    195195    {
    196         kDelimiterStart = 0xfb01,
    197         kDelimiterEnd   = 0x04fe
     196        kDelimiterStart = 0xfb01, ///< Start delimiter send before each header
     197        kDelimiterEnd   = 0x04fe  ///< End delimiter send after each data block
    198198    };
    199199
    200200    struct Header
    201201    {
    202         uint16_t fDelimiter;        /// Start delimiter
    203         uint16_t fType;             /// Type of the data to be received after the header
    204         uint16_t fDataSize;         /// Size in words to be received after the header
    205         uint16_t fState;            /// State of the FTM state machine
     202        uint16_t fDelimiter;      /// Start delimiter
     203        uint16_t fType;           /// Type of the data to be received after the header
     204        uint16_t fDataSize;       /// Size in words to be received after the header
     205        uint16_t fState;          /// State of the FTM state machine
    206206        uint64_t fBoardId;
    207207        uint16_t fFirmwareId;
     
    276276        enum
    277277        {
    278             kMaxCoincidence     = 40,
     278            kMaxMultiplicity    = 40,      ///< Maximum for required trigger multiplicity
    279279            kMaxWindow          = 0xf,
    280280            kMaxDeadTime        = 0xffff,
     
    304304        uint16_t fTriggerSequence;         // 3x5bit
    305305        uint64_t fDummy0;
    306         uint16_t fCoincidencePhysics;
    307         uint16_t fCoincidenceCalib;
     306        uint16_t fMultiplicityPhysics;
     307        uint16_t fMultiplicityCalib;
    308308        uint16_t fDelayTrigger;
    309309        uint16_t fDelayTimeMarker;
     
    377377        uint16_t fTriggerSeqPed;           // only 5bits used
    378378        //28
    379         uint16_t fCoincidencePhysics;      // 0-40
    380         uint16_t fCoincidenceCalib;        // 0-40
     379        uint16_t fMultiplicityPhysics;      // 0-40
     380        uint16_t fMultiplicityCalib;        // 0-40
    381381        //32
    382382        uint16_t fWindowPhysics;
     
    421421            fTriggerSeqLPext((d.fTriggerSequence>>5)&0x1f),
    422422            fTriggerSeqPed((d.fTriggerSequence>>10)&0x1f),
    423             fCoincidencePhysics(d.fCoincidencePhysics),
    424             fCoincidenceCalib(d.fCoincidenceCalib),
     423            fMultiplicityPhysics(d.fMultiplicityPhysics),
     424            fMultiplicityCalib(d.fMultiplicityCalib),
    425425            fWindowPhysics(d.fWindowPhysics*4+8),
    426426            fWindowCalib(d.fWindowCalib*4+8),
  • trunk/FACT++/src/StateMachineImp.h

    r10688 r10691  
    1818    /// Derived classes must define different state-number for
    1919    /// their purpose
    20     enum
     20    enum DefaultStates_t
    2121    {
    2222        kSM_NotReady   =     -1,  ///< Mainloop not running, state machine stopped
     
    2424        kSM_Error      =  0x100,  ///< Error states should be between 0x100 and 0xffff
    2525        kSM_FatalError = 0xffff,  ///< Fatal error: stop program
    26     } defaultstates_t;
     26    };
    2727
    2828private:
  • trunk/FACT++/src/ftm.cc

    r10592 r10691  
    7676        fStaticData.clear();
    7777
    78         fStaticData.fCoincidencePhysics = 1;
    79         fStaticData.fCoincidenceCalib   = 40;
    80         fStaticData.fWindowCalib        = 1;
    81         fStaticData.fWindowPhysics      = 0;
    82         fStaticData.fDelayTrigger       = 21;
    83         fStaticData.fDelayTimeMarker    = 42;
    84         fStaticData.fDeadTime           = 84;
     78        fStaticData.fMultiplicityPhysics = 1;
     79        fStaticData.fMultiplicityCalib   = 40;
     80        fStaticData.fWindowCalib         = 1;
     81        fStaticData.fWindowPhysics       = 0;
     82        fStaticData.fDelayTrigger        = 21;
     83        fStaticData.fDelayTimeMarker     = 42;
     84        fStaticData.fDeadTime            = 84;
    8585
    8686        fStaticData.fClockConditioner[0] = 100;
     
    265265                switch (fBufCommand[2])
    266266                {
    267                 case kReadStaticData:
     267                case kCmdStaticData:
    268268                    cout << "-> STATIC" << endl;
    269269
     
    275275                    return;
    276276
    277                 case kReadDynamicData:
     277                case kCmdDynamicData:
    278278                    cout << "-> DYNAMIC" << endl;
    279279
     
    285285                    return;
    286286
    287                 case kReadRegister:
     287                case kCmdRegister:
    288288                    fCommand = fBufCommand;
    289289                    cout << "-> REGISTER" << endl;
     
    299299                switch (fBufCommand[2])
    300300                {
    301                 case kWriteRegister:
     301                case kCmdRegister:
    302302                    fCommand = fBufCommand;
    303303                    cout << "-> REGISTER" << endl;
     
    307307                    return;
    308308
    309                 case kWriteStaticData:
     309                case kCmdStaticData:
    310310                    fCommand = fBufCommand;
    311311                    cout << "-> STATIC DATA" << endl;
     
    376376            switch (fCommand[2])
    377377            {
    378             case kWriteRegister:
     378            case kCmdRegister:
    379379                {
    380380                    const uint16_t addr = ntohs(fBufCommand[0]);
     
    387387                break;
    388388
    389             case kWriteStaticData:
     389            case kCmdStaticData:
    390390                {
    391391                    cout << "-> SET STATIC DATA" << endl;
  • trunk/FACT++/src/ftmctrl.cc

    r10688 r10691  
    505505    void CmdReqDynDat()
    506506    {
    507         PostCmd(FTM::kCmdRead, FTM::kReadDynamicData);
     507        PostCmd(FTM::kCmdRead, FTM::kCmdDynamicData);
    508508    }
    509509
    510510    void CmdReqStatDat()
    511511    {
    512         PostCmd(FTM::kCmdRead, FTM::kReadStaticData);
     512        PostCmd(FTM::kCmdRead, FTM::kCmdStaticData);
    513513    }
    514514
    515515    void CmdSendStatDat()
    516516    {
    517         PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::kWriteStaticData);
     517        PostCmd(fStaticData.HtoN(), FTM::kCmdWrite, FTM::kCmdStaticData);
    518518
    519519        // Request the changed configuration to ensure the
     
    553553
    554554        const boost::array<uint16_t, 2> data = {{ addr, val }};
    555         PostCmd(data, FTM::kCmdWrite, FTM::kWriteRegister);
     555        PostCmd(data, FTM::kCmdWrite, FTM::kCmdRegister);
    556556
    557557        // Request the changed configuration to ensure the
     
    568568
    569569        const boost::array<uint16_t, 1> data = {{ addr }};
    570         PostCmd(data, FTM::kCmdRead, FTM::kReadRegister);
     570        PostCmd(data, FTM::kCmdRead, FTM::kCmdRegister);
    571571
    572572        return true;
     
    813813    }
    814814
    815     bool SetTriggerCoincidence(uint16_t n)
    816     {
    817         if (n==0 || n>FTM::StaticData::kMaxCoincidence)
     815    bool SetTriggerMultiplicity(uint16_t n)
     816    {
     817        if (n==0 || n>FTM::StaticData::kMaxMultiplicity)
    818818            return false;
    819819
    820         if (n==fStaticData.fCoincidencePhysics)
     820        if (n==fStaticData.fMultiplicityPhysics)
    821821            return true;
    822822
    823         fStaticData.fCoincidencePhysics = n;
     823        fStaticData.fMultiplicityPhysics = n;
    824824
    825825        CmdSendStatDat();
     
    843843    }
    844844
    845     bool SetCalibCoincidence(uint16_t n)
    846     {
    847         if (n==0 || n>FTM::StaticData::kMaxCoincidence)
     845    bool SetCalibMultiplicity(uint16_t n)
     846    {
     847        if (n==0 || n>FTM::StaticData::kMaxMultiplicity)
    848848            return false;
    849849
    850         if (n==fStaticData.fCoincidenceCalib)
     850        if (n==fStaticData.fMultiplicityCalib)
    851851            return true;
    852852
    853         fStaticData.fCoincidenceCalib = n;
     853        fStaticData.fMultiplicityCalib = n;
    854854
    855855        CmdSendStatDat();
     
    12641264    }
    12651265
    1266     int SetTriggerCoincidence(const EventImp &evt)
    1267     {
    1268         if (!CheckEventSize(evt.GetSize(), "SetTriggerCoincidence", 2))
    1269             return T::kSM_FatalError;
    1270 
    1271         if (!fFTM.SetTriggerCoincidence(evt.GetUShort()))
    1272             T::Warn("SetTriggerCoincidence -  Value out of range.");
    1273 
    1274         return T::GetCurrentState();
    1275     }
    1276 
    1277     int SetCalibCoincidence(const EventImp &evt)
    1278     {
    1279         if (!CheckEventSize(evt.GetSize(), "SetCalibCoincidence", 2))
    1280             return T::kSM_FatalError;
    1281 
    1282         if (!fFTM.SetCalibCoincidence(evt.GetUShort()))
    1283             T::Warn("SetCalibCoincidence -  Value out of range.");
     1266    int SetTriggerMultiplicity(const EventImp &evt)
     1267    {
     1268        if (!CheckEventSize(evt.GetSize(), "SetTriggerMultiplicity", 2))
     1269            return T::kSM_FatalError;
     1270
     1271        if (!fFTM.SetTriggerMultiplicity(evt.GetUShort()))
     1272            T::Warn("SetTriggerMultiplicity -  Value out of range.");
     1273
     1274        return T::GetCurrentState();
     1275    }
     1276
     1277    int SetCalibMultiplicity(const EventImp &evt)
     1278    {
     1279        if (!CheckEventSize(evt.GetSize(), "SetCalibMultiplicity", 2))
     1280            return T::kSM_FatalError;
     1281
     1282        if (!fFTM.SetCalibMultiplicity(evt.GetUShort()))
     1283            T::Warn("SetCalibMultiplicity -  Value out of range.");
    12841284
    12851285        return T::GetCurrentState();
     
    15161516             "|LPext[int]:number of triggers of the external light pulser");
    15171517
    1518         AddEvent("SET_TRIGGER_COINCIDENCE", "S:1", kStateIdle)
    1519             (boost::bind(&StateMachineFTM::SetTriggerCoincidence, this, _1))
    1520             ("Setup the coincidence condition for physcis triggers"
     1518        AddEvent("SET_TRIGGER_Multiplicity", "S:1", kStateIdle)
     1519            (boost::bind(&StateMachineFTM::SetTriggerMultiplicity, this, _1))
     1520            ("Setup the Multiplicity condition for physcis triggers"
    15211521             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    15221522
     
    15251525            ("");
    15261526
    1527         AddEvent("SET_CALIBRATION_COINCIDENCE", "S:1", kStateIdle)
    1528             (boost::bind(&StateMachineFTM::SetCalibCoincidence, this, _1))
    1529             ("Setup the coincidence condition for artificial (calibration) triggers"
     1527        AddEvent("SET_CALIBRATION_Multiplicity", "S:1", kStateIdle)
     1528            (boost::bind(&StateMachineFTM::SetCalibMultiplicity, this, _1))
     1529            ("Setup the Multiplicity condition for artificial (calibration) triggers"
    15301530             "|N[int]:Number of requirered coincident triggers from sum-patches (1-40)");
    15311531
Note: See TracChangeset for help on using the changeset viewer.