1 #ifndef DataFormats_SiPixelRecHitQuality_h 2 #define DataFormats_SiPixelRecHitQuality_h 1 62 edm::LogWarning(
"ObsoleteVariable") <<
"Since 39x, probabilityX and probabilityY have been replaced by probabilityXY and probabilityQ";
66 edm::LogWarning(
"ObsoleteVariable") <<
"Since 39x, probabilityX and probabilityY have been replaced by probabilityXY and probabilityQ";
72 if(raw<0 || raw >16383) {
73 edm::LogWarning(
"OutOfBounds") <<
"Probability XY outside the bounds of the quality word. Defaulting to Prob=0. Raw = " << raw <<
" QualityWord = " << qualWord;
76 float prob = (raw==16383) ? 0:
pow( probX_units, (
float)( -raw) );
82 if(raw<0 || raw >255) {
83 edm::LogWarning(
"OutOfBounds") <<
"Probability Q outside the bounds of the quality word. Defaulting to Prob=0. Raw = " << raw <<
" QualityWord = " << qualWord;
86 float prob = (raw==255) ? 0 :
pow( probY_units, (
float)( -raw) );
92 inline int qBin( QualWordType qualWord )
const {
93 int qbin = (qualWord >>
qBin_shift) & qBin_mask;
94 if(qbin<0 || qbin >7) {
95 edm::LogWarning(
"OutOfBounds") <<
"Qbin outside the bounds of the quality word. Defaulting to Qbin=0. Qbin = " << qbin <<
" QualityWord = " << qualWord;
102 inline bool isOnEdge( QualWordType qualWord )
const {
103 return (qualWord >> edge_shift) &
edge_mask;
107 return (qualWord >> bad_shift) &
bad_mask;
126 edm::LogWarning(
"OutOfBounds") <<
"Prob XY outside the bounds of the quality word. ProbXY = 1+" << prob-1 <<
" and QualityWord = " << qualWord <<
" --> Now defaulting to ProbXY = 0.0";
129 double draw = (prob<=1.6E-13) ? 16383 : -
log( (
double)
prob ) * probX_1_over_log_units;
130 unsigned int raw = (
int) (draw+0.5);
132 qualWord |= ((raw &
probX_mask) << probX_shift);
138 edm::LogWarning(
"OutOfBounds") <<
"Prob Q outside the bounds of the quality word. ProbQ = 1+" << prob-1 <<
" and QualityWord = " << qualWord <<
" --> Now defaulting to ProbQ = 0.0";
141 double draw = (prob<=1E-5) ? 255 : -
log( (
double)
prob ) * probY_1_over_log_units;
142 unsigned int raw = (
int) (draw+0.5);
144 qualWord |= ((raw &
probY_mask) << probY_shift);
148 inline void setQBin(
int qbin, QualWordType & qualWord )
const {
149 if(qbin<0 || qbin >7) {
150 edm::LogWarning(
"OutOfBounds") <<
"Qbin outside the bounds of the quality word. Defaulting to Qbin=0. Qbin = " << qbin <<
" QualityWord = " << qualWord;
153 qualWord |= ((qbin &
qBin_mask) << qBin_shift);
157 qualWord |= ((flag &
edge_mask) << edge_shift);
160 qualWord |= ((flag &
bad_mask) << bad_shift);
163 qualWord |= ((flag &
twoROC_mask) << twoROC_shift);
float probabilityQ(QualWordType qualWord) const
void setProbabilityXY(float prob, QualWordType &qualWord) const
double probX_1_over_log_units
bool spansTwoROCs(QualWordType qualWord) const
static const Packing thePacking
float probabilityXY(QualWordType qualWord) const
double probY_1_over_log_units
def draw(name, histos, styles=_defaultStyles, legendLabels=[], kwargs)
void setHasBadPixels(bool flag, QualWordType &qualWord) const
void setProbabilityQ(float prob, QualWordType &qualWord) const
float probabilityY(QualWordType qualWord) const
int qBin(QualWordType qualWord) const
void setSpansTwoROCs(bool flag, QualWordType &qualWord) const
float probabilityX(QualWordType qualWord) const
void setIsOnEdge(bool flag, QualWordType &qualWord) const
bool isOnEdge(QualWordType qualWord) const
unsigned int QualWordType
bool hasBadPixels(QualWordType qualWord) const
void setHasFilledProb(bool flag, QualWordType &qualWord) const
void setQBin(int qbin, QualWordType &qualWord) const
QualWordType hasFilledProb_mask
Power< A, B >::type pow(const A &a, const B &b)
bool hasFilledProb(QualWordType qualWord) const