CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
FEDHeader Class Reference

#include <FEDHeader.h>

Public Member Functions

int bxID ()
 The bunch crossing number. More...
 
int bxID ()
 The bunch crossing number. More...
 
bool check ()
 Check that the header is OK. More...
 
bool check ()
 Check that the header is OK. More...
 
 FEDHeader (const unsigned char *header)
 Constructor. More...
 
 FEDHeader (const unsigned char *header)
 Constructor. More...
 
int lvl1ID ()
 Level-1 event number generated by the TTC system. More...
 
int lvl1ID ()
 Level-1 event number generated by the TTC system. More...
 
bool moreHeaders ()
 
bool moreHeaders ()
 
int sourceID ()
 Identifier of the FED. More...
 
int sourceID ()
 Identifier of the FED. More...
 
int triggerType ()
 Event Trigger type identifier. More...
 
int triggerType ()
 Event Trigger type identifier. More...
 
int version ()
 Version identifier of the FED data format. More...
 
int version ()
 Version identifier of the FED data format. More...
 
 ~FEDHeader ()
 Destructor. More...
 
 ~FEDHeader ()
 Destructor. More...
 

Static Public Member Functions

static void set (unsigned char *header, int evt_ty, int lvl1_ID, int bx_ID, int source_ID, int version=0, bool H=false)
 Set all fields in the header. More...
 
static void set (unsigned char *header, int evt_ty, int lvl1_ID, int bx_ID, int source_ID, int version=0, bool H=false)
 Set all fields in the header. More...
 

Private Attributes

const fedh_ttheHeader
 
const fedh_structtheHeader
 

Detailed Description

TEMPORARY helper class to interpret/create FED header words. FIXME: will be replaced by the xdaq implementation.

Date:
2005/10/06 18:25:22
Revision:
1.3
Author
N. Amapane - CERN

TEMPORARY helper class to interpret/create FED header words.

Date:
2008/07/01 21:50:36
Revision:
1.1
Author
N. Amapane - CERN

Definition at line 15 of file FEDHeader.h.

Constructor & Destructor Documentation

FEDHeader::FEDHeader ( const unsigned char *  header)

Constructor.

Definition at line 11 of file FEDHeader.cc.

11  :
12  theHeader(reinterpret_cast<const fedh_t*>(header)) {}
const fedh_struct * theHeader
Definition: FEDHeader.h:56
FEDHeader::~FEDHeader ( )

Destructor.

Definition at line 15 of file FEDHeader.cc.

15 {}
FEDHeader::FEDHeader ( const unsigned char *  header)

Constructor.

FEDHeader::~FEDHeader ( )

Destructor.

Member Function Documentation

int FEDHeader::bxID ( )

The bunch crossing number.

int FEDHeader::bxID ( )
bool FEDHeader::check ( )

Check that the header is OK.

bool FEDHeader::check ( )

Check that the header is OK.

Definition at line 66 of file FEDHeader.cc.

References fedh_struct::eventid, FED_HCTRLID, FED_HCTRLID_MASK, query::result, and theHeader.

Referenced by ErrorChecker::checkHeader(), DTDDUUnpacker::interpretRawData(), ESUnpacker::interpretRawData(), DTDDUFileReader::isHeader(), DTSpyReader::isHeader(), DTDataIntegrityTask::processFED(), and RPCUnpackingModule::produce().

66  {
67  // ...may report with finer detail
68  bool result = true;
69  result &= ((theHeader->eventid & FED_HCTRLID_MASK) == FED_HCTRLID);
70 
71  return result;
72 }
const fedh_struct * theHeader
Definition: FEDHeader.h:56
tuple result
Definition: query.py:137
#define FED_HCTRLID
Definition: fed_header.h:47
unsigned int eventid
Definition: fed_header.h:33
#define FED_HCTRLID_MASK
Definition: fed_header.h:37
int FEDHeader::lvl1ID ( )

Level-1 event number generated by the TTC system.

int FEDHeader::lvl1ID ( )
bool FEDHeader::moreHeaders ( )

0 -> the current header word is the last one. 1-> other header words can follow (always 1 for ECAL)

bool FEDHeader::moreHeaders ( )

0 -> the current header word is the last one. 1-> other header words can follow (always 1 for ECAL)

Definition at line 38 of file FEDHeader.cc.

References FED_MORE_HEADERS, fedh_struct::sourceid, and theHeader.

Referenced by ErrorChecker::checkHeader(), ESUnpacker::interpretRawData(), RPCUnpackingModule::produce(), L1GlobalTriggerEvmRawToDigi::unpackHeader(), and L1GlobalTriggerRawToDigi::unpackHeader().

38  {
39  return ((theHeader->sourceid & FED_MORE_HEADERS)!=0);
40 }
unsigned int sourceid
Definition: fed_header.h:32
const fedh_struct * theHeader
Definition: FEDHeader.h:56
#define FED_MORE_HEADERS
Definition: fed_header.h:44
static void FEDHeader::set ( unsigned char *  header,
int  evt_ty,
int  lvl1_ID,
int  bx_ID,
int  source_ID,
int  version = 0,
bool  H = false 
)
static

Set all fields in the header.

Referenced by betterConfigParser.BetterConfigParser::getGeneral().

void FEDHeader::set ( unsigned char *  header,
int  evt_ty,
int  lvl1_ID,
int  bx_ID,
int  source_ID,
int  version = 0,
bool  H = false 
)
static

Set all fields in the header.

Definition at line 42 of file FEDHeader.cc.

References fedh_struct::eventid, FED_BXID_MASK, FED_BXID_SHIFT, FED_EVTY_MASK, FED_EVTY_SHIFT, FED_HCTRLID, FED_HCTRLID_MASK, FED_LVL1_MASK, FED_LVL1_SHIFT, FED_MORE_HEADERS, FED_SOID_MASK, FED_SOID_SHIFT, FED_VERSION_MASK, FED_VERSION_SHIFT, h, and fedh_struct::sourceid.

Referenced by CSCDCCHeader::CSCDCCHeader(), ESDataFormatterV1_1::DigiToRaw(), ESDataFormatterV4::DigiToRaw(), PixelDataFormatter::formatRawData(), betterConfigParser.BetterConfigParser::getGeneral(), L1GTEvmDigiToRaw::packHeader(), L1GTDigiToRaw::packHeader(), DTDigiToRawModule::produce(), CSCTFPacker::produce(), GctDigiToRaw::produce(), and RPCPackingModule::rawData().

48  {
49 
50  // FIXME: should check that input ranges are OK!!!
51  fedh_t* h = reinterpret_cast<fedh_t*>(header);
52  h->eventid =
54  ( ( evt_ty << FED_EVTY_SHIFT) & FED_EVTY_MASK ) |
55  ( ( lvl1_ID << FED_LVL1_SHIFT) & FED_LVL1_MASK );
56 
57  h->sourceid =
58  ( ( bx_ID << FED_BXID_SHIFT) & FED_BXID_MASK ) |
59  ( ( source_ID << FED_SOID_SHIFT) & FED_SOID_MASK ) |
61 
62  if (H) h->sourceid |= FED_MORE_HEADERS;
63 
64 }
int version()
Version identifier of the FED data format.
Definition: FEDHeader.cc:34
unsigned int sourceid
Definition: fed_header.h:32
#define FED_SOID_SHIFT
Definition: fed_header.h:55
#define FED_EVTY_SHIFT
Definition: fed_header.h:51
#define FED_BXID_MASK
Definition: fed_header.h:41
#define FED_VERSION_MASK
Definition: fed_header.h:43
#define FED_BXID_SHIFT
Definition: fed_header.h:54
#define FED_SOID_MASK
Definition: fed_header.h:42
#define FED_LVL1_MASK
Definition: fed_header.h:39
#define FED_VERSION_SHIFT
Definition: fed_header.h:56
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
#define FED_HCTRLID
Definition: fed_header.h:47
#define FED_LVL1_SHIFT
Definition: fed_header.h:52
unsigned int eventid
Definition: fed_header.h:33
#define FED_MORE_HEADERS
Definition: fed_header.h:44
#define FED_HCTRLID_MASK
Definition: fed_header.h:37
#define FED_EVTY_MASK
Definition: fed_header.h:38
int FEDHeader::sourceID ( )

Identifier of the FED.

int FEDHeader::sourceID ( )
int FEDHeader::triggerType ( )

Event Trigger type identifier.

int FEDHeader::triggerType ( )

Event Trigger type identifier.

Definition at line 18 of file FEDHeader.cc.

References fedh_struct::eventid, FED_EVTY_MASK, FED_EVTY_SHIFT, and theHeader.

Referenced by DTDataIntegrityTask::processFED(), RPCUnpackingModule::produce(), L1GlobalTriggerEvmRawToDigi::unpackHeader(), and L1GlobalTriggerRawToDigi::unpackHeader().

18  {
20 }
const fedh_struct * theHeader
Definition: FEDHeader.h:56
#define FED_EVTY_SHIFT
Definition: fed_header.h:51
unsigned int eventid
Definition: fed_header.h:33
#define FED_EVTY_MASK
Definition: fed_header.h:38
int FEDHeader::version ( )

Version identifier of the FED data format.

int FEDHeader::version ( )

Version identifier of the FED data format.

Definition at line 34 of file FEDHeader.cc.

References FED_VERSION_MASK, FED_VERSION_SHIFT, fedh_struct::sourceid, and theHeader.

Referenced by RPCUnpackingModule::produce(), L1GlobalTriggerEvmRawToDigi::unpackHeader(), and L1GlobalTriggerRawToDigi::unpackHeader().

34  {
36 }
unsigned int sourceid
Definition: fed_header.h:32
const fedh_struct * theHeader
Definition: FEDHeader.h:56
#define FED_VERSION_MASK
Definition: fed_header.h:43
#define FED_VERSION_SHIFT
Definition: fed_header.h:56

Member Data Documentation

const fedh_t* FEDHeader::theHeader
private

Definition at line 55 of file FEDHeader.h.

const fedh_struct* FEDHeader::theHeader
private

Definition at line 56 of file FEDHeader.h.

Referenced by bxID(), check(), lvl1ID(), moreHeaders(), sourceID(), triggerType(), and version().