CMS 3D CMS Logo

DCCEBTCCBlock.cc
Go to the documentation of this file.
5 
7  : DCCTCCBlock(u, m, e, unpack) {
10 }
11 
13 
16 
17  if (tccId_ != expTccId_) {
19  edm::LogWarning("IncorrectBlock") << "Error on event " << event_->l1A() << " with bx " << event_->bx()
20  << " in fed " << mapper_->getActiveDCC() << "\n TCC id is " << tccId_
21  << " while expected is " << expTccId_ << "\n TCC Block Skipped ...";
22  //todo : add this to error colection
23  }
24  return false;
25  }
26 
27  //Check number of TT Flags
28  if (nTTs_ != expNumbTTs_) {
30  edm::LogWarning("IncorrectBlock") << "Unable to unpack TCC block for event " << event_->l1A() << " in fed "
31  << mapper_->getActiveDCC() << "\n Number of TTs " << nTTs_
32  << " is different from expected " << expNumbTTs_ << "\n TCC Block Skipped ...";
33  //todo : add this to error colection
34  }
35  return false;
36  }
37  return true;
38 }
39 
41  //point to trigger data
42  data_++;
43 
44  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
45 
46  const uint16_t* tccP_ = reinterpret_cast<const uint16_t*>(data_);
47 
48  for (unsigned int i = 1; i <= expNumbTTs_; i++) {
49  unsigned int theTT = i;
50 
51  if (NUMB_SM_EB_PLU_MIN <= mapper_->getActiveSM() && mapper_->getActiveSM() <= NUMB_SM_EB_PLU_MAX) {
52  unsigned int u = (i - 1) % towersInPhi;
53  u = towersInPhi - u;
54  theTT = ((i - 1) / towersInPhi) * towersInPhi + u;
55  }
56 
57  pTP_ = mapper_->getTPPointer(tccId_, theTT);
58  for (unsigned int ns = 0; ns < nTSamples_; ns++, tccP_++) {
59  pTP_->setSampleValue(ns, (*tccP_));
60  (*tps_)->push_back(*pTP_);
61  }
62  }
63 }
bool checkTccIdAndNumbTTs() override
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
unsigned int getEBTCCBlockLength()
unsigned int nTSamples_
Definition: DCCTCCBlock.h:57
void addTriggerPrimitivesToCollection() override
std::unique_ptr< EcalTrigPrimDigiCollection > * tps_
Definition: DCCTCCBlock.h:64
DCCEBTCCBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCEBTCCBlock.cc:6
static std::atomic< bool > silentMode_
unsigned int bx()
Definition: DCCEventBlock.h:58
EcalTriggerPrimitiveDigi * pTP_
Definition: DCCTCCBlock.h:62
void setSampleValue(int i, uint16_t value)
void updateCollectors() override
unsigned int tccId_
Definition: DCCTCCBlock.h:51
DCCDataUnpacker * unpacker_
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:58
unsigned int nTTs_
Definition: DCCTCCBlock.h:56
EcalTriggerPrimitiveDigi * getTPPointer(unsigned int tccId, unsigned int tower)
EcalElectronicsMapper * mapper_
std::unique_ptr< EcalTrigPrimDigiCollection > * ecalTpsCollection()
Log< level::Warning, false > LogWarning
unsigned int expTccId_
Definition: DCCTCCBlock.h:59
unsigned int l1A()
Definition: DCCEventBlock.h:57