#include <DataFormats/TrackerRecHit2D/interface/SiPixelRecHitQuality.h>
Definition at line 21 of file SiPixelRecHitQuality.h.
SiPixelRecHitQuality::Packing::Packing | ( | ) |
Definition at line 5 of file SiPixelRecHitQuality.cc.
References bad_mask, bad_shift, bad_width, cotAlpha_mask, cotAlpha_shift, cotAlpha_units, cotAlpha_width, cotBeta_mask, cotBeta_shift, cotBeta_units, cotBeta_width, GenMuonPlsPt100GeV_cfg::cout, edge_mask, edge_shift, edge_width, lat::endl(), probX_mask, probX_shift, probX_units, probX_width, probY_mask, probY_shift, probY_units, probY_width, qBin_mask, qBin_shift, qBin_width, spare_width, twoROC_mask, twoROC_shift, and twoROC_width.
00006 { 00007 // Constructor: pre-computes masks and shifts from field widths 00008 // Order of fields (from right to left) is 00009 // noise, pedestal, gain, status count. 00010 probX_width = 8; 00011 probY_width = 8; 00012 cotAlpha_width = 4; 00013 cotBeta_width = 4; 00014 qBin_width = 3; 00015 edge_width = 1; 00016 bad_width = 1; 00017 twoROC_width = 1; 00018 spare_width = 2; 00019 00020 if ( probX_width + probY_width + cotAlpha_width + cotBeta_width + 00021 qBin_width + edge_width + bad_width + twoROC_width + 00022 spare_width 00023 != 32 ) { 00024 std::cout << std::endl << "Error in SiPixelRecHitQuality::Packing constructor:" 00025 << "sum of field widths != 32" << std::endl; 00026 // &&& throw an exception? 00027 } 00028 00029 probX_units = 0.0625; 00030 probY_units = 0.0625; 00031 cotAlpha_units = 1.0/16; 00032 cotBeta_units = 1.0/16; 00033 00034 00035 // Fields are counted from right to left! 00036 probX_shift = 0; 00037 probY_shift = probX_shift + probX_width; 00038 cotAlpha_shift = probY_shift + probY_width; 00039 cotBeta_shift = cotAlpha_shift + cotAlpha_width; 00040 qBin_shift = cotBeta_shift + cotBeta_width; 00041 edge_shift = qBin_shift + qBin_width; 00042 bad_shift = edge_shift + edge_width; 00043 twoROC_shift = bad_shift + bad_width; 00044 00045 // Ensure the complement of the correct 00046 // number of bits: 00047 QualWordType zero32 = 0; // 32-bit wide set of 0's 00048 00049 probX_mask = ~(~zero32 << probX_width); 00050 probY_mask = ~(~zero32 << probY_width); 00051 cotAlpha_mask = ~(~zero32 << cotAlpha_width); 00052 cotBeta_mask = ~(~zero32 << cotBeta_width); 00053 qBin_mask = ~(~zero32 << qBin_width); 00054 edge_mask = ~(~zero32 << edge_width); 00055 bad_mask = ~(~zero32 << bad_width); 00056 twoROC_mask = ~(~zero32 << twoROC_width); 00057 }
float SiPixelRecHitQuality::Packing::cotAlphaFromCluster | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 66 of file SiPixelRecHitQuality.h.
References cotAlpha_mask, cotAlpha_shift, and cotAlpha_units.
00066 { 00067 int raw = (qualWord >> cotAlpha_shift) & cotAlpha_mask; 00068 return raw * cotAlpha_units; 00069 }
float SiPixelRecHitQuality::Packing::cotBetaFromCluster | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 70 of file SiPixelRecHitQuality.h.
References cotBeta_mask, cotBeta_shift, and cotBeta_units.
00070 { 00071 int raw = (qualWord >> cotBeta_shift) & cotBeta_mask; 00072 return raw * cotBeta_units; 00073 }
bool SiPixelRecHitQuality::Packing::hasBadPixels | ( | QualWordType | qualWord | ) | const [inline] |
bool SiPixelRecHitQuality::Packing::isOnEdge | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 94 of file SiPixelRecHitQuality.h.
References edge_mask, and edge_shift.
00094 { 00095 return (qualWord >> edge_shift) & edge_mask; 00096 }
float SiPixelRecHitQuality::Packing::probabilityX | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 78 of file SiPixelRecHitQuality.h.
References funct::pow(), probX_mask, probX_shift, and probX_units.
00078 { 00079 int raw = (qualWord >> probX_shift) & probX_mask; 00080 float prob = pow(10.0, (double)-raw * probX_units); 00081 return prob; 00082 }
float SiPixelRecHitQuality::Packing::probabilityY | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 83 of file SiPixelRecHitQuality.h.
References funct::pow(), probY_mask, probY_shift, and probY_units.
00083 { 00084 int raw = (qualWord >> probY_shift) & probY_mask; 00085 float prob = pow(10.0, (double)-raw * probY_units); 00086 return prob; 00087 }
int SiPixelRecHitQuality::Packing::qBin | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 89 of file SiPixelRecHitQuality.h.
References qBin_mask, and qBin_shift.
00089 { 00090 return (qualWord >> qBin_shift) & qBin_mask; 00091 }
void SiPixelRecHitQuality::Packing::setCotAlphaFromCluster | ( | float | cotalpha, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 111 of file SiPixelRecHitQuality.h.
References cotAlpha_mask, cotAlpha_shift, cotAlpha_units, and int.
00111 { 00112 int raw = (int) (cotalpha/cotAlpha_units); // convert to integer units 00113 qualWord &= ((raw & cotAlpha_mask) << cotAlpha_shift); 00114 }
void SiPixelRecHitQuality::Packing::setCotBetaFromCluster | ( | float | cotbeta, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 115 of file SiPixelRecHitQuality.h.
References cotBeta_mask, cotBeta_shift, cotBeta_units, and int.
00115 { 00116 int raw = (int) (cotbeta/cotBeta_units); // convert to integer units 00117 qualWord &= ((raw & cotBeta_mask) << cotBeta_shift); 00118 }
void SiPixelRecHitQuality::Packing::setHasBadPixels | ( | bool | flag, | |
QualWordType & | qualWord | |||
) | [inline] |
void SiPixelRecHitQuality::Packing::setIsOnEdge | ( | bool | flag, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 134 of file SiPixelRecHitQuality.h.
References edge_mask, and edge_shift.
00134 { 00135 qualWord &= ((flag & edge_mask) << edge_shift); 00136 }
void SiPixelRecHitQuality::Packing::setProbabilityX | ( | float | prob, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 121 of file SiPixelRecHitQuality.h.
References int, probX_mask, probX_shift, and probX_units.
00121 { 00122 int raw = (int) (prob/probX_units); // convert to integer units 00123 qualWord &= ((raw & probX_mask) << probX_shift); 00124 }
void SiPixelRecHitQuality::Packing::setProbabilityY | ( | float | prob, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 125 of file SiPixelRecHitQuality.h.
References int, probY_mask, probY_shift, and probY_units.
00125 { 00126 int raw = (int) (prob/probY_units); // convert to integer units 00127 qualWord &= ((raw & probY_mask) << probY_shift); 00128 }
void SiPixelRecHitQuality::Packing::setQBin | ( | int | qbin, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 130 of file SiPixelRecHitQuality.h.
References qBin_mask, and qBin_shift.
00130 { 00131 qualWord &= ((qbin & qBin_mask) << qBin_shift); 00132 }
void SiPixelRecHitQuality::Packing::setSpansTwoROCs | ( | bool | flag, | |
QualWordType & | qualWord | |||
) | [inline] |
Definition at line 140 of file SiPixelRecHitQuality.h.
References twoROC_mask, and twoROC_shift.
00140 { 00141 qualWord &= ((flag & twoROC_mask) << twoROC_shift); 00142 }
bool SiPixelRecHitQuality::Packing::spansTwoROCs | ( | QualWordType | qualWord | ) | const [inline] |
Definition at line 102 of file SiPixelRecHitQuality.h.
References twoROC_mask, and twoROC_shift.
00102 { 00103 return (qualWord >> twoROC_shift) & twoROC_mask; 00104 }
Definition at line 56 of file SiPixelRecHitQuality.h.
Referenced by hasBadPixels(), Packing(), and setHasBadPixels().
Definition at line 57 of file SiPixelRecHitQuality.h.
Referenced by hasBadPixels(), Packing(), and setHasBadPixels().
Definition at line 38 of file SiPixelRecHitQuality.h.
Referenced by cotAlphaFromCluster(), Packing(), and setCotAlphaFromCluster().
Definition at line 39 of file SiPixelRecHitQuality.h.
Referenced by cotAlphaFromCluster(), Packing(), and setCotAlphaFromCluster().
Definition at line 40 of file SiPixelRecHitQuality.h.
Referenced by cotAlphaFromCluster(), Packing(), and setCotAlphaFromCluster().
Definition at line 43 of file SiPixelRecHitQuality.h.
Referenced by cotBetaFromCluster(), Packing(), and setCotBetaFromCluster().
Definition at line 44 of file SiPixelRecHitQuality.h.
Referenced by cotBetaFromCluster(), Packing(), and setCotBetaFromCluster().
Definition at line 45 of file SiPixelRecHitQuality.h.
Referenced by cotBetaFromCluster(), Packing(), and setCotBetaFromCluster().
Definition at line 52 of file SiPixelRecHitQuality.h.
Referenced by isOnEdge(), Packing(), and setIsOnEdge().
Definition at line 53 of file SiPixelRecHitQuality.h.
Referenced by isOnEdge(), Packing(), and setIsOnEdge().
Definition at line 28 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityX(), and setProbabilityX().
Definition at line 29 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityX(), and setProbabilityX().
Definition at line 30 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityX(), and setProbabilityX().
Definition at line 33 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityY(), and setProbabilityY().
Definition at line 34 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityY(), and setProbabilityY().
Definition at line 35 of file SiPixelRecHitQuality.h.
Referenced by Packing(), probabilityY(), and setProbabilityY().
Definition at line 48 of file SiPixelRecHitQuality.h.
Definition at line 49 of file SiPixelRecHitQuality.h.
Definition at line 60 of file SiPixelRecHitQuality.h.
Referenced by Packing(), setSpansTwoROCs(), and spansTwoROCs().
Definition at line 61 of file SiPixelRecHitQuality.h.
Referenced by Packing(), setSpansTwoROCs(), and spansTwoROCs().