57 static constexpr
int tdcmax_ = 49;
71 : _verbosity(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
72 tdc1_(iConfig.getParameter<
int>(
"tdc1")),
73 tdc2_(iConfig.getParameter<
int>(
"tdc2")),
74 packHBTDC_(iConfig.getParameter<
bool>(
"packHBTDC")),
75 electronicsMapLabel_(iConfig.getParameter<
std::
string>(
"ElectronicsMap")),
76 tok_QIE10DigiCollection_(
78 tok_QIE11DigiCollection_(
85 premix_(iConfig.getParameter<
bool>(
"premix")) {
86 produces<FEDRawDataCollection>(
"");
116 map<int, unique_ptr<HCalFED> > fedMap;
123 if (qie10DigiCollection.
isValid()) {
125 for (
unsigned int j = 0;
j < qie10dc.
size();
j++) {
129 int crateId =
eid.crateId();
130 int slotId =
eid.slot();
131 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
139 if (!uhtrs.
exist(uhtrIndex)) {
150 if (qie11DigiCollection.
isValid()) {
152 for (
unsigned int j = 0;
j < qie11dc.
size();
j++) {
156 int crateId =
eid.crateId();
157 int slotId =
eid.slot();
158 int uhtrIndex = ((slotId & 0xF) << 8) | (crateId & 0xFF);
165 if (!uhtrs.
exist(uhtrIndex)) {
175 if (hfDigiCollection.
isValid()) {
178 DetId detid = qiedf->id();
181 int crateId =
eid.crateId();
182 int slotId =
eid.slot();
183 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
186 if (!uhtrs.
exist(uhtrIndex)) {
196 if (hbheDigiCollection.
isValid()) {
199 DetId detid = qiedf->id();
202 int crateId =
eid.crateId();
203 int slotId =
eid.slot();
204 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
207 if (!uhtrs.
exist(uhtrIndex)) {
220 DetId detid = qiedf->id();
223 int crateId =
eid.crateId();
224 int slotId =
eid.slot();
225 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
226 int ilink =
eid.fiberIndex();
227 int itower =
eid.fiberChanId();
228 int channelid = (itower & 0xF) | ((ilink & 0xF) << 4);
231 if (!uhtrs.
exist(uhtrIndex)) {
244 for (UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin(); uhtr != uhtrs.
uhtrs.end(); ++uhtr) {
247 uint64_t crateId = (uhtr->first) & 0xFF;
248 uint64_t slotId = (uhtr->first & 0xF00) >> 8;
252 if (fedMap.find(
fedId) == fedMap.end()) {
257 fedMap[
fedId]->addUHTR(uhtr->second, crateId, slotId);
265 for (
map<
int, unique_ptr<HCalFED> >::iterator fed = fedMap.begin(); fed != fedMap.end(); ++fed) {
266 int fedId = fed->first;
269 fed->second->formatFEDdata(
rawData);
290 desc.addUntracked<
int>(
"Verbosity", 0);
291 desc.add<
int>(
"tdc1", 4);
292 desc.add<
int>(
"tdc2", 20);
293 desc.add<
bool>(
"packHBTDC",
false);
300 desc.add<
bool>(
"premix",
false);
301 descriptions.
add(
"hcalDigiToRawuHTR",
desc);