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
DCCEBSRPBlock Class Reference

#include <DCCEBSRPBlock.h>

Inheritance diagram for DCCEBSRPBlock:
DCCSRPBlock DCCDataBlockPrototype

Public Member Functions

 DCCEBSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void updateCollectors ()
 
- Public Member Functions inherited from DCCSRPBlock
 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 updateEventPointers ()
 
virtual ~DCCDataBlockPrototype ()
 

Protected Member Functions

void addSRFlagToCollection ()
 
bool checkSrpIdAndNumbSRFlags ()
 

Protected Attributes

std::auto_ptr
< EBSrFlagCollection > * 
ebSrFlagsDigis_
 
EcalTrigTowerDetIdpTTDetId_
 
- Protected Attributes inherited from DCCSRPBlock
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 DCCEBSRPBlock.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file DCCEBSRPBlock.cc.

References DCCSRPBlock::expNumbSrFlags_, and SRP_EB_NUMBFLAGS.

11  : DCCSRPBlock(u,m,e,unpack)
12 {
13 
15 
16 }
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:57
DCCSRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCSRPBlock.cc:6
int unpack(const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
Definition: DCCSRPBlock.cc:19

Member Function Documentation

void DCCEBSRPBlock::addSRFlagToCollection ( )
protectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 25 of file DCCEBSRPBlock.cc.

References DCCDataBlockPrototype::data_, DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getSrFlagPointer(), i, EcalElectronicsMapper::kTowersInPhi, DCCDataBlockPrototype::mapper_, n, NUMB_SM_EB_PLU_MAX, DCCSRPBlock::srFlag(), DCCSRPBlock::srFlags_, SRP_SRFLAG_MASK, and DCCDataBlockPrototype::unpackInternalData_.

25  {
26 
27  // Point to SR flags
28  data_++;
29  const uint16_t * my16Bitp_ = reinterpret_cast<const uint16_t *> (data_);
30 
31  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
32 
33  unsigned int fov = event_->fov();
34 
35 
36  for( unsigned int n=0; n<expNumbSrFlags_ ; n++ ){
37 
38  if(n>0&&n%4==0) my16Bitp_++;
39 
40  unsigned short srFlag = ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) ) & SRP_SRFLAG_MASK ;
41 
42  unsigned int theSRPi = n ;
43 
44 
45  if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX && fov>=1 ){
46  unsigned int u = n%towersInPhi;
47  u = towersInPhi-u;
48  theSRPi = ( n/towersInPhi )*towersInPhi + u - 1;
49  }
50 
51 
52  srFlags_[theSRPi] = srFlag;
53 
55 
56  std::vector<EcalSrFlag*> srs = mapper_->getSrFlagPointer(theSRPi+1);
57 
58  for(size_t i = 0; i < srs.size(); ++i){
59  srs[i]->setValue(srFlag);
60  (*ebSrFlagsDigis_)->push_back(*((EBSrFlag*)srs[i]));
61  }
62  }
63  }
64 }
int i
Definition: DBlmapReader.cc:9
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:59
std::vector< EcalSrFlag * > getSrFlagPointer(unsigned int feChannel)
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:57
unsigned short srFlag(unsigned int feChannel)
Definition: DCCSRPBlock.h:45
unsigned int fov()
Definition: DCCEventBlock.h:54
EcalElectronicsMapper * mapper_
bool DCCEBSRPBlock::checkSrpIdAndNumbSRFlags ( )
protectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 68 of file DCCEBSRPBlock.cc.

References DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, EcalElectronicsMapper::getActiveDCC(), DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, DCCSRPBlock::nSRFlags_, and DCCDataUnpacker::silentMode_.

68  {
69 
70  //todo : check srp id based on sm...
71 
72  // Check number of SR flags
73  if (nSRFlags_ != expNumbSrFlags_) {
75  edm::LogWarning("IncorrectBlock")
76  <<"Unable to unpack SRP block for event " << event_->l1A()<<" in fed <<"<<mapper_->getActiveDCC()
77  <<"\nNumber of flags "<<nSRFlags_<<" is different from expected "<<expNumbSrFlags_;
78  }
79  //Note : add to error collection ?
80  return false;
81  }
82  return true;
83 
84 }
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:57
static bool silentMode_
EcalElectronicsMapper * mapper_
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:56
unsigned int l1A()
Definition: DCCEventBlock.h:56
void DCCEBSRPBlock::updateCollectors ( )
virtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 19 of file DCCEBSRPBlock.cc.

References DCCDataUnpacker::ebSrFlagsCollection(), ebSrFlagsDigis_, and DCCDataBlockPrototype::unpacker_.

19  {
20  // Set SR flag digis
22 }
std::auto_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
std::auto_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
Definition: DCCEBSRPBlock.h:50
DCCDataUnpacker * unpacker_

Member Data Documentation

std::auto_ptr<EBSrFlagCollection>* DCCEBSRPBlock::ebSrFlagsDigis_
protected

Definition at line 50 of file DCCEBSRPBlock.h.

Referenced by updateCollectors().

EcalTrigTowerDetId* DCCEBSRPBlock::pTTDetId_
protected

Definition at line 52 of file DCCEBSRPBlock.h.