CMS 3D CMS Logo

Classes | Enumerations | Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/EventFilter/EcalRawToDigi/interface/DCCEventBlock.h File Reference

#include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
#include <DataFormats/EcalDigi/interface/EcalDigiCollections.h>
#include "DCCRawDataDefinitions.h"

Go to the source code of this file.

Classes

class  DCCEventBlock

Enumerations

enum  BlockType { FE_MEM = 1, TCC_SRP = 2 }

Functions

bool isSynced (const unsigned int dccBx, const unsigned int bx, const unsigned int dccL1, const unsigned int l1, const BlockType type, const unsigned int fov)

Enumeration Type Documentation

enum BlockType
Enumerator:
FE_MEM 
TCC_SRP 

Definition at line 129 of file DCCEventBlock.h.

{FE_MEM = 1, TCC_SRP = 2};

Function Documentation

bool isSynced ( const unsigned int  dccBx,
const unsigned int  bx,
const unsigned int  dccL1,
const unsigned int  l1,
const BlockType  type,
const unsigned int  fov 
)

Definition at line 168 of file DCCEventBlock.cc.

References FE_MEM, and TCC_SRP.

Referenced by DCCMemBlock::unpack(), DCCFEBlock::unpack(), DCCTCCBlock::unpack(), and DCCSRPBlock::unpack().

{
  // avoid checking for MC until EcalDigiToRaw bugfixed
  // and to guarantee backward compatibility on RAW data
  if ( fov < 1 ) return true;
  // check the BX sync according the following rule:
  //
  //   FE Block     MEM Block     TCC Block  SRP Block  DCC
  // ------------------------------------------------------------------
  //   fe_bx     == mem_bx == 0   tcc_bx ==  srp_bx ==  DCC_bx == 3564
  //   fe_bx     == mem_bx     == tcc_bx ==  srp_bx ==  DCC_bx != 3564
  
  const bool bxSynced =
    ((type ==  FE_MEM) && (bx ==     0) && (dccBx == 3564)) ||
    ((type ==  FE_MEM) && (bx == dccBx) && (dccBx != 3564)) ||
    ((type == TCC_SRP) && (bx == dccBx));
  
  // check the L1A sync:
  //
  // L1A counter relation is valid modulo 0xFFF:
  // fe_l1  == mem_l1 == (DCC_l1-1) & 0xFFF
  // tcc_l1 == srp_l1 ==  DCC_l1    & 0xFFF
  
  const bool l1Synced =
    ((type ==  FE_MEM) && (l1 == ((dccL1 - 1) & 0xFFF))) ||
    ((type == TCC_SRP) && (l1 == ( dccL1      & 0xFFF)));
  
  return (bxSynced && l1Synced);
}