CMS 3D CMS Logo

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

#include <DCCSRPBlock.h>

Inheritance diagram for DCCSRPBlock:
DCCDataBlockPrototype DCCEBSRPBlock DCCEESRPBlock

Public Member Functions

 DCCSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void display (std::ostream &o)
 
unsigned short srFlag (unsigned int feChannel)
 
int unpack (const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
 
- Public Member Functions inherited from DCCDataBlockPrototype
 DCCDataBlockPrototype (DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)
 
void enableSyncChecks ()
 
virtual unsigned int getLength ()
 
virtual int unpack (const uint64_t **data, unsigned int *dwToEnd)
 
virtual void updateCollectors ()
 
virtual void updateEventPointers ()
 
virtual ~DCCDataBlockPrototype ()
 

Protected Member Functions

virtual void addSRFlagToCollection ()
 
virtual bool checkSrpIdAndNumbSRFlags ()
 

Protected Attributes

unsigned int bx_
 
unsigned int expNumbSrFlags_
 
unsigned int l1_
 
unsigned int nSRFlags_
 
unsigned short srFlags_ [SRP_NUMBFLAGS]
 
unsigned int srpId_
 
- Protected Attributes inherited from DCCDataBlockPrototype
unsigned int blockLength_
 
const uint64_t * data_
 
const uint64_t ** datap_
 
unsigned int * dwToEnd_
 
bool error_
 
DCCEventBlockevent_
 
EcalElectronicsMappermapper_
 
bool sync_
 
DCCDataUnpackerunpacker_
 
bool unpackInternalData_
 

Detailed Description

Definition at line 35 of file DCCSRPBlock.h.

Constructor & Destructor Documentation

DCCSRPBlock::DCCSRPBlock ( DCCDataUnpacker u,
EcalElectronicsMapper m,
DCCEventBlock e,
bool  unpack 
)

Definition at line 6 of file DCCSRPBlock.cc.

References DCCDataBlockPrototype::blockLength_, i, srFlags_, SRP_BLOCKLENGTH, and SRP_NUMBFLAGS.

9 {
10 
11  // Todo : include data integrity collections
13  // Set SR flags to zero
14  for(unsigned int i=0; i<SRP_NUMBFLAGS; i++){ srFlags_[i]=0; }
15 
16 }
int i
Definition: DBlmapReader.cc:9
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:59
int unpack(const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
Definition: DCCSRPBlock.cc:19
DCCDataBlockPrototype(DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)

Member Function Documentation

virtual void DCCSRPBlock::addSRFlagToCollection ( )
inlineprotectedvirtual

Reimplemented in DCCEBSRPBlock, and DCCEESRPBlock.

Definition at line 49 of file DCCSRPBlock.h.

Referenced by unpack().

49 {};
virtual bool DCCSRPBlock::checkSrpIdAndNumbSRFlags ( )
inlineprotectedvirtual

Reimplemented in DCCEBSRPBlock, and DCCEESRPBlock.

Definition at line 51 of file DCCSRPBlock.h.

Referenced by unpack().

51 { return true; };
void DCCSRPBlock::display ( std::ostream &  o)
virtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 97 of file DCCSRPBlock.cc.

References bx_, i, l1_, nSRFlags_, srFlags_, SRP_NUMBFLAGS, and srpId_.

97  {
98 
99  o<<"\n Unpacked Info for SRP Block"
100  <<"\n DW1 ============================="
101  <<"\n SRP Id "<<srpId_
102  <<"\n Numb Flags "<<nSRFlags_
103  <<"\n Bx "<<bx_
104  <<"\n L1 "<<l1_;
105 
106  for(unsigned int i=0; i<SRP_NUMBFLAGS; i++){
107  o<<"\n SR flag "<<(i+1)<<" = "<<(srFlags_[i]);
108  }
109 }
unsigned int srpId_
Definition: DCCSRPBlock.h:51
int i
Definition: DBlmapReader.cc:9
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:59
unsigned int l1_
Definition: DCCSRPBlock.h:55
unsigned int bx_
Definition: DCCSRPBlock.h:54
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:56
unsigned short DCCSRPBlock::srFlag ( unsigned int  feChannel)
inline

Definition at line 45 of file DCCSRPBlock.h.

References srFlags_.

Referenced by DCCEESRPBlock::addSRFlagToCollection(), DCCEBSRPBlock::addSRFlagToCollection(), DCCEEEventBlock::unpack(), and DCCEBEventBlock::unpack().

45 { return srFlags_[feChannel-1]; }
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:59
int DCCSRPBlock::unpack ( const uint64_t **  data,
unsigned int *  dwToEnd,
unsigned int  numbFlags = SRP_NUMBFLAGS 
)

Definition at line 19 of file DCCSRPBlock.cc.

References addSRFlagToCollection(), DCCDataBlockPrototype::blockLength_, DCCEventBlock::bx(), bx_, checkSrpIdAndNumbSRFlags(), data, DCCDataBlockPrototype::data_, DCCDataBlockPrototype::datap_, DCCDataBlockPrototype::dwToEnd_, DCCDataBlockPrototype::error_, DCCDataBlockPrototype::event_, expNumbSrFlags_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveDCC(), H_FOV_MASK, i, isSynced(), l1_, DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, nSRFlags_, DCCEventBlock::setSRPSyncNumbers(), DCCDataUnpacker::silentMode_, srFlags_, SRP_BX_B, SRP_BX_MASK, SRP_ID_MASK, SRP_L1_B, SRP_L1_MASK, SRP_NFLAGS_B, SRP_NFLAGS_MASK, SRP_NUMBFLAGS, srpId_, STOP_EVENT_UNPACKING, DCCDataBlockPrototype::sync_, TCC_SRP, and DCCDataBlockPrototype::updateEventPointers().

Referenced by DCCEEEventBlock::unpack(), and DCCEBEventBlock::unpack().

19  {
20 
21  // Set SR flags to zero
22  for(unsigned int i=0; i<SRP_NUMBFLAGS; i++){ srFlags_[i]=0; }
23 
24 
25  expNumbSrFlags_ = numbFlags;
26  error_ = false;
27  datap_ = data;
28  data_ = *data;
29  dwToEnd_ = dwToEnd;
30 
31  // Check SRP Length
32  if( (*dwToEnd_) < blockLength_ ){
34  edm::LogWarning("IncorrectEvent")
35  <<"\n Event "<<l1_
36  <<"\n Unable to unpack SRP block for event "<<event_->l1A()<<" in fed <<"<<mapper_->getActiveDCC()
37  <<"\n Only "<<((*dwToEnd_)*8)<<" bytes are available while "<<(blockLength_*8)<<" are needed!";
38  }
39 
40  //Note : add to error collection
41 
42  return STOP_EVENT_UNPACKING;
43 
44  }
45 
46 
47 
48  // Point to begin of block
49  data_++;
50 
51  srpId_ = ( *data_ ) & SRP_ID_MASK;
52  bx_ = ( *data_>>SRP_BX_B ) & SRP_BX_MASK;
53  l1_ = ( *data_>>SRP_L1_B ) & SRP_L1_MASK;
55 
57 
58  if( ! checkSrpIdAndNumbSRFlags() ){
59  // SRP flags are required to check FE data
60  return STOP_EVENT_UNPACKING;
61  }
62 
63  // Check synchronization
64  if(sync_){
65  const unsigned int dccL1 = ( event_->l1A() ) & SRP_L1_MASK;
66  const unsigned int dccBx = ( event_->bx() ) & SRP_BX_MASK;
67  const unsigned int fov = ( event_->fov() ) & H_FOV_MASK;
68 
69  if (! isSynced(dccBx, bx_, dccL1, l1_, TCC_SRP, fov)) {
71  edm::LogWarning("IncorrectEvent")
72  << "Synchronization error for SRP block"
73  << " (L1A " << event_->l1A() << " bx " << event_->bx() << " fed " << mapper_->getActiveDCC() << ")\n"
74  << " dccBx = " << dccBx << " bx_ = " << bx_ << " dccL1 = " << dccL1 << " l1_ = " << l1_ << "\n"
75  << " => Stop event unpacking";
76  }
77  //Note : add to error collection ?
78  // SRP flags are required to check FE , better using synchronized data...
79  return STOP_EVENT_UNPACKING;
80  }
81  }
82 
83  // initialize array, protecting in case of inconsistently formatted data
84  for(int dccCh=0; dccCh<SRP_NUMBFLAGS; dccCh++) srFlags_[dccCh] =0;
85 
86  //display(cout);
88 
90 
91  return true;
92 
93 }
unsigned int srpId_
Definition: DCCSRPBlock.h:51
int i
Definition: DBlmapReader.cc:9
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:59
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)
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:57
unsigned int l1_
Definition: DCCSRPBlock.h:55
virtual bool checkSrpIdAndNumbSRFlags()
Definition: DCCSRPBlock.h:51
virtual void addSRFlagToCollection()
Definition: DCCSRPBlock.h:49
static bool silentMode_
unsigned int bx()
Definition: DCCEventBlock.h:57
unsigned int bx_
Definition: DCCSRPBlock.h:54
unsigned int fov()
Definition: DCCEventBlock.h:54
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void updateEventPointers()
EcalElectronicsMapper * mapper_
void setSRPSyncNumbers(short l1, short bx)
Definition: DCCEventBlock.h:60
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:56
unsigned int l1A()
Definition: DCCEventBlock.h:56

Member Data Documentation

unsigned int DCCSRPBlock::bx_
protected

Definition at line 54 of file DCCSRPBlock.h.

Referenced by display(), and unpack().

unsigned int DCCSRPBlock::expNumbSrFlags_
protected
unsigned int DCCSRPBlock::l1_
protected

Definition at line 55 of file DCCSRPBlock.h.

Referenced by display(), and unpack().

unsigned int DCCSRPBlock::nSRFlags_
protected

Definition at line 56 of file DCCSRPBlock.h.

Referenced by DCCEBSRPBlock::checkSrpIdAndNumbSRFlags(), display(), and unpack().

unsigned short DCCSRPBlock::srFlags_[SRP_NUMBFLAGS]
protected
unsigned int DCCSRPBlock::srpId_
protected

Definition at line 51 of file DCCSRPBlock.h.

Referenced by display(), and unpack().