CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
HcalUnpacker Class Reference

#include <HcalUnpacker.h>

Classes

struct  Collections
 

Public Member Functions

 HcalUnpacker (int sourceIdOffset)
 For histograms, no begin and end. More...
 
 HcalUnpacker (int sourceIdOffset, int beg, int end)
 for normal data More...
 
void setExpectedOrbitMessageTime (int time)
 
void setMode (int mode)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)
 

Private Member Functions

void printInvalidDataMessage (const std::string &coll_type, int default_ns, int conflict_ns, bool extended=false)
 
void unpackUMNio (const FEDRawData &raw, int slot, Collections &colls)
 
void unpackUTCA (const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
 
void unpackVME (const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
 

Private Attributes

int endSample_
 last sample from fed raw data to copy (if present) More...
 
int expectedOrbitMessageTime_
 Expected orbit bunch time (needed to evaluate time differences) More...
 
int mode_
 
int nPrinted_
 
int sourceIdOffset_
 number to subtract from the source id to get the dcc id More...
 
int startSample_
 first sample from fed raw data to copy More...
 
std::set< HcalElectronicsIdunknownIds_
 
std::set< HcalElectronicsIdunknownIdsTrig_
 Recorded to limit number of times a log message is generated. More...
 

Detailed Description

Definition at line 21 of file HcalUnpacker.h.

Constructor & Destructor Documentation

◆ HcalUnpacker() [1/2]

HcalUnpacker::HcalUnpacker ( int  sourceIdOffset,
int  beg,
int  end 
)
inline

for normal data

Definition at line 44 of file HcalUnpacker.h.

45  : sourceIdOffset_(sourceIdOffset),
46  startSample_(beg),
47  endSample_(end),
49  mode_(0),
50  nPrinted_(0) {}

◆ HcalUnpacker() [2/2]

HcalUnpacker::HcalUnpacker ( int  sourceIdOffset)
inline

For histograms, no begin and end.

Definition at line 52 of file HcalUnpacker.h.

53  : sourceIdOffset_(sourceIdOffset),
54  startSample_(-1),
55  endSample_(-1),
57  mode_(0),
58  nPrinted_(0) {}

Member Function Documentation

◆ printInvalidDataMessage()

void HcalUnpacker::printInvalidDataMessage ( const std::string &  coll_type,
int  default_ns,
int  conflict_ns,
bool  extended = false 
)
private

Definition at line 1070 of file HcalUnpacker.cc.

1073  {
1074  nPrinted_++;
1075 
1076  constexpr int limit = 2; //print up to limit-1 messages
1077  if (nPrinted_ >= limit) {
1078  if (nPrinted_ == limit)
1079  edm::LogInfo("Invalid Data") << "Suppressing further error messages";
1080 
1081  return;
1082  }
1083 
1084  std::stringstream message;
1085 
1086  message << "The default " << coll_type << " Collection has " << default_ns
1087  << " samples per digi, while the current data has " << conflict_ns
1088  << "! This data cannot be included with the default collection.";
1089 
1090  if (extended) {
1091  message << "\nIn order to store this data in the event, it must have a unique tag. "
1092  << "To accomplish this, provide two lists to HcalRawToDigi \n"
1093  << "1) that specifies the number of samples and "
1094  << "2) that gives tags with which these data are saved.\n"
1095  << "For example in this case you might add \n"
1096  << "process.hcalDigis.save" << coll_type << "DataNSamples = cms.untracked.vint32( " << conflict_ns
1097  << ") \nprocess.hcalDigis.save" << coll_type << "DataTags = cms.untracked.vstring( \"MYDATA\" )";
1098  }
1099 
1100  edm::LogWarning("Invalid Data") << message.str();
1101 }

References remoteMonitoring_LED_IterMethod_cfg::limit, and nPrinted_.

Referenced by unpackUTCA().

◆ setExpectedOrbitMessageTime()

void HcalUnpacker::setExpectedOrbitMessageTime ( int  time)
inline

Definition at line 59 of file HcalUnpacker.h.

References expectedOrbitMessageTime_, and ntuplemaker::time.

Referenced by HcalRawToDigi::HcalRawToDigi().

◆ setMode()

void HcalUnpacker::setMode ( int  mode)
inline

Definition at line 66 of file HcalUnpacker.h.

66 { mode_ = mode; }

References ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, and mode_.

Referenced by HcalRawToDigi::HcalRawToDigi().

◆ unpack() [1/2]

void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
Collections conts,
HcalUnpackerReport report,
bool  silent = false 
)

Definition at line 208 of file HcalUnpacker.cc.

212  {
213  if (raw.size() < 16) {
214  if (!silent)
215  edm::LogWarning("Invalid Data") << "Empty/invalid data, size = " << raw.size();
216  return;
217  }
218 
219  // get the DCC header
220  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(raw.data());
221 
222  if (dccHeader->BOEshouldBeZeroAlways() == 0) // also includes uTCA before the common AMC13XG firmware
223  unpackVME(raw, emap, colls, report, silent);
224  else
225  unpackUTCA(raw, emap, colls, report, silent);
226 }

References HcalDCCHeader::BOEshouldBeZeroAlways(), FEDRawData::data(), edmIntegrityCheck::report, CastorRawToDigi_cfi::silent, FEDRawData::size(), unpackUTCA(), and unpackVME().

◆ unpack() [2/2]

void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
std::vector< HcalHistogramDigi > &  histoDigis 
)

Definition at line 991 of file HcalUnpacker.cc.

993  {
994  // get the DCC header
995  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(raw.data());
996  int dccid = dccHeader->getSourceId() - sourceIdOffset_;
997 
998  // check the summary status
999 
1000  // walk through the HTR data...
1001  HcalHTRData htr;
1002  for (int spigot = 0; spigot < HcalDCCHeader::SPIGOT_COUNT; spigot++) {
1003  if (!dccHeader->getSpigotPresent(spigot))
1004  continue;
1005 
1006  int retval = dccHeader->getSpigotData(spigot, htr, raw.size());
1007  // check
1008  if (retval || !htr.check()) {
1009  edm::LogWarning("Invalid Data") << "Invalid HTR data observed on spigot " << spigot << " of DCC with source id "
1010  << dccHeader->getSourceId();
1011  continue;
1012  }
1013  if (!htr.isHistogramEvent()) {
1014  edm::LogWarning("Invalid Data") << "Non-histogram data passed to histogram unpacker on spigot " << spigot
1015  << " of DCC with source id " << dccHeader->getSourceId();
1016  continue;
1017  }
1018 
1019  unsigned int smid = htr.getSubmodule();
1020  int htr_tb = smid & 0x1;
1021  int htr_slot = (smid >> 1) & 0x1F;
1022  int htr_cr = (smid >> 6) & 0x1F;
1023 
1024  // find out the fibers
1025  int f[2], fc;
1026  htr.getHistogramFibers(f[0], f[1]);
1027 
1028  for (int nf = 0; nf < 2; nf++) {
1029  if (f[nf] < 0 || (nf == 1 && f[0] == f[1]))
1030  continue; // skip if invalid or the same
1031  for (fc = 0; fc <= 2; fc++) {
1032  HcalElectronicsId eid(fc, f[nf], spigot, dccid);
1033  eid.setHTR(htr_cr, htr_slot, htr_tb);
1034  DetId did = emap.lookup(eid);
1035 
1036  if (did.null() || did.det() != DetId::Hcal || did.subdetId() == 0) {
1037  if (unknownIds_.find(eid) == unknownIds_.end()) {
1038  edm::LogWarning("HCAL") << "HcalHistogramUnpacker: No match found for electronics id :" << eid;
1039  unknownIds_.insert(eid);
1040  }
1041  continue;
1042  }
1043  histoDigis.push_back(HcalHistogramDigi(HcalDetId(did))); // add it!
1044  HcalHistogramDigi& digi = histoDigis.back();
1045 
1046  // unpack the four capids
1047  for (int capid = 0; capid < 4; capid++)
1048  htr.unpackHistogram(f[nf], fc, capid, digi.getArray(capid));
1049  }
1050  }
1051  }
1052 }

References HcalHTRData::check(), FEDRawData::data(), DetId::det(), runTauDisplay::eid, f, benchmark_cfg::fc, HcalHistogramDigi::getArray(), HcalHTRData::getHistogramFibers(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), HcalHTRData::getSubmodule(), DetId::Hcal, HcalHTRData::isHistogramEvent(), HcalElectronicsMap::lookup(), DetId::null(), FEDRawData::size(), sourceIdOffset_, HcalDCCHeader::SPIGOT_COUNT, DetId::subdetId(), unknownIds_, and HcalHTRData::unpackHistogram().

Referenced by HcalHistogramRawToDigi::produce(), and HcalRawToDigi::produce().

◆ unpackUMNio()

void HcalUnpacker::unpackUMNio ( const FEDRawData raw,
int  slot,
Collections colls 
)
private

Definition at line 1054 of file HcalUnpacker.cc.

1054  {
1055  const hcal::AMC13Header* amc13 = (const hcal::AMC13Header*)(raw.data());
1056  int namc = amc13->NAMC();
1057  //Find AMC corresponding to uMNio slot
1058  for (int iamc = 0; iamc < namc; iamc++) {
1059  if (amc13->AMCSlot(iamc) == slot)
1060  namc = iamc;
1061  }
1062  if (namc == amc13->NAMC()) {
1063  return;
1064  }
1065  const uint16_t* data = (const uint16_t*)(amc13->AMCPayload(namc));
1066  size_t nwords = amc13->AMCSize(namc) * (sizeof(uint64_t) / sizeof(uint16_t));
1067  *(colls.umnio) = HcalUMNioDigi(data, nwords);
1068 }

References FEDRawData::data(), data, and HcalUnpacker::Collections::umnio.

Referenced by unpackUTCA().

◆ unpackUTCA()

void HcalUnpacker::unpackUTCA ( const FEDRawData raw,
const HcalElectronicsMap emap,
Collections conts,
HcalUnpackerReport report,
bool  silent = false 
)
private

Definition at line 683 of file HcalUnpacker.cc.

687  {
688  const hcal::AMC13Header* amc13 = (const hcal::AMC13Header*)(raw.data());
689 
690  // how many AMC in this packet
691  int namc = amc13->NAMC();
692  for (int iamc = 0; iamc < namc; iamc++) {
693  // if not enabled, ignore
694  if (!amc13->AMCEnabled(iamc))
695  continue;
696 
697  if (!amc13->AMCDataPresent(iamc)) {
698  if (!silent)
699  edm::LogWarning("Invalid Data") << "Missing data observed on iamc " << iamc << " of AMC13 with source id "
700  << amc13->sourceId();
701  report.countSpigotFormatError();
702  continue;
703  }
704  if (!amc13->AMCCRCOk(iamc)) {
705  if (!silent)
706  edm::LogWarning("Invalid Data") << "CRC Error on uHTR data observed on iamc " << iamc
707  << " of AMC13 with source id " << amc13->sourceId();
708  report.countSpigotFormatError();
709  // continue;
710  }
711  // this unpacker cannot handle segmented data!
712  if (amc13->AMCSegmented(iamc)) {
713  if (!silent)
714  edm::LogWarning("Invalid Data") << "Unpacker cannot handle segmented data observed on iamc " << iamc
715  << " of AMC13 with source id " << amc13->sourceId();
716  report.countSpigotFormatError();
717  continue;
718  }
719 
720  // ok, now we're work-able
721  int slot = amc13->AMCSlot(iamc);
722  int crate = amc13->AMCId(iamc) & 0xFF;
723 
724  HcalUHTRData uhtr(amc13->AMCPayload(iamc), amc13->AMCSize(iamc));
725  //Check to make sure uMNio is not unpacked here
726  if (uhtr.getFormatVersion() != 1) {
727  unpackUMNio(raw, slot, colls);
728  continue;
729  }
730 #ifdef DebugLog
731  //debug printouts
732  int nwords = uhtr.getRawLengthBytes() / 2;
733  for (int iw = 0; iw < nwords; iw++)
734  printf("%04d %04x\n", iw, uhtr.getRawData16()[iw]);
735 #endif
736 
737  //use uhtr presamples since amc header not properly packed in simulation
738  int nps = uhtr.presamples();
739 
740  HcalUHTRData::const_iterator i = uhtr.begin(), iend = uhtr.end();
741  while (i != iend) {
742 #ifdef DebugLog
743  std::cout << "This data is flavored:" << i.flavor() << std::endl;
744 #endif
745 
746  if (!i.isHeader()) {
747  ++i;
748 #ifdef DebugLog
749  std::cout << "its not a header" << std::endl;
750 #endif
751  continue;
752  }
754  if (i.flavor() == 1 || i.flavor() == 0 || i.flavor() == 3) {
755  int ifiber = ((i.channelid() >> 3) & 0x1F);
756  int ichan = (i.channelid() & 0x7);
757  HcalElectronicsId eid(crate, slot, ifiber, ichan, false);
758  DetId did = emap.lookup(eid);
759  // Count from current position to next header, or equal to end
760  const uint16_t* head_pos = i.raw();
761  int ns = 0;
762  for (++i; i != iend && !i.isHeader(); ++i) {
763  ns++;
764  }
765  // Check QEI11 container exists
766  if (colls.qie11 == nullptr) {
767  colls.qie11 = new QIE11DigiCollection(ns);
768  } else if (colls.qie11->samples() != ns) {
769  // if this sample type hasn't been requested to be saved
770  // warn the user to provide a configuration that prompts it to be saved
771  if (colls.qie11Addtl.find(ns) == colls.qie11Addtl.end()) {
772  printInvalidDataMessage("QIE11", colls.qie11->samples(), ns, true);
773  }
774  }
775 
776  // Insert data
778  if (!did.null()) { // unpack and store...
779  // only fill the default collection if we have the correct number of samples
780  if (colls.qie11->samples() == ns) {
781  colls.qie11->addDataFrame(did, head_pos);
782  }
783  // fill the additional qie11 collections
784  if (colls.qie11Addtl.find(ns) != colls.qie11Addtl.end()) {
785  colls.qie11Addtl[ns]->addDataFrame(did, head_pos);
786  }
787  } else {
788  report.countUnmappedDigi(eid);
789  if (unknownIds_.find(eid) == unknownIds_.end()) {
790  if (!silent)
791  edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
792  unknownIds_.insert(eid);
793 #ifdef DebugLog
794  std::cout << "HcalUnpacker: No match found for electronics id :" << eid << std::endl;
795 #endif
796  }
797 #ifdef DebugLog
798  std::cout << "OH NO! detector id is null!" << std::endl;
799 #endif
800  }
801  } else if (i.flavor() == 2) {
803 
804  int ifiber = ((i.channelid() >> 3) & 0x1F);
805  int ichan = (i.channelid() & 0x7);
806  HcalElectronicsId eid(crate, slot, ifiber, ichan, false);
807  DetId did = emap.lookup(eid);
808 
809  // Count from current position to next header, or equal to end
810  const uint16_t* head_pos = i.raw();
811  int ns = 0;
812  for (++i; i != iend && !i.isHeader(); ++i) {
813  ns++;
814  }
815 
816  bool isZDC = (did.det() == DetId::Calo && did.subdetId() == HcalZDCDetId::SubdetectorId);
817  bool isLasmon = (did.det() == DetId::Hcal && (HcalSubdetector)did.subdetId() == HcalOther &&
818  HcalCalibDetId(did).calibFlavor() == 5);
819 
820  if (isZDC) {
821  if (colls.qie10ZDC == nullptr) {
822  colls.qie10ZDC = new QIE10DigiCollection(ns);
823  } else if (colls.qie10ZDC->samples() != ns) {
824  printInvalidDataMessage("QIE10ZDC", colls.qie10ZDC->samples(), ns, false);
825  }
826  } else if (isLasmon) {
827  if (colls.qie10Lasermon == nullptr) {
828  colls.qie10Lasermon = new QIE10DigiCollection(ns);
829  } else if (colls.qie10Lasermon->samples() != ns) {
830  printInvalidDataMessage("QIE10LASMON", colls.qie10Lasermon->samples(), ns, false);
831  }
832  } else { // these are the default qie10 channels
833  if (colls.qie10 == nullptr) {
834  colls.qie10 = new QIE10DigiCollection(ns);
835  } else if (colls.qie10->samples() != ns) {
836  // if this sample type hasn't been requested to be saved
837  // warn the user to provide a configuration that prompts it to be saved
838  if (colls.qie10Addtl.find(ns) == colls.qie10Addtl.end()) {
839  printInvalidDataMessage("QIE10", colls.qie10->samples(), ns, true);
840  }
841  }
842  }
843 
844  // Insert data
846  if (!did.null()) { // unpack and store...
847  // fill the additional qie10 collections
848  if (isZDC)
849  colls.qie10ZDC->addDataFrame(did, head_pos);
850  else if (isLasmon)
851  colls.qie10Lasermon->addDataFrame(did, head_pos);
852  else {
853  // only fill the default collection if we have the correct number of samples
854  if (colls.qie10->samples() == ns) {
855  colls.qie10->addDataFrame(did, head_pos);
856  }
857 
858  // fill the additional qie10 collections
859  if (colls.qie10Addtl.find(ns) != colls.qie10Addtl.end()) {
860  colls.qie10Addtl[ns]->addDataFrame(did, head_pos);
861  }
862  }
863  } else {
864  report.countUnmappedDigi(eid);
865  if (unknownIds_.find(eid) == unknownIds_.end()) {
866  if (!silent)
867  edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
868  unknownIds_.insert(eid);
869 #ifdef DebugLog
870  std::cout << "HcalUnpacker: No match found for electronics id :" << eid << std::endl;
871 #endif
872  }
873 #ifdef DebugLog
874  std::cout << "OH NO! HcalUnpacker: No match found for electronics id :" << eid << std::endl;
875 #endif
876  }
877  } else if (i.flavor() == 5 || (i.flavor() == 7 && i.technicalDataType() == 15)) { // Old-style digis
878  int ifiber = ((i.channelid() >> 2) & 0x1F);
879  int ichan = (i.channelid() & 0x3);
880  HcalElectronicsId eid(crate, slot, ifiber, ichan, false);
881  DetId did = emap.lookup(eid);
882 
883  if (!did.null()) { // unpack and store...
884  if (did.det() == DetId::Calo && did.subdetId() == HcalZDCDetId::SubdetectorId) {
885  colls.zdcCont->push_back(ZDCDataFrame(HcalZDCDetId(did)));
886  HcalUnpacker_impl::unpack_compact<ZDCDataFrame>(
887  i, iend, colls.zdcCont->back(), nps, eid, startSample_, endSample_);
888  } else if (did.det() == DetId::Hcal) {
889  switch (((HcalSubdetector)did.subdetId())) {
890  case (HcalBarrel):
891  case (HcalEndcap): {
892  colls.hbheCont->push_back(HBHEDataFrame(HcalDetId(did)));
893  HcalUnpacker_impl::unpack_compact<HBHEDataFrame>(
894  i, iend, colls.hbheCont->back(), nps, eid, startSample_, endSample_);
895  } break;
896  case (HcalOuter): {
897  colls.hoCont->push_back(HODataFrame(HcalDetId(did)));
898  HcalUnpacker_impl::unpack_compact<HODataFrame>(
899  i, iend, colls.hoCont->back(), nps, eid, startSample_, endSample_);
900  } break;
901  case (HcalForward): {
902  colls.hfCont->push_back(HFDataFrame(HcalDetId(did)));
903  HcalUnpacker_impl::unpack_compact<HFDataFrame>(
904  i, iend, colls.hfCont->back(), nps, eid, startSample_, endSample_);
905  } break;
906  case (HcalOther): {
907  HcalOtherDetId odid(did);
908  if (odid.subdet() == HcalCalibration) {
909  colls.calibCont->push_back(HcalCalibDataFrame(HcalCalibDetId(did)));
910  HcalUnpacker_impl::unpack_compact<HcalCalibDataFrame>(
911  i, iend, colls.calibCont->back(), nps, eid, startSample_, endSample_);
912  }
913  } break;
914  case (HcalEmpty):
915  default: {
916  for (++i; i != iend && !i.isHeader(); ++i)
917  ;
918  } break;
919  }
920  }
921  } else {
922  report.countUnmappedDigi(eid);
923  if (unknownIds_.find(eid) == unknownIds_.end()) {
924  if (!silent)
925  edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
926  unknownIds_.insert(eid);
927  }
928  for (++i; i != iend && !i.isHeader(); ++i)
929  ;
930  }
931  } else if (i.flavor() == 0x4) { // TP digis
932  int ilink = ((i.channelid() >> 4) & 0xF);
933  int itower = (i.channelid() & 0xF);
934  HcalElectronicsId eid(crate, slot, ilink, itower, true);
935  DetId did = emap.lookupTrigger(eid);
936 #ifdef DebugLog
937  std::cout << "Unpacking " << eid << " " << i.channelid() << std::endl;
938 #endif
939  if (did.null()) {
940  report.countUnmappedTPDigi(eid);
941  if (unknownIdsTrig_.find(eid) == unknownIdsTrig_.end()) {
942  if (!silent)
943  edm::LogWarning("HCAL") << "HcalUnpacker: No trigger primitive match found for electronics id :" << eid;
944  unknownIdsTrig_.insert(eid);
945  }
946  // Skip it
947  for (++i; i != iend && !i.isHeader(); ++i)
948  ;
949  } else if (did == HcalTrigTowerDetId::Undefined || (did.det() == DetId::Hcal && did.subdetId() == 0)) {
950  for (++i; i != iend && !i.isHeader(); ++i)
951  ;
952  } else {
953  HcalTrigTowerDetId id(did);
954 #ifdef DebugLog
955  std::cout << "Unpacking " << id << std::endl;
956 #endif
957  colls.tpCont->push_back(HcalTriggerPrimitiveDigi(id));
958  int j = 0;
959  for (++i; i != iend && !i.isHeader(); ++i) {
960  colls.tpCont->back().setSample(j, i.value());
961  if (i.soi())
962  colls.tpCont->back().setPresamples(j);
963  j++;
964  }
965  colls.tpCont->back().setSize(j);
966  }
967  } else {
968  // consume any not-understood channel data
969  for (++i; i != iend && !i.isHeader(); ++i)
970  ;
971  }
972  }
973  }
974 }

References HcalDataFrameContainer< Digi >::addDataFrame(), HcalUnpacker::Collections::calibCont, HcalCalibDetId::calibFlavor(), DetId::Calo, gather_cfg::cout, FEDRawData::data(), DetId::det(), runTauDisplay::eid, endSample_, HcalUnpacker::Collections::hbheCont, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalUnpacker::Collections::hfCont, HcalUnpacker::Collections::hoCont, mps_fire::i, triggerObjects_cff::id, dqmiolumiharvest::j, HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), DetId::null(), printInvalidDataMessage(), HcalUnpacker::Collections::qie10, HcalUnpacker::Collections::qie10Addtl, HcalUnpacker::Collections::qie10Lasermon, HcalUnpacker::Collections::qie10ZDC, HcalUnpacker::Collections::qie11, HcalUnpacker::Collections::qie11Addtl, edmIntegrityCheck::report, HcalDataFrameContainer< Digi >::samples(), CastorRawToDigi_cfi::silent, startSample_, HcalOtherDetId::subdet(), HcalZDCDetId::SubdetectorId, DetId::subdetId(), HcalUnpacker::Collections::tpCont, HcalTrigTowerDetId::Undefined, unknownIds_, unknownIdsTrig_, unpackUMNio(), and HcalUnpacker::Collections::zdcCont.

Referenced by unpack().

◆ unpackVME()

void HcalUnpacker::unpackVME ( const FEDRawData raw,
const HcalElectronicsMap emap,
Collections conts,
HcalUnpackerReport report,
bool  silent = false 
)
private

work through the samples

branch point between 2006-2011 data format and 2012+ data format

work through the samples

Definition at line 232 of file HcalUnpacker.cc.

236  {
237  // get the DCC header
238  const HcalDCCHeader* dccHeader = (const HcalDCCHeader*)(raw.data());
239  const HcalDTCHeader* dtcHeader = (const HcalDTCHeader*)(raw.data());
240  bool is_VME_DCC = (dccHeader->getDCCDataFormatVersion() < 0x10) || ((mode_ & 0x1) == 0);
241 
242  int dccid =
243  (is_VME_DCC) ? (dccHeader->getSourceId() - sourceIdOffset_) : (dtcHeader->getSourceId() - sourceIdOffset_);
244 
245  // check the summary status
246 
247  // walk through the HTR data. For the uTCA, use spigot=slot+1
248  HcalHTRData htr;
249  const unsigned short *daq_first, *daq_last, *tp_first, *tp_last;
250  const HcalQIESample *qie_begin, *qie_end, *qie_work;
251  const HcalTriggerPrimitiveSample *tp_begin, *tp_end, *tp_work;
252  for (int spigot = 0; spigot < HcalDCCHeader::SPIGOT_COUNT; spigot++) {
253  if (is_VME_DCC) {
254  if (!dccHeader->getSpigotPresent(spigot))
255  continue;
256 
257  int retval = dccHeader->getSpigotData(spigot, htr, raw.size());
258  if (retval != 0) {
259  if (retval == -1) {
260  if (!silent)
261  edm::LogWarning("Invalid Data") << "Invalid HTR data (data beyond payload size) observed on spigot "
262  << spigot << " of DCC with source id " << dccHeader->getSourceId();
263  report.countSpigotFormatError();
264  }
265  continue;
266  }
267  // check
268  if (dccHeader->getSpigotCRCError(spigot)) {
269  if (!silent)
270  edm::LogWarning("Invalid Data") << "CRC Error on HTR data observed on spigot " << spigot
271  << " of DCC with source id " << dccHeader->getSourceId();
272  report.countSpigotFormatError();
273  continue;
274  }
275  } else { // is_uTCA (!is_VME_DCC)
276  int slot = spigot + 1;
277  if (slot > HcalDTCHeader::MAXIMUM_SLOT)
278  continue;
279 
280  if (!dtcHeader->getSlotPresent(slot))
281  continue;
282 
283  int retval = dtcHeader->getSlotData(slot, htr, raw.size());
284  if (retval != 0) {
285  if (retval == -1) {
286  if (!silent)
287  edm::LogWarning("Invalid Data") << "Invalid uHTR data (data beyond payload size) observed on slot " << slot
288  << " of DTC with source id " << dtcHeader->getSourceId();
289  report.countSpigotFormatError();
290  }
291  continue;
292  }
293  // check
294  if (dtcHeader->getSlotCRCError(slot)) {
295  if (!silent)
296  edm::LogWarning("Invalid Data") << "CRC Error on uHTR data observed on slot " << slot
297  << " of DTC with source id " << dtcHeader->getSourceId();
298  report.countSpigotFormatError();
299  continue;
300  }
301  }
302 
303  // check for EE
304  if (htr.isEmptyEvent()) {
305  report.countEmptyEventSpigot();
306  }
307  if (htr.isOverflowWarning()) {
308  report.countOFWSpigot();
309  }
310  if (htr.isBusy()) {
311  report.countBusySpigot();
312  }
313  if (!htr.check()) {
314  if (!silent)
315  edm::LogWarning("Invalid Data") << "Invalid HTR data observed on spigot " << spigot << " of DCC with source id "
316  << dccHeader->getSourceId();
317  report.countSpigotFormatError();
318  continue;
319  }
320  if (htr.isHistogramEvent()) {
321  if (!silent)
322  edm::LogWarning("Invalid Data") << "Histogram data passed to non-histogram unpacker on spigot " << spigot
323  << " of DCC with source id " << dccHeader->getSourceId();
324  continue;
325  }
326  if ((htr.getFirmwareFlavor() & 0xE0) == 0x80) { // some kind of TTP data
327  if (colls.ttp != nullptr) {
328  HcalTTPUnpacker ttpUnpack;
329  colls.ttp->push_back(HcalTTPDigi());
330  ttpUnpack.unpack(htr, colls.ttp->back());
331  } else {
332  LogDebug("HcalTechTrigProcessor")
333  << "Skipping data on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId()
334  << " which is from the TechTrigProcessor (use separate unpacker!)";
335  }
336  continue;
337  }
338  if (htr.getFirmwareFlavor() >= 0x80) {
339  if (!silent)
340  edm::LogWarning("HcalUnpacker") << "Skipping data on spigot " << spigot << " of DCC with source id "
341  << dccHeader->getSourceId() << " which is of unknown flavor "
342  << htr.getFirmwareFlavor();
343  continue;
344  }
345 
346  // calculate "real" number of presamples
347  int nps = htr.getNPS() - startSample_;
348 
349  // get pointers
350  htr.dataPointers(&daq_first, &daq_last, &tp_first, &tp_last);
351  unsigned int smid = htr.getSubmodule();
352  int htr_tb = smid & 0x1;
353  int htr_slot = (smid >> 1) & 0x1F;
354  int htr_cr = (smid >> 6) & 0x1F;
355 
356  tp_begin = (const HcalTriggerPrimitiveSample*)tp_first;
357  tp_end = (const HcalTriggerPrimitiveSample*)(tp_last + 1); // one beyond last..
358 
360  int currFiberChan = 0x3F; // invalid fiber+channel...
361  int ncurr = 0;
362  bool valid = false;
363 
364  bool tpgSOIbitInUse = htr.getFormatVersion() >= 3; // version 3 and later
365  bool isHOtpg = htr.getFormatVersion() >= 3 && htr.getFirmwareFlavor() == 0; // HO is flavor zero
366  int npre = 0;
367  /*
368  Unpack the trigger primitives
369  */
370  if (isHOtpg) {
371  HOUnrolledTP unrolled[24];
372  for (tp_work = tp_begin; tp_work != tp_end; tp_work++) {
373  if (tp_work->raw() == 0xFFFF)
374  continue; // filler word
375  int sector = slbChan(tp_work->raw());
376  if (sector > 2)
377  continue;
378 
379  for (int ibit = 0; ibit < 8; ibit++) {
380  int linear = sector * 8 + ibit;
381  if (!unrolled[linear].checked) {
382  unrolled[linear].checked = true;
383  int fiber = (linear / 3) + 1;
384  int fc = (linear % 3);
385  // electronics id (use precision match for HO TP)
386  HcalElectronicsId eid(fc, fiber, spigot, dccid);
387  eid.setHTR(htr_cr, htr_slot, htr_tb);
388  DetId did = emap.lookup(eid);
389  if (!did.null()) {
390  if (did.det() == DetId::Hcal && ((HcalSubdetector)did.subdetId()) == HcalOuter) {
391  HcalDetId hid(did);
392  unrolled[linear].valid = true;
393  unrolled[linear].ieta = hid.ieta();
394  unrolled[linear].iphi = hid.iphi();
395  }
396  } else {
397  report.countUnmappedTPDigi(eid);
398  }
399  }
400  if (unrolled[linear].valid) {
401  if (isTPGSOI(*tp_work))
402  unrolled[linear].soi = unrolled[linear].samples;
403  if (tp_work->raw() & (1 << ibit))
404  unrolled[linear].setbit(unrolled[linear].samples);
405  unrolled[linear].samples++;
406  }
407  }
408  }
409  for (int i = 0; i < 24; i++) {
410  if (unrolled[i].valid)
411  colls.tphoCont->push_back(HOTriggerPrimitiveDigi(
412  unrolled[i].ieta, unrolled[i].iphi, unrolled[i].samples, unrolled[i].soi, unrolled[i].databits));
413  }
414  } else { // regular TPs (not HO)
415  for (tp_work = tp_begin; tp_work != tp_end; tp_work++) {
416  if (tp_work->raw() == 0xFFFF)
417  continue; // filler word
418  if (slbAndChan(tp_work->raw()) != currFiberChan) { // start new set
419  npre = 0;
420  currFiberChan = slbAndChan(tp_work->raw());
421  // lookup the right channel
422  HcalElectronicsId eid(slbChan(tp_work->raw()), slb(tp_work->raw()), spigot, dccid, htr_cr, htr_slot, htr_tb);
423  DetId did = emap.lookupTrigger(eid);
424  if (did.null()) {
425  report.countUnmappedTPDigi(eid);
426  if (unknownIdsTrig_.find(eid) == unknownIdsTrig_.end()) {
427  if (!silent)
428  edm::LogWarning("HCAL") << "HcalUnpacker: No trigger primitive match found for electronics id :" << eid;
429  unknownIdsTrig_.insert(eid);
430  }
431  valid = false;
432  continue;
433  } else if (did == HcalTrigTowerDetId::Undefined || (did.det() == DetId::Hcal && did.subdetId() == 0)) {
434  // known to be unmapped
435  valid = false;
436  continue;
437  }
438  HcalTrigTowerDetId id(did);
439  colls.tpCont->push_back(HcalTriggerPrimitiveDigi(id));
440  // set the various bits
441  if (!tpgSOIbitInUse)
442  colls.tpCont->back().setPresamples(nps);
443  colls.tpCont->back().setZSInfo(htr.isUnsuppressed(),
444  htr.wasMarkAndPassZSTP(slb(tp_work->raw()), slbChan(tp_work->raw())));
445 
446  // no hits recorded for current
447  ncurr = 0;
448  valid = true;
449  }
450  // add the word (if within settings or recent firmware [recent firmware ignores startSample/endSample])
451  if (valid && ((tpgSOIbitInUse && ncurr < 10) || (ncurr >= startSample_ && ncurr <= endSample_))) {
452  colls.tpCont->back().setSample(colls.tpCont->back().size(), *tp_work);
453  colls.tpCont->back().setSize(colls.tpCont->back().size() + 1);
454  }
455  // set presamples,if SOI
456  if (valid && tpgSOIbitInUse && isTPGSOI(*tp_work)) {
457  colls.tpCont->back().setPresamples(ncurr);
458  }
459  ncurr++;
460  npre++;
461  }
462  }
463 
466  qie_begin = (const HcalQIESample*)daq_first;
467  qie_end = (const HcalQIESample*)(daq_last + 1); // one beyond last..
468 
470 
471  for (qie_work = qie_begin; qie_work != qie_end;) {
472  if (qie_work->raw() == 0xFFFF) {
473  qie_work++;
474  continue; // filler word
475  }
476  // always at the beginning ...
477 
478  // lookup the right channel
479  HcalElectronicsId eid(qie_work->fiberChan(), qie_work->fiber(), spigot, dccid);
480  eid.setHTR(htr_cr, htr_slot, htr_tb);
481  DetId did = emap.lookup(eid);
482 
483  if (!did.null()) {
484  if (did.det() == DetId::Calo && did.subdetId() == HcalZDCDetId::SubdetectorId) {
485  colls.zdcCont->push_back(ZDCDataFrame(HcalZDCDetId(did)));
486  qie_work = HcalUnpacker_impl::unpack<ZDCDataFrame>(qie_work,
487  qie_end,
488  colls.zdcCont->back(),
489  nps,
490  eid,
491  startSample_,
492  endSample_,
494  htr);
495  } else if (did.det() == DetId::Hcal) {
496  switch (((HcalSubdetector)did.subdetId())) {
497  case (HcalBarrel):
498  case (HcalEndcap): {
499  colls.hbheCont->push_back(HBHEDataFrame(HcalDetId(did)));
500  qie_work = HcalUnpacker_impl::unpack<HBHEDataFrame>(qie_work,
501  qie_end,
502  colls.hbheCont->back(),
503  nps,
504  eid,
505  startSample_,
506  endSample_,
508  htr);
509  } break;
510  case (HcalOuter): {
511  colls.hoCont->push_back(HODataFrame(HcalDetId(did)));
512  qie_work = HcalUnpacker_impl::unpack<HODataFrame>(qie_work,
513  qie_end,
514  colls.hoCont->back(),
515  nps,
516  eid,
517  startSample_,
518  endSample_,
520  htr);
521  } break;
522  case (HcalForward): {
523  colls.hfCont->push_back(HFDataFrame(HcalDetId(did)));
524  qie_work = HcalUnpacker_impl::unpack<HFDataFrame>(qie_work,
525  qie_end,
526  colls.hfCont->back(),
527  nps,
528  eid,
529  startSample_,
530  endSample_,
532  htr);
533  } break;
534  case (HcalOther): {
535  HcalOtherDetId odid(did);
536  if (odid.subdet() == HcalCalibration) {
537  colls.calibCont->push_back(HcalCalibDataFrame(HcalCalibDetId(did)));
538  qie_work = HcalUnpacker_impl::unpack<HcalCalibDataFrame>(qie_work,
539  qie_end,
540  colls.calibCont->back(),
541  nps,
542  eid,
543  startSample_,
544  endSample_,
546  htr);
547  }
548  } break;
549  case (HcalEmpty):
550  default: {
551  for (int fiberC = qie_work->fiberAndChan(); qie_work != qie_end && qie_work->fiberAndChan() == fiberC;
552  qie_work++)
553  ;
554  } break;
555  }
556  }
557  } else {
558  report.countUnmappedDigi(eid);
559  if (unknownIds_.find(eid) == unknownIds_.end()) {
560  if (!silent)
561  edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
562  unknownIds_.insert(eid);
563  }
564  for (int fiberC = qie_work->fiberAndChan(); qie_work != qie_end && qie_work->fiberAndChan() == fiberC;
565  qie_work++)
566  ;
567  }
568  }
569  } else {
570  // this is the branch for unpacking the compact data format with per-channel headers
571  const unsigned short* ptr_header = daq_first;
572  const unsigned short* ptr_end = daq_last + 1;
573  int flavor, error_flags, capid0, channelid;
574 
575  while (ptr_header != ptr_end) {
576  if (*ptr_header == 0xFFFF) { // impossible filler word
577  ptr_header++;
578  continue;
579  }
580  // unpack the header word
581  bool isheader = HcalHTRData::unpack_per_channel_header(*ptr_header, flavor, error_flags, capid0, channelid);
582  if (!isheader) {
583  ptr_header++;
584  continue;
585  }
586 
587  int fiberchan = channelid & 0x3;
588  int fiber = ((channelid >> 2) & 0x7) + 1;
589 
590  // lookup the right channel
591  HcalElectronicsId eid(fiberchan, fiber, spigot, dccid);
592  eid.setHTR(htr_cr, htr_slot, htr_tb);
593  DetId did = emap.lookup(eid);
594 
595  if (!did.null()) {
596  if (did.det() == DetId::Calo && did.subdetId() == HcalZDCDetId::SubdetectorId) {
597  colls.zdcCont->push_back(ZDCDataFrame(HcalZDCDetId(did)));
598  ptr_header = HcalUnpacker_impl::unpack_compact<ZDCDataFrame>(ptr_header,
599  ptr_end,
600  colls.zdcCont->back(),
601  nps,
602  eid,
603  startSample_,
604  endSample_,
606  htr);
607  } else if (did.det() == DetId::Hcal) {
608  switch (((HcalSubdetector)did.subdetId())) {
609  case (HcalBarrel):
610  case (HcalEndcap): {
611  colls.hbheCont->push_back(HBHEDataFrame(HcalDetId(did)));
612  ptr_header = HcalUnpacker_impl::unpack_compact<HBHEDataFrame>(ptr_header,
613  ptr_end,
614  colls.hbheCont->back(),
615  nps,
616  eid,
617  startSample_,
618  endSample_,
620  htr);
621  } break;
622  case (HcalOuter): {
623  colls.hoCont->push_back(HODataFrame(HcalDetId(did)));
624  ptr_header = HcalUnpacker_impl::unpack_compact<HODataFrame>(ptr_header,
625  ptr_end,
626  colls.hoCont->back(),
627  nps,
628  eid,
629  startSample_,
630  endSample_,
632  htr);
633  } break;
634  case (HcalForward): {
635  colls.hfCont->push_back(HFDataFrame(HcalDetId(did)));
636  ptr_header = HcalUnpacker_impl::unpack_compact<HFDataFrame>(ptr_header,
637  ptr_end,
638  colls.hfCont->back(),
639  nps,
640  eid,
641  startSample_,
642  endSample_,
644  htr);
645  } break;
646  case (HcalOther): {
647  HcalOtherDetId odid(did);
648  if (odid.subdet() == HcalCalibration) {
649  colls.calibCont->push_back(HcalCalibDataFrame(HcalCalibDetId(did)));
650  ptr_header = HcalUnpacker_impl::unpack_compact<HcalCalibDataFrame>(ptr_header,
651  ptr_end,
652  colls.calibCont->back(),
653  nps,
654  eid,
655  startSample_,
656  endSample_,
658  htr);
659  }
660  } break;
661  case (HcalEmpty):
662  default: {
663  for (ptr_header++; ptr_header != ptr_end && !HcalHTRData::is_channel_header(*ptr_header); ptr_header++)
664  ;
665  } break;
666  }
667  }
668  } else {
669  report.countUnmappedDigi(eid);
670  if (unknownIds_.find(eid) == unknownIds_.end()) {
671  if (!silent)
672  edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
673  unknownIds_.insert(eid);
674  }
675  for (ptr_header++; ptr_header != ptr_end && !HcalHTRData::is_channel_header(*ptr_header); ptr_header++)
676  ;
677  }
678  }
679  }
680  }
681 }

References HcalUnpacker::Collections::calibCont, DetId::Calo, HcalHTRData::check(), HOUnrolledTP::checked, FEDRawData::data(), HcalHTRData::dataPointers(), DetId::det(), runTauDisplay::eid, endSample_, expectedOrbitMessageTime_, benchmark_cfg::fc, HcalQIESample::fiber(), HcalQIESample::fiberAndChan(), HcalQIESample::fiberChan(), HcalHTRData::FORMAT_VERSION_COMPACT_DATA, HcalDCCHeader::getDCCDataFormatVersion(), HcalHTRData::getFirmwareFlavor(), HcalHTRData::getFormatVersion(), HcalHTRData::getNPS(), HcalDTCHeader::getSlotCRCError(), HcalDTCHeader::getSlotData(), HcalDTCHeader::getSlotPresent(), HcalDCCHeader::getSourceId(), HcalDTCHeader::getSourceId(), HcalDCCHeader::getSpigotCRCError(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), HcalHTRData::getSubmodule(), HcalUnpacker::Collections::hbheCont, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalUnpacker::Collections::hfCont, HcalUnpacker::Collections::hoCont, mps_fire::i, triggerObjects_cff::id, LEDCalibrationChannels::ieta, HcalDetId::ieta(), HOUnrolledTP::ieta, LEDCalibrationChannels::iphi, HcalDetId::iphi(), HOUnrolledTP::iphi, HcalHTRData::is_channel_header(), HcalHTRData::isBusy(), HcalHTRData::isEmptyEvent(), HcalHTRData::isHistogramEvent(), HcalHTRData::isOverflowWarning(), isTPGSOI(), HcalHTRData::isUnsuppressed(), linear(), LogDebug, HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), HcalDTCHeader::MAXIMUM_SLOT, mode_, DetId::null(), HcalTriggerPrimitiveSample::raw(), HcalQIESample::raw(), edmIntegrityCheck::report, EgammaValidation_cff::samples, HOUnrolledTP::samples, HOUnrolledTP::setbit(), CastorRawToDigi_cfi::silent, FEDRawData::size(), slb(), slbAndChan(), slbChan(), HOUnrolledTP::soi, sourceIdOffset_, HcalDCCHeader::SPIGOT_COUNT, startSample_, HcalOtherDetId::subdet(), HcalZDCDetId::SubdetectorId, DetId::subdetId(), HcalUnpacker::Collections::tpCont, HcalUnpacker::Collections::tphoCont, HcalUnpacker::Collections::ttp, HcalTrigTowerDetId::Undefined, unknownIds_, unknownIdsTrig_, HcalTTPUnpacker::unpack(), HcalHTRData::unpack_per_channel_header(), validateGeometry_cfg::valid, HOUnrolledTP::valid, HcalHTRData::wasMarkAndPassZSTP(), testProducerWithPsetDescEmpty_cfi::x1, and HcalUnpacker::Collections::zdcCont.

Referenced by unpack().

Member Data Documentation

◆ endSample_

int HcalUnpacker::endSample_
private

last sample from fed raw data to copy (if present)

Definition at line 85 of file HcalUnpacker.h.

Referenced by unpackUTCA(), and unpackVME().

◆ expectedOrbitMessageTime_

int HcalUnpacker::expectedOrbitMessageTime_
private

Expected orbit bunch time (needed to evaluate time differences)

Definition at line 86 of file HcalUnpacker.h.

Referenced by setExpectedOrbitMessageTime(), and unpackVME().

◆ mode_

int HcalUnpacker::mode_
private

Definition at line 87 of file HcalUnpacker.h.

Referenced by setMode(), and unpackVME().

◆ nPrinted_

int HcalUnpacker::nPrinted_
private

Definition at line 91 of file HcalUnpacker.h.

Referenced by printInvalidDataMessage().

◆ sourceIdOffset_

int HcalUnpacker::sourceIdOffset_
private

number to subtract from the source id to get the dcc id

Definition at line 83 of file HcalUnpacker.h.

Referenced by unpack(), and unpackVME().

◆ startSample_

int HcalUnpacker::startSample_
private

first sample from fed raw data to copy

Definition at line 84 of file HcalUnpacker.h.

Referenced by unpackUTCA(), and unpackVME().

◆ unknownIds_

std::set<HcalElectronicsId> HcalUnpacker::unknownIds_
private

Definition at line 88 of file HcalUnpacker.h.

Referenced by unpack(), unpackUTCA(), and unpackVME().

◆ unknownIdsTrig_

std::set<HcalElectronicsId> HcalUnpacker::unknownIdsTrig_
private

Recorded to limit number of times a log message is generated.

Definition at line 88 of file HcalUnpacker.h.

Referenced by unpackUTCA(), and unpackVME().

HcalOther
Definition: HcalAssistant.h:38
HcalHTRData::getSubmodule
unsigned int getSubmodule() const
Get the HTR submodule number.
Definition: HcalHTRData.cc:355
HcalDTCHeader::MAXIMUM_SLOT
static const int MAXIMUM_SLOT
Definition: HcalDTCHeader.h:22
HcalUnpacker::unpackUMNio
void unpackUMNio(const FEDRawData &raw, int slot, Collections &colls)
Definition: HcalUnpacker.cc:1054
mps_fire.i
i
Definition: mps_fire.py:355
HcalDTCHeader::getSlotPresent
bool getSlotPresent(unsigned int nslot) const
Read the "PRESENT" bit for this slot.
Definition: HcalDTCHeader.h:85
HcalHTRData::unpackHistogram
bool unpackHistogram(int fiber, int fiberchan, int capid, unsigned short *histogram) const
Unpack special histogramming mode data.
Definition: HcalHTRData.cc:464
HcalHTRData::isHistogramEvent
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:409
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HcalTriggerPrimitiveSample
Definition: HcalTriggerPrimitiveSample.h:11
HcalDCCHeader::getDCCDataFormatVersion
short getDCCDataFormatVersion() const
Definition: HcalDCCHeader.h:59
HcalCalibDetId
Definition: HcalCalibDetId.h:45
slbAndChan
static int slbAndChan(uint16_t theSample)
Definition: HcalUnpacker.cc:230
HcalHTRData::isUnsuppressed
bool isUnsuppressed() const
Is this event an unsuppresed event?
Definition: HcalHTRData.cc:378
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HcalDTCHeader::getSlotData
int getSlotData(int nslot, HcalHTRData &decodeTool, int validSize) const
Definition: HcalDTCHeader.cc:22
gather_cfg.cout
cout
Definition: gather_cfg.py:144
isTPGSOI
static bool isTPGSOI(const HcalTriggerPrimitiveSample &s)
Definition: HcalUnpacker.cc:190
DetId::Hcal
Definition: DetId.h:28
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
edm::LogInfo
Definition: MessageLogger.h:254
HcalQIESample::raw
constexpr uint16_t raw() const
get the raw word
Definition: HcalQIESample.h:41
HcalUnpacker::printInvalidDataMessage
void printInvalidDataMessage(const std::string &coll_type, int default_ns, int conflict_ns, bool extended=false)
Definition: HcalUnpacker.cc:1070
HcalUnpacker::unknownIds_
std::set< HcalElectronicsId > unknownIds_
Definition: HcalUnpacker.h:88
amc13
Definition: AMC13Spec.h:14
DetId::null
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
HcalTTPDigi
Definition: HcalTTPDigi.h:12
HcalBarrel
Definition: HcalAssistant.h:33
HcalEmpty
Definition: HcalAssistant.h:32
HcalQIESample::fiberAndChan
constexpr int fiberAndChan() const
get the id channel
Definition: HcalQIESample.h:57
HOUnrolledTP
Definition: HcalUnpacker.cc:192
DetId::Calo
Definition: DetId.h:29
HcalHTRData::isOverflowWarning
bool isOverflowWarning() const
Definition: HcalHTRData.cc:115
HcalDCCHeader::SPIGOT_COUNT
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
HcalUnpacker::startSample_
int startSample_
first sample from fed raw data to copy
Definition: HcalUnpacker.h:84
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
HcalQIESample
Definition: HcalQIESample.h:32
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
QIE10DigiCollection
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
Definition: HcalDigiCollections.h:52
HcalHTRData::dataPointers
void dataPointers(const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
Obtain the starting and ending pointers for external unpacking of the data.
Definition: HcalHTRData.cc:161
end
#define end
Definition: vmac.h:39
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
HcalUnpacker::unpackUTCA
void unpackUTCA(const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
Definition: HcalUnpacker.cc:683
HcalElectronicsMap::lookupTrigger
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:80
HcalTTPUnpacker::unpack
bool unpack(const HcalHTRData &data, HcalTTPDigi &digi)
Definition: HcalTTPUnpacker.cc:3
HcalUnpacker::unpackVME
void unpackVME(const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
Definition: HcalUnpacker.cc:232
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HcalHTRData::wasMarkAndPassZSTP
bool wasMarkAndPassZSTP(int slb, int slbchan) const
Was this channel passed as part of Mark&Pass ZS?
Definition: HcalHTRData.cc:389
HcalTriggerPrimitiveSample::raw
uint16_t raw() const
get the raw word
Definition: HcalTriggerPrimitiveSample.h:19
HcalHTRData::unpack_per_channel_header
static bool unpack_per_channel_header(unsigned short, int &flav, int &error_flags, int &capid0, int &channelid)
Unpack a per-channel header word (compact format)
Definition: HcalHTRData.cc:455
DetId
Definition: DetId.h:17
HcalZDCDetId
Definition: HcalZDCDetId.h:16
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HcalDCCHeader::getSourceId
int getSourceId() const
Definition: HcalDCCHeader.h:32
HcalHTRData::getNPS
int getNPS() const
Get the number of presamples in daq data.
Definition: HcalHTRData.cc:426
HOTriggerPrimitiveDigi
Definition: HOTriggerPrimitiveDigi.h:15
HcalHTRData::getFirmwareFlavor
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalHTRData.cc:433
HcalHTRData::is_channel_header
static bool is_channel_header(unsigned short value)
check top bit to see if this is a compact format channel header word
Definition: HcalHTRData.h:92
HcalDCCHeader::getSpigotCRCError
bool getSpigotCRCError(unsigned int nspigot) const
Read the "CRC-Mismatch" bit for this spigot.
Definition: HcalDCCHeader.h:122
HcalDTCHeader::getSlotCRCError
bool getSlotCRCError(unsigned int nslot) const
Read the "CRC-Mismatch" bit for this slot.
Definition: HcalDTCHeader.h:93
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
HcalHTRData::getFormatVersion
int getFormatVersion() const
Get the version number of this event.
Definition: HcalHTRData.h:36
HcalQIESample::fiber
constexpr int fiber() const
get the fiber number
Definition: HcalQIESample.h:53
HcalDCCHeader::BOEshouldBeZeroAlways
short BOEshouldBeZeroAlways() const
Definition: HcalDCCHeader.h:50
benchmark_cfg.fc
fc
Definition: benchmark_cfg.py:15
HcalOuter
Definition: HcalAssistant.h:35
HOUnrolledTP::soi
int soi
Definition: HcalUnpacker.cc:194
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
ZDCDataFrame
Definition: ZDCDataFrame.h:15
HcalUMNioDigi
Definition: HcalUMNioDigi.h:15
HcalUnpacker::unknownIdsTrig_
std::set< HcalElectronicsId > unknownIdsTrig_
Recorded to limit number of times a log message is generated.
Definition: HcalUnpacker.h:88
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HcalUnpacker::mode_
int mode_
Definition: HcalUnpacker.h:87
HOUnrolledTP::checked
bool checked
Definition: HcalUnpacker.cc:193
HOUnrolledTP::valid
bool valid
Definition: HcalUnpacker.cc:193
edm::LogWarning
Definition: MessageLogger.h:141
HBHEDataFrame
Definition: HBHEDataFrame.h:14
HcalCalibDataFrame
Definition: HcalCalibDataFrame.h:15
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalUnpacker::nPrinted_
int nPrinted_
Definition: HcalUnpacker.h:91
HcalTriggerPrimitiveDigi
Definition: HcalTriggerPrimitiveDigi.h:13
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
HcalUHTRData
Definition: HcalUHTRData.h:16
HcalTrigTowerDetId::Undefined
static const HcalTrigTowerDetId Undefined
Definition: HcalTrigTowerDetId.h:62
HcalQIESample::fiberChan
constexpr int fiberChan() const
get the fiber channel number
Definition: HcalQIESample.h:55
HcalDetId
Definition: HcalDetId.h:12
HFDataFrame
Definition: HFDataFrame.h:14
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
HcalHTRData::getHistogramFibers
void getHistogramFibers(int &a, int &b) const
Get the fiber numbers for the data present in this event (only in histogram mode!)
Definition: HcalHTRData.cc:435
HcalUnpacker::expectedOrbitMessageTime_
int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
Definition: HcalUnpacker.h:86
HOUnrolledTP::iphi
int iphi
Definition: HcalUnpacker.cc:194
HcalHTRData::isBusy
bool isBusy() const
Definition: HcalHTRData.cc:123
QIE11DigiCollection
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
Definition: HcalDigiCollections.h:53
HcalCalibDetId::calibFlavor
CalibDetType calibFlavor() const
get the flavor of this calibration detid
Definition: HcalCalibDetId.h:77
CastorRawToDigi_cfi.silent
silent
Definition: CastorRawToDigi_cfi.py:27
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
edmIntegrityCheck.report
report
Definition: edmIntegrityCheck.py:349
HcalDCCHeader::getSpigotPresent
bool getSpigotPresent(unsigned int nspigot) const
Read the "PRESENT" bit for this spigot.
Definition: HcalDCCHeader.h:106
HcalDCCHeader
Definition: HcalDCCHeader.h:17
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
slb
static int slb(uint16_t theSample)
Definition: HcalUnpacker.cc:228
HcalUHTRData::const_iterator
Definition: HcalUHTRData.h:43
linear
float linear(float x)
Definition: OccupancyPlotMacros.cc:26
HOUnrolledTP::ieta
int ieta
Definition: HcalUnpacker.cc:194
HOUnrolledTP::samples
int samples
Definition: HcalUnpacker.cc:194
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
HcalElectronicsMap::lookup
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:70
HcalEndcap
Definition: HcalAssistant.h:34
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HODataFrame
Definition: HODataFrame.h:14
HcalOtherDetId
Definition: HcalOtherDetId.h:22
HcalHTRData::isEmptyEvent
bool isEmptyEvent() const
Definition: HcalHTRData.cc:107
hcal::AMC13Header
Definition: AMC13Header.h:12
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
HcalUnpacker::sourceIdOffset_
int sourceIdOffset_
number to subtract from the source id to get the dcc id
Definition: HcalUnpacker.h:83
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
HcalHistogramDigi::getArray
uint16_t * getArray(int capid)
get the array for the specified capid
Definition: HcalHistogramDigi.cc:24
HcalHistogramDigi
Definition: HcalHistogramDigi.h:12
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HcalHTRData::FORMAT_VERSION_COMPACT_DATA
static const int FORMAT_VERSION_COMPACT_DATA
Definition: HcalHTRData.h:20
HcalTTPUnpacker
Definition: HcalTTPUnpacker.h:11
HcalUnpacker::endSample_
int endSample_
last sample from fed raw data to copy (if present)
Definition: HcalUnpacker.h:85
ntuplemaker.time
time
Definition: ntuplemaker.py:310
HcalHTRData
Definition: HcalHTRData.h:16
slbChan
static int slbChan(uint16_t theSample)
Definition: HcalUnpacker.cc:229
HcalDTCHeader::getSourceId
int getSourceId() const
Definition: HcalDTCHeader.h:35
HcalDCCHeader::getSpigotData
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
Definition: HcalDCCHeader.cc:27
HOUnrolledTP::setbit
void setbit(int i)
Definition: HcalUnpacker.cc:205
HcalDTCHeader
Definition: HcalDTCHeader.h:18
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14
HcalHTRData::check
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event.
Definition: HcalHTRData.cc:63