test
CMS 3D CMS Logo

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

129 {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 221 of file DCCEventBlock.cc.

References FE_MEM, and TCC_SRP.

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

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