54 static constexpr
int tdcmax_ = 49;
67 : _verbosity(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
68 tdc1_(iConfig.getParameter<
int>(
"tdc1")),
69 tdc2_(iConfig.getParameter<
int>(
"tdc2")),
70 packHBTDC_(iConfig.getParameter<
bool>(
"packHBTDC")),
71 electronicsMapLabel_(iConfig.getParameter<
std::
string>(
"ElectronicsMap")),
72 tok_QIE10DigiCollection_(
74 tok_QIE11DigiCollection_(
79 premix_(iConfig.getParameter<
bool>(
"premix")) {
80 produces<FEDRawDataCollection>(
"");
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)) {
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)) {
170 if (hfDigiCollection.
isValid()) {
173 DetId detid = qiedf->id();
176 int crateId =
eid.crateId();
177 int slotId =
eid.slot();
178 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
181 if (!uhtrs.
exist(uhtrIndex)) {
191 if (hbheDigiCollection.
isValid()) {
194 DetId detid = qiedf->id();
197 int crateId =
eid.crateId();
198 int slotId =
eid.slot();
199 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
202 if (!uhtrs.
exist(uhtrIndex)) {
215 DetId detid = qiedf->id();
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)) {
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;
264 fed->second->formatFEDdata(
rawData);
286 desc.
add<
int>(
"tdc1", 4);
287 desc.
add<
int>(
"tdc2", 20);
288 desc.
add<
bool>(
"packHBTDC",
false);
295 desc.
add<
bool>(
"premix",
false);
296 descriptions.
add(
"hcalDigiToRawuHTR", desc);