117 map<int, unique_ptr<HCalFED>> fedMap;
124 if (qie10DigiCollection.
isValid()) {
126 for (
unsigned int j = 0;
j < qie10dc.
size();
j++) {
130 int crateId =
eid.crateId();
131 int slotId =
eid.slot();
132 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
140 if (!uhtrs.
exist(uhtrIndex)) {
151 if (qie11DigiCollection.
isValid()) {
153 for (
unsigned int j = 0;
j < qie11dc.
size();
j++) {
157 int crateId =
eid.crateId();
158 int slotId =
eid.slot();
159 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
166 if (!uhtrs.
exist(uhtrIndex)) {
176 if (hfDigiCollection.
isValid()) {
182 int crateId =
eid.crateId();
183 int slotId =
eid.slot();
184 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
187 if (!uhtrs.
exist(uhtrIndex)) {
197 if (hbheDigiCollection.
isValid()) {
203 int crateId =
eid.crateId();
204 int slotId =
eid.slot();
205 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
208 if (!uhtrs.
exist(uhtrIndex)) {
224 int crateId =
eid.crateId();
225 int slotId =
eid.slot();
226 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
227 int ilink =
eid.fiberIndex();
228 int itower =
eid.fiberChanId();
229 int channelid = (itower & 0xF) | ((ilink & 0xF) << 4);
232 if (!uhtrs.
exist(uhtrIndex)) {
244 for (UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin(); uhtr != uhtrs.
uhtrs.end(); ++uhtr) {
245 uint64_t crateId = (uhtr->first) & 0xFF;
246 uint64_t slotId = (uhtr->first & 0xF00) >> 8;
250 if (fedMap.find(
fedId) == fedMap.end()) {
255 fedMap[
fedId]->addUHTR(uhtr->second, crateId, slotId);
263 for (
map<
int, unique_ptr<HCalFED>>::iterator fed = fedMap.begin(); fed != fedMap.end(); ++fed) {
264 int fedId = fed->first;
267 fed->second->formatFEDdata(
rawData);
constexpr DetId detid() const
Get the detector id.
constexpr edm::DataFrame::id_type id() const
const edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
QIE11DataFrame convertHB(QIE11DataFrame qiehe, std::vector< int > const &tdc1, std::vector< int > const &tdc2, const int tdcmax)
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
std::vector< T >::const_iterator const_iterator
static constexpr int tdcmax_
constexpr int presamples() const
for backward compatibility
constexpr DetId detid() const
Get the detector id.
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
const edm::ESGetToken< HcalElectronicsMap, HcalElectronicsMapRcd > tok_electronicsMap_
const_iterator begin() const
constexpr int presamples() const
for backward compatibility
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const_iterator end() const
unsigned long long uint64_t
constexpr uint32_t rawId() const
get the raw id
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
bool exist(int uhtrIndex)
const vector< int > tdc1_
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Readout chain identification for Hcal.
const edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_
const edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
const edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
const vector< int > tdc2_
const edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_