19 void endJob()
override;
24 typedef std::map<HcalDetId, SampleSet>
PathSet;
25 typedef std::map<HcalDetId, HcalElectronicsId>
IdMap;
35 template <
class DigiCollection>
37 for (
typename DigiCollection::const_iterator digi = digis.begin(); digi != digis.end(); digi++) {
39 for (
int i = 0;
i < digi->size();
i++)
40 q.push_back(digi->sample(
i));
42 if (fullHistory_.find(digi->id()) == fullHistory_.end())
43 fullHistory_.insert(std::pair<
HcalDetId, std::vector<SampleSet>>(digi->id(), std::vector<SampleSet>()));
44 if (IdSet.find(digi->id()) == IdSet.end())
45 IdSet.insert(std::pair<HcalDetId, HcalElectronicsId>(digi->id(),
HcalElectronicsId()));
46 fullHistory_[digi->id()].push_back(
q);
47 IdSet[digi->id()] = digi->elecId();
58 constexpr
char const *
det_names[] = {
"Zero",
"HcalBarrel",
"HcalEndcap",
"HcalForward",
"HcalOuter"};
61 PathSet::const_iterator iii;
62 IdMap::const_iterator ij;
64 for (iii = ps.begin(); iii != ps.end(); iii++) {
72 int ieta = ((
ss[1].adc()) & 0x3F);
73 int z_ieta = (((
ss[1].adc()) >> 6) & 0x1);
74 int iphi = ((
ss[2].adc()) & 0x7F);
75 int depth = ((
ss[3].adc()) & 0x7);
76 int det = (((
ss[3].adc()) >> 3) & 0xF);
77 int spigot = ((
ss[4].adc()) & 0xF);
78 int fiber = (((
ss[4].adc()) >> 4) & 0x7);
79 int crate = ((
ss[5].adc()) & 0x1F);
80 int fiber_chan = (((
ss[5].adc()) >> 5) & 0x3);
81 int G_Dcc = ((
ss[6].adc()) & 0x3F);
82 int H_slot = ((
ss[7].adc()) & 0x1F);
83 int TB = (((
ss[7].adc()) >> 5) & 0x1);
84 int RBX_7 = (((
ss[7].adc()) >> 6) & 0x1);
85 int RBX = ((
ss[8].adc()) & 0x7F);
86 int RM = ((
ss[9].adc()) & 0x3);
87 int RM_card = (((
ss[9].adc()) >> 2) & 0x3);
88 int RM_chan = (((
ss[9].adc()) >> 4) & 0x7);
91 if (det > 4 || det < 0) {
93 snprintf(
c, 20,
"Det=%d", det);
106 if ((spigot ==
eid.spigot()) && (fiber + 1 ==
eid.fiberIndex()) && (fiber_chan ==
eid.fiberChanId()) &&
107 (H_slot ==
eid.htrSlot()) && (G_Dcc ==
eid.dccid()) && (crate ==
eid.readoutVMECrateId()) &&
109 (det ==
dd.subdet())) {
110 std::cout <<
"Pathway match" << std::endl;
112 is_header =
" Header found";
114 std::cout <<
" Digi ID: " <<
dd << is_header <<
" ieta: " << eta_sign <<
ieta <<
" iphi: " <<
iphi
115 <<
" Depth: " <<
depth <<
" Detector: " << det_name <<
" Spigot: " << spigot <<
"/" <<
eid.spigot()
116 <<
" Fiber: " << fiber + 1 <<
"/" <<
eid.fiberIndex() <<
" Fiber Channel: " << fiber_chan <<
"/"
117 <<
eid.fiberChanId() <<
" Crate: " << crate <<
"/" <<
eid.readoutVMECrateId()
118 <<
" Global Dcc: " << G_Dcc <<
"/" <<
eid.dccid() <<
" HTR Slot: " << H_slot <<
"/ " <<
eid.htrSlot()
119 <<
" Top/Bottom: " << TB <<
"/" <<
eid.htrTopBottom() <<
" RBX: " << (RBX_7 * 128 + RBX)
120 <<
" RM: " << RM + 1 <<
" RM Card: " << RM_card + 1 <<
" RM Channel: " << RM_chan << std::endl;
122 }
else if (
ieta + 64 == 0x75) {
123 ieta = ((
ss[2].adc()) & 0x3F);
124 z_ieta = (((
ss[2].adc()) >> 6) & 0x1);
125 iphi = ((
ss[3].adc()) & 0x7F);
127 det = (((
ss[4].adc()) >> 3) & 0xF);
128 spigot = ((
ss[5].adc()) & 0xF);
129 fiber = (((
ss[5].adc()) >> 4) & 0x7);
130 crate = ((
ss[6].adc()) & 0x1F);
131 fiber_chan = (((
ss[6].adc()) >> 5) & 0x3);
132 G_Dcc = ((
ss[7].adc()) & 0x3F);
133 H_slot = ((
ss[8].adc()) & 0x1F);
134 TB = (((
ss[8].adc()) >> 5) & 0x1);
135 RBX_7 = (((
ss[8].adc()) >> 6) & 0x1);
136 RBX = ((
ss[9].adc()) & 0x7F);
139 if ((spigot ==
eid.spigot()) && (fiber + 1 ==
eid.fiberIndex()) && (fiber_chan ==
eid.fiberChanId()) &&
140 (H_slot ==
eid.htrSlot()) && (G_Dcc ==
eid.dccid()) && (TB ==
eid.htrTopBottom()) &&
141 (crate ==
eid.readoutVMECrateId()) && (
iphi ==
dd.iphi()) && (
depth ==
dd.depth()) && (det ==
dd.subdet()) &&
144 std::cout <<
"Pathway match (SHIFT)" << std::endl;
146 is_header =
" DATA SHIFT";
148 std::cout <<
" Digi ID: " <<
dd << is_header <<
" ieta: " << eta_sign <<
ieta <<
" iphi: " <<
iphi
149 <<
" Depth: " <<
depth <<
" Detector: " << det_name <<
" Spigot: " << spigot <<
"/" <<
eid.spigot()
150 <<
" Fiber: " << fiber + 1 <<
"/" <<
eid.fiberIndex() <<
" Fiber Channel: " << fiber_chan <<
"/"
151 <<
eid.fiberChanId() <<
" Crate: " << crate <<
"/" <<
eid.readoutVMECrateId()
152 <<
" Global Dcc: " << G_Dcc <<
"/" <<
eid.dccid() <<
" HTR Slot: " << H_slot <<
"/ " <<
eid.htrSlot()
153 <<
" Top/Bottom: " << TB <<
"/" <<
eid.htrTopBottom() <<
" RBX: " << (RBX_7 * 128 + RBX) << std::endl;
157 <<
" RBX: " << (RBX_7 * 128 + RBX) << std::endl;
164 e.getByToken(tok_hbhe_,
hbhe);
167 e.getByToken(tok_hf_,
hf);
169 e.getByToken(tok_ho_,
ho);
177 std::vector<SampleSet>::iterator
j;
182 std::map<HcalDetId, std::vector<SampleSet>>::iterator
i;
186 for (
i = fullHistory_.begin();
i != fullHistory_.end();
i++) {
190 for (
k = 0;
k < 10;
k++) {
191 for (
ii = 0;
ii < 128;
ii++)
194 for (
j =
i->second.begin();
j !=
i->second.end();
j++) {
195 if (
int(
j->size()) >
k)
200 for (
kk = 0;
kk < 128;
kk++) {
201 if (
c[
kk] >
c[c_max]) {
206 s.push_back(((c_max & 0x7F)));
210 consensus[
i->first] =
s;