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 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