CMS 3D CMS Logo

SiPixelDigiConstants.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiPixelDigi_interface_SiPixelDigiConstants
2 #define DataFormats_SiPixelDigi_interface_SiPixelDigiConstants
3 
5 #include <cstdint>
6 
9 
10 namespace sipixelconstants {
11  constexpr cms_uint32_t dummyDetId = 0xffffffff;
12 
13  constexpr uint32_t CRC_bits = 1;
14  constexpr uint32_t DCOL_bits = 5; // double column
15  constexpr uint32_t PXID_bits = 8; // pixel id
16  constexpr uint32_t ADC_bits = 8;
17  constexpr uint32_t OMIT_ERR_bits = 1;
18  // GO BACK TO OLD VALUES. THE 48-CHAN FED DOES NOT NEED A NEW FORMAT 28/9/16 d.k.
19  constexpr uint32_t LINK_bits = 6; // 7;
20  constexpr uint32_t ROC_bits = 5; // 4;
21 
22  constexpr uint32_t CRC_shift = 2;
23  constexpr uint32_t ADC_shift = 0;
24  constexpr uint32_t PXID_shift = ADC_shift + ADC_bits;
25  constexpr uint32_t DCOL_shift = PXID_shift + PXID_bits;
26  constexpr uint32_t ROC_shift = DCOL_shift + DCOL_bits;
27  constexpr uint32_t LINK_shift = ROC_shift + ROC_bits;
28  constexpr uint32_t OMIT_ERR_shift = 20;
29 
30  constexpr uint64_t CRC_mask = ~(~Word64(0) << CRC_bits);
31  constexpr uint32_t ERROR_mask = ~(~Word32(0) << ROC_bits);
32  constexpr uint32_t LINK_mask = ~(~Word32(0) << LINK_bits);
33  constexpr uint32_t ROC_mask = ~(~Word32(0) << ROC_bits);
34  constexpr uint32_t OMIT_ERR_mask = ~(~Word32(0) << OMIT_ERR_bits);
35  constexpr uint32_t DCOL_mask = ~(~Word32(0) << DCOL_bits);
36  constexpr uint32_t PXID_mask = ~(~Word32(0) << PXID_bits);
37  constexpr uint32_t ADC_mask = ~(~Word32(0) << ADC_bits);
38 
39  // Special for layer 1 bpix rocs 6/9/16 d.k. THIS STAYS.
40  inline namespace phase1layer1 {
41  constexpr uint32_t COL_bits1_l1 = 6;
42  constexpr uint32_t ROW_bits1_l1 = 7;
43  constexpr uint32_t ROW_shift = ADC_shift + ADC_bits;
44  constexpr uint32_t COL_shift = ROW_shift + ROW_bits1_l1;
45  constexpr uint32_t COL_mask = ~(~Word32(0) << COL_bits1_l1);
46  constexpr uint32_t ROW_mask = ~(~Word32(0) << ROW_bits1_l1);
47  } // namespace phase1layer1
48 
49  // constexpr functions are available in device code (GPU) as well
50  inline namespace functions {
51  inline constexpr uint32_t getLink(uint32_t ww) { return ((ww >> LINK_shift) & LINK_mask); }
52  inline constexpr uint32_t getROC(uint32_t ww) { return ((ww >> ROC_shift) & ROC_mask); }
53  inline constexpr uint32_t getADC(uint32_t ww) { return ((ww >> ADC_shift) & ADC_mask); }
54  inline constexpr uint32_t getCol(uint32_t ww) { return ((ww >> COL_shift) & COL_mask); }
55  inline constexpr uint32_t getRow(uint32_t ww) { return ((ww >> ROW_shift) & ROW_mask); }
56  inline constexpr uint32_t getDCol(uint32_t ww) { return ((ww >> DCOL_shift) & DCOL_mask); }
57  inline constexpr uint32_t getPxId(uint32_t ww) { return ((ww >> PXID_shift) & PXID_mask); }
58  } // namespace functions
59 } // namespace sipixelconstants
60 
61 #endif // DataFormats_SiPixelDigi_interface_SiPixelDigiConstants
sipixelconstants::DCOL_bits
constexpr uint32_t DCOL_bits
Definition: SiPixelDigiConstants.h:14
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
sipixelconstants::LINK_bits
constexpr uint32_t LINK_bits
Definition: SiPixelDigiConstants.h:19
sipixelconstants::functions::getRow
constexpr uint32_t getRow(uint32_t ww)
Definition: SiPixelDigiConstants.h:55
sipixelconstants::functions::getADC
constexpr uint32_t getADC(uint32_t ww)
Definition: SiPixelDigiConstants.h:53
sipixelconstants::dummyDetId
constexpr cms_uint32_t dummyDetId
Definition: SiPixelDigiConstants.h:11
sipixelconstants::LINK_shift
constexpr uint32_t LINK_shift
Definition: SiPixelDigiConstants.h:27
sipixelconstants::DCOL_mask
constexpr uint32_t DCOL_mask
Definition: SiPixelDigiConstants.h:35
sipixelconstants::functions::getROC
constexpr uint32_t getROC(uint32_t ww)
Definition: SiPixelDigiConstants.h:52
sipixelconstants::OMIT_ERR_bits
constexpr uint32_t OMIT_ERR_bits
Definition: SiPixelDigiConstants.h:17
sipixelconstants::LINK_mask
constexpr uint32_t LINK_mask
Definition: SiPixelDigiConstants.h:32
sipixelconstants::ADC_mask
constexpr uint32_t ADC_mask
Definition: SiPixelDigiConstants.h:37
sipixelconstants::ROC_shift
constexpr uint32_t ROC_shift
Definition: SiPixelDigiConstants.h:26
sipixelconstants::CRC_bits
constexpr uint32_t CRC_bits
Definition: SiPixelDigiConstants.h:13
sipixelconstants::phase1layer1::COL_shift
constexpr uint32_t COL_shift
Definition: SiPixelDigiConstants.h:44
sipixelconstants::OMIT_ERR_shift
constexpr uint32_t OMIT_ERR_shift
Definition: SiPixelDigiConstants.h:28
sipixelconstants::phase1layer1::ROW_shift
constexpr uint32_t ROW_shift
Definition: SiPixelDigiConstants.h:43
Word64
cms_uint64_t Word64
Definition: SiPixelDigiConstants.h:7
sipixelconstants::OMIT_ERR_mask
constexpr uint32_t OMIT_ERR_mask
Definition: SiPixelDigiConstants.h:34
sipixelconstants
Definition: SiPixelDigiConstants.h:10
typedefs.h
sipixelconstants::phase1layer1::COL_bits1_l1
constexpr uint32_t COL_bits1_l1
Definition: SiPixelDigiConstants.h:41
sipixelconstants::functions::getDCol
constexpr uint32_t getDCol(uint32_t ww)
Definition: SiPixelDigiConstants.h:56
sipixelconstants::ADC_shift
constexpr uint32_t ADC_shift
Definition: SiPixelDigiConstants.h:23
sipixelconstants::ERROR_mask
constexpr uint32_t ERROR_mask
Definition: SiPixelDigiConstants.h:31
sipixelconstants::functions::getCol
constexpr uint32_t getCol(uint32_t ww)
Definition: SiPixelDigiConstants.h:54
sipixelconstants::PXID_mask
constexpr uint32_t PXID_mask
Definition: SiPixelDigiConstants.h:36
sipixelconstants::ROC_mask
constexpr uint32_t ROC_mask
Definition: SiPixelDigiConstants.h:33
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
sipixelconstants::functions::getLink
constexpr uint32_t getLink(uint32_t ww)
Definition: SiPixelDigiConstants.h:51
sipixelconstants::ADC_bits
constexpr uint32_t ADC_bits
Definition: SiPixelDigiConstants.h:16
sipixelconstants::DCOL_shift
constexpr uint32_t DCOL_shift
Definition: SiPixelDigiConstants.h:25
stringResolutionProvider_cfi.functions
functions
Definition: stringResolutionProvider_cfi.py:7
sipixelconstants::PXID_bits
constexpr uint32_t PXID_bits
Definition: SiPixelDigiConstants.h:15
Word32
cms_uint32_t Word32
Definition: SiPixelDigiConstants.h:8
sipixelconstants::functions::getPxId
constexpr uint32_t getPxId(uint32_t ww)
Definition: SiPixelDigiConstants.h:57
sipixelconstants::ROC_bits
constexpr uint32_t ROC_bits
Definition: SiPixelDigiConstants.h:20
sipixelconstants::phase1layer1::ROW_bits1_l1
constexpr uint32_t ROW_bits1_l1
Definition: SiPixelDigiConstants.h:42
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
sipixelconstants::PXID_shift
constexpr uint32_t PXID_shift
Definition: SiPixelDigiConstants.h:24
sipixelconstants::phase1layer1::COL_mask
constexpr uint32_t COL_mask
Definition: SiPixelDigiConstants.h:45
sipixelconstants::CRC_shift
constexpr uint32_t CRC_shift
Definition: SiPixelDigiConstants.h:22
sipixelconstants::phase1layer1::ROW_mask
constexpr uint32_t ROW_mask
Definition: SiPixelDigiConstants.h:46
sipixelconstants::CRC_mask
constexpr uint64_t CRC_mask
Definition: SiPixelDigiConstants.h:30