File indexing completed on 2024-04-06 12:19:53
0001 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctRegion.h"
0002
0003 L1GctRegion::L1GctRegion() : L1CaloRegion() {}
0004
0005 L1GctRegion::~L1GctRegion() {}
0006
0007 L1GctRegion L1GctRegion::makeJfInputRegion(const L1CaloRegion& r_in) {
0008 bool of = (r_in.isHf() ? (r_in.et() == 0xff) : r_in.overFlow());
0009 L1GctRegion r(r_in.et(), of, r_in.fineGrain(), r_in.gctEta(), r_in.gctPhi(), r_in.bx());
0010 return r;
0011 }
0012
0013 L1GctRegion L1GctRegion::makeProtoJetRegion(const unsigned et,
0014 const bool overFlow,
0015 const bool fineGrain,
0016 const bool tauIsolationVeto,
0017 const unsigned ieta,
0018 const unsigned iphi,
0019 const int16_t bx) {
0020 L1GctRegion r(et, overFlow, fineGrain, ieta, iphi, bx);
0021 if (tauIsolationVeto) {
0022 r.setFeatureBit0();
0023 } else {
0024 r.clrFeatureBit0();
0025 }
0026 return r;
0027 }
0028
0029 L1GctRegion L1GctRegion::makeFinalJetRegion(const unsigned et,
0030 const bool overFlow,
0031 const bool fineGrain,
0032 const unsigned ieta,
0033 const unsigned iphi,
0034 const int16_t bx) {
0035 L1GctRegion r(et, overFlow, fineGrain, ieta, iphi, bx);
0036 return r;
0037 }
0038
0039
0040 L1GctRegion::L1GctRegion(const unsigned et,
0041 const bool overFlow,
0042 const bool fineGrain,
0043 const unsigned ieta,
0044 const unsigned iphi,
0045 const int16_t bx)
0046 : L1CaloRegion(L1CaloRegion::makeGctJetRegion(
0047 ((overFlow || et > kGctRegionMaxValue) ? (unsigned)kGctRegionMaxValue : (unsigned)(et & kGctRegionMaxValue)),
0048 (overFlow || et > kGctRegionMaxValue),
0049 fineGrain,
0050 ieta,
0051 iphi,
0052 bx)) {}
0053
0054 void L1GctRegion::setBit(const unsigned bitNum, const bool onOff) {
0055 if ((bitNum == 14) || (bitNum == 15)) {
0056 uint16_t data = raw();
0057 uint16_t mask = 1 << bitNum;
0058 data &= ~mask;
0059 if (onOff)
0060 data |= mask;
0061 setRawData(data);
0062 }
0063 }