56 return StatusCode::SUCCESS ;
84 ATH_CHECK(topoData.
record(std::make_unique<JetCMXTopoDataCollection>()));
88 std::vector< std::vector<int> > crateHits;
89 std::vector<int> Hits;
91 bool jetOverflow =
false;
96 for (
int crate = 0; crate < 2; ++crate) {
97 crateHits[crate].resize(25);
102 for (
int crate = 0; crate < 2; ++crate) {
103 topoData->
push_back(std::make_unique<JetCMXTopoData>(crate));
111 int crate = bpData->crate();
112 std::vector<unsigned int> tobWords = bpData->TopoTOBs();
115 bool overflow = bpData->overflow();
117 (*topoData)[crate]->setOverflow(
true);
121 for (std::vector<unsigned int>::const_iterator word = tobWords.begin();
122 word != tobWords.end(); ++word) {
125 (*topoData)[crate]->addTOB( (*word) );
130 int ieta = 2*(etaindex-15) + (etaindex > 15 ? 0 : -1);
131 if (etaindex < 2 || etaindex > 28) {
132 if (etaindex == 0) ieta = -40;
133 else if (etaindex == 1) ieta = -30;
134 else if (etaindex == 29) ieta = 29;
135 else if (etaindex >= 30) ieta = 39;
137 int iphi = tob.
iphi();
138 if (iphi < 0) iphi += 64;
143 float jepScale = l1Menu->thrExtraInfo().JET().jetScale();
145 std::vector<std::shared_ptr<TrigConf::L1Threshold>> allThresholds = l1Menu->thresholds();
147 for (
const auto&
thresh : allThresholds ) {
151 int etCut =
thresh->thrValue(ieta)*jepScale;
152 if (etLarge > etCut) {
155 if (
num < 10 && crateHits[crate][
num] < 7 ) crateHits[crate][
num]++;
156 else if (
num >= 10 && crateHits[crate][
num] < 3 ) crateHits[crate][
num]++;
157 if (
num < 10 && Hits[
num] < 7 ) Hits[
num]++;
158 else if (
num >= 10 && Hits[
num] < 3 ) Hits[
num]++;
169 unsigned int cableWord0 = 0;
170 unsigned int cableWord1 = 0;
173 for (
int i = 0;
i < 10; ++
i) cableWord0 |= ( Hits[
i]<<(3*
i) );
174 for (
int i = 10;
i < 25; ++
i) cableWord1 |= ( Hits[
i]<<(2*(
i-10)) );
177 cableWord0 = 0x3fffffff;
178 cableWord1 = 0x3fffffff;
182 ATH_CHECK(jetCTP.
record(std::make_unique<JetCTP>(cableWord0, cableWord1)));
185 std::vector<int> error0;
186 std::vector<int> error1;
189 std::vector<unsigned int> cratehits0;
190 std::vector<unsigned int> cratehits1;
192 const int system_crate = 1;
195 for (
int crate = 0; crate < 2; ++crate) {
197 cratehits0.assign(1,0);
198 cratehits1.assign(1,0);
199 for (
int i = 0;
i < 5; ++
i) {
200 cratehits0[0] |= ( crateHits[crate][
i]<<(3*
i) );
201 cratehits1[0] |= ( crateHits[crate][
i+5]<<(3*
i) );
204 cratehits0, cratehits1, error0, error1, peak));
205 if (crate != system_crate) {
207 cratehits0, cratehits1, error0, error1, peak));
210 cratehits0.assign(1,0);
211 cratehits1.assign(1,0);
212 for (
int i = 0;
i < 8; ++
i) cratehits0[0] |= ( crateHits[crate][
i+10]<<(2*
i) );
213 for (
int i = 0;
i < 7; ++
i) cratehits1[0] |= ( crateHits[crate][
i+18]<<(2*
i) );
215 cratehits0, cratehits1, error0, error1, peak));
216 if (crate != system_crate) {
218 cratehits0, cratehits1, error0, error1, peak));
223 cratehits0.assign(1,0);
224 cratehits1.assign(1,0);
225 for (
int i = 0;
i < 5; ++
i) {
226 cratehits0[0] |= ( Hits[
i]<<(3*
i) );
227 cratehits1[0] |= ( Hits[
i+5]<<(3*
i) );
230 cratehits0, cratehits1, error0, error1, peak));
232 cratehits0.assign(1,0);
233 cratehits1.assign(1,0);
234 for (
int i = 0;
i < 8; ++
i) cratehits0[0] |= ( Hits[
i+10]<<(2*
i) );
235 for (
int i = 0;
i < 7; ++
i) cratehits1[0] |= ( Hits[
i+18]<<(2*
i) );
237 cratehits0, cratehits1, error0, error1, peak));
246 return StatusCode::SUCCESS ;