FACT++  1.0
HeadersFTM.h File Reference
#include <ostream>
#include <iostream>
#include "ByteOrder.h"
+ Include dependency graph for HeadersFTM.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FTM::Header
 
struct  FTM::DimPassport
 
struct  FTM::StaticDataBoard
 
struct  FTM::StaticData
 
struct  FTM::DimStaticData
 
struct  FTM::DynamicDataBoard
 
struct  FTM::DynamicData
 
struct  FTM::DimDynamicData
 
struct  FTM::DimTriggerRates
 
struct  FTM::FtuResponse
 
struct  FTM::FtuList
 
struct  FTM::DimFtuList
 
struct  FTM::Error
 
struct  FTM::DimError
 

Namespaces

 FTM
 
 FTM::State
 

Enumerations

enum  FTM::States {
  FTM::kFtmUndefined = 0, FTM::kFtmIdle = 1, FTM::kFtmConfig = 2, FTM::kFtmRunning = 3,
  FTM::kFtmCalib = 4, FTM::kFtmStates = 0x0ff, FTM::kFtmLocked = 0x100
}
 
enum  FTM::State::StateMachine {
  FTM::State::kDisconnected = 1, FTM::State::kConnected, FTM::State::kIdle, FTM::State::kValid,
  FTM::State::kTriggerOn, FTM::State::kConfiguring1, FTM::State::kConfiguring2, FTM::State::kConfigured1,
  FTM::State::kConfigured2, FTM::State::kConfigError1 = 0x101, FTM::State::kConfigError2 = 0x102
}
 
enum  FTM::Commands {
  FTM::kCmdRead = 0x0001, FTM::kCmdWrite = 0x0002, FTM::kCmdStartRun = 0x0004, FTM::kCmdStopRun = 0x0008,
  FTM::kCmdPing = 0x0010, FTM::kCmdCrateReset = 0x0020, FTM::kCmdDisableReports = 0x0040, FTM::kCmdConfigFTU = 0x0080,
  FTM::kCmdToggleLed = 0xc000, FTM::kCmdStaticData = 0x0001, FTM::kCmdDynamicData = 0x0002, FTM::kCmdRegister = 0x0004,
  FTM::kStartRun = 0x0001, FTM::kTakeNevents = 0x0002, FTM::kResetCrate0 = 0x0001, FTM::kResetCrate1 = 0x0002,
  FTM::kResetCrate2 = 0x0004, FTM::kResetCrate3 = 0x0008
}
 Command codes for FTM communication. More...
 
enum  FTM::Types {
  FTM::kHeader = 0, FTM::kStaticData = 1, FTM::kDynamicData = 2, FTM::kFtuList = 3,
  FTM::kErrorList = 4, FTM::kRegister = 5
}
 Types sent in the header of the following data. More...
 
enum  FTM::Delimiter { FTM::kDelimiterStart = 0xfb01, FTM::kDelimiterEnd = 0x04fe }
 
enum  Limits {
  kMaxMultiplicity = 40, kMaxWindow = 0xf, kMaxDeadTime = 0xffff, kMaxDelayTimeMarker = 0x3ff,
  kMaxDelayTrigger = 0x3ff, kMaxTriggerInterval = 0x3ff, kMaxIntensity = 0x7f, kMaxSequence = 0x1f,
  kMaxDAC = 0xfff, kMaxAddr = 0xfff, kMaxPatchIdx = 159, kMaxPixelIdx = 1439,
  kMaskSettings = 0xf, kMaskLEDs = 0xf
}
 
enum  GeneralSettings {
  kTrigger = 0x80, kPedestal = 0x40, kLPint = 0x20, kLPext = 0x10,
  kExt2 = 0x08, kExt1 = 0x04, kVeto = 0x02, kClockConditioner = 0x01
}
 
enum  LightPulserEnable { kGroup1 = 0x40, kGroup2 = 0x80 }
 

Functions

struct FTM::Header FTM::__attribute__ ((__packed__))
 
 Header ()
 
std::vector< uint16_t > HtoN () const
 
void operator= (const std::vector< uint16_t > &vec)
 
void clear ()
 
void print (std::ostream &out) const
 
 DimPassport (const Header &h)
 
 StaticDataBoard ()
 Internal readout time of FTUs for trigger counter. More...
 
 StaticData ()
 
 StaticData (const std::vector< uint16_t > &vec)
 
bool operator== (StaticData d) const
 
bool valid () const
 
StaticDataBoardoperator[] (int i)
 
void EnableFTU (int i)
 
void DisableFTU (int i)
 
void EnableAllFTU ()
 
void DisableAllFTU ()
 
void EnableLPint (LightPulserEnable group, bool enable)
 
void EnableLPext (LightPulserEnable group, bool enable)
 
void ToggleFTU (int i)
 
void Enable (GeneralSettings type, bool enable)
 
bool IsEnabled (GeneralSettings type) const
 
uint16_t * EnablePixel (int idx, bool enable)
 
void EnablePatch (int idx, bool enable)
 
void EnableAllPixel ()
 
bool Enabled (uint16_t idx) const
 
uint8_t GetSequencePed () const
 
uint8_t GetSequenceLPint () const
 
uint8_t GetSequenceLPext () const
 
void SetSequence (uint8_t ped, uint8_t lpint, uint8_t lpext)
 
void SetClockRegister (const uint64_t reg[])
 
void SetPrescaling (uint16_t val)
 
bool HasTrigger () const
 
bool HasPedestal () const
 
bool HasLPext () const
 
bool HasLPint () const
 
bool HasExt2 () const
 
bool HasExt1 () const
 
bool HasVeto () const
 
bool HasClockConditioner () const
 
bool HasLPextG1 () const
 
bool HasLPextG2 () const
 
bool HasLPintG1 () const
 
bool HasLPintG2 () const
 
bool IsActive (int i) const
 
bool IsEnabled (int i) const
 
 DimStaticData ()
 
 DimStaticData (const Header &h, const StaticData &d)
 
void reverse ()
 
 DynamicData ()
 
 DimDynamicData (const Header &h, const DynamicData &d, const StaticData &s)
 
 DimTriggerRates ()
 
 DimTriggerRates (const Header &h, const DynamicData &d, const StaticData &s, float rate, float et, float ot)
 
 FtuList ()
 
 DimFtuList (const Header &h, const FtuList &d)
 Number of pings until response (same as in Error) More...
 
 Error ()
 
 DimError (const Header &h, const Error &e)
 
std::ostream & FTM::operator<< (std::ostream &out, const FtuResponse &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const Header &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const FtuList &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const DynamicDataBoard &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const DynamicData &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const StaticDataBoard &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const StaticData &h)
 
std::ostream & FTM::operator<< (std::ostream &out, const Error &h)
 

Variables

enum FTM::State::StateMachine FTM::State::__attribute__
 
uint16_t fDelimiter
 Start delimiter. More...
 
uint16_t fType
 Type of the data to be received after the header. More...
 
uint16_t fDataSize
 Size in words to be received after the header (incl end delim.) More...
 
uint16_t fState
 State of the FTM central state machine. More...
 
uint64_t fBoardId
 FPGA device DNA (unique chip id) More...
 
uint16_t fFirmwareId
 Version number. More...
 
uint32_t fTriggerCounter
 FTM internal counter of all trigger decision independant of trigger-line enable/disable (reset: start/stop run) More...
 
uint64_t fTimeStamp
 Internal counter (micro-seconds, reset: start/stop run) More...
 
uint16_t fEnable [4]
 
uint16_t fDAC [5]
 enable of 4x9 pixels coded as 4x9bits More...
 
uint16_t fPrescaling
 0-3 (A-D) Threshold of patches, 4 (H) Threshold for N out of 4 (12 bit each) More...
 
uint16_t fGeneralSettings
 
uint16_t fStatusLEDs
 Enable for different trigger types / select for TIM/ClockConditioner output (only 8 bit used) More...
 
uint16_t fTriggerInterval
 only 8 bit used More...
 
uint16_t fTriggerSequence
 [ms] Interval between two artificial triggers (no matter which type) minimum 1ms, 10 bit More...
 
uint8_t fIntensityLPext
 Ratio between trigger types send as artificial trigger (in this order) 3x5bit. More...
 
uint8_t fEnableLPext
 Intensity of LEDs (0-127) More...
 
uint8_t fIntensityLPint
 Enable for LED group 1/2 (LightPulserEnable) More...
 
uint8_t fEnableLPint
 Intensity of LEDs (0-127) More...
 
uint32_t fDummy0
 Enable for LED group 1/2 (LightPulserEnable) More...
 
uint16_t fMultiplicityPhysics
 Intensity of LEDs (0-127) More...
 
uint16_t fMultiplicityCalib
 Required trigger multiplicity for physcis triggers (0-40) More...
 
uint16_t fDelayTrigger
 Required trigger multiplicity calibration (LPext) triggers (0-40) More...
 
uint16_t fDelayTimeMarker
 (4ns * x + 8ns) FTM internal programmable delay between trigger decision and output More...
 
uint16_t fDeadTime
 (4ns * x + 8ns) FTM internal programmable delay between trigger descision and time marker output More...
 
uint32_t fClockConditioner [8]
 (4ns * x + 8ns) FTM internal programmable dead time after trigger decision More...
 
uint16_t fWindowPhysics
 R0, R1, R8, R9, R11, R13, R14, R15. More...
 
uint16_t fWindowCalib
 (4ns * x + 8ns) At least N (multiplicity) rising edges (trigger signal) within this window More...
 
uint16_t fDummy1
 (4ns * x + 8ns) At least N (multiplicity) rising edges (trigger signal) within this window More...
 
StaticDataBoard fBoard [4][10]
 
uint16_t fActiveFTU [4]
 Num of board responded in crate 0-3. More...
 
uint16_t fTriggerSeqLPint
 
uint16_t fTriggerSeqLPext
 
uint16_t fTriggerSeqPed
 
uint16_t fThreshold [160]
 
uint16_t fMultiplicity [40]
 
uint32_t fRatePatch [4]
 
uint32_t fRateTotal
 
uint16_t fOverflow
 
uint16_t fCrcError
 
uint64_t fOnTimeCounter
 
uint16_t fTempSensor [4]
 
uint32_t fRateBoard [40]
 
uint16_t fRateOverflow [40]
 
float fTriggerRate
 
float fBoardRate [40]
 
float fPatchRate [160]
 
float fElapsedTime
 
float fOnTime
 
uint16_t fPingAddr
 
uint64_t fDNA
 Number of boards answered per crate. More...
 
uint16_t fErrorCounter
 
uint16_t fNumBoards
 
uint16_t fNumBoardsCrate [4]
 Total number of boards responded. More...
 
FtuResponse fFTU [4][10]
 List of active FTU boards in crate 0-3. More...
 
uint8_t fAddr [40]
 DNA of FTU board. More...
 
uint8_t fPing [40]
 Address of FTU board. More...
 
uint16_t fNumCalls
 
uint16_t fDestAddress
 
uint16_t fSrcAddress
 
uint16_t fCommand
 
uint16_t fData [21]
 
uint16_t fCrcErrorCounter
 
uint16_t fCrcCheckSum
 
Error fError