18 const double floatingPointValue,
19 const unsigned int digitizedSignedValue,
20 const double undigitizedSignedValue,
21 const unsigned int redigitizedSignedValue) {
22 edm::LogInfo(
"TTTrack_TrackWord") <<
"testDigitizationScheme: (nBits, lsb) = (" << nBits <<
", " << lsb <<
")\n"
23 <<
"Floating point value = " << floatingPointValue
24 <<
"\tDigitized value = " << digitizedSignedValue
25 <<
"\tUn-digitized value = " << undigitizedSignedValue
26 <<
"\tRe-digitized value = " << redigitizedSignedValue;
37 unsigned int hitPattern,
38 unsigned int mvaQuality,
39 unsigned int mvaOther,
40 unsigned int sector) {
41 setTrackWord(valid, momentum, POCA, rInv, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther, sector);
50 unsigned int chi2RPhi,
52 unsigned int bendChi2,
53 unsigned int hitPattern,
54 unsigned int mvaQuality,
55 unsigned int mvaOther) {
56 setTrackWord(valid, rInv, phi0, tanl, z0, d0, chi2RPhi, chi2RZ, bendChi2, hitPattern, mvaQuality, mvaOther);
67 unsigned int hitPattern,
68 unsigned int mvaQuality,
69 unsigned int mvaOther,
70 unsigned int sector) {
73 float rTanl = momentum.
z() / momentum.
perp();
75 float rD0 = POCA.
perp();
87 hit_t hitPattern_ = hitPattern;
94 valid_, rInv_, phi0_, tanl_, z0_, d0_, chi2RPhi_, chi2RZ_, bendChi2_, hitPattern_, mvaQuality_, mvaOther_);
104 unsigned int chi2RPhi,
106 unsigned int bendChi2,
107 unsigned int hitPattern,
108 unsigned int mvaQuality,
109 unsigned int mvaOther) {
120 hit_t hitPattern_ = hitPattern;
129 valid_, rInv_, phi0_, tanl_, z0_, d0_, chi2RPhi_, chi2RZ_, bendChi2_, hitPattern_, mvaQuality_, mvaOther_);
133 ap_uint<TrackBitWidths::kValidSize> valid,
134 ap_uint<TrackBitWidths::kRinvSize> rInv,
135 ap_uint<TrackBitWidths::kPhiSize> phi0,
136 ap_uint<TrackBitWidths::kTanlSize> tanl,
137 ap_uint<TrackBitWidths::kZ0Size> z0,
138 ap_uint<TrackBitWidths::kD0Size>
d0,
139 ap_uint<TrackBitWidths::kChi2RPhiSize> chi2RPhi,
140 ap_uint<TrackBitWidths::kChi2RZSize> chi2RZ,
141 ap_uint<TrackBitWidths::kBendChi2Size> bendChi2,
142 ap_uint<TrackBitWidths::kHitPatternSize> hitPattern,
143 ap_uint<TrackBitWidths::kMVAQualitySize> mvaQuality,
144 ap_uint<TrackBitWidths::kMVAOtherSize> mvaOther) {
147 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kMVAOtherSize);
b++) {
150 offset += TrackBitWidths::kMVAOtherSize;
151 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kMVAQualitySize);
b++) {
154 offset += TrackBitWidths::kMVAQualitySize;
155 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kHitPatternSize);
b++) {
158 offset += TrackBitWidths::kHitPatternSize;
159 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kBendChi2Size);
b++) {
162 offset += TrackBitWidths::kBendChi2Size;
163 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kD0Size);
b++) {
166 offset += TrackBitWidths::kD0Size;
167 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kChi2RZSize);
b++) {
170 offset += TrackBitWidths::kChi2RZSize;
171 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kZ0Size);
b++) {
174 offset += TrackBitWidths::kZ0Size;
175 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kTanlSize);
b++) {
178 offset += TrackBitWidths::kTanlSize;
179 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kChi2RPhiSize);
b++) {
182 offset += TrackBitWidths::kChi2RPhiSize;
183 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kPhiSize);
b++) {
186 offset += TrackBitWidths::kPhiSize;
187 for (
unsigned int b = offset;
b < (offset + TrackBitWidths::kRinvSize);
b++) {
190 offset += TrackBitWidths::kRinvSize;
191 for (
unsigned int b = offset;
b < offset + TrackBitWidths::kValidSize;
b++) {
197 const unsigned int nBits,
198 const double lsb)
const {
201 unsigned int redigitizedSignedValue =
digitizeSignedValue(undigitizedSignedValue, nBits, lsb);
203 nBits, lsb, floatingPointValue, digitizedSignedValue, undigitizedSignedValue, redigitizedSignedValue);
204 return (
std::abs(floatingPointValue - undigitizedSignedValue) <= (lsb / 2.0)) &&
205 (digitizedSignedValue == redigitizedSignedValue);
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
bool singleDigitizationSchemeTest(const double floatingPointValue, const unsigned int nBits, const double lsb) const
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb) const
Geom::Phi< T > phi() const
static constexpr double stepD0
void infoTestDigitizationScheme(const unsigned int, const double, const double, const unsigned int, const double, const unsigned int)
static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
static const uint16_t valid_
constexpr unsigned int getBin(double value, const T &bins) const
ap_uint< TrackBitWidths::kZ0Size > z0_t
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, unsigned int mvaQuality, unsigned int mvaOther, unsigned int sector)
static constexpr double stepRinv
unsigned int digitizeSignedValue(double value, unsigned int nBits, double lsb) const
ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
void testDigitizationScheme() const
ap_uint< TrackBitWidths::kValidSize > valid_t
ap_uint< TrackBitWidths::kRinvSize > rinv_t
Abs< T >::type abs(const T &t)
static constexpr double stepTanL
ap_uint< TrackBitWidths::kHitPatternSize > hit_t
ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
Log< level::Info, false > LogInfo
static constexpr float d0
static constexpr double stepPhi0
float localPhi(float globalPhi, unsigned int sector) const
ap_uint< TrackBitWidths::kTanlSize > tanl_t
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
ap_uint< TrackBitWidths::kD0Size > d0_t
static constexpr double stepZ0
ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
ap_uint< TrackBitWidths::kPhiSize > phi_t