#include <L1PSNumber.h>
|
| static int64_t | decodeFloat (const float psF) |
| | Calculates the NMD combination nearest to psF.
|
| static int64_t | encodeNMD (const int nn, const unsigned int mm, const unsigned int dd) |
| | Returns INT64_T prescale number with the correct sign as it is stored in DB.
|
|
| bool | validate (const int nn, const unsigned int mm, const unsigned int dd, const int ss) |
| | Checks whether the m_n,m_m,m_d combination is valid, i.e.
|
| void | setInt64 (const int64_t tmpLong) |
| | Sets the N,M,D values from a Int64_t prescale value.
|
|
| static int64_t | makeLong (unsigned int n, unsigned int m, unsigned int d) |
| | Returns the POSITIVE int64_t of 3 ints.
|
|
| static const uint32_t | NMASK = 0x00FFFFFF |
| static const uint32_t | MMASK = 0xF0000000 |
| static const uint32_t | DMASK = 0x0F000000 |
| static const int | MSHIFT = 28 |
| static const int | DSHIFT = 24 |
| static const int | s_auxLength = 79 |
| static const unsigned int | s_psAuxValues [79][2] |
| | Help array containing the allowed MD combinations (for N=1).
|
Definition at line 33 of file L1PSNumber.h.
◆ L1PSNumber() [1/5]
| TrigConf::L1PSNumber::L1PSNumber |
( |
| ) |
|
◆ L1PSNumber() [2/5]
| TrigConf::L1PSNumber::L1PSNumber |
( |
const float | ps | ) |
|
Constructor from float.
Definition at line 83 of file L1PSNumber.cxx.
83 {
86 }
void setInt64(const int64_t tmpLong)
Sets the N,M,D values from a Int64_t prescale value.
static int64_t decodeFloat(const float psF)
Calculates the NMD combination nearest to psF.
◆ L1PSNumber() [3/5]
| TrigConf::L1PSNumber::L1PSNumber |
( |
const int64_t | ps | ) |
|
◆ L1PSNumber() [4/5]
| TrigConf::L1PSNumber::L1PSNumber |
( |
const int | ps | ) |
|
Simple constructor, sets only int.
Definition at line 43 of file L1PSNumber.cxx.
43 {
44 if (ps >= 1) {
47 } else if (ps < 1 && ps>-1) {
48
51 } else {
54 }
59 }
◆ L1PSNumber() [5/5]
| TrigConf::L1PSNumber::L1PSNumber |
( |
const int | nn, |
|
|
const unsigned int | mm, |
|
|
unsigned const int | dd, |
|
|
const int | ss = 1 ) |
Constructor from N,M,D and S.
Definition at line 71 of file L1PSNumber.cxx.
72 {
75 } else {
77 }
78 }
static int64_t makeLong(unsigned int n, unsigned int m, unsigned int d)
Returns the POSITIVE int64_t of 3 ints.
bool validate(const int nn, const unsigned int mm, const unsigned int dd, const int ss)
Checks whether the m_n,m_m,m_d combination is valid, i.e.
◆ decodeFloat()
| int64_t TrigConf::L1PSNumber::decodeFloat |
( |
const float | psF | ) |
|
|
static |
Calculates the NMD combination nearest to psF.
Returns the int64_t representation of NMD.
Definition at line 167 of file L1PSNumber.cxx.
167 {
168 int64_t ret = -1;
169 int tmpN = (
int) psF;
170 float psOne = psF / (
float) tmpN;
173 unsigned int dd = 0;
174 float tmpPS;
175 float tmpDiff;
176
177 if (std::abs(tmpN) <= (
int)
NMASK) {
178
179 if (tmpN == psF) {
180 ret = (int64_t) psF;
181 } else {
182
186 tmpPS = (
float) ((tmpM + tmpD + 1.0) / (tmpM + 1.0));
187 tmpDiff = fabs(tmpPS - psOne);
188 if (tmpPS * tmpN >= tmpN + 1) {
189 break;
190 }
191 if (tmpDiff <
diff) {
194 dd = tmpD;
195 }
196 }
198 }
199 }
200 return ret;
201 }
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
static const uint32_t NMASK
static const int s_auxLength
static const unsigned int s_psAuxValues[79][2]
Help array containing the allowed MD combinations (for N=1).
static int64_t encodeNMD(const int nn, const unsigned int mm, const unsigned int dd)
Returns INT64_T prescale number with the correct sign as it is stored in DB.
◆ encodeNMD()
| int64_t TrigConf::L1PSNumber::encodeNMD |
( |
const int | nn, |
|
|
const unsigned int | mm, |
|
|
const unsigned int | dd ) |
|
static |
Returns INT64_T prescale number with the correct sign as it is stored in DB.
Definition at line 207 of file L1PSNumber.cxx.
208 {
209 int64_t ret = -1;
210 unsigned int nTemp = 1;
211 int sTemp = 1;
212 if (nn < 0) {
213 nTemp = -nn;
214 sTemp = -1;
215 } else {
216 nTemp = nn;
217 sTemp = 1;
218 }
220 ret = sTemp*ret;
221 return ret;
222 }
◆ getD()
| unsigned int TrigConf::L1PSNumber::getD |
( |
| ) |
const |
|
inline |
◆ getFloatPrescale()
| float TrigConf::L1PSNumber::getFloatPrescale |
( |
| ) |
const |
|
inline |
◆ getInt32()
| int TrigConf::L1PSNumber::getInt32 |
( |
| ) |
const |
|
inline |
◆ getInt64()
| int64_t TrigConf::L1PSNumber::getInt64 |
( |
| ) |
const |
|
inline |
◆ getM()
| unsigned int TrigConf::L1PSNumber::getM |
( |
| ) |
const |
|
inline |
◆ getN()
| unsigned int TrigConf::L1PSNumber::getN |
( |
| ) |
const |
|
inline |
◆ getSign()
| int TrigConf::L1PSNumber::getSign |
( |
| ) |
const |
|
inline |
◆ makeLong()
| int64_t TrigConf::L1PSNumber::makeLong |
( |
unsigned int | nn, |
|
|
unsigned int | mm, |
|
|
unsigned int | dd ) |
|
staticprivate |
Returns the POSITIVE int64_t of 3 ints.
Takes care that no number is longer than it should.
Definition at line 228 of file L1PSNumber.cxx.
229 {
230 int64_t ret;
233 ret = (ret | ((dd & 0xF) <<
DSHIFT));
234 ret = (ret | (nn &
NMASK));
235 return ret;
236 }
◆ setInt64()
| void TrigConf::L1PSNumber::setInt64 |
( |
const int64_t | prescaleBitArray | ) |
|
|
private |
Sets the N,M,D values from a Int64_t prescale value.
- Parameters
-
| prescaleArray | the prescale as a long. |
Decodeonly if ps > 0. Else PS=1.
Definition at line 124 of file L1PSNumber.cxx.
124 {
125 unsigned int nTemp = 1;
126 unsigned int mTemp = 0;
127 unsigned int dTemp = 0;
128 int sTemp = -1;
129
131
132
133 if (prescaleBitArray < 0) {
134 sTemp = -1;
135 psTemp = (
uint32_t) (-1 * prescaleBitArray);
136 } else {
137 sTemp = 1;
138 psTemp = (
uint32_t) prescaleBitArray;
139 }
143 nTemp = psTemp&
NMASK;
148 }
static const uint32_t MMASK
static const uint32_t DMASK
◆ validate()
| bool TrigConf::L1PSNumber::validate |
( |
const int | nn, |
|
|
const unsigned int | mm, |
|
|
const unsigned int | dd, |
|
|
const int | ss = 1 ) |
|
private |
Checks whether the m_n,m_m,m_d combination is valid, i.e.
whether m_n >= 1 && 1 < (m_m+m_d+1)/(m_m+1) < 2. Sets N, M, D & m_psFloat.
Definition at line 93 of file L1PSNumber.cxx.
93 {
94 bool ret = false;
95 if (nn <= -1 || nn >= 1) {
96 if (nn < 0) {
99 } else if (nn >= 1) {
102 }
106 ret = true;
107 } else {
113 ret = false;
114 }
115 return ret;
116 }
◆ write()
| std::string TrigConf::L1PSNumber::write |
( |
| ) |
|
Writes nicely the ps value.
Definition at line 153 of file L1PSNumber.cxx.
153 {
154 std::stringstream
ss;
155 if (
m_m == 0 &&
m_d == 0) {
157 } else {
159 }
161 }
◆ DMASK
| const uint32_t TrigConf::L1PSNumber::DMASK = 0x0F000000 |
|
staticprivate |
◆ DSHIFT
| const int TrigConf::L1PSNumber::DSHIFT = 24 |
|
staticprivate |
◆ m_d
| unsigned int TrigConf::L1PSNumber::m_d |
|
private |
◆ m_m
| unsigned int TrigConf::L1PSNumber::m_m |
|
private |
◆ m_n
| unsigned int TrigConf::L1PSNumber::m_n |
|
private |
◆ m_psFloat
| float TrigConf::L1PSNumber::m_psFloat |
|
private |
◆ m_psLong
| int64_t TrigConf::L1PSNumber::m_psLong |
|
private |
◆ m_s
| int TrigConf::L1PSNumber::m_s |
|
private |
◆ MMASK
| const uint32_t TrigConf::L1PSNumber::MMASK = 0xF0000000 |
|
staticprivate |
◆ MSHIFT
| const int TrigConf::L1PSNumber::MSHIFT = 28 |
|
staticprivate |
◆ NMASK
| const uint32_t TrigConf::L1PSNumber::NMASK = 0x00FFFFFF |
|
staticprivate |
◆ s_auxLength
| const int TrigConf::L1PSNumber::s_auxLength = 79 |
|
staticprivate |
◆ s_psAuxValues
| const unsigned int TrigConf::L1PSNumber::s_psAuxValues |
|
staticprivate |
The documentation for this class was generated from the following files: