57 static constexpr
int tdcmax_ = 49;
70 : _verbosity(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
71 tdc1_(iConfig.getParameter<
vector<
int>>(
"tdc1")),
72 tdc2_(iConfig.getParameter<
vector<
int>>(
"tdc2")),
73 packHBTDC_(iConfig.getParameter<
bool>(
"packHBTDC")),
74 tok_QIE10DigiCollection_(
76 tok_QIE11DigiCollection_(
83 premix_(iConfig.getParameter<
bool>(
"premix")) {
84 produces<FEDRawDataCollection>(
"");
85 for (
size_t i = 0;
i <
tdc1_.size();
i++) {
88 <<
" incorrect TDC ranges " <<
i <<
"-th element: " <<
tdc1_.at(
i) <<
", " <<
tdc2_.at(
i) <<
", " <<
tdcmax_;
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()) {
179 DetId detid = qiedf->id();
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()) {
200 DetId detid = qiedf->id();
203 int crateId =
eid.crateId();
204 int slotId =
eid.slot();
205 int uhtrIndex = (crateId & 0xFF) | ((slotId & 0xF) << 8);
208 if (!uhtrs.
exist(uhtrIndex)) {
221 DetId detid = qiedf->id();
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)) {
245 for (UHTRpacker::UHTRMap::iterator uhtr = uhtrs.
uhtrs.begin(); uhtr != uhtrs.
uhtrs.end(); ++uhtr) {
248 uint64_t crateId = (uhtr->first) & 0xFF;
249 uint64_t slotId = (uhtr->first & 0xF00) >> 8;
253 if (fedMap.find(
fedId) == fedMap.end()) {
258 fedMap[
fedId]->addUHTR(uhtr->second, crateId, slotId);
266 for (
map<
int, unique_ptr<HCalFED>>::iterator fed = fedMap.begin(); fed != fedMap.end(); ++fed) {
267 int fedId = fed->first;
270 fed->second->formatFEDdata(
rawData);
291 desc.addUntracked<
int>(
"Verbosity", 0);
292 desc.add<vector<int>>(
"tdc1", {8, 14, 15, 17, 8, 14, 15, 17, 8, 14, 14, 17, 8, 14, 14, 17, 8, 13, 14, 16, 8, 13,
293 14, 16, 8, 12, 14, 15, 8, 12, 14, 15, 7, 12, 13, 15, 7, 12, 13, 15, 7, 12, 13, 15,
294 7, 12, 13, 15, 7, 11, 12, 14, 7, 11, 12, 14, 7, 11, 12, 14, 7, 11, 12, 7});
295 desc.add<vector<int>>(
"tdc2", {10, 16, 17, 19, 10, 16, 17, 19, 10, 16, 16, 19, 10, 16, 16, 19, 10, 15, 16, 18, 10, 15,
296 16, 18, 10, 14, 16, 17, 10, 14, 16, 17, 9, 14, 15, 17, 9, 14, 15, 17, 9, 14, 15, 17,
297 9, 14, 15, 17, 9, 13, 14, 16, 9, 13, 14, 16, 9, 13, 14, 16, 9, 13, 14, 9});
298 desc.add<
bool>(
"packHBTDC",
true);
305 desc.add<
bool>(
"premix",
false);
306 descriptions.
add(
"hcalDigiToRawuHTR",
desc);