/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/TrackerRecHit2D/src/SiPixelRecHitQuality.cc
76 строк
3 KB
Tamas
Add epsilon in comparison of probabilities
25 ноя 2021, 02:41
25 ноя 2021, 02:41
a12778d
Код
Авторство
О чём код?
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitQuality.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" SiPixelRecHitQuality::Packing::Packing() { // Constructor: pre-computes masks and shifts from field widths // X is now XY // Y is now Q probX_width = 14; probY_width = 8; qBin_width = 3; edge_width = 1; bad_width = 1; twoROC_width = 1; hasFilledProb_width = 1; spare_width = 3; if (probX_width + probY_width + qBin_width + edge_width + bad_width + twoROC_width + hasFilledProb_width + spare_width != 32) { throw cms::Exception("SiPixelRecHitQuality::Packing: ") << "\nERROR: The allocated bits for the quality word to not sum to 32." << "\n\n"; } probX_units = 1.0018; probY_units = 1.0461; probX_1_over_log_units = 1.0 / log(probX_units); probY_1_over_log_units = 1.0 / log(probY_units); // Fields are counted from right to left! probX_shift = 0; probY_shift = probX_shift + probX_width; qBin_shift = probY_shift + probY_width; edge_shift = qBin_shift + qBin_width; bad_shift = edge_shift + edge_width; twoROC_shift = bad_shift + bad_width; hasFilledProb_shift = twoROC_shift + twoROC_width; // Ensure the complement of the correct // number of bits: QualWordType zero32 = 0; // 32-bit wide set of 0's probX_mask = ~(~zero32 << probX_width); probY_mask = ~(~zero32 << probY_width); qBin_mask = ~(~zero32 << qBin_width); edge_mask = ~(~zero32 << edge_width); bad_mask = ~(~zero32 << bad_width); twoROC_mask = ~(~zero32 << twoROC_width); hasFilledProb_mask = ~(~zero32 << hasFilledProb_width); } // Initialize the packing format singleton const SiPixelRecHitQuality::Packing SiPixelRecHitQuality::thePacking; void SiPixelRecHitQuality::warningObsolete() { edm::LogWarning("ObsoleteVariable") << "Since 39x, probabilityX and probabilityY have been replaced by probabilityXY and probabilityQ"; } void SiPixelRecHitQuality::warningOutOfBoundQbin(int iValue, QualWordType const& iQualWord) { edm::LogWarning("OutOfBounds") << "Qbin outside the bounds of the quality word: Qbin = " << iValue << " and QualityWord = " << iQualWord << " --> Now defaulting to Qbin = 0.0"; } void SiPixelRecHitQuality::warningOutOfBoundProb(const char* iName, float iProb, QualWordType const& iQualWord) { edm::LogWarning("OutOfBounds") << "Prob" << iName << " outside the bounds of the quality word: Prob" << iName << " = 1+" << iProb - 1 << " and QualityWord = " << iQualWord << " --> Now defaulting to Prob" << iName << " = 0.0"; } void SiPixelRecHitQuality::warningOutOfBoundRaw(const char* iName, int iRaw, QualWordType const& iQualWord) { edm::LogWarning("OutOfBounds") << "Probability" << iName << " outside the bounds of the quality word: Raw = " << iRaw << " and QualityWord = " << iQualWord << " --> Now defaulting to Prob" << iName << " = 0.0"; }