CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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 DCCFEBlock::unpack(), DCCSRPBlock::unpack(), DCCMemBlock::unpack(), and DCCTCCBlock::unpack().

174 {
175  // avoid checking for MC until EcalDigiToRaw bugfixed
176  // and to guarantee backward compatibility on RAW data
177  if ( fov < 1 ) return true;
178  // check the BX sync according the following rule:
179  //
180  // FE Block MEM Block TCC Block SRP Block DCC
181  // ------------------------------------------------------------------
182  // fe_bx == mem_bx == 0 tcc_bx == srp_bx == DCC_bx == 3564
183  // fe_bx == mem_bx == tcc_bx == srp_bx == DCC_bx != 3564
184 
185  const bool bxSynced =
186  ((type == FE_MEM) && (bx == 0) && (dccBx == 3564)) ||
187  ((type == FE_MEM) && (bx == dccBx) && (dccBx != 3564)) ||
188  ((type == TCC_SRP) && (bx == dccBx));
189 
190  // check the L1A sync:
191  //
192  // L1A counter relation is valid modulo 0xFFF:
193  // fe_l1 == mem_l1 == (DCC_l1-1) & 0xFFF
194  // tcc_l1 == srp_l1 == DCC_l1 & 0xFFF
195 
196  const bool l1Synced =
197  ((type == FE_MEM) && (l1 == ((dccL1 - 1) & 0xFFF))) ||
198  ((type == TCC_SRP) && (l1 == ( dccL1 & 0xFFF)));
199 
200  return (bxSynced && l1Synced);
201 }
type
Definition: HCALResponse.h:22