CMS 3D CMS Logo

DCCEBSRPBlock.cc
Go to the documentation of this file.
6 
8  : DCCSRPBlock(u, m, e, unpack) {
10 }
11 
13  // Set SR flag digis
15 }
16 
18  // Point to SR flags
19  data_++;
20  const uint16_t *my16Bitp_ = reinterpret_cast<const uint16_t *>(data_);
21 
22  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
23 
24  unsigned int fov = event_->fov();
25 
26  for (unsigned int n = 0; n < expNumbSrFlags_; n++) {
27  if (n > 0 && n % 4 == 0)
28  my16Bitp_++;
29 
30  unsigned short srFlag = (*my16Bitp_ >> ((n - (n / 4) * 4) * 3)) & SRP_SRFLAG_MASK;
31 
32  unsigned int theSRPi = n;
33 
34  if (NUMB_SM_EB_PLU_MIN <= mapper_->getActiveSM() && mapper_->getActiveSM() <= NUMB_SM_EB_PLU_MAX && fov >= 1) {
35  unsigned int u = n % towersInPhi;
36  u = towersInPhi - u;
37  theSRPi = (n / towersInPhi) * towersInPhi + u - 1;
38  }
39 
40  srFlags_[theSRPi] = srFlag;
41 
42  if (unpackInternalData_) {
43  std::vector<EcalSrFlag *> srs = mapper_->getSrFlagPointer(theSRPi + 1);
44 
45  for (size_t i = 0; i < srs.size(); ++i) {
46  srs[i]->setValue(srFlag);
47  (*ebSrFlagsDigis_)->push_back(*((EBSrFlag *)srs[i]));
48  }
49  }
50  }
51 }
52 
54  //todo : check srp id based on sm...
55 
56  // Check number of SR flags
57  if (nSRFlags_ != expNumbSrFlags_) {
59  edm::LogWarning("IncorrectBlock") << "Unable to unpack SRP block for event " << event_->l1A() << " in fed <<"
60  << mapper_->getActiveDCC() << "\nNumber of flags " << nSRFlags_
61  << " is different from expected " << expNumbSrFlags_;
62  }
63  //Note : add to error collection ?
64  return false;
65  }
66  return true;
67 }
DCCDataUnpacker.h
DCCEventBlock
Definition: DCCEventBlock.h:29
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SRP_EB_NUMBFLAGS
Definition: DCCRawDataDefinitions.h:33
DCCSRPBlock::srFlags_
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:51
DCCSRPBlock::nSRFlags_
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:48
DCCDataBlockPrototype::data_
const uint64_t * data_
Definition: DCCDataBlockPrototype.h:73
DCCSRPBlock::expNumbSrFlags_
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:49
SRP_SRFLAG_MASK
Definition: DCCRawDataDefinitions.h:209
EcalElectronicsMapper::getActiveSM
unsigned int getActiveSM()
Definition: EcalElectronicsMapper.h:128
DCCSRPBlock
Definition: DCCSRPBlock.h:30
DCCDataUnpacker
Definition: DCCDataUnpacker.h:49
DCCDataUnpacker::silentMode_
static std::atomic< bool > silentMode_
Definition: DCCDataUnpacker.h:185
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalElectronicsMapper.h
DCCEventBlock::fov
unsigned int fov()
Definition: DCCEventBlock.h:55
EcalElectronicsMapper::kTowersInPhi
Definition: EcalElectronicsMapper.h:161
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
EBSrFlag
Definition: EBSrFlag.h:13
DCCSRPBlock::srFlag
unsigned short srFlag(unsigned int feChannel)
Definition: DCCSRPBlock.h:38
DCCDataBlockPrototype::unpacker_
DCCDataUnpacker * unpacker_
Definition: DCCDataBlockPrototype.h:67
EcalElectronicsMapper::getActiveDCC
unsigned int getActiveDCC()
Definition: EcalElectronicsMapper.h:126
DCCEBSRPBlock::checkSrpIdAndNumbSRFlags
bool checkSrpIdAndNumbSRFlags() override
Definition: DCCEBSRPBlock.cc:53
EcalElectronicsMapper::getSrFlagPointer
std::vector< EcalSrFlag * > getSrFlagPointer(unsigned int feChannel)
Definition: EcalElectronicsMapper.h:122
NUMB_SM_EB_PLU_MAX
Definition: DCCRawDataDefinitions.h:57
DCCEventBlock.h
DCCEBSRPBlock::ebSrFlagsDigis_
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
Definition: DCCEBSRPBlock.h:41
DCCDataBlockPrototype::event_
DCCEventBlock * event_
Definition: DCCDataBlockPrototype.h:70
DCCEventBlock::l1A
unsigned int l1A()
Definition: DCCEventBlock.h:57
DCCEBSRPBlock::updateCollectors
void updateCollectors() override
Definition: DCCEBSRPBlock.cc:12
EcalElectronicsMapper
Definition: EcalElectronicsMapper.h:36
DCCDataBlockPrototype.h
DCCDataBlockPrototype::mapper_
EcalElectronicsMapper * mapper_
Definition: DCCDataBlockPrototype.h:69
DCCEBSRPBlock::addSRFlagToCollection
void addSRFlagToCollection() override
Definition: DCCEBSRPBlock.cc:17
DCCEBSRPBlock.h
BeamSpotPI::unpack
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
Definition: BeamSpotPayloadInspectorHelper.h:23
DCCDataBlockPrototype::unpackInternalData_
bool unpackInternalData_
Definition: DCCDataBlockPrototype.h:77
DCCDataUnpacker::ebSrFlagsCollection
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
Definition: DCCDataUnpacker.h:126
DCCEBSRPBlock::DCCEBSRPBlock
DCCEBSRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCEBSRPBlock.cc:7
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37