CMS 3D CMS Logo

Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

CSCDCCExaminer Class Reference

#include <CSCDCCExaminer.h>

List of all members.

Classes

class  OStream

Public Member Functions

std::set< CSCIdTypechambersWithError (int num) const
std::set< CSCIdTypechambersWithWarning (int num) const
int32_t check (const uint16_t *&buffer, int32_t length)
void crcALCT (bool enable)
void crcCFEB (bool enable)
void crcTMB (bool enable)
 CSCDCCExaminer (ExaminerMaskType mask=0x1)
std::map< DDUIdType, const
uint16_t * > 
DDU_block (void) const
std::map< DDUIdType, uint32_t > DDU_ptrOffsets (void) const
std::map< DDUIdType, uint32_t > DDU_size (void) const
DDUIdType dduSourceID (void)
std::map< DDUIdType, std::map
< CSCIdType, const uint16_t * > > 
DMB_block (void) const
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
DMB_ptrOffsets (void) const
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
DMB_size (void) const
const char * errName (int num) const
bool error (int num) const
const char * errorName (int num) const
ExaminerStatusType errors (void) const
std::map< CSCIdType,
ExaminerStatusType
errorsDetailed (void) const
std::map< DDUIdType,
ExaminerStatusType
errorsDetailedDDU (void) const
ExaminerStatusType errorsForChamber (CSCIdType chamber) const
ExaminerStatusType errorsForDDU (DDUIdType dduSourceID) const
ExaminerMaskType getMask () const
std::vector< DDUIdTypelistOfDDUs (void) const
void modeDDU (bool enable)
OStreamoutput1 (void)
OStreamoutput2 (void)
std::map< CSCIdType,
ExaminerStatusType
payloadDetailed (void) const
ExaminerStatusType payloadForChamber (CSCIdType chamber) const
const char * payloadName (int num) const
void setMask (ExaminerMaskType mask)
std::map< CSCIdType,
ExaminerStatusType
statusDetailed (void) const
ExaminerStatusType statusForChamber (CSCIdType chamber) const
const char * statusName (int num) const
bool warning (int num) const
const char * warningName (int num) const
ExaminerStatusType warnings (void) const
std::map< CSCIdType,
ExaminerStatusType
warningsDetailed (void) const
ExaminerStatusType warningsForChamber (CSCIdType chamber) const
ExaminerStatusType warningsForDDU (DDUIdType dduSourceID) const
const char * wrnName (int num) const
 ~CSCDCCExaminer (void)

Public Attributes

std::map< CSCIdType, uint32_t > cntCHAMB_Headers
std::map< CSCIdType, uint32_t > cntCHAMB_Trailers
uint32_t cntDDU_Headers
uint32_t cntDDU_Trailers
const uint16_t nERRORS
const uint16_t nPAYLOADS
const uint16_t nSTATUSES
const uint16_t nWARNINGS

Private Member Functions

void checkDAVs ()
 checks DAV_ALCT, DAV_TMB, and DAV_CFEB
void checkTriggerHeadersAndTrailers ()
void clear ()
int scanbuf (const uint16_t *&buf, int32_t length, uint16_t sig, uint16_t mask=0xFFFF)
void zeroCounts ()

Private Attributes

uint32_t ALCT_CRC
uint32_t ALCT_WordCount
uint32_t ALCT_WordsExpected
uint32_t ALCT_WordsSinceLastHeader
uint32_t ALCT_WordsSinceLastHeaderZeroSuppressed
uint32_t ALCT_ZSE
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_ERR
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_PAYLOAD
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_STATUS
std::map< CSCIdType,
ExaminerStatusType
bCHAMB_WRN
std::map< DDUIdType,
ExaminerStatusType
bDDU_ERR
std::map< DDUIdType,
ExaminerStatusType
bDDU_WRN
ExaminerStatusType bERROR
const uint16_t * buf0
const uint16_t * buf1
const uint16_t * buf2
const uint16_t * buf_1
const uint16_t * buf_2
const uint16_t * buffer_start
ExaminerStatusType bWARNING
OStream cerr
uint32_t CFEB_BSampleCount
uint32_t CFEB_CRC
uint32_t CFEB_SampleCount
uint32_t CFEB_SampleWordCount
bool checkCrcALCT
bool checkCrcCFEB
bool checkCrcTMB
OStream cout
CSCIdType currentChamber
bool DAV_ALCT
int DAV_CFEB
int DAV_DMB
bool DAV_TMB
uint32_t DDU_WordCount
uint32_t DDU_WordMismatch_Occurrences
uint32_t DDU_WordsSinceLastHeader
uint32_t DDU_WordsSinceLastTrailer
std::map< DDUIdType, const
uint16_t * > 
dduBuffers
std::map< DDUIdType, uint32_t > dduOffsets
std::map< DDUIdType, uint32_t > dduSize
int DMB_Active
std::map< DDUIdType, std::map
< CSCIdType, const uint16_t * > > 
dmbBuffers
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
dmbOffsets
std::map< DDUIdType, std::map
< CSCIdType, uint32_t > > 
dmbSize
ExaminerMaskType examinerMask
bool fALCT_Format2007
bool fALCT_Header
std::set< CSCIdTypefCHAMB_ERR [29]
std::set< CSCIdTypefCHAMB_WRN [5]
bool fDCC_Header
bool fDCC_Trailer
bool fDDU_Header
bool fDDU_Trailer
bool fDMB_Header
bool fDMB_Trailer
bool fERROR [29]
bool fTMB_Format2007
bool fTMB_Header
bool fWARNING [5]
bool modeDDUonly
int nDMBs
uint32_t nWG_round_up
 check zero suppression mode
std::vector< const char * > sDMBEventStaus
std::vector< const char * > sDMBExpectedPayload
std::vector< const char * > sERROR
std::vector< const char * > sERROR_
DDUIdType sourceID
std::vector< const char * > sWARNING
std::vector< const char * > sWARNING_
uint32_t TMB_CRC
uint32_t TMB_Firmware_Revision
uint32_t TMB_Tbins
uint32_t TMB_WordCount
uint32_t TMB_WordsExpected
uint32_t TMB_WordsRPC
uint32_t TMB_WordsSinceLastHeader
 to decode if zero suppression enabled
uint16_t tmpbuf [16]
bool uniqueALCT
bool uniqueTMB

Detailed Description

Definition at line 11 of file CSCDCCExaminer.h.


Constructor & Destructor Documentation

CSCDCCExaminer::CSCDCCExaminer ( ExaminerMaskType  mask = 0x1)

Definition at line 43 of file CSCDCCExaminer.cc.

References ALCT_CRC, ALCT_ZSE, buf0, buf1, buf2, buf_1, benchmark_cfg::cerr, cerr, CFEB_CRC, checkCrcALCT, checkCrcCFEB, checkCrcTMB, clear(), cntCHAMB_Headers, cntCHAMB_Trailers, cntDDU_Headers, cntDDU_Trailers, cout, gather_cfg::cout, currentChamber, DAV_ALCT, DAV_CFEB, DAV_TMB, DDU_WordCount, DDU_WordMismatch_Occurrences, DDU_WordsSinceLastHeader, DDU_WordsSinceLastTrailer, DMB_Active, fALCT_Format2007, fALCT_Header, fDCC_Header, fDCC_Trailer, fDDU_Header, fDDU_Trailer, fDMB_Header, fDMB_Trailer, fTMB_Format2007, fTMB_Header, modeDDUonly, nDMBs, nWG_round_up, CSCDCCExaminer::OStream::redirect(), sDMBEventStaus, sDMBExpectedPayload, sERROR, sERROR_, sourceID, sWARNING, sWARNING_, TMB_CRC, TMB_Firmware_Revision, TMB_WordsRPC, tmpbuf, and zeroCounts().

                                                   :nERRORS(29),nWARNINGS(5),nPAYLOADS(12),nSTATUSES(23),sERROR(nERRORS),sWARNING(nWARNINGS),sERROR_(nERRORS),sWARNING_(nWARNINGS),sDMBExpectedPayload(nPAYLOADS),sDMBEventStaus(nSTATUSES),examinerMask(mask){
  cout.redirect(std::cout); cerr.redirect(std::cerr);

  sERROR[0] = " Any errors                                       ";
  sERROR[1] = " DDU Trailer Missing                              ";
  sERROR[2] = " DDU Header Missing                               ";
  sERROR[3] = " DDU CRC Error (not yet implemented)              ";
  sERROR[4] = " DDU Word Count Error                             ";
  sERROR[5] = " DMB Trailer Missing                              ";
  sERROR[6] = " DMB Header Missing                               ";
  sERROR[7] = " ALCT Trailer Missing                             ";
  sERROR[8] = " ALCT Header Missing                              ";
  sERROR[9] = " ALCT Word Count Error                            ";
  sERROR[10] = "ALCT CRC Error                                   ";
  sERROR[11] = "ALCT Trailer Bit Error                           ";
  // ^^^ This is due to seeing many events in ddu293 (also, some in ddu294)
  // with some bits in the 1st ALCT D-Header being lost. This causes a chain of errors:
  // - TMB Trailer is not identified and TMB word count mismatch occur when Trailer is found
  // - CFEB sample count is not reset on ALCT Trailer.
  // To merge all these errors in one,
  // the D-signature in the 1st ALCT Trailer will not be required for identifying the ALCT Trailer;
  // However, if these bits are found to be missing, ERROR[11] will be flagged.
  // This is just a temporary patch to make the output look less clattered.
  sERROR[12] = "TMB Trailer Missing                              ";
  sERROR[13] = "TMB Header Missing                               ";
  sERROR[14] = "TMB Word Count Error                             ";
  sERROR[15] = "TMB CRC Error                                    ";
  sERROR[16] = "CFEB Word Count Per Sample Error                 ";
  sERROR[17] = "CFEB Sample Count Error                          ";
  sERROR[18] = "CFEB CRC Error                                   ";
  sERROR[19] = "DDU Event Size Limit Error                       ";
  sERROR[20] = "C-Words                                          ";
  sERROR[21] = "ALCT DAV Error                                   ";
  sERROR[22] = "TMB DAV Error                                    ";
  sERROR[23] = "CFEB DAV Error                                   ";
  sERROR[24] = "DMB Active Error                                 ";
  sERROR[25] = "DCC Trailer Missing                              ";
  sERROR[26] = "DCC Header Missing                               ";
  sERROR[27] = "DMB DAV vs. DMB Active mismatch Error            ";
  sERROR[28] = "Extra words between DDU Header and first DMB header";

  //    sERROR[21] = "DDU Header vs. Trailer mismatch for DAV or Avtive"; // oboslete since 16.09.05

  sWARNING[0] = " Extra words between DDU Trailer and DDU Header ";
  sWARNING[1] = " DDU Header Incomplete                          ";

  sDMBExpectedPayload[0]  = "CFEB1_ACTIVE";
  sDMBExpectedPayload[1]  = "CFEB2_ACTIVE";
  sDMBExpectedPayload[2]  = "CFEB3_ACTIVE";
  sDMBExpectedPayload[3]  = "CFEB4_ACTIVE";
  sDMBExpectedPayload[4]  = "CFEB5_ACTIVE";
  sDMBExpectedPayload[5]  = "ALCT_DAV";
  sDMBExpectedPayload[6]  = "TMB_DAV";
  sDMBExpectedPayload[7]  = "CFEB1_DAV";
  sDMBExpectedPayload[8]  = "CFEB2_DAV";
  sDMBExpectedPayload[9]  = "CFEB3_DAV";
  sDMBExpectedPayload[10] = "CFEB4_DAV";
  sDMBExpectedPayload[11] = "CFEB5_DAV";

  sDMBEventStaus[0]  = "ALCT_FIFO_FULL";
  sDMBEventStaus[1]  = "TMB_FIFO_FULL";
  sDMBEventStaus[2]  = "CFEB1_FIFO_FULL";
  sDMBEventStaus[3]  = "CFEB2_FIFO_FULL";
  sDMBEventStaus[4]  = "CFEB3_FIFO_FULL";
  sDMBEventStaus[5]  = "CFEB4_FIFO_FULL";
  sDMBEventStaus[6]  = "CFEB5_FIFO_FULL";
  sDMBEventStaus[7]  = "ALCT_START_TIMEOUT";
  sDMBEventStaus[8]  = "TMB_START_TIMEOUT";
  sDMBEventStaus[9]  = "CFEB1_START_TIMEOUT";
  sDMBEventStaus[10] = "CFEB2_START_TIMEOUT";
  sDMBEventStaus[11] = "CFEB3_START_TIMEOUT";
  sDMBEventStaus[12] = "CFEB4_START_TIMEOUT";
  sDMBEventStaus[13] = "CFEB5_START_TIMEOUT";
  sDMBEventStaus[14] = "ALCT_END_TIMEOUT";
  sDMBEventStaus[15] = "TMB_END_TIMEOUT";
  sDMBEventStaus[16] = "CFEB1_END_TIMEOUT";
  sDMBEventStaus[17] = "CFEB2_END_TIMEOUT";
  sDMBEventStaus[18] = "CFEB3_END_TIMEOUT";
  sDMBEventStaus[19] = "CFEB4_END_TIMEOUT";
  sDMBEventStaus[20] = "CFEB5_END_TIMEOUT";
  sDMBEventStaus[21] = "CFEB Active-DAV mismatch";
  sDMBEventStaus[22] = "B-words found";

  sERROR_[0] = " Any errors: 00";
  sERROR_[1] = " DDU Trailer Missing: 01";
  sERROR_[2] = " DDU Header Missing: 02";
  sERROR_[3] = " DDU CRC Error (not yet implemented): 03";
  sERROR_[4] = " DDU Word Count Error: 04";
  sERROR_[5] = " DMB Trailer Missing: 05";
  sERROR_[6] = " DMB Header Missing: 06";
  sERROR_[7] = " ALCT Trailer Missing: 07";
  sERROR_[8] = " ALCT Header Missing: 08";
  sERROR_[9] = " ALCT Word Count Error: 09";
  sERROR_[10] = "ALCT CRC Error: 10";
  sERROR_[11] = "ALCT Trailer Bit Error: 11";
  sERROR_[12] = "TMB Trailer Missing: 12";
  sERROR_[13] = "TMB Header Missing: 13";
  sERROR_[14] = "TMB Word Count Error: 14";
  sERROR_[15] = "TMB CRC Error: 15";
  sERROR_[16] = "CFEB Word Count Per Sample Error: 16";
  sERROR_[17] = "CFEB Sample Count Error: 17";
  sERROR_[18] = "CFEB CRC Error: 18";
  sERROR_[19] = "DDU Event Size Limit Error: 19";
  sERROR_[20] = "C-Words: 20";
  sERROR_[21] = "ALCT DAV Error: 21";
  sERROR_[22] = "TMB DAV Error: 22";
  sERROR_[23] = "CFEB DAV Error: 23";
  sERROR_[24] = "DMB Active Error: 24";
  sERROR_[25] = "DCC Trailer Missing: 25";
  sERROR_[26] = "DCC Header Missing: 26";
  sERROR_[27] = "DMB DAV vs. DMB Active mismatch Error: 27";
  sERROR_[28] = "Extra words between DDU Header and first DMB header: 28";
  //    sERROR_[21] = "DDU Header vs. Trailer mismatch for DAV or Avtive: 21"; // oboslete since 16.09.05

  sWARNING_[0] = " Extra words between DDU Trailer and DDU Header: 00";
  sWARNING_[1] = " DDU Header Incomplete: 02";

  fDCC_Header  = false;
  fDCC_Trailer = false;
  fDDU_Header  = false;
  fDDU_Trailer = false;
  fDMB_Header  = false;
  fDMB_Trailer = false;
  fALCT_Header = false;
  fTMB_Header  = false;
  fALCT_Format2007 = true;
  fTMB_Format2007  = true;

  cntDDU_Headers  = 0;
  cntDDU_Trailers = 0;
  cntCHAMB_Headers.clear();
  cntCHAMB_Trailers.clear();

  DAV_ALCT = false;
  DAV_TMB  = false;
  DAV_CFEB = 0;
  DMB_Active  = 0;
  nDMBs = 0;
  DDU_WordsSinceLastHeader     = 0;
  DDU_WordCount                = 0;
  DDU_WordMismatch_Occurrences = 0;
  DDU_WordsSinceLastTrailer    = 0;
  ALCT_ZSE                     = 0;
  nWG_round_up                 = 0;

  TMB_WordsRPC  = 0;
  TMB_Firmware_Revision = 0;
  zeroCounts();

  checkCrcALCT = false; ALCT_CRC=0;
  checkCrcTMB  = false; TMB_CRC=0;
  checkCrcCFEB = false; CFEB_CRC=0;

  modeDDUonly = false;
  sourceID    = 0xFFF;
  currentChamber = -1;

  //headerDAV_Active = -1; // Trailer vs. Header check // Obsolete since 16.09.05

  clear();
  buf_1 = &(tmpbuf[0]);
  buf0  = &(tmpbuf[4]);
  buf1  = &(tmpbuf[8]);
  buf2  = &(tmpbuf[12]);

  bzero(tmpbuf, sizeof(uint16_t)*16);
}
CSCDCCExaminer::~CSCDCCExaminer ( void  ) [inline]

Definition at line 238 of file CSCDCCExaminer.h.

{}

Member Function Documentation

std::set<CSCIdType> CSCDCCExaminer::chambersWithError ( int  num) const [inline]

Definition at line 167 of file CSCDCCExaminer.h.

References fCHAMB_ERR, and nERRORS.

{ if(num>=0&&num<nERRORS)   return fCHAMB_ERR[num]; else return std::set<int>(); }
std::set<CSCIdType> CSCDCCExaminer::chambersWithWarning ( int  num) const [inline]

Definition at line 168 of file CSCDCCExaminer.h.

References fCHAMB_WRN, and nWARNINGS.

{ if(num>=0&&num<nWARNINGS) return fCHAMB_WRN[num]; else return std::set<int>(); }
int32_t CSCDCCExaminer::check ( const uint16_t *&  buffer,
int32_t  length 
)

'buffer' is a sliding pointer; keep track of the true buffer

Check for presence of data blocks inside TMB data

increment counter of 16-bit words since last DMB*ALCT Header match this counter is reset if ALCT Header is found right after DMB Header

decode the actual counting if zero suppression enabled

increment counter of 16-bit words without zero suppression decoding

bzero(fERROR, sizeof(bool)*nERRORS); bzero(fWARNING, sizeof(bool)*nWARNINGS); bERROR = 0; bWARNING = 0; for(int err=0; err<nERRORS; err++) fCHAMB_ERR[err].clear(); for(int wrn=0; wrn<nWARNINGS; wrn++) fCHAMB_WRN[wrn].clear(); bCHAMB_ERR.clear(); bCHAMB_WRN.clear();

Check if ALCT zero suppression enable:

Check calculated CRC sum against reported

w = buf0[j] & 0x7fff;

w = buf0[j] & 0x7fff;

Definition at line 211 of file CSCDCCExaminer.cc.

References ALCT_CRC, ALCT_WordCount, ALCT_WordsExpected, ALCT_WordsSinceLastHeader, ALCT_WordsSinceLastHeaderZeroSuppressed, ALCT_ZSE, bCHAMB_ERR, bCHAMB_PAYLOAD, bCHAMB_STATUS, bCHAMB_WRN, bDDU_ERR, bDDU_WRN, bERROR, buf0, buf1, buf2, buf_1, buf_2, buffer_start, bWARNING, cerr, CFEB_BSampleCount, CFEB_CRC, CFEB_SampleCount, CFEB_SampleWordCount, checkCrcALCT, checkCrcCFEB, checkCrcTMB, checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), cntCHAMB_Headers, cntCHAMB_Trailers, cntDDU_Headers, cntDDU_Trailers, cout, currentChamber, DAV_ALCT, DAV_CFEB, DAV_DMB, DAV_TMB, DDU_WordCount, DDU_WordsSinceLastHeader, DDU_WordsSinceLastTrailer, dduBuffers, dduOffsets, dduSize, DMB_Active, dmbBuffers, dmbOffsets, dmbSize, end, fALCT_Format2007, fALCT_Header, fCHAMB_ERR, fDCC_Header, fDCC_Trailer, fDDU_Header, fDDU_Trailer, fDMB_Header, fDMB_Trailer, fERROR, spr::find(), fTMB_Format2007, fTMB_Header, fWARNING, g, i, j, modeDDUonly, nDMBs, nERRORS, nWARNINGS, nWG_round_up, pos, scanbuf(), sERROR, sourceID, sWARNING, matplotRender::t, TMB_CRC, TMB_Firmware_Revision, TMB_Tbins, TMB_WordCount, TMB_WordsExpected, TMB_WordsRPC, TMB_WordsSinceLastHeader, tmpbuf, uniqueALCT, uniqueTMB, and zeroCounts().

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

                                                                    {
  if( length<=0 ) return -1;

  buffer_start = buffer;

  
  bool fTMB_Scope_Start = false;
  bool fTMB_MiniScope_Start = false; 
  bool fTMB_RPC_Start = false;
  bool fTMB_BlockedCFEBs_Start = false;
 
  bool fTMB_Scope = false;
  bool fTMB_MiniScope = false; 
  bool fTMB_RPC = false;
  bool fTMB_BlockedCFEBs = false;

  while( length>0 ){
    // == Store last 4 read buffers in pipeline-like memory (note that memcpy works quite slower!)
    buf_2 = buf_1;         //  This bufer was not needed so far
    buf_1 = buf0;
    buf0  = buf1;
    buf1  = buf2;
    buf2  = buffer;

    // check for too long event
    if(!fERROR[19] && DDU_WordsSinceLastHeader>100000 ){
      fERROR[19] = true;
      bERROR    |= 0x80000;
    }

    // increment counter of 64-bit words since last DDU Header
    // this counter is reset if DDU Header is found
    if ( fDDU_Header ) { ++DDU_WordsSinceLastHeader; }

    // increment counter of 64-bit words since last DDU Trailer
    // this counter is reset if DDU Trailer is found
    if ( fDDU_Trailer ) {++DDU_WordsSinceLastTrailer; }

    if ( fALCT_Header ) {
        if(ALCT_ZSE){
          for(int g=0; g<4; g++){
             if(buf0[g]==0x1000){
               ALCT_WordsSinceLastHeader = ALCT_WordsSinceLastHeader + nWG_round_up;
          } 
          else if(buf0[g]!=0x3000) ALCT_WordsSinceLastHeader = ALCT_WordsSinceLastHeader + 1;
         } 
        }
        else ALCT_WordsSinceLastHeader = ALCT_WordsSinceLastHeader + 4;
        ALCT_WordsSinceLastHeaderZeroSuppressed = ALCT_WordsSinceLastHeaderZeroSuppressed + 4;
    }

    // increment counter of 16-bit words since last DMB*TMB Header match
    // this counter is reset if TMB Header is found right after DMB Header or ALCT Trailer
    if ( fTMB_Header ) { TMB_WordsSinceLastHeader = TMB_WordsSinceLastHeader + 4; }

    // increment counter of 16-bit words since last of DMB Header, ALCT Trailer, TMB Trailer,
    // CFEB Sample Trailer, CFEB B-word; this counter is reset by all these conditions
    if ( fDMB_Header ) { CFEB_SampleWordCount = CFEB_SampleWordCount + 4; }

    // If DDU header is missing we set unphysical 0xFFF value for DDU id
    if( !fDDU_Header ){ sourceID=0xFFF; }


    if (!modeDDUonly) {
      // DCC Header 1 && DCC Header 2
      // =VB= Added support for Sep. 2008 CMS DAQ DCC format
      if ( ( ( (buf0[3]&0xF000) == 0x5000 && (buf0[0]&0x00FF) == 0x005F )
        ||
           ( (buf0[3]&0xF000) == 0x5000 && (buf0[0]&0x000F) == 0x0008 ) )
         &&
          (buf1[3]&0xFF00) == 0xD900 ) 
        {
        if( fDCC_Header ){
          // == Another DCC Header before encountering DCC Trailer!
          fERROR[25]=true;
          bERROR|=0x2000000;
          fERROR[0]=true;
          bERROR|=0x1;
          cerr<<"\n\nDCC Header Occurrence ";
          cerr<<"  ERROR 25    "<<sERROR[25]<<endl;
          fDDU_Header = false;

          // go backward for 3 DDU words ( buf2, buf1, and buf0 )
          buffer-=12;
          buf_1 = &(tmpbuf[0]);  // Just for safety
          buf0  = &(tmpbuf[4]);  // Just for safety
          buf1  = &(tmpbuf[8]);  // Just for safety
          buf2  = &(tmpbuf[12]); // Just for safety
          bzero(tmpbuf,sizeof(uint16_t)*16);
          return length+12;
        }

    fDCC_Header  = true;
    clear();
          }
        }
    // == Check for Format Control Words, set proper flags, perform self-consistency checks

    // C-words anywhere besides DDU Header
    if( fDDU_Header && ( (buf0[0]&0xF000)==0xC000 || (buf0[1]&0xF000)==0xC000 || (buf0[2]&0xF000)==0xC000 || (buf0[3]&0xF000)==0xC000 ) &&
        ( /*buf_1[0]!=0x8000 ||*/ buf_1[1]!=0x8000 || buf_1[2]!=0x0001 || buf_1[3]!=0x8000 ) ){
      fERROR[0]  = true;
      bERROR    |= 0x1;
      fERROR[20] = true;
      bERROR    |= 0x100000;
          // fCHAMB_ERR[20].insert(currentChamber);
          // bCHAMB_ERR[currentChamber] |= 0x100000;
      cerr<<"\nDDU Header Occurrence = "<<cntDDU_Headers;
      cerr<<"  ERROR 20 "<<sERROR[20]<<endl;
    }

    // == DDU Header found
    if( /*buf0[0]==0x8000 &&*/ buf0[1]==0x8000 && buf0[2]==0x0001 && buf0[3]==0x8000 ){
      // headerDAV_Active = (buf1[1]<<16) | buf1[0]; // Obsolete since 16.09.05
        checkDAVs();
        checkTriggerHeadersAndTrailers();

      if( fDDU_Header ){
        // == Another DDU Header before encountering DDU Trailer!
        fERROR[1]=true;
        bERROR|=0x2;
        fERROR[0] = true;
        bERROR|=0x1;
        cerr<<"\n\nDDU Header Occurrence = "<<cntDDU_Headers;
        cerr<<"  ERROR 1    "<<sERROR[1]<<endl;
        fDDU_Header = false;

        // Part of work for chambers that hasn't been done in absent trailer
        if( fDMB_Header || fDMB_Trailer ){
          fERROR[5] = true;
          bERROR   |= 0x20;
          // Since here there are no chances to know what this chamber was, force it to be -2
          if( currentChamber == -1 ) currentChamber = -2;
          fCHAMB_ERR[5].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x20;
          fCHAMB_ERR[0].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x1;
          cerr<<"\n\nDDU Header Occurrence = "<<cntDDU_Headers;
          cerr<<"  ERROR 5    "<<sERROR[5]<<endl;
        }       // One of DMB Trailers is missing ( or both )
        fDMB_Header  = false;
        fDMB_Trailer = false;

        if( DMB_Active!=nDMBs ){
          fERROR[24] = true;
          bERROR    |= 0x1000000;
        }
        DMB_Active = 0;
    nDMBs = 0;

        // Unknown chamber denoted as -2
        // If it still remains in any of errors - put it in error 0
        for(int err=1; err<nERRORS; ++err)
          if( fCHAMB_ERR[err].find(-2) != fCHAMB_ERR[err].end() ){
            fCHAMB_ERR[0].insert(-2);
            bCHAMB_ERR[-2] |= 0x1;
          }

        bDDU_ERR[sourceID] |= bERROR;
        bDDU_WRN[sourceID] |= bWARNING;

        // go backward for 3 DDU words ( buf2, buf1, and buf0 )
        buffer-=12;
        buf_1 = &(tmpbuf[0]);  // Just for safety
        buf0  = &(tmpbuf[4]);  // Just for safety
        buf1  = &(tmpbuf[8]);  // Just for safety
        buf2  = &(tmpbuf[12]); // Just for safety
        bzero(tmpbuf,sizeof(uint16_t)*16);
        return length+12;
      }

      // Reset all Error and Warning flags to be false
      currentChamber = -1; // Unknown yet

      if( fDDU_Trailer && DDU_WordsSinceLastTrailer != 4 ){
        // == Counted extraneous words between last DDU Trailer and this DDU Header
        fWARNING[0]=true;
        bWARNING|=0x1;
        cerr<<"\nDDU Header Occurrence = "<<cntDDU_Headers;
        cerr<<"  WARNING 0 "<<sWARNING[0]<<" "<<DDU_WordsSinceLastTrailer<<" extra 64-bit words"<<endl;
      }

      sourceID      = ((buf_1[1]&0xF)<<8) | ((buf_1[0]&0xFF00)>>8);
      fDDU_Header   = true;
      fDDU_Trailer  = false;
      DDU_WordCount = 0;
      fDMB_Header   = false;
      fDMB_Trailer  = false;
      fALCT_Header  = false;
      fALCT_Format2007= true;
      fTMB_Header   = false;
      fTMB_Format2007= true;
      uniqueALCT    = true;
      uniqueTMB     = true;
      zeroCounts();

      if (modeDDUonly) {
         fDCC_Header  = true;
         clear();
      }

          dduBuffers[sourceID] = buf_1;
      dduOffsets[sourceID] = buf_1-buffer_start;
      dduSize   [sourceID] = 0;
      dmbBuffers[sourceID].clear();
      dmbOffsets[sourceID].clear();
      dmbSize   [sourceID].clear();

          bDDU_ERR[sourceID] = 0;
      bDDU_WRN[sourceID] = 0;

      nDMBs      = 0;
      DMB_Active = buf1[0]&0xF;
      DAV_DMB    = buf1[1]&0x7FFF;

      int nDAV_DMBs=0;
      for(int bit=0; bit<15; bit++) if( DAV_DMB&(1<<bit) ) nDAV_DMBs++;
      if(DMB_Active!=nDAV_DMBs){
          fERROR[27] = true;
          bERROR    |= 0x8000000;
      }

      if( (buf_1[3]&0xF000)!=0x5000 ){
        fWARNING[1]=true;
        bWARNING|=0x2;
        cerr<<"\nDDU Header Occurrence = "<<cntDDU_Headers;
                cerr<<"  WARNING 1 "<<sWARNING[1]<<". What must have been Header 1: 0x"<<std::hex<<buf_1[0]<<" 0x"<<buf_1[1]<<" 0x"<<buf_1[2]<<" 0x"<<buf_1[3]<<std::dec<<endl;
      }

      ++cntDDU_Headers;
      DDU_WordsSinceLastHeader=0; // Reset counter of DDU Words since last DDU Header
      cout<<"\n----------------------------------------------------------"<<endl;
      cout<<"DDU  Header Occurrence "<<cntDDU_Headers<< " L1A = " << ( ((buf_1[2]&0xFFFF) + ((buf_1[3]&0x00FF) << 16)) ) <<endl;
    }

    // == DMB Header found
    if( (buf0[0]&0xF000)==0xA000 && (buf0[1]&0xF000)==0xA000 && (buf0[2]&0xF000)==0xA000 && (buf0[3]&0xF000)==0xA000 ){
      checkDAVs();
      checkTriggerHeadersAndTrailers();

      if( DDU_WordsSinceLastHeader>3 && !fDMB_Header && !fDMB_Trailer && !nDMBs ){
        fERROR[28]=true;
        bERROR|=0x10000000;;
      }

      if( fDMB_Header || fDMB_Trailer ){ // F or E  DMB Trailer is missed
        fERROR[5]=true;
        bERROR|=0x20;
        fCHAMB_ERR[5].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x20;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
      }
      fDMB_Header  = true;
      fDMB_Trailer = false;

      // If previous DMB record was not assigned to any chamber ( it still has -1 indentificator )
      // let's free -1 identificator for current use and call undefined chamber from previous record -2
      // ( -2 may already exists in this sets but we have nothing to do with it )
      for(int err=0; err<nERRORS; ++err)
        if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() ){
          fCHAMB_ERR[err].erase(-1);
          fCHAMB_ERR[err].insert(-2);
        }
// Two lines below are commented out because payloads never get filled if 0xA header is missing
//      bCHAMB_PAYLOAD[-2] |= bCHAMB_PAYLOAD[-1];
//      fCHAMB_PAYLOAD[-1] = 0;
      bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
      bCHAMB_STATUS[-1] = 0;
      bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
      bCHAMB_ERR[-1] = 0;
      bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
      bCHAMB_WRN[-1] = 0;

      // Chamber id ( DMB_ID + (DMB_CRATE<<4) ) from header
      currentChamber = buf0[1]&0x0FFF;
      ++cntCHAMB_Headers[currentChamber];
      bCHAMB_ERR[currentChamber] |= 0; //Victor's line

      fALCT_Header = false;
      fALCT_Format2007= true;
      fTMB_Header  = false;
      fTMB_Format2007= true;
      uniqueALCT   = true;
      uniqueTMB    = true;

      fTMB_Scope_Start = false;
      fTMB_MiniScope_Start = false;
      fTMB_RPC_Start = false;
      fTMB_BlockedCFEBs_Start = false;

      fTMB_Scope = false;
      fTMB_MiniScope = false;
      fTMB_RPC = false;
      fTMB_BlockedCFEBs = false;       


      zeroCounts();
      CFEB_CRC                  = 0;

      nDMBs++;

      dmbBuffers[sourceID][currentChamber] = buf0-4;
      dmbOffsets[sourceID][currentChamber] = buf0-4-buffer_start;
      dmbSize   [sourceID][currentChamber] = 4;

      // Print DMB_ID from DMB Header
      cout<< "Crate=" << setw(3) << setfill('0') << ((buf0[1]>>4)&0x00FF) << " DMB="<<setw(2)<<setfill('0')<<(buf0[1]&0x000F)<<" ";
      // Print ALCT_DAV and TMB_DAV from DMB Header
      //cout<<setw(1)<<((buf0[0]&0x0020)>>5)<<" "<<((buf0[0]&0x0040)>>6)<<" ";
      cout<<setw(1)<<((buf0[0]&0x0200)>>9)<<" "<<((buf0[0]&0x0800)>>11)<<" "; //change of format 16.09.05
      // Print CFEB_DAV from DMB Header
      cout<<setw(1)<<((buf0[0]&0x0010)>>4)<<((buf0[0]&0x0008)>>3)<<((buf0[0]&0x0004)>>2)<<((buf0[0]&0x0002)>>1)<<(buf0[0]&0x0001);
      // Print DMB Header Tag
      cout << " {";

      // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event
      DAV_ALCT = (buf0[0]&0x0200)>>9;
      DAV_TMB  = (buf0[0]&0x0800)>>11;
      DAV_CFEB = 0;
      if( buf0[0]&0x0001 ) ++DAV_CFEB;
      if( buf0[0]&0x0002 ) ++DAV_CFEB;
      if( buf0[0]&0x0004 ) ++DAV_CFEB;
      if( buf0[0]&0x0008 ) ++DAV_CFEB;
      if( buf0[0]&0x0010 ) ++DAV_CFEB;
      if( DAV_ALCT ) bCHAMB_PAYLOAD[currentChamber] |= 0x20;
      if( DAV_TMB  ) bCHAMB_PAYLOAD[currentChamber] |= 0x40;
      bCHAMB_PAYLOAD[currentChamber] |= (buf0[0]&0x001f)<<7;
      bCHAMB_PAYLOAD[currentChamber] |=((buf_1[2]>>5)&0x001f);
          bCHAMB_STATUS [currentChamber] |= (buf0[0]&0x0040)<<16;
    }


    // New ALCT data format:
    if( ( buf0[0]==0xDB0A && (buf0[1]&0xF000)==0xD000 && (buf0[2]&0xF000)==0xD000 && (buf0[3]&0xF000)==0xD000)
        &&
        ( (buf_1[0]&0xF000)==0xA000 && (buf_1[1]&0xF000)==0xA000 && (buf_1[2]&0xF000)==0xA000 && (buf_1[3]&0xF000)==0xA000 ) ){
        fALCT_Header              = true;
        fALCT_Format2007          = true;
        ALCT_CRC                  = 0;
        ALCT_WordsSinceLastHeader = 4;
        ALCT_WordsSinceLastHeaderZeroSuppressed = 4;

        // Calculate expected number of ALCT words
        ALCT_WordsExpected = 12; // header and trailer always exists

        //  Aauxilary variables
        //   number of wire groups per layer:
        int  nWGs_per_layer = ( (buf1[2]&0x0007) + 1 ) * 16 ;
        // words in the layer
        nWG_round_up   = int(nWGs_per_layer/12)+(nWGs_per_layer%3?1:0);
        //   configuration present:
        bool config_present =  buf1[0]&0x4000;
        //   lct overflow:
        bool lct_overflow   =  buf1[0]&0x2000;
        //   raw overflow:
        bool raw_overflow   =  buf1[0]&0x1000;
        //   l1a_window:
        int  lct_tbins      = (buf1[3]&0x01E0)>>5;
        //   fifo_tbins:
        int  raw_tbins      = (buf1[3]&0x001F);
        
        ALCT_ZSE            = (buf1[1]&0x1000)>>12;
        
        /*
        std::cout << " Number of Wire Groups: " << nWG_round_up << std::endl;
        std::cout << " ALCT_ZSE: " << ALCT_ZSE << std::endl; 
        std::cout << " raw_tbins: " << std::dec << raw_tbins << std::endl;
        std::cout << " LCT Tbins: " << lct_tbins << std::endl;
         */

        //  Data block sizes:
        //   3 words of Vertex ID register + 5 words of config. register bits:
        int config_size    = ( config_present ? 3 + 5 : 0 );
        //   collision mask register:
        int colreg_size    = ( config_present ? nWGs_per_layer/4 : 0 );
        //   hot channel mask:
        int hot_ch_size    = ( config_present ? nWG_round_up*6 : 0 );
        //   ALCT0,1 (best tracks):
        int alct_0_1_size  = ( !lct_overflow ? 2*lct_tbins : 0 );
        //   raw hit dump size:
        int raw_hit_dump_size=(!raw_overflow ? nWG_round_up*6*raw_tbins : 0 );

        //std::cout << " Raw Hit Dump: " << std::dec << raw_hit_dump_size << std::endl;

        ALCT_WordsExpected += config_size + colreg_size + hot_ch_size + alct_0_1_size + raw_hit_dump_size;

        cout<<" <A";
    } else {
        // Old ALCT data format

        // == ALCT Header found right after DMB Header
        //   (check for all currently reserved/fixed bits in ALCT first 4 words)
        // if( ( (buf0 [0]&0xF800)==0x6000 && (buf0 [1]&0xFF80)==0x0080 && (buf0 [2]&0xF000)==0x0000 && (buf0 [3]&0xc000)==0x0000 )
        if( ( (buf0 [0]&0xF800)==0x6000 && (buf0 [1]&0x8F80)==0x0080 && (buf0 [2]&0x8000)==0x0000 && (buf0 [3]&0xc000)==0x0000 )
            &&
            ( (buf_1[0]&0xF000)==0xA000 && (buf_1[1]&0xF000)==0xA000 && (buf_1[2]&0xF000)==0xA000 && (buf_1[3]&0xF000)==0xA000 ) ){
              fALCT_Header              = true;
              fALCT_Format2007          = false;
              ALCT_CRC                  = 0;
              ALCT_WordsSinceLastHeader = 4;

              // Calculate expected number of ALCT words
              if( (buf0[3]&0x0003)==0 ){ ALCT_WordsExpected = 12; }     // Short Readout

              if( (buf0[1]&0x0003)==1 ){                                        // Full Readout
                       ALCT_WordsExpected = ((buf0[1]&0x007c) >> 2) *
                        ( ((buf0[3]&0x0001)   )+((buf0[3]&0x0002)>>1)+
                        ((buf0[3]&0x0004)>>2)+((buf0[3]&0x0008)>>3)+
                        ((buf0[3]&0x0010)>>4)+((buf0[3]&0x0020)>>5)+
                        ((buf0[3]&0x0040)>>6) ) * 12 + 12;
              }
              cout<<" <A";
        }
    }
    //std::cout << " ALCT Word Expected: " << ALCT_WordsExpected << std::endl;

    if( (buf0[0]&0xFFFF)==0xDB0C ){
        fTMB_Header              = true;
        fTMB_Format2007          = true;
        TMB_CRC                  = 0;
        TMB_WordsSinceLastHeader = 4;
        TMB_WordsExpected = 0;

        // Calculate expected number of TMB words (whether RPC included will be known later)
        if ( (buf1[1]&0x3000) == 0x3000) { TMB_WordsExpected = 12; }  // Short Header Only
        if ( (buf1[1]&0x3000) == 0x0000) { TMB_WordsExpected = 48; }  // Long Header Only

        cout << " <T";
    } else {
        // == TMB Header found right after DMB Header or right after ALCT Trailer
        if(   (buf0 [0]&0xFFFF)==0x6B0C && (
                                        ( (buf_1[0]&0xF000)==0xA000 && (buf_1[1]&0xF000)==0xA000 && (buf_1[2]&0xF000)==0xA000 && (buf_1[3]&0xF000)==0xA000 )
                                        ||
                                        ( (buf_1[0]&0x0800)==0x0000 && (buf_1[1]&0xF800)==0xD000 && (buf_1[2]&0xFFFF)==0xDE0D && (buf_1[3]&0xF000)==0xD000 )
                                        // should've been (buf_1[0]&0xF800)==0xD000 - see comments for sERROR[11]
                                        ) )
        {
        //if( (buf_1[2]&0xFFFF)==0xDE0D && (buf_1[3]&0xFC00)!=0xD000 && summer2004 ) ???

            fTMB_Header              = true;
            fTMB_Format2007          = false;
            TMB_CRC                  = 0;
            TMB_WordsSinceLastHeader = 4;

            // Calculate expected number of TMB words (whether RPC included will be known later)
            if ( (buf0[1]&0x3000) == 0x3000) { TMB_WordsExpected = 8; }   // Short Header Only
            if ( (buf0[1]&0x3000) == 0x0000) { TMB_WordsExpected = 32; }  // Long Header Only

            if ( (buf0[1]&0x3000) == 0x1000) {
                // Full Readout   = 28 + (#Tbins * #CFEBs * 6)
                TMB_Tbins=(buf0[1]&0x001F);
                TMB_WordsExpected = 28 + TMB_Tbins * ((buf1[0]&0x00E0)>>5) * 6;
            }

                        cout << " <T";
                }
        }
    // New TMB format => very long header Find Firmware revision
    if ( fTMB_Header && fTMB_Format2007 && TMB_WordsSinceLastHeader==8 ) {
        TMB_Firmware_Revision = buf0[3];
    }

    // New TMB format => very long header
    if ( fTMB_Header && fTMB_Format2007 && TMB_WordsSinceLastHeader==20 ) {
        // Full Readout   = 44 + (#Tbins * #CFEBs * 6)
        TMB_Tbins=(buf0[3]&0x00F8)>>3;
        TMB_WordsExpected = 44 + TMB_Tbins * (buf0[3]&0x0007) * 6;
    }

    // == ALCT Trailer found
        if(
        // New ALCT data format:
        ( buf0[0]==0xDE0D && (buf0[1]&0xF800)==0xD000 && (buf0[2]&0xF800)==0xD000 && (buf0[3]&0xF000)==0xD000 && fALCT_Format2007 ) ||
        // Old ALCT data format; last check is added to avoid confusion with new TMB header (may not be needed):
        ( (buf0[0]&0x0800)==0x0000 && (buf0[1]&0xF800)==0xD000 && (buf0[2]&0xFFFF)==0xDE0D && (buf0[3]&0xF000)==0xD000 && !fALCT_Format2007 && !(fTMB_Header&&fTMB_Format2007) )
    ){
      // should've been (buf0[0]&0xF800)==0xD000 - see comments for sERROR[11]

      // Second ALCT -> Lost both previous DMB Trailer and current DMB Header
      if( !uniqueALCT ) currentChamber = -1;
      // Check if this ALCT record have to exist according to DMB Header
      if(   DAV_ALCT  ) DAV_ALCT = false; else DAV_ALCT = true;

      if( !fALCT_Header ){
        fERROR[8] = true;
        bERROR   |= 0x100;
        fCHAMB_ERR[8].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x100;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
      } // ALCT Header is missing

      if( !fALCT_Format2007 && (buf0[0]&0xF800)!=0xD000 ){
        fERROR[11] = true;
        bERROR    |= 0x800;
        fCHAMB_ERR[11].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x800;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
      } // some bits in 1st D-Trailer are lost

      if( checkCrcALCT ){
    uint32_t crc = ( fALCT_Format2007 ? buf0[1] : buf0[0] ) & 0x7ff;
    crc |= ((uint32_t)( ( fALCT_Format2007 ? buf0[2] : buf0[1] ) & 0x7ff)) << 11;
        if( ALCT_CRC != crc ){
          fERROR[10] = true;
          bERROR   |= 0x400;
          fCHAMB_ERR[10].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x400;
          fCHAMB_ERR[0].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x1;
        }
      }

      fALCT_Header = false;
      uniqueALCT   = false;
      CFEB_CRC     = 0;
      //ALCT_WordCount = (buf0[3]&0x03FF);
      ALCT_WordCount = (buf0[3]&0x07FF);
      //ALCT_WordCount = (buf0[3]&0x0FFF);
      CFEB_SampleWordCount = 0;
      cout << "A> ";
    }

    // Calculation of CRC sum ( algorithm is written by Madorsky )
    if( fALCT_Header && checkCrcALCT ){
      for(uint16_t j=0, w=0; j<4; ++j){
        w = buf0[j] & (fALCT_Format2007 ? 0xffff : 0x7fff);
        for(uint32_t i=15, t=0, ncrc=0; i<16; i--){
          t = ((w >> i) & 1) ^ ((ALCT_CRC >> 21) & 1);
          ncrc = (ALCT_CRC << 1) & 0x3ffffc;
          ncrc |= (t ^ (ALCT_CRC & 1)) << 1;
          ncrc |= t;
          ALCT_CRC = ncrc;
        }
      }
    }

    // == Find Correction for TMB_WordsExpected due to RPC raw hits,
    //    should it turn out to be the new RPC-aware format
    if( fTMB_Header && ((buf0[2]&0xFFFF)==0x6E0B) )  {
      if (fTMB_Format2007) {
        if (TMB_Firmware_Revision >= 0x50c3) { // TMB2007 rev.0x50c3
          // On/off * nRPCs * nTimebins * 2 words/RPC/bin
          TMB_WordsRPC = ((buf_1[0]&0x0010)>>4) * ((buf_1[0]&0x000c)>>2) * ((buf_1[0]>>5) & 0x1F) * 2;
        }
        else { // TMB2007 (may not work since TMB_Tbins != RPC_Tbins)
          TMB_WordsRPC = ((buf_1[0]&0x0040)>>6) * ((buf_1[0]&0x0030)>>4) * TMB_Tbins * 2;
        }
      }
      else { // Old format
        TMB_WordsRPC   = ((buf_1[2]&0x0040)>>6) * ((buf_1[2]&0x0030)>>4) * TMB_Tbins * 2;
      }
      TMB_WordsRPC += 2; // add header/trailer for block of RPC raw hits
    }


        
    // Check for RPC data
    if ( fTMB_Header && (scanbuf(buf0,4, 0x6B04)>=0) ) {
        fTMB_RPC_Start = true;
      }

    // Check for Scope data
    if ( fTMB_Header && (scanbuf(buf0,4, 0x6B05)>=0) ) { 
        fTMB_Scope_Start = true;
      }

    // Check for Mini-Scope data
    if ( fTMB_Header && (scanbuf(buf0,4, 0x6B07)>=0) ) { 
        fTMB_MiniScope_Start = true;
      }
    
    // Check for Blocked CFEBs data
    if ( fTMB_Header && (scanbuf(buf0,4, 0x6BCB)>=0) ) { 
        fTMB_BlockedCFEBs_Start = true;
      }

    
    // Check for end of RPC data
    if ( fTMB_Header && fTMB_RPC_Start 
        && (scanbuf(buf0,4, 0x6E04)>=0) ) {
        fTMB_RPC = true;
      }

    // Check for end of Scope data
    if ( fTMB_Header && fTMB_Scope_Start 
        && (scanbuf(buf0,4, 0x6E05)>=0) ) {
        fTMB_Scope = true;
      }

    // Check for end of Mini-Scope data
    if ( fTMB_Header && fTMB_MiniScope_Start 
        && (scanbuf(buf0,4, 0x6E07)>=0) ) {
        fTMB_MiniScope = true;
      }

    // Check for end of Blocked CFEBs data
    if ( fTMB_Header && fTMB_BlockedCFEBs_Start 
        && (scanbuf(buf0,4, 0x6ECB)>=0) ) {
        fTMB_BlockedCFEBs = true;
      }

 /* 
    if ( fTMB_Header && (scanbuf(buf0,4, 0x6E04)>=0) ) {
          TMB_WordsExpected += TMB_WordsRPC; 
      }
*/

    // == TMB Trailer found
    if(
       // Old TMB data format; last condition in needed not to confuse if with new ALCT data header
       ((buf0[0]&0xF000)==0xD000 && (buf0[1]&0xF000)==0xD000 && (buf0[2]&0xFFFF)==0xDE0F && (buf0[3]&0xF000)==0xD000 && !fTMB_Format2007 && !(fALCT_Header&&fALCT_Format2007)) ||
       // New TMB data format
       ( buf0[0]==        0xDE0F && (buf0[1]&0xF000)==0xD000 && (buf0[2]&0xF000)==0xD000 && (buf0[3]&0xF000)==0xD000 &&  fTMB_Format2007 )
    ){

      // Second TMB -> Lost both previous DMB Trailer and current DMB Header
      if( !uniqueTMB ) currentChamber = -1;
      // Check if this TMB record have to exist according to DMB Header
      if(   DAV_TMB  ) DAV_TMB = false; else DAV_TMB = true;

      if(!fTMB_Header){
        fERROR[13] = true;
        bERROR    |= 0x2000;
        fCHAMB_ERR[13].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x2000;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
      }  // TMB Header is missing

      // Check calculated CRC sum against reported
      if( checkCrcTMB ){
    uint32_t crc = ( fTMB_Format2007 ? buf0[1]&0x7ff : buf0[0]&0x7ff );
    crc |= ((uint32_t)( ( fTMB_Format2007 ? buf0[2]&0x7ff : buf0[1] & 0x7ff ) )) << 11;
        if( TMB_CRC != crc ){
          fERROR[15] = true;
          bERROR    |= 0x8000;
          fCHAMB_ERR[15].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x8000;
          fCHAMB_ERR[0].insert(currentChamber);
          bCHAMB_ERR[currentChamber] |= 0x1;
        }
      }

      fTMB_Header = false;
      uniqueTMB   = false;
      CFEB_CRC     = 0;
      TMB_WordCount = (buf0[3]&0x07FF);

      // == Correct TMB_WordsExpected
      //        1) for 2 optional 0x2AAA and 0x5555 Words in the Trailer
      //        2) for extra 4 frames in the new TMB trailer and
      //         for RPC raw hit data, if present
      //
      // If the scope data was enabled in readout, scope data markers (0x6B05
      // and 0x6E05) appear before 0x6E0C, and the optional 0x2AAA and 0x5555
      // trailer words are suppressed.  So far, we only have data with the
      // empty scope content, so more corrections will be needed once
      // non-empty scope data is available. -SV, 5 Nov 2008.
      //
      // If word count is not multiple of 4, add 2 optional words and
      // 4 trailer words.
  
      int pos = scanbuf(buf_1,4,0x6E0C);
      if (pos==1) {
        TMB_WordsExpected += 6;
      }
      // If word count is multiple of 4, add 4 trailer words.
      else if (pos==3) {
        TMB_WordsExpected += 4;
      }

      // Correct expected wordcount by RPC data size
      if (fTMB_RPC) 
        TMB_WordsExpected += TMB_WordsRPC;

      // Correct expected wordcount by MiniScope data size (22 words + 2 signature words)
      if (fTMB_MiniScope) 
        TMB_WordsExpected += 24;

      // Correct expected wordcount by BlockedCFEBs data size (20 words + 2 signature words) 
      if (fTMB_BlockedCFEBs) 
        TMB_WordsExpected += 22;

      CFEB_SampleWordCount = 0;
      cout << "T> ";
    }

    if( fTMB_Header && checkCrcTMB ){
      for(uint16_t j=0, w=0; j<4; ++j){
        w = buf0[j] & (fTMB_Format2007 ? 0xffff : 0x7fff);
        for(uint32_t i=15, t=0, ncrc=0; i<16; i--){
          t = ((w >> i) & 1) ^ ((TMB_CRC >> 21) & 1);
          ncrc = (TMB_CRC << 1) & 0x3ffffc;
          ncrc |= (t ^ (TMB_CRC & 1)) << 1;
          ncrc |= t;
          TMB_CRC = ncrc;
        }
      }
    }


    // == CFEB Sample Trailer found

        if( ((buf0[1]&0xF000)==0x7000) &&
                ((buf0[2]&0xF000)==0x7000) &&
                ((buf0[1]!=0x7FFF) || (buf0[2]!=0x7FFF)) &&
                ( ((buf0[3]&0xFFFF)==0x7FFF) ||   // old format
              ( (buf0[3]&buf0[0])==0x0000 && (buf0[3]+buf0[0])==0x7FFF ) // 2007 format
              ) ){

      if((CFEB_SampleCount%8)  == 0   ){ cout<<" <"; }
      if( CFEB_SampleWordCount == 100 ){ cout<<"+";  }
      if( CFEB_SampleWordCount != 100 ){ cout<<"-";
      fERROR[16] = true;
      bERROR    |= 0x10000;
      fCHAMB_ERR[16].insert(currentChamber);
      bCHAMB_ERR[currentChamber] |= 0x10000;
      fCHAMB_ERR[0].insert(currentChamber);
      bCHAMB_ERR[currentChamber] |= 0x1;
      }

      ++CFEB_SampleCount;

      if( (CFEB_SampleCount%8)==0 ){
        cout<<">";
        CFEB_BSampleCount=0;
        // Count CFEBs
        DAV_CFEB--;
      }

      // Check calculated CRC sum against reported
      if( checkCrcCFEB && CFEB_CRC!=buf0[0] ){
        fERROR[18] = true;
        bERROR    |= 0x40000;
        fCHAMB_ERR[18].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x40000;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
      }

      CFEB_CRC = 0;
      CFEB_SampleWordCount=0;
    }


    // == CFEB B-word found
    if( (buf0[0]&0xF000)==0xB000 && (buf0[1]&0xF000)==0xB000 && (buf0[2]&0xF000)==0xB000 && (buf0[3]&0xF000)==0xB000 ){
      bCHAMB_STATUS[currentChamber] |= 0x400000;

      if( (CFEB_SampleCount%8)==0 ){ cout<<" <"; }
      cout<<"B";

      ++CFEB_SampleCount;
      ++CFEB_BSampleCount;

      if( (CFEB_SampleCount%8)==0 ){
        cout << ">";
        CFEB_BSampleCount=0;
        DAV_CFEB--;
      }

      CFEB_SampleWordCount=0;
    }

     // == If it is nither ALCT record nor TMB - probably it is CFEB record and we try to count CRC sum.
    // It very few words of CFEB occasionaly will be misinterpreted as ALCT or TMB header the result
    // for the CRC sum will be wrong, but other errors of Trailers counting will appear as well
    if( checkCrcCFEB && fDMB_Header && !fTMB_Header && !fALCT_Header && CFEB_SampleWordCount )
      for(int pos=0; pos<4; ++pos)
        CFEB_CRC=(buf0[pos]&0x1fff)^((buf0[pos]&0x1fff)<<1)^(((CFEB_CRC&0x7ffc)>>2)|((0x0003&CFEB_CRC)<<13))^((CFEB_CRC&0x7ffc)>>1);


    // == DMB F-Trailer found
    if( (buf0[0]&0xF000)==0xF000 && (buf0[1]&0xF000)==0xF000 && (buf0[2]&0xF000)==0xF000 && (buf0[3]&0xF000)==0xF000 ){
      if(!fDMB_Header){
        currentChamber = buf0[3]&0x0FFF;
        fERROR[6] = true;
        bERROR   |= 0x40;
        fCHAMB_ERR[6].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x40;
        nDMBs++;
        // Set variables if we are waiting ALCT, TMB and CFEB records to be present in event
        if( buf0[0]&0x0400 ) bCHAMB_PAYLOAD[currentChamber] |= 0x20;
        if( buf0[0]&0x0800 ) bCHAMB_PAYLOAD[currentChamber] |= 0x40;
        bCHAMB_PAYLOAD[currentChamber] |= (buf0[0]&0x001f)<<7;
        bCHAMB_PAYLOAD[currentChamber] |=((buf0[0]>>5)&0x1f);

      } // DMB Header is missing
      fDMB_Header  = false;
      fDMB_Trailer = true;
      uniqueALCT   = true;
      uniqueTMB    = true;

      dmbSize[sourceID][currentChamber] = buf0 - dmbBuffers[sourceID][currentChamber];

      // Finally check if DAVs were correct
      checkDAVs();

      // If F-Trailer is lost then do necessary work here
      if( (buf1[0]&0xF000)!=0xE000 || (buf1[1]&0xF000)!=0xE000 || (buf1[2]&0xF000)!=0xE000 || (buf1[3]&0xF000)!=0xE000 ){
        for(int err=1; err<nERRORS; ++err)
          if( fCHAMB_ERR[err].find(currentChamber) != fCHAMB_ERR[err].end() ){
            fCHAMB_ERR[0].insert(currentChamber);
            bCHAMB_ERR[currentChamber] |= 0x1;
          }
        // Reset chamber id
        currentChamber=-1;
        /*
          for(int err=0; err<nERRORS; err++)
          if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() )
          fCHAMB_ERR[err].erase(-1);
          bCHAMB_ERR[-1] = 0;
          bCHAMB_WRN[-1] = 0;
        */
      }

      // Print DMB F-Trailer marker
      cout << " }";
    }

    // == DMB E-Trailer found
    if( (buf0[0]&0xF000)==0xE000 && (buf0[1]&0xF000)==0xE000 && (buf0[2]&0xF000)==0xE000 && (buf0[3]&0xF000)==0xE000 ){
      if( !fDMB_Header && !fDMB_Trailer ) nDMBs++; // both DMB Header and DMB F-Trailer were missing

      bCHAMB_STATUS[currentChamber] |= (buf0[0]&0x0800)>>11;
      bCHAMB_STATUS[currentChamber] |= (buf0[0]&0x0400)>>9;
      bCHAMB_STATUS[currentChamber] |= (buf0[0]&0x03E0)>>3;
      if( fDMB_Trailer ){ // F-Trailer exists
        bCHAMB_STATUS[currentChamber] |= (buf_1[2]&0x0002)<<6;
        bCHAMB_STATUS[currentChamber] |= (buf_1[2]&0x0001)<<8;
        bCHAMB_STATUS[currentChamber] |= (buf_1[3]&0x001f)<<9;
        bCHAMB_STATUS[currentChamber] |= (buf_1[3]&0x0040)<<8;
        bCHAMB_STATUS[currentChamber] |= (buf_1[3]&0x0020)<<10;
                bCHAMB_STATUS[currentChamber] |= (buf_1[3]&0x0f80)<<9;
      }
      fDMB_Header  = false;

      // If chamber id is unknown it is time to find it out
      if( currentChamber==-1 ){
        currentChamber = buf0[1]&0x0FFF;
        for(int err=0; err<nERRORS; ++err)
          if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() ){
            fCHAMB_ERR[err].insert(currentChamber);
            fCHAMB_ERR[err].erase(-1);
          }
    bCHAMB_STATUS[currentChamber] = bCHAMB_STATUS[-1];
    bCHAMB_STATUS[-1] = 0;
        bCHAMB_ERR[currentChamber] = bCHAMB_ERR[-1];
        bCHAMB_ERR[-1] = 0;
        bCHAMB_WRN[currentChamber] = bCHAMB_WRN[-1];
        bCHAMB_WRN[-1] = 0;
      }
      ++cntCHAMB_Trailers[buf0[1]&0x0FFF];

      dmbSize[sourceID][currentChamber] = buf0 - dmbBuffers[sourceID][currentChamber];

      // Lost DMB F-Trailer before
      if( !fDMB_Trailer ){
        fERROR[6] = true;
        bERROR   |= 0x40;
        fCHAMB_ERR[6].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x40;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x1;
        // Check if DAVs were correct here
        checkDAVs();
      }
      fDMB_Trailer = false;

     // Print DMB E-Trailer marker
      cout<<" DMB="<<(buf0[1]&0x000F);
      cout << "; "
           << ALCT_WordsSinceLastHeader << "-"
           << ALCT_WordCount << "-"
           << ALCT_WordsExpected
           << "      "
           << TMB_WordsSinceLastHeader << "-"
           << TMB_WordCount << "-"
           << TMB_WordsExpected
           << endl;

     checkTriggerHeadersAndTrailers();

      //
      for(int err=0; err<nERRORS; ++err)
        if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() ){
          fCHAMB_ERR[err].erase(-1);
          fCHAMB_ERR[err].insert(-2);
        }
      bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
      bCHAMB_STATUS[-1] = 0;
      bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
      bCHAMB_ERR[-1] = 0;
      bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
      bCHAMB_WRN[-1] = 0;

      if( currentChamber != -1 )
        for(int err=1; err<nERRORS; ++err)
          if( fCHAMB_ERR[err].find(currentChamber) != fCHAMB_ERR[err].end() ){
            fCHAMB_ERR[0].insert(currentChamber);
            bCHAMB_ERR[currentChamber] |= 0x1;
          }

      currentChamber=-1;
/*
      // Print DMB E-Trailer marker
      cout<<" DMB="<<(buf0[1]&0x000F);
      cout << "; "
           << ALCT_WordsSinceLastHeader << "-"
           << ALCT_WordCount << "-"
           << ALCT_WordsExpected
           << "      "
           << TMB_WordsSinceLastHeader << "-"
           << TMB_WordCount << "-"
           << TMB_WordsExpected
           << endl;
*/

    }

    // == DDU Trailer found
    if( buf0[0]==0x8000 && buf0[1]==0x8000 && buf0[2]==0xFFFF && buf0[3]==0x8000 ){
      // Obsolete since 16.09.05
      //                        if( headerDAV_Active != ((buf1[1]<<16) | buf1[0]) ){
      //                                fERROR[0]  = true;
      //                                fERROR[21] = true;
      //                                bERROR|=0x200000;
      //                                //cerr<<"  ERROR 21   "<<sERROR[21]<<endl;
      //                        }
      //                        headerDAV_Active = -1;
      checkDAVs();

      checkTriggerHeadersAndTrailers();


      if( DDU_WordsSinceLastHeader>3 && !nDMBs ){
        fERROR[28]=true;
        bERROR|=0x10000000;;
      }

      if(fDDU_Trailer){
        fERROR[2] = true;
        bERROR   |= 0x4;
      } // DDU Header is missing
      fDDU_Trailer=true;
      fDDU_Header=false;

      if( fDMB_Header || fDMB_Trailer ){
       // std::cout << " Ex-Err: DMB (Header, Trailer) " << std::endl;
        fERROR[5] = true;
        bERROR   |= 0x20;
        fCHAMB_ERR[5].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x20;
        fCHAMB_ERR[0].insert(currentChamber);
        bCHAMB_ERR[currentChamber] |= 0x20;
      } // DMB Trailer is missing
      fDMB_Header  = false;
      fDMB_Trailer = false;

      currentChamber=-1;

      for(int err=0; err<nERRORS; ++err)
        if( fCHAMB_ERR[err].find(-1) != fCHAMB_ERR[err].end() ){
          fCHAMB_ERR[err].erase(-1);
          fCHAMB_ERR[err].insert(-2);
        }
      bCHAMB_STATUS[-2] |= bCHAMB_STATUS[-1];
      bCHAMB_STATUS[-1] = 0;
      bCHAMB_ERR[-2] |= bCHAMB_ERR[-1];
      bCHAMB_ERR[-1] = 0;
      bCHAMB_WRN[-2] |= bCHAMB_WRN[-1];
      bCHAMB_WRN[-1] = 0;

      for(int err=1; err<nERRORS; ++err)
        if( fCHAMB_ERR[err].find(-2) != fCHAMB_ERR[err].end() ){
          fCHAMB_ERR[0].insert(-2);
          bCHAMB_ERR[-2] |= 0x1;
        }

      dduSize[sourceID] = buf0-dduBuffers[sourceID];

      ++cntDDU_Trailers; // Increment DDUTrailer counter

      // == Combining 2 words into 24bit value
      DDU_WordCount = buf2[2] | ((buf2[3] & 0xFF) <<16) ;

      if( (DDU_WordsSinceLastHeader+4) != DDU_WordCount ){
        fERROR[4] = true;
        bERROR   |= 0x10;
      }

      if( DMB_Active!=nDMBs ){
        fERROR[24] = true;
        bERROR    |= 0x1000000;
      }

      cout<<"DDU Trailer Occurrence "<<cntDDU_Trailers<<endl;
      cout<<"----------------------------------------------------------"<<endl;
      cout<<"DDU 64-bit words = Actual - DDUcounted ="<<DDU_WordsSinceLastHeader+4<<"-"<<DDU_WordCount<<endl;

      // increment statistics Errors and Warnings (i=0 case is handled in DDU Header)
      for(int err=1; err<nERRORS; ++err){
        if( fERROR[err] ){
          fERROR[0] = true;
          bERROR |= 0x1;
          cerr<<"\nDDU Header Occurrence = "<<cntDDU_Headers;
          cerr<<"  ERROR "<<err<<"  " <<sERROR[err]<<endl;
        }
      }
      for(int wrn=1; wrn<nWARNINGS; ++wrn){
        if( fWARNING[wrn] ){
          cout<<"\nDDU Header Occurrence = "<<cntDDU_Headers;
          cout<<"  WARNING "<<wrn<<"  "<<sWARNING[wrn]<<endl;
        }
      }

      bDDU_ERR[sourceID] |= bERROR;
      bDDU_WRN[sourceID] |= bWARNING;

      DDU_WordsSinceLastHeader=0;
      DDU_WordsSinceLastTrailer=0;
      if (modeDDUonly) {
        buffer+=4;
        buf_1 = &(tmpbuf[0]);  // Just for safety
        buf0  = &(tmpbuf[4]);  // Just for safety
        buf1  = &(tmpbuf[8]);  // Just for safety
        buf2  = &(tmpbuf[12]); // Just for safety
        bzero(tmpbuf, sizeof(uint16_t)*16);
        return length-4;
      }
    }

    if (!modeDDUonly) {
      // DCC Trailer 1 && DCC Trailer 2
      // =VB= Added support for Sep. 2008 CMS DAQ DCC format
      // =VB= 04.18.09 Removed (buf2[0]&0x0003) == 0x3 check for old DCC format to satisfy older format of simulated data
      if( (buf1[3]&0xFF00) == 0xEF00 &&
          ( ((buf2[3]&0xFF00) == 0xAF00 ) 
          || 
     (( buf2[3]&0xFF00) == 0xA000 && (buf2[0]&0x0003) == 0x0) ) ){
        // =VB= Added check that there is no DCCHeader detected to set missing DCC Header error
        if(!fDCC_Header || fDCC_Trailer){
          fERROR[26] = true;
          bERROR|=0x4000000;
          fERROR[0] = true;
          bERROR|=0x1;
        } // DCC Header is missing
        fDCC_Trailer=true;
        fDCC_Header=false;

        if( fDDU_Header ){
          // == DDU Trailer is missing
          fERROR[1]=true;
          bERROR|=0x2;
          fERROR[0] = true;
          bERROR|=0x1;
        }

        buffer+=4;
        buf_1 = &(tmpbuf[0]);  // Just for safety
        buf0  = &(tmpbuf[4]);  // Just for safety
        buf1  = &(tmpbuf[8]);  // Just for safety
        buf2  = &(tmpbuf[12]); // Just for safety
        bzero(tmpbuf, sizeof(uint16_t)*16);
        return length-4;
      }
    }

    length-=4;
    buffer+=4;
  }
  //Store the tail of the buffer
  buf_1 = &(tmpbuf[0]);
  buf0  = &(tmpbuf[4]);
  buf1  = &(tmpbuf[8]);
  buf2  = &(tmpbuf[12]);
  memcpy((void*)tmpbuf,(void*)(buffer-16),sizeof(short)*16);

  if (!modeDDUonly && !fDCC_Trailer && !fDCC_Header) {
        fERROR[26] = true;
        bERROR|=0x4000000;
        fERROR[25] = true;
        bERROR|=0x2000000;
        fERROR[0]=true;
        bERROR|=0x1;
        return length;
        
  }
 
  return -2;
}
void CSCDCCExaminer::checkDAVs ( ) [private]

checks DAV_ALCT, DAV_TMB, and DAV_CFEB

Definition at line 1369 of file CSCDCCExaminer.cc.

References bCHAMB_ERR, bERROR, currentChamber, DAV_ALCT, DAV_CFEB, DAV_TMB, fCHAMB_ERR, and fERROR.

Referenced by check().

{
  if( DAV_ALCT ){ 
    fERROR[21] = true;
    bERROR   |= 0x200000;
    fCHAMB_ERR[21].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x200000;
    DAV_ALCT = false;
  }
  if( DAV_TMB  ){
    fERROR[22] = true;
    bERROR   |= 0x400000;
    fCHAMB_ERR[22].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x400000;
    DAV_TMB = false;
  }
  if( DAV_CFEB && DAV_CFEB!=-16){
    fERROR[23] = true;
    bERROR   |= 0x800000;
    fCHAMB_ERR[23].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x800000;
    DAV_CFEB = 0;
  }
}
void CSCDCCExaminer::checkTriggerHeadersAndTrailers ( ) [private]

Definition at line 1395 of file CSCDCCExaminer.cc.

References ALCT_WordCount, ALCT_WordsExpected, ALCT_WordsSinceLastHeader, ALCT_WordsSinceLastHeaderZeroSuppressed, ALCT_ZSE, bCHAMB_ERR, bERROR, CFEB_SampleCount, currentChamber, fALCT_Header, fCHAMB_ERR, fERROR, fTMB_Header, TMB_WordCount, TMB_WordsExpected, and TMB_WordsSinceLastHeader.

Referenced by check().

{   /*
    std::cout << " Ex-ALCT-Word-count " << std::endl;
    std::cout << " ALCT Words Since Last Header: " <<  ALCT_WordsSinceLastHeader << std::endl;
    std::cout << " ALCT Word Count: " <<  ALCT_WordCount << std::endl;
    std::cout << " ALCT Words Expected: " << ALCT_WordsExpected << std::endl;
    */
  if( !fALCT_Header && ( ALCT_WordsSinceLastHeader!=ALCT_WordCount || ALCT_WordsSinceLastHeader!=ALCT_WordsExpected )
    && ALCT_ZSE==0 ){
    fERROR[9] = true;
    bERROR   |= 0x200;
    fCHAMB_ERR[9].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x200;
    ALCT_WordsSinceLastHeader = 0;
    ALCT_WordCount            = 0;
    ALCT_WordsSinceLastHeader = 0;
    ALCT_WordsExpected        = 0;
  } // ALCT Word Count Error

if( !fALCT_Header && (ALCT_WordsSinceLastHeader!=ALCT_WordsExpected 
    || ALCT_WordsSinceLastHeaderZeroSuppressed!=ALCT_WordCount) && ALCT_ZSE!=0 ){
    fERROR[9] = true;
    bERROR   |= 0x200;
    fCHAMB_ERR[9].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x200;
    ALCT_WordsSinceLastHeaderZeroSuppressed =0;
    ALCT_WordsSinceLastHeader = 0;
    ALCT_WordCount            = 0;
    ALCT_WordsSinceLastHeader = 0;
    ALCT_WordsExpected        = 0;
  } // ALCT Word Count Error With zero suppression

  if( !fTMB_Header && ( TMB_WordsSinceLastHeader!=TMB_WordCount || TMB_WordsSinceLastHeader!=TMB_WordsExpected ) ){
    fERROR[14] = true;
    bERROR    |= 0x4000;
    fCHAMB_ERR[14].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x4000;
    TMB_WordsSinceLastHeader = 0;
    TMB_WordCount            = 0;
    TMB_WordsSinceLastHeader = 0;
    TMB_WordsExpected        = 0;
  } // TMB Word Count Error

  if( (CFEB_SampleCount%8)!=0 ){
    fERROR[17] = true;
    bERROR    |= 0x20000;
    fCHAMB_ERR[17].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x20000;
    CFEB_SampleCount = 0;
  } // Number of CFEB samples != 8*n

  if(fALCT_Header) {
    fERROR[7] = true;  // ALCT Trailer is missing
    bERROR   |= 0x80;
    fCHAMB_ERR[7].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x80;
    ALCT_WordsSinceLastHeaderZeroSuppressed =0;
    ALCT_WordsSinceLastHeader = 0;
    ALCT_WordsExpected        = 0;
    fALCT_Header = 0;
  }

  if(fTMB_Header) {
    fERROR[12]=true;        // TMB Trailer is missing
    bERROR   |= 0x1000;
    fCHAMB_ERR[12].insert(currentChamber);
    bCHAMB_ERR[currentChamber] |= 0x1000;
    TMB_WordsSinceLastHeader = 0;
    TMB_WordsExpected        = 0;
    fTMB_Header = false;
  }
}
void CSCDCCExaminer::clear ( void  ) [private]

Definition at line 1330 of file CSCDCCExaminer.cc.

References bCHAMB_ERR, bCHAMB_PAYLOAD, bCHAMB_STATUS, bCHAMB_WRN, bDDU_ERR, bDDU_WRN, bERROR, bWARNING, dduBuffers, dduOffsets, dduSize, dmbBuffers, dmbOffsets, dmbSize, fCHAMB_ERR, fCHAMB_WRN, fERROR, fWARNING, nERRORS, and nWARNINGS.

Referenced by check(), and CSCDCCExaminer().

{
  bzero(fERROR,   sizeof(bool)*nERRORS);
  bzero(fWARNING, sizeof(bool)*nWARNINGS);
  bERROR = 0; bWARNING = 0;
  for(int err=0; err<nERRORS;   ++err) fCHAMB_ERR[err].clear();
  for(int wrn=0; wrn<nWARNINGS; ++wrn) fCHAMB_WRN[wrn].clear();
  bCHAMB_ERR.clear();
  bCHAMB_WRN.clear();
  bCHAMB_PAYLOAD.clear();
  bCHAMB_STATUS.clear();
  bDDU_ERR.clear();
  bDDU_WRN.clear();
  dduBuffers.clear();
  dduOffsets.clear();
  dmbBuffers.clear();
  dmbOffsets.clear();
  dduSize.clear();
  dmbSize.clear();
}
void CSCDCCExaminer::crcALCT ( bool  enable)

Definition at line 6 of file CSCDCCExaminer.cc.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

                                       {
  checkCrcALCT = enable;
  if( checkCrcALCT )
    sERROR[10] = "ALCT CRC Error                                   ";
  else
    sERROR[10] = "ALCT CRC Error ( disabled )                      ";
}
void CSCDCCExaminer::crcCFEB ( bool  enable)

Definition at line 22 of file CSCDCCExaminer.cc.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

                                       {
  checkCrcCFEB = enable;
  if( checkCrcCFEB )
    sERROR[18] = "CFEB CRC Error                                   ";
  else
    sERROR[18] = "CFEB CRC Error ( disabled )                      ";
}
void CSCDCCExaminer::crcTMB ( bool  enable)

Definition at line 14 of file CSCDCCExaminer.cc.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

                                      {
  checkCrcTMB = enable;
  if( checkCrcTMB )
    sERROR[15] = "TMB CRC Error                                    ";
  else
    sERROR[15] = "TMB CRC Error ( disabled )                       ";
}
std::map<DDUIdType,const uint16_t*> CSCDCCExaminer::DDU_block ( void  ) const [inline]

Definition at line 228 of file CSCDCCExaminer.h.

References dduBuffers.

Referenced by CSCEventData::unpack_data().

{ return dduBuffers; }
std::map<DDUIdType,uint32_t> CSCDCCExaminer::DDU_ptrOffsets ( void  ) const [inline]

Definition at line 231 of file CSCDCCExaminer.h.

References dduOffsets.

{ return dduOffsets; }
std::map<DDUIdType,uint32_t> CSCDCCExaminer::DDU_size ( void  ) const [inline]

Definition at line 234 of file CSCDCCExaminer.h.

References dduSize.

Referenced by CSCEventData::unpack_data().

{ return dduSize; }
DDUIdType CSCDCCExaminer::dduSourceID ( void  ) [inline]

Definition at line 226 of file CSCDCCExaminer.h.

References sourceID.

{ return sourceID; }
std::map<DDUIdType,std::map<CSCIdType,const uint16_t*> > CSCDCCExaminer::DMB_block ( void  ) const [inline]

Definition at line 229 of file CSCDCCExaminer.h.

References dmbBuffers.

Referenced by CSCEventData::unpack_data().

{ return dmbBuffers; }
std::map<DDUIdType,std::map<CSCIdType,uint32_t> > CSCDCCExaminer::DMB_ptrOffsets ( void  ) const [inline]

Definition at line 232 of file CSCDCCExaminer.h.

References dmbOffsets.

{ return dmbOffsets; }
std::map<DDUIdType,std::map<CSCIdType,uint32_t> > CSCDCCExaminer::DMB_size ( void  ) const [inline]

Definition at line 235 of file CSCDCCExaminer.h.

References dmbSize.

{ return dmbSize; }
const char* CSCDCCExaminer::errName ( int  num) const [inline]

Definition at line 155 of file CSCDCCExaminer.h.

References nERRORS, and sERROR.

Referenced by CSCDCCUnpacker::produce().

{ if(num>=0&&num<nERRORS)   return sERROR[num];   else return ""; }
bool CSCDCCExaminer::error ( int  num) const [inline]

Definition at line 164 of file CSCDCCExaminer.h.

References fERROR, and nERRORS.

{ if(num>=0&&num<nERRORS)   return fERROR  [num]; else return 0; }
const char* CSCDCCExaminer::errorName ( int  num) const [inline]

Definition at line 158 of file CSCDCCExaminer.h.

References nERRORS, and sERROR_.

{ if(num>=0&&num<nERRORS)   return sERROR_[num];   else return ""; }
ExaminerStatusType CSCDCCExaminer::errors ( void  ) const [inline]

Definition at line 152 of file CSCDCCExaminer.h.

References bERROR.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

{ return bERROR;   }
std::map<CSCIdType,ExaminerStatusType> CSCDCCExaminer::errorsDetailed ( void  ) const [inline]

Definition at line 213 of file CSCDCCExaminer.h.

References bCHAMB_ERR.

Referenced by CSCDCCUnpacker::produce().

{ return bCHAMB_ERR; }
std::map<DDUIdType,ExaminerStatusType> CSCDCCExaminer::errorsDetailedDDU ( void  ) const [inline]

Definition at line 211 of file CSCDCCExaminer.h.

References bDDU_ERR.

Referenced by CSCDCCUnpacker::produce().

{ return bDDU_ERR; }
ExaminerStatusType CSCDCCExaminer::errorsForChamber ( CSCIdType  chamber) const [inline]

Print (for debugging, to be removed)

Definition at line 180 of file CSCDCCExaminer.h.

References bCHAMB_ERR.

Referenced by cscdqm::EventProcessor::processCSC(), and CSCEventData::unpack_data().

                                                                     {
                std::map<CSCIdType,ExaminerStatusType>::const_iterator item = bCHAMB_ERR.find(chamber);
                
                // for(item =bCHAMB_ERR.begin() ; item !=bCHAMB_ERR.end() ; item++)
                //std::cout << " Ex-errors: " << std::hex << (*item).second << std::dec << std::endl;

                item = bCHAMB_ERR.find(chamber);
                if( item != bCHAMB_ERR.end() ) return item->second; else return 0;
        }
ExaminerStatusType CSCDCCExaminer::errorsForDDU ( DDUIdType  dduSourceID) const [inline]

Definition at line 196 of file CSCDCCExaminer.h.

References bDDU_ERR.

                                                                     {
                std::map<DDUIdType,ExaminerStatusType>::const_iterator item = bDDU_ERR.find(dduSourceID);
                if( item != bDDU_ERR.end() ) return item->second; else return 0;
        }
ExaminerMaskType CSCDCCExaminer::getMask ( ) const [inline]

Definition at line 150 of file CSCDCCExaminer.h.

References examinerMask.

Referenced by CSCDCCUnpacker::produce(), and CSCEventData::unpack_data().

{return examinerMask;}
std::vector<DDUIdType> CSCDCCExaminer::listOfDDUs ( void  ) const [inline]

Definition at line 204 of file CSCDCCExaminer.h.

References bDDU_ERR.

                                                    {
                std::vector<DDUIdType> DDUs;
                std::map<DDUIdType,ExaminerStatusType>::const_iterator item = bDDU_ERR.begin();
                while( item != bDDU_ERR.end() ){ DDUs.push_back(item->first); item++; }
                return DDUs;
        }
void CSCDCCExaminer::modeDDU ( bool  enable)

Definition at line 30 of file CSCDCCExaminer.cc.

                                       {
  modeDDUonly = enable;
  if( modeDDUonly) {
    sERROR[25] = "DCC Trailer Missing                              ";
    sERROR[26] = "DCC Header Missing                               ";
  } else {
    sERROR[25] = "DCC Trailer Missing (disabled)                   ";
    sERROR[26] = "DCC Header Missing (disabled)                    ";
  }

}
OStream& CSCDCCExaminer::output1 ( void  ) [inline]

Definition at line 144 of file CSCDCCExaminer.h.

References cout.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

{ return cout; }
OStream& CSCDCCExaminer::output2 ( void  ) [inline]

Definition at line 145 of file CSCDCCExaminer.h.

References cerr.

Referenced by CSCOfflineMonitor::doBXMonitor(), CSCValidation::doTimeMonitoring(), and CSCDCCUnpacker::produce().

{ return cerr; }
std::map<CSCIdType,ExaminerStatusType> CSCDCCExaminer::payloadDetailed ( void  ) const [inline]

Definition at line 215 of file CSCDCCExaminer.h.

References bCHAMB_PAYLOAD.

Referenced by CSCDCCUnpacker::produce().

{ return bCHAMB_PAYLOAD; }
ExaminerStatusType CSCDCCExaminer::payloadForChamber ( CSCIdType  chamber) const [inline]

Definition at line 170 of file CSCDCCExaminer.h.

References bCHAMB_PAYLOAD.

                                                                      {
                std::map<CSCIdType,ExaminerStatusType>::const_iterator item = bCHAMB_PAYLOAD.find(chamber);
                if( item != bCHAMB_PAYLOAD.end() ) return item->second; else return 0;
        }
const char* CSCDCCExaminer::payloadName ( int  num) const [inline]

Definition at line 161 of file CSCDCCExaminer.h.

References nPAYLOADS, and sDMBExpectedPayload.

{ if(num>=0&&num<nPAYLOADS) return sDMBExpectedPayload[num]; else return ""; }
int CSCDCCExaminer::scanbuf ( const uint16_t *&  buf,
int32_t  length,
uint16_t  sig,
uint16_t  mask = 0xFFFF 
) [inline, private]

Definition at line 1468 of file CSCDCCExaminer.cc.

References i.

Referenced by check().

{
        for (int i=0; i<length; i++)
        {
           if ( (buffer[i]&mask) == sig) { 
                return i;
           }
        }
        return -1;
}
void CSCDCCExaminer::setMask ( ExaminerMaskType  mask) [inline]
std::map<CSCIdType,ExaminerStatusType> CSCDCCExaminer::statusDetailed ( void  ) const [inline]

Definition at line 216 of file CSCDCCExaminer.h.

References bCHAMB_STATUS.

Referenced by CSCDCCUnpacker::produce().

{ return bCHAMB_STATUS; }
ExaminerStatusType CSCDCCExaminer::statusForChamber ( CSCIdType  chamber) const [inline]

Definition at line 175 of file CSCDCCExaminer.h.

References bCHAMB_STATUS.

                                                                     {
                std::map<CSCIdType,ExaminerStatusType>::const_iterator item = bCHAMB_STATUS.find(chamber);
                if( item != bCHAMB_STATUS.end() ) return item->second; else return 0;
        }
const char* CSCDCCExaminer::statusName ( int  num) const [inline]

Definition at line 162 of file CSCDCCExaminer.h.

References nSTATUSES, and sDMBEventStaus.

{ if(num>=0&&num<nSTATUSES) return sDMBEventStaus     [num]; else return ""; }
bool CSCDCCExaminer::warning ( int  num) const [inline]

Definition at line 165 of file CSCDCCExaminer.h.

References fWARNING, and nWARNINGS.

{ if(num>=0&&num<nWARNINGS) return fWARNING[num]; else return 0; }
const char* CSCDCCExaminer::warningName ( int  num) const [inline]

Definition at line 159 of file CSCDCCExaminer.h.

References nWARNINGS, and sWARNING_.

{ if(num>=0&&num<nWARNINGS) return sWARNING_[num]; else return ""; }
ExaminerStatusType CSCDCCExaminer::warnings ( void  ) const [inline]

Definition at line 153 of file CSCDCCExaminer.h.

References bWARNING.

{ return bWARNING; }
std::map<CSCIdType,ExaminerStatusType> CSCDCCExaminer::warningsDetailed ( void  ) const [inline]

Definition at line 214 of file CSCDCCExaminer.h.

References bCHAMB_WRN.

{ return bCHAMB_WRN; }
ExaminerStatusType CSCDCCExaminer::warningsForChamber ( CSCIdType  chamber) const [inline]

Definition at line 191 of file CSCDCCExaminer.h.

References bCHAMB_WRN.

                                                                       {
                std::map<CSCIdType,ExaminerStatusType>::const_iterator item = bCHAMB_WRN.find(chamber);
                if( item != bCHAMB_WRN.end() ) return item->second; else return 0;
        }
ExaminerStatusType CSCDCCExaminer::warningsForDDU ( DDUIdType  dduSourceID) const [inline]

Definition at line 200 of file CSCDCCExaminer.h.

References bDDU_WRN.

                                                                       {
                std::map<DDUIdType,ExaminerStatusType>::const_iterator item = bDDU_WRN.find(dduSourceID);
                if( item != bDDU_WRN.end() ) return item->second; else return 0;
        }
const char* CSCDCCExaminer::wrnName ( int  num) const [inline]

Definition at line 156 of file CSCDCCExaminer.h.

References nWARNINGS, and sWARNING.

{ if(num>=0&&num<nWARNINGS) return sWARNING[num]; else return ""; }
void CSCDCCExaminer::zeroCounts ( ) [private]

Member Data Documentation

uint32_t CSCDCCExaminer::ALCT_CRC [private]

Definition at line 122 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::ALCT_WordCount [private]

Definition at line 105 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

Definition at line 106 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

Definition at line 103 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

Definition at line 104 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::ALCT_ZSE [private]

Definition at line 25 of file CSCDCCExaminer.h.

Referenced by check(), clear(), payloadDetailed(), and payloadForChamber().

Definition at line 26 of file CSCDCCExaminer.h.

Referenced by check(), clear(), statusDetailed(), and statusForChamber().

Definition at line 24 of file CSCDCCExaminer.h.

Referenced by check(), clear(), warningsDetailed(), and warningsForChamber().

Definition at line 27 of file CSCDCCExaminer.h.

Referenced by check(), clear(), errorsDetailedDDU(), errorsForDDU(), and listOfDDUs().

Definition at line 28 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and warningsForDDU().

Definition at line 17 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), and errors().

const uint16_t * CSCDCCExaminer::buf0 [private]

Definition at line 61 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf1 [private]

Definition at line 61 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf2 [private]

Definition at line 61 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t * CSCDCCExaminer::buf_1 [private]

Definition at line 61 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t* CSCDCCExaminer::buf_2 [private]

Definition at line 61 of file CSCDCCExaminer.h.

Referenced by check().

const uint16_t* CSCDCCExaminer::buffer_start [private]

Definition at line 141 of file CSCDCCExaminer.h.

Referenced by check().

Definition at line 17 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and warnings().

Definition at line 57 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and output2().

Definition at line 119 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

uint32_t CSCDCCExaminer::CFEB_CRC [private]

Definition at line 126 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 118 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

Definition at line 117 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

Definition at line 121 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 125 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 123 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 86 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 87 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 84 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 85 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 57 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and output1().

Definition at line 59 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

bool CSCDCCExaminer::DAV_ALCT [private]

Definition at line 77 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

int CSCDCCExaminer::DAV_CFEB [private]

Definition at line 79 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

int CSCDCCExaminer::DAV_DMB [private]

Definition at line 80 of file CSCDCCExaminer.h.

Referenced by check().

bool CSCDCCExaminer::DAV_TMB [private]

Definition at line 78 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::DDU_WordCount [private]

Definition at line 99 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 100 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer().

Definition at line 98 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 101 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<DDUIdType,const uint16_t*> CSCDCCExaminer::dduBuffers [private]

Definition at line 135 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_block().

std::map<DDUIdType,uint32_t> CSCDCCExaminer::dduOffsets [private]

Definition at line 137 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_ptrOffsets().

std::map<DDUIdType,uint32_t> CSCDCCExaminer::dduSize [private]

Definition at line 139 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DDU_size().

Definition at line 81 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::map<DDUIdType,std::map<CSCIdType,const uint16_t*> > CSCDCCExaminer::dmbBuffers [private]

Definition at line 136 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_block().

std::map<DDUIdType,std::map<CSCIdType,uint32_t> > CSCDCCExaminer::dmbOffsets [private]

Definition at line 138 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_ptrOffsets().

std::map<DDUIdType,std::map<CSCIdType,uint32_t> > CSCDCCExaminer::dmbSize [private]

Definition at line 140 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and DMB_size().

Definition at line 130 of file CSCDCCExaminer.h.

Referenced by getMask(), and setMask().

Definition at line 73 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 70 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

std::set<CSCIdType> CSCDCCExaminer::fCHAMB_ERR[29] [private]
std::set<CSCIdType> CSCDCCExaminer::fCHAMB_WRN[5] [private]

Definition at line 22 of file CSCDCCExaminer.h.

Referenced by chambersWithWarning(), and clear().

Definition at line 64 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 65 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 66 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 67 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 68 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 69 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

bool CSCDCCExaminer::fERROR[29] [private]

Definition at line 18 of file CSCDCCExaminer.h.

Referenced by check(), checkDAVs(), checkTriggerHeadersAndTrailers(), clear(), and error().

Definition at line 72 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 71 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and CSCDCCExaminer().

bool CSCDCCExaminer::fWARNING[5] [private]

Definition at line 19 of file CSCDCCExaminer.h.

Referenced by check(), clear(), and warning().

Definition at line 128 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

int CSCDCCExaminer::nDMBs [private]

Definition at line 81 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

const uint16_t CSCDCCExaminer::nERRORS
const uint16_t CSCDCCExaminer::nPAYLOADS

Definition at line 13 of file CSCDCCExaminer.h.

Referenced by payloadName().

const uint16_t CSCDCCExaminer::nSTATUSES

Definition at line 13 of file CSCDCCExaminer.h.

Referenced by cscdqm::EventProcessor::processExaminer(), and statusName().

const uint16_t CSCDCCExaminer::nWARNINGS

Definition at line 13 of file CSCDCCExaminer.h.

Referenced by chambersWithWarning(), check(), clear(), warning(), warningName(), and wrnName().

uint32_t CSCDCCExaminer::nWG_round_up [private]

check zero suppression mode

Definition at line 108 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

std::vector<const char*> CSCDCCExaminer::sDMBEventStaus [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and statusName().

std::vector<const char*> CSCDCCExaminer::sDMBExpectedPayload [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and payloadName().

std::vector<const char*> CSCDCCExaminer::sERROR [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and errName().

std::vector<const char*> CSCDCCExaminer::sERROR_ [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and errorName().

Definition at line 129 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and dduSourceID().

std::vector<const char*> CSCDCCExaminer::sWARNING [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by check(), CSCDCCExaminer(), and wrnName().

std::vector<const char*> CSCDCCExaminer::sWARNING_ [private]

Definition at line 16 of file CSCDCCExaminer.h.

Referenced by CSCDCCExaminer(), and warningName().

uint32_t CSCDCCExaminer::TMB_CRC [private]

Definition at line 124 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 115 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

uint32_t CSCDCCExaminer::TMB_Tbins [private]

Definition at line 113 of file CSCDCCExaminer.h.

Referenced by check(), and zeroCounts().

uint32_t CSCDCCExaminer::TMB_WordCount [private]

Definition at line 111 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

Definition at line 112 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint32_t CSCDCCExaminer::TMB_WordsRPC [private]

Definition at line 114 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

to decode if zero suppression enabled

Definition at line 110 of file CSCDCCExaminer.h.

Referenced by check(), checkTriggerHeadersAndTrailers(), and zeroCounts().

uint16_t CSCDCCExaminer::tmpbuf[16] [private]

Definition at line 62 of file CSCDCCExaminer.h.

Referenced by check(), and CSCDCCExaminer().

Definition at line 75 of file CSCDCCExaminer.h.

Referenced by check().

bool CSCDCCExaminer::uniqueTMB [private]

Definition at line 75 of file CSCDCCExaminer.h.

Referenced by check().