ATLAS Offline Software
Loading...
Searching...
No Matches
L1CPCMXTools.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <map>
6#include <memory>
7#include <numeric>
8#include <utility> // Temporary
9
13#include "TrigConfL1Data/Menu.h"
18#include "L1CPCMXTools.h"
25
26namespace LVL1 {
27
29
30L1CPCMXTools::L1CPCMXTools(const std::string &type, const std::string &name,
31 const IInterface *parent)
32 : AthAlgTool(type, name, parent),
33 m_crates(4),
34 m_modules(14), m_maxTobs(5), m_sysCrate(3), m_debug(false) {
35 declareInterface<IL1CPCMXTools>(this);
36
37}
38
40
42 m_debug = msgLvl(MSG::DEBUG);
43
44 return StatusCode::SUCCESS;
45}
46
48
49std::pair<uint32_t, uint32_t> L1CPCMXTools::roiWord(const EmTauROI *roi) const {
50 const uint32_t oldRoi = roi->roiWord();
51 CPRoIDecoder decoder;
52 const int crate = decoder.crate(oldRoi);
53 const int module = decoder.module(oldRoi);
54 const int chip = decoder.chip(oldRoi);
55 const int coord = decoder.localcoord(oldRoi);
56 bool em = false;
57 bool tau = false;
58 for (unsigned int thresh = 1; thresh <= TrigT1CaloDefs::numOfCPThresholds;
59 ++thresh) {
60 if (roi->thresholdPassed(thresh)) {
61 if (roi->thresholdType(thresh) == TrigT1CaloDefs::EMAlg)
62 em = true;
63 else
64 tau = true;
65 }
66 }
67 uint32_t emRoi = 0;
68 uint32_t tauRoi = 0;
69 if (em) {
70 int isolation =
73 const CPMTobRoI newRoi(crate, module, chip, coord, 0, roi->clusterEnergy(),
74 isolation);
75 emRoi = newRoi.roiWord();
76 }
77 if (tau) {
78 int isolation =
81 const CPMTobRoI newRoi(crate, module, chip, coord, 1,
82 roi->tauClusterEnergy(), isolation);
83 tauRoi = newRoi.roiWord();
84 }
85 return std::make_pair(emRoi, tauRoi);
86}
87
88int L1CPCMXTools::isolationEm(unsigned int /*clusterEnergy*/,
89 unsigned int /*emIsol*/, unsigned int /*hadIsol*/,
90 unsigned int hadVeto) const {
91 int isol = 0;
92 if (hadVeto > 1)
93 isol = 1;
94 return isol;
95}
96
97int L1CPCMXTools::isolationTau(unsigned int /*clusterEnergy*/,
98 unsigned int emIsol,
99 unsigned int /*hadIsol*/) const {
100 int isol = 0;
101 if (emIsol > 4)
102 isol = 1;
103 return isol;
104}
105
106void L1CPCMXTools::unpackEmIsol(int /*energy*/, int isol, unsigned int &emIsol,
107 unsigned int &hadIsol,
108 unsigned int &hadVeto) const {
109 emIsol = 0;
110 hadIsol = 0;
111 hadVeto = (isol == 1) ? 2 : 0;
112}
113
114void L1CPCMXTools::unpackTauIsol(int /*energy*/, int isol, unsigned int &emIsol,
115 unsigned int &hadIsol) const {
116 emIsol = (isol == 1) ? 5 : 0;
117 hadIsol = 0;
118}
119
121
123 xAOD::CMXCPTobContainer *cmxTobVec) const {
124 std::vector<const xAOD::CPMTobRoIContainer *> cpmRoiColls(1, cpmRoiVec);
125 formCMXCPTob(cpmRoiColls, cmxTobVec, 0);
126}
127
129
131 const std::vector<const xAOD::CPMTobRoIContainer *> &cpmRoiColls,
132 xAOD::CMXCPTobContainer *cmxTobVec, uint8_t peak) const {
133 std::map<uint32_t, const xAOD::CPMTobRoI *> cpmRoiMap;
134 std::map<int, xAOD::CMXCPTob *> cmxTobMap;
136 int timeslices = cpmRoiColls.size();
137 for (int slice = 0; slice < timeslices; ++slice) {
138 const xAOD::CPMTobRoIContainer *cpmRoiVec = cpmRoiColls[slice];
139 cpmRoiMap.clear();
140 std::vector<unsigned int> presenceMaps(2 * m_crates * m_modules);
141 std::vector<int> tobCount(2 * m_crates * m_modules);
144 for (; it != itE; ++it) { // get sorted list
145 const xAOD::CPMTobRoI *roi = *it;
146 const int type = roi->type();
147 const int crate = roi->crate();
148 const int cpm = roi->cpm();
149 const int index = ((type * m_crates) + crate) * m_modules + cpm - 1;
150 const int presenceBit =
151 (roi->chip() << 1) |
152 ((roi->location() >> 2) &
153 0x1); // <<== CHECK THIS SHIFT LOOKS OK @@vkousk
154 presenceMaps[index] |= (1 << presenceBit);
155 tobCount[index]++;
156 uint32_t key = roi->roiWord();
157 cpmRoiMap.insert(std::make_pair(key, roi));
158 }
159 std::map<uint32_t, const xAOD::CPMTobRoI *>::const_iterator mit =
160 cpmRoiMap.begin();
161 std::map<uint32_t, const xAOD::CPMTobRoI *>::const_iterator mitE =
162 cpmRoiMap.end();
163 for (; mit != mitE; ++mit) {
164 const xAOD::CPMTobRoI *roi = mit->second;
165 const int type = roi->type();
166 const int crate = roi->crate();
167 const int cmx = 1 - type; // <<== CHECK
168 const int cpm = roi->cpm();
169 const int chip = (roi->chip() << 1) | ((roi->location() >> 2) & 0x1);
170 const int loc = roi->location() & 0x3;
171 const int index = ((type * m_crates) + crate) * m_modules + cpm - 1;
172 const int energy = roi->energy();
173 const int isolation = roi->isolation();
174 const unsigned int presence = presenceMaps[index];
175 int error = 0;
176 if (tobCount[index] > m_maxTobs) { // overflow
177 int count = 0;
178 for (int bit = 0; bit <= chip; ++bit)
179 count += (presence >> bit) & 0x1;
180 if (count > m_maxTobs)
181 continue;
182 LVL1::DataError err;
184 error = err.error();
185 }
186 const int key =
187 (((((((crate << 1) | cmx) << 4) | cpm) << 4) | chip) << 2) | loc;
188 xAOD::CMXCPTob *tob = 0;
189 std::map<int, xAOD::CMXCPTob *>::iterator xit = cmxTobMap.find(key);
190 if (xit == cmxTobMap.end()) {
191 tob = new xAOD::CMXCPTob();
192 tob->makePrivateStore(); // make temp store
193 tob->initialize(crate, cmx, cpm, chip, loc);
194 std::vector<uint8_t> vecI(timeslices);
195 std::vector<uint32_t> vecU32(timeslices);
196 std::vector<uint16_t> vecU(timeslices);
197 tob->addTob(vecI, vecI, vecU32, vecU);
198 tob->setPeak(peak);
199 cmxTobMap.insert(std::make_pair(key, tob));
200 cmxTobVec->push_back(tob);
201 } else
202 tob = xit->second;
203 std::vector<uint8_t> energyVec(tob->energyVec());
204 std::vector<uint8_t> isolationVec(tob->isolationVec());
205 std::vector<uint32_t> errorVec(tob->errorVec());
206 std::vector<uint16_t> presenceMapVec(tob->presenceMapVec());
207 energyVec[slice] = energy;
208 isolationVec[slice] = isolation;
209 errorVec[slice] = error;
210 presenceMapVec[slice] = presence;
211 tob->addTob(energyVec, isolationVec, errorVec, presenceMapVec);
212 }
213 }
214}
215
217
219 const xAOD::CMXCPTobContainer *cmxTobVec,
220 xAOD::CMXCPHitsContainer *cmxHitsVec) const {
223 // @@vkousk
224 // temporarily comment out cmxHitsTopo, see Jira ticket: ATLLONECAL-13
225 // xAOD::CMXCPHitsContainer* cmxHitsTopo = new xAOD::CMXCPHitsContainer;
226 formCMXCPHitsCrate(l1menu, cmxTobVec, cmxHitsCrate);
227 formCMXCPHitsSystem(cmxHitsCrate, cmxHitsSys);
228 // formCMXCPHitsTopo(cmxTobVec, cmxHitsTopo);
229 mergeCMXCPHits(cmxHitsVec, cmxHitsCrate);
230 mergeCMXCPHits(cmxHitsVec, cmxHitsSys);
231 // mergeCMXCPHits(cmxHitsVec, cmxHitsTopo);
232 delete cmxHitsCrate;
233 delete cmxHitsSys;
234 // delete cmxHitsTopo;
235}
236
238
240 const TrigConf::L1Menu* l1menu,
241 const xAOD::CMXCPTobContainer *cmxTobVec,
242 xAOD::CMXCPHitsContainer *cmxHitsCrate) const {
243 uint8_t peakm = 0;
244 std::vector<HitsVector> hitVec(4 * m_crates);
245 std::vector<ErrorVector> errVec(4 *
246 m_crates); // Need overflow for neutral format
247 HitsVector hit0;
248 HitsVector hit1;
249 HitsVector hits;
252 for (; pos != pose; ++pos) {
253 const xAOD::CMXCPTob *tob = *pos;
254 uint8_t crate = tob->crate();
255 uint8_t cmx = tob->cmx();
256 const int index = (crate * 2 + cmx) * 2;
257 const std::vector<uint32_t> &error(tob->errorVec());
258 hit0.clear();
259 hit1.clear();
260 getHits(l1menu, tob, hit0, hit1);
261
262 addCMXCPHits(hitVec[index], hit0);
263 addCMXCPHits(hitVec[index + 1], hit1);
264 addOverflow(errVec[index], error);
265 addOverflow(errVec[index + 1], error);
266 uint8_t peak = tob->peak();
267 if (peak > peakm)
268 peakm = peak;
269 }
270 // Save non-zero crate totals
271 for (uint8_t crate = 0; crate < m_crates; ++crate) {
272 for (uint8_t cmx = 0; cmx < 2; ++cmx) {
273 const int index = (crate * 2 + cmx) * 2;
274 saveCMXCPHits(cmxHitsCrate, hitVec[index], hitVec[index + 1],
275 errVec[index], errVec[index + 1], crate, cmx,
277 if (crate != m_sysCrate) { // REMOTE totals
278 uint8_t source = crate;
279 saveCMXCPHits(cmxHitsCrate, hitVec[index], hitVec[index + 1],
280 errVec[index], errVec[index + 1], m_sysCrate, cmx, source,
281 peakm);
282 }
283 }
284 }
285}
286
288 HitsVector &hit1) const {
289 using namespace TrigConf;
290 const std::vector<uint8_t> &energy(tob->energyVec());
291 const std::vector<uint8_t> &isolation(tob->isolationVec());
292
293 int cmx = tob->cmx();
294 int crate = tob->crate();
295 int cpm = tob->cpm();
296 int chip = (tob->chip() >> 1) & 0x7;
297 int loc = tob->location() | ((tob->chip() & 1) << 2);
298 auto err = LVL1::DataError(tob->error());
299
300 const int type = 1 - cmx;
301 const int timeslices = energy.size();
302 hit0.resize(timeslices);
303 hit1.resize(timeslices);
304
305 // Get thresholds from menu
307
308 // Get EM and TAU trigger thresholds
309 std::vector<std::shared_ptr<TrigConf::L1Threshold>> allThresholds = l1menu->thresholds();
310 std::vector<std::shared_ptr<TrigConf::L1Threshold>> thresholds;
311 thresholds.reserve(16);
312
313 for ( const auto& thresh : allThresholds ) {
314 if (thresh->type() == thrType) {
315 thresholds.push_back(thresh);
316 }
317 }
318
319 if (thresholds.size() > 16) {
320 ATH_MSG_ERROR("Wrong number of thresholds " << thresholds.size());
321 return;
322 }
323
324 for (int slice = 0; slice < timeslices; ++slice) {
325 if (energy[slice] == 0)
326 continue;
327
328 if (err.get(LVL1::DataError::Overflow)) {
329 hit0[slice] = 0xffffff;
330 hit1[slice] = 0xffffff;
331 continue;
332 }
333 /* Form an RoI word from the information present
334 Simplest way without duplication is to create a CPMTobRoI */
335 int et = energy[slice];
336 int isol = isolation[slice];
337 std::unique_ptr<LVL1::CPMTobRoI> roi(
338 new CPMTobRoI(crate, cpm, chip, loc, type, et, isol));
339
340 /* Now get the hit information using RecEmTauroI */
341 RecEmTauRoI recRoI(roi->roiWord(), &(*l1menu));
342 auto mask = recRoI.thresholdPattern();
343 for (const auto& threshold : thresholds) {
344 auto numThresh = threshold->mapping();
345 if (!recRoI.isValidThreshold(numThresh) ||
346 (((1 << numThresh) & mask) == 0)) {
347 continue;
348 }
349 if (numThresh < 8) {
350 hit0[slice] |= (1 << (numThresh * 3));
351 } else {
352 hit1[slice] |= (1 << ((numThresh - 8) * 3));
353 }
354 }
355 }
356}
357
359 const ErrorVector &tobErr) const {
360 const int timeslices = tobErr.size();
361 hitErr.resize(timeslices);
362 for (int slice = 0; slice < timeslices; ++slice) {
363 int error = tobErr[slice];
364 if (error) {
366 int overflow = err.get(LVL1::DataError::Overflow);
367 LVL1::DataError err2;
368 err2.set(LVL1::DataError::Overflow, overflow);
369 hitErr[slice] |= err2.error();
370 }
371 }
372}
373
375
377 const xAOD::CMXCPHitsContainer *cmxHitsCrate,
378 xAOD::CMXCPHitsContainer *cmxHitsSys) const {
379 uint8_t peakm = 0;
380 std::vector<HitsVector> systemHit0(2);
381 std::vector<HitsVector> systemHit1(2);
382 std::vector<ErrorVector> systemErr0(2);
383 std::vector<ErrorVector> systemErr1(2);
386 for (; pos != pose; ++pos) {
387 const xAOD::CMXCPHits *hits = *pos;
388 if (hits->crate() != m_sysCrate)
389 continue;
390 uint8_t source = hits->sourceComponent();
391 if (source != xAOD::CMXCPHits::LOCAL &&
392 source != xAOD::CMXCPHits::REMOTE_0 &&
393 source != xAOD::CMXCPHits::REMOTE_1 &&
395 continue;
396 const uint8_t peak = hits->peak();
397 if (peak > peakm)
398 peakm = peak;
399 HitsVector hits0(hits->hitsVec0());
400 HitsVector hits1(hits->hitsVec1());
401 ErrorVector err0(hits->errorVec0());
402 ErrorVector err1(hits->errorVec1());
403 uint8_t cmx = hits->cmx();
404 addCMXCPHits(systemHit0[cmx], hits0);
405 addCMXCPHits(systemHit1[cmx], hits1);
406 addOverflow(systemErr0[cmx], err0);
407 addOverflow(systemErr1[cmx], err1);
408 }
409 // Save non-zero system totals
410 for (uint8_t cmx = 0; cmx < 2; ++cmx) {
411 saveCMXCPHits(cmxHitsSys, systemHit0[cmx], systemHit1[cmx], systemErr0[cmx],
412 systemErr1[cmx], m_sysCrate, cmx, xAOD::CMXCPHits::TOTAL,
413 peakm);
414 }
415}
416 // Temporary for
418 // testing
419
421 const xAOD::CMXCPTobContainer *cmxTobVec,
422 xAOD::CMXCPHitsContainer *cmxHitsTopo) const {
423 uint8_t peakm = 0;
424 int timeslices = 0;
425 std::vector<HitsVector> hitVec(8 * m_crates);
428 for (; pos != pose; ++pos) {
429 const xAOD::CMXCPTob *tob = *pos;
430 uint8_t crate = tob->crate();
431 uint8_t cmx = tob->cmx();
432 const uint8_t cpm = tob->cpm();
433 const uint8_t chip = tob->chip() >> 1;
434 const uint8_t loc = ((tob->chip() & 0x1) << 2) | tob->location();
435 const int index = (crate * 2 + cmx) * 4;
436 const std::vector<uint8_t> &energy(tob->energyVec());
437 const std::vector<uint8_t> &isolation(tob->isolationVec());
438 const std::vector<uint32_t> &error(tob->errorVec());
439 timeslices = energy.size();
440 HitsVector &checksum(hitVec[index]);
441 HitsVector &map(hitVec[index + 1]);
442 HitsVector &countsLow(hitVec[index + 2]);
443 HitsVector &countsHigh(hitVec[index + 3]);
444 checksum.resize(timeslices);
445 map.resize(timeslices);
446 countsLow.resize(timeslices);
447 countsHigh.resize(timeslices);
448 for (int slice = 0; slice < timeslices; ++slice) {
449 if (energy[slice] == 0)
450 continue;
451 // checksum
452 LVL1::DataError err(error[slice]);
453 int overflow = err.get(LVL1::DataError::Overflow);
454 checksum[slice] +=
455 cpm + chip + loc + energy[slice] + isolation[slice] + overflow;
456 checksum[slice] &= 0xff;
457 // occupancy map
458 map[slice] |= (1 << (cpm - 1));
459 // occupancy counts
460 if (cpm <= 7) {
461 countsLow[slice] += (1 << (3 * (cpm - 1))); // can't saturate
462 } else {
463 countsHigh[slice] += (1 << (3 * (cpm - 8)));
464 }
465 }
466 uint8_t peak = tob->peak();
467 if (peak > peakm)
468 peakm = peak;
469 }
470 // Save non-zero crate totals
471 HitsVector dummy(timeslices);
472 std::vector<uint32_t> dummyE(timeslices);
473 for (uint8_t crate = 0; crate < m_crates; ++crate) {
474 for (uint8_t cmx = 0; cmx < 2; ++cmx) {
475 const int index = (crate * 2 + cmx) * 4;
476 saveCMXCPHits(cmxHitsTopo, hitVec[index], dummy, dummyE, dummyE, crate,
478 saveCMXCPHits(cmxHitsTopo, hitVec[index + 1], dummy, dummyE, dummyE,
479 crate, cmx, xAOD::CMXCPHits::TOPO_OCCUPANCY_MAP, peakm);
480 saveCMXCPHits(cmxHitsTopo, hitVec[index + 2], hitVec[index + 3], dummyE,
481 dummyE, crate, cmx, xAOD::CMXCPHits::TOPO_OCCUPANCY_COUNTS,
482 peakm);
483 }
484 }
485}
486
488
490 const HitsVector &vec2) const {
491 int size1 = vec1.size();
492 int size2 = vec2.size();
493 if (size1 < size2)
494 vec1.resize(size2);
495 HitsVector::iterator pos1 = vec1.begin();
496 HitsVector::iterator pose1 = vec1.end();
497 HitsVector::const_iterator pos2 = vec2.begin();
498 HitsVector::const_iterator pose2 = vec2.end();
499 for (; pos1 != pose1 && pos2 != pose2; ++pos1, ++pos2) {
500 *pos1 = addHits(*pos1, *pos2, 24, 24);
501 }
502}
503
505
506unsigned int L1CPCMXTools::addHits(unsigned int hitMult, unsigned int hitVec,
507 int multBits, int vecBits) const {
508 if (m_debug)
509 msg() << MSG::DEBUG << "addHits: Original hitMult = " << std::hex << hitMult
510 << ". Add hitWord = " << hitVec << std::dec << endmsg;
511
512 // Results transmitted in 2 words, each reporting half of the CP thresholds
513 int nthresh = TrigT1CaloDefs::numOfCPThresholds / 2;
514
515 int nbitsOut = multBits / nthresh;
516 int nbitsIn = vecBits / nthresh;
517
518 if (m_debug)
519 msg() << MSG::DEBUG << " Bits per threshold = " << nbitsOut << endmsg;
520
521 int max = (1 << nbitsOut) - 1;
522 unsigned int multMask = max;
523 unsigned int hitMask = (1 << nbitsIn) - 1;
524 unsigned int shift = 0;
525
526 unsigned int hits = 0;
527
528 for (int i = 0; i < nthresh; i++) {
529 int mult = (hitMult & multMask) + (hitVec & hitMask);
530 mult = ((mult <= max) ? mult : max);
531 hits += (mult << shift);
532
533 hitMult >>= nbitsOut;
534 hitVec >>= nbitsIn;
535 shift += nbitsOut;
536 }
537
538 if (m_debug)
539 msg() << MSG::DEBUG << "addHits returning hitMult = " << std::hex << hits
540 << std::dec << endmsg;
541
542 return hits;
543}
544
546
548 xAOD::CMXCPHitsContainer *cmxHitsVec2) const {
549 int size = cmxHitsVec2->size();
550 for (int index = 0; index < size; ++index) {
551 xAOD::CMXCPHits *hitsIn = 0;
552 xAOD::CMXCPHits *hitsOut = 0;
553 cmxHitsVec2->swapElement(index, hitsIn, hitsOut);
554 cmxHitsVec1->push_back(hitsOut);
555 }
556 cmxHitsVec2->clear();
557}
558
560
562 xAOD::CMXCPHitsContainer *cmxHitsVec, const HitsVector &hits0,
563 const HitsVector &hits1, const ErrorVector &err0, const ErrorVector &err1,
564 uint8_t crate, uint8_t cmx, uint8_t source, uint8_t peak) const {
565 if (std::accumulate(hits0.begin(), hits0.end(), 0) ||
566 std::accumulate(hits1.begin(), hits1.end(), 0)) {
567 xAOD::CMXCPHits *cmxCpHits = new xAOD::CMXCPHits();
568 cmxCpHits->makePrivateStore();
569 cmxCpHits->initialize(crate, cmx, source, hits0, hits1, err0, err1, peak);
570 cmxHitsVec->push_back(cmxCpHits);
571 }
572}
573
574} // end of namespace
#define endmsg
#define ATH_MSG_ERROR(x)
double coord
Type of coordination system.
#define max(a, b)
Definition cfImp.cxx:41
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
void swapElement(size_type index, value_type newElem, reference oldElem)
Swap one element out of the container.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void clear()
Erase all the elements in the collection.
uint32_t roiWord() const
Return packed RoI word.
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
Error data.
Definition DataError.h:27
int error() const
Return the full error word.
Definition DataError.h:78
void set(ErrorBit bit, int value=1)
Set an error bit or data.
Definition DataError.cxx:28
This class defines the em/tau hadron ROI which are generated by the LVL1 Calo Trigger.
Definition EmTauROI.h:35
unsigned int hadCoreEnergy() const
return energy
Definition EmTauROI.h:82
unsigned int emRingIsolationEnergy() const
return energy
Definition EmTauROI.h:78
unsigned int clusterEnergy() const
return energy
Definition EmTauROI.h:84
bool thresholdPassed(int thresh) const
returns TRUE if threshold number threshold_number has been passed by this ROI.
Definition EmTauROI.cxx:44
unsigned int tauClusterEnergy() const
Definition EmTauROI.h:85
unsigned int hadRingIsolationEnergy() const
return energy
Definition EmTauROI.h:80
TrigT1CaloDefs::ClusterAlgorithm thresholdType(int thresh) const
returns type of thresholds number threshold_number Thresholds numbered from 1 to TrigT1CaloDefs::numO...
Definition EmTauROI.cxx:54
unsigned int roiWord() const
returns the 32bit ROI word.
Definition EmTauROI.cxx:37
std::vector< uint32_t > HitsVector
L1CPCMXTools(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
void addOverflow(ErrorVector &hitErr, const ErrorVector &tobErr) const
void addCMXCPHits(HitsVector &vec1, const HitsVector &vec2) const
Add hits from second vector to first.
std::pair< uint32_t, uint32_t > roiWord(const EmTauROI *roi) const
Temporary for testing until CPAlgorithm and EmTauROI are updated.
virtual void formCMXCPHitsTopo(const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsTopo) const
form partial CMX-CP hits (topo) from CMX-CP TOBs
std::vector< uint32_t > ErrorVector
unsigned int addHits(unsigned int hitMult, unsigned int hitVec, int multBits, int vecBits) const
Increment CPM/CMX hit word.
void getHits(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTob *tob, HitsVector &hits0, HitsVector &hits1) const
virtual void formCMXCPHitsCrate(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsCrate) const
form partial CMX-CP hits (crate) from CMX-CP TOBs
int isolationTau(unsigned int clusterEnergy, unsigned int emIsol, unsigned int hadIsol) const
virtual void formCMXCPHitsSystem(const xAOD::CMXCPHitsContainer *cmxHitsCrate, xAOD::CMXCPHitsContainer *cmxHitsSys) const
form partial CMX-CP hits (system) from crate CMX-CP hits
int m_maxTobs
Maximum number of TOBs per CPM.
void saveCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec, const HitsVector &hits0, const HitsVector &hits1, const ErrorVector &err0, const ErrorVector &err1, uint8_t crate, uint8_t cmx, uint8_t source, uint8_t peak) const
Save non-zero CMX-CP hits.
int isolationEm(unsigned int clusterEnergy, unsigned int emIsol, unsigned int hadIsol, unsigned int hadVeto) const
int m_crates
Number of CP crates.
int m_modules
Number of CPMs per crate.
int m_sysCrate
System crate.
bool m_debug
Debug printout flag.
void unpackEmIsol(int energy, int isol, unsigned int &emIsol, unsigned int &hadIsol, unsigned int &hadVeto) const
void unpackTauIsol(int energy, int isol, unsigned int &emIsol, unsigned int &hadIsol) const
virtual StatusCode initialize()
standard Athena-Algorithm method
virtual void formCMXCPTob(const xAOD::CPMTobRoIContainer *cpmRoiVec, xAOD::CMXCPTobContainer *cmxTobVec) const
form CMX-CP TOBs from RoIs - single slice
virtual void formCMXCPHits(const TrigConf::L1Menu *l1menu, const xAOD::CMXCPTobContainer *cmxTobVec, xAOD::CMXCPHitsContainer *cmxHitsVec) const
form complete CMX-CP hits from CMX-CP TOBs
void mergeCMXCPHits(xAOD::CMXCPHitsContainer *cmxHitsVec1, xAOD::CMXCPHitsContainer *cmxHitsVec2) const
Merge CMX-CP hits vectors.
This class defines the reconstructed em/tau hadron ROI.
Definition RecEmTauRoI.h:44
bool isValidThreshold(unsigned int thresh) const
returns true if thresh is a valid threshold number
unsigned int thresholdPattern() const
returns bitmask of passed thresholds
static const unsigned int numOfCPThresholds
void makePrivateStore()
Create a new (empty) private store for this object.
static std::string & typeAsString(TriggerType tt)
Definition L1DataDef.h:53
L1 menu configuration.
Definition L1Menu.h:28
STL class.
virtual void initialize(const uint8_t crate, const uint8_t cmx, const uint8_t source)
initialize
uint8_t cmx() const
get cmx
uint8_t cpm() const
get cpm
uint32_t error() const
get errorVec at peak bunch crossing
const std::vector< uint8_t > & energyVec() const
get energyVec
uint8_t crate() const
get crate
void setPeak(uint8_t)
set peak
const std::vector< uint32_t > & errorVec() const
get errorVec
const std::vector< uint8_t > & isolationVec() const
get isolationVec
virtual void initialize(const uint8_t crate, const uint8_t cmx, const uint8_t cpm, const uint8_t chip, const uint8_t loc)
initialize
void addTob(const std::vector< uint8_t > &energyVec, const std::vector< uint8_t > &isolationVec, const std::vector< uint32_t > &errorVec, const std::vector< uint16_t > &presenceMapVec)
add data to existing object
const std::vector< uint16_t > & presenceMapVec() const
get presenceMapVec
uint8_t chip() const
get chip
uint8_t peak() const
get peak
uint8_t location() const
get location
uint32_t roiWord() const
get roiWord
int crate() const
Return crate number (0-1)
int cpm() const
Return CPM number (1-14)
int location() const
Return location (RoI local coords) (0-7)
int energy() const
Return energy.
int chip() const
Return CP chip number (0-7)
int isolation() const
Return isolation.
int type() const
Return type em/tau (0/1)
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
Definition index.py:1
CPMTobRoI_v1 CPMTobRoI
Define the latest version of the CPMTobRoI class.
CMXCPTobContainer_v1 CMXCPTobContainer
Define the latest version of the CMXCPTob class.
CMXCPHitsContainer_v1 CMXCPHitsContainer
Define the latest version of the CMXCPHits class.
CMXCPTob_v1 CMXCPTob
Define the latest version of the CMXCPTob class.
CMXCPHits_v1 CMXCPHits
Define the latest version of the CMMCPHits class.
CPMTobRoIContainer_v1 CPMTobRoIContainer
Define the latest version of the CPMTobRoI class.
Extra patterns decribing particle interation process.