111 map<int, unique_ptr<HCalFED> > fedMap;
118 if (qie10DigiCollection.
isValid()) {
120 for (
unsigned int j = 0;
j < qie10dc.
size();
j++) {
124 int crateId =
eid.crateId();
125 int slotId =
eid.slot();
126 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
134 if (!uhtrs.
exist(uhtrIndex)) {
135 uhtrs.
newUHTR(uhtrIndex, presamples);
145 if (qie11DigiCollection.
isValid()) {
147 for (
unsigned int j = 0;
j < qie11dc.
size();
j++) {
151 int crateId =
eid.crateId();
152 int slotId =
eid.slot();
153 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
160 if (!uhtrs.
exist(uhtrIndex)) {
161 uhtrs.
newUHTR(uhtrIndex, presamples);
170 if (hfDigiCollection.
isValid()) {
176 int crateId =
eid.crateId();
177 int slotId =
eid.slot();
178 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
181 if (!uhtrs.
exist(uhtrIndex)) {
182 uhtrs.
newUHTR(uhtrIndex, presamples);
191 if (hbheDigiCollection.
isValid()) {
197 int crateId =
eid.crateId();
198 int slotId =
eid.slot();
199 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
202 if (!uhtrs.
exist(uhtrIndex)) {
203 uhtrs.
newUHTR(uhtrIndex, presamples);
212 if (tpDigiCollection.
isValid()) {
218 int crateId =
eid.crateId();
219 int slotId =
eid.slot();
220 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
221 int ilink =
eid.fiberIndex();
222 int itower =
eid.fiberChanId();
223 int channelid = (itower & 0xF) | ((ilink & 0xF) << 4);
226 if (!uhtrs.
exist(uhtrIndex)) {
227 uhtrs.
newUHTR(uhtrIndex, presamples);
239 for (UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin(); uhtr != uhtrs.
uhtrs.end(); ++uhtr) {
242 uint64_t crateId = (uhtr->first) & 0xFF;
243 uint64_t slotId = (uhtr->first & 0xF00) >> 8;
247 if (fedMap.find(fedId) == fedMap.end()) {
249 fedMap[
fedId] = std::unique_ptr<HCalFED>(
252 fedMap[
fedId]->addUHTR(uhtr->second, crateId, slotId);
260 for (
map<
int, unique_ptr<HCalFED> >::iterator fed = fedMap.begin(); fed != fedMap.end(); ++fed) {
261 int fedId = fed->first;
263 auto&
rawData = fed_buffers->FEDData(fedId);
264 fed->second->formatFEDdata(
rawData);
DetId detid() const
Get the detector id.
EventNumber_t event() const
edm::EDGetTokenT< HBHEDigiCollection > tok_HBHEDigiCollection_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int presamples() const
for backward compatibility
constexpr uint32_t rawId() const
get the raw id
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
QIE11DataFrame convertHB(QIE11DataFrame qiehe, int tdc1, int tdc2, int tdcmax)
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
edm::EDGetTokenT< HcalDataFrameContainer< QIE10DataFrame > > tok_QIE10DigiCollection_
std::string electronicsMapLabel_
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
edm::EDGetTokenT< HFDigiCollection > tok_HFDigiCollection_
edm::DataFrame::id_type id() const
DetId detid() const
Get the detector id.
const_iterator end() const
unsigned long long uint64_t
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
int presamples() const
for backward compatibility
bool exist(int uhtrIndex)
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
T const * product() const
Readout chain identification for Hcal.
edm::EDGetTokenT< HcalTrigPrimDigiCollection > tok_TPDigiCollection_
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
const_iterator begin() const
edm::EDGetTokenT< HcalDataFrameContainer< QIE11DataFrame > > tok_QIE11DigiCollection_