CMS 3D CMS Logo

Functions
DCCEventBlock.cc File Reference
#include "EventFilter/EcalRawToDigi/interface/DCCEventBlock.h"
#include "EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h"
#include "EventFilter/EcalRawToDigi/interface/EcalDCCHeaderRuntypeDecoder.h"
#include "EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h"
#include "EventFilter/EcalRawToDigi/interface/DCCFEBlock.h"
#include "EventFilter/EcalRawToDigi/interface/DCCMemBlock.h"
#include "EventFilter/EcalRawToDigi/interface/DCCTCCBlock.h"
#include "EventFilter/EcalRawToDigi/interface/DCCSRPBlock.h"
#include <sys/time.h>
#include <iomanip>
#include <sstream>

Go to the source code of this file.

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)
 

Function Documentation

◆ isSynced()

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 228 of file DCCEventBlock.cc.

References nano_mu_digi_cff::bx, FE_MEM, and TCC_SRP.

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

233  {
234  // avoid checking for MC until EcalDigiToRaw bugfixed
235  // and to guarantee backward compatibility on RAW data
236  if (fov < 1)
237  return true;
238  // check the BX sync according the following rule:
239  //
240  // FE Block MEM Block TCC Block SRP Block DCC
241  // ------------------------------------------------------------------
242  // fe_bx == mem_bx == 0 tcc_bx == srp_bx == DCC_bx == 3564
243  // fe_bx == mem_bx == tcc_bx == srp_bx == DCC_bx != 3564
244 
245  const bool bxSynced = ((type == FE_MEM) && (bx == 0) && (dccBx == 3564)) ||
246  ((type == FE_MEM) && (bx == dccBx) && (dccBx != 3564)) || ((type == TCC_SRP) && (bx == dccBx));
247 
248  // check the L1A sync:
249  //
250  // L1A counter relation is valid modulo 0xFFF:
251  // fe_l1 == mem_l1 == (DCC_l1-1) & 0xFFF
252  // tcc_l1 == srp_l1 == DCC_l1 & 0xFFF
253 
254  const bool l1Synced =
255  ((type == FE_MEM) && (l1 == ((dccL1 - 1) & 0xFFF))) || ((type == TCC_SRP) && (l1 == (dccL1 & 0xFFF)));
256 
257  return (bxSynced && l1Synced);
258 }