CMS 3D CMS Logo

EcalConstants.h
Go to the documentation of this file.
1 //Namespaces for Phase1 and Phase2
2 #ifndef DataFormats_EcalDigi_EcalConstants_h
3 #define DataFormats_EcalDigi_EcalConstants_h
4 
6 
7 // The HOST_DEVICE_CONSTANTs can not reside in the classes directly, which is
8 // why they are defined in a namespace and constant pointers to them are used in the classes
9 namespace ecalph2 {
10  constexpr unsigned int NGAINS = 2; // Number of CATIA gains
11  HOST_DEVICE_CONSTANT float gains[NGAINS] = {10., 1.}; // CATIA gain values
12 } // namespace ecalph2
13 
14 namespace ecalph1 {
15  constexpr unsigned int NGAINS = 4; // Number of MGPA gains including a zero gain that
16  // could be encoded in the gain id mask
17  HOST_DEVICE_CONSTANT float gains[NGAINS] = {0., 12., 6., 1.}; // MGPA gain values including a zero gain
18 } // namespace ecalph1
19 
20 class ecalPh2 {
21 public:
22  static constexpr double Samp_Period = 6.25; // ADC sampling period in ns
23  static constexpr unsigned int NGAINS = ecalph2::NGAINS; // Number of CATIA gains
24  static constexpr const float *gains = ecalph2::gains; // CATIA gain values
25  static constexpr unsigned int gainId1 = 1; // Position of gain 1 in gains array
26  static constexpr unsigned int gainId10 = 0; // Position of gain 10 in gains array
27  static constexpr unsigned int sampleSize = 16; // Number of samples per event
28  static constexpr unsigned int NBITS = 12; // Number of available bits
29  static constexpr unsigned int MAXADC = (1 << NBITS) - 1; // 2^NBITS - 1, ADC max range
30  static constexpr unsigned int kEBChannels = 61200; // Number of channels in the barrel
31  static constexpr double maxEneEB = 2000.; // Max attainable energy in the barrel in GeV
32  // ~(MAXADC * 10(gain) * 0.05 GeV(LSB at gain 10))
33  static constexpr unsigned int kNOffsets = 2000; // Number of time offsets generated for APD pulse shape
34  // simulation and reused for every kNOffsets^th channel
35  static constexpr unsigned int kAdcMask = 0xFFF; // ADC sample mask for unpacking
36  static constexpr unsigned int kGainIdMask = 0x1; // Gain id mask for unpacking
37 };
38 
39 class ecalPh1 {
40 public:
41  static constexpr double Samp_Period = 25.; // ADC sampling period in ns
42  static constexpr unsigned int NGAINS = ecalph1::NGAINS; // Number of MGPA gains including a zero gain
43  static constexpr const float *gains = ecalph1::gains; // MGPA gain values including a zero gain
44  static constexpr unsigned int sampleSize = 10; // Number of samples per event
45  static constexpr unsigned int NBITS = 12; // Number of available bits
46  static constexpr unsigned int kNOffsets = 2000; // Number of time offsets generated for APD pulse shape
47  // simulation and reused for every kNOffsets^th channel
48  static constexpr unsigned int kAdcMask = 0xFFF; // ADC sample mask for unpacking
49  static constexpr unsigned int kGainIdMask = 0x3; // Gain id mask for unpacking
50 };
51 #endif
static constexpr const float * gains
Definition: EcalConstants.h:43
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:23
static constexpr unsigned int kGainIdMask
Definition: EcalConstants.h:36
static constexpr unsigned int NBITS
Definition: EcalConstants.h:45
static constexpr unsigned int kNOffsets
Definition: EcalConstants.h:33
constexpr unsigned int NGAINS
Definition: EcalConstants.h:15
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:27
static constexpr unsigned int kAdcMask
Definition: EcalConstants.h:35
static constexpr double maxEneEB
Definition: EcalConstants.h:31
static constexpr unsigned int kNOffsets
Definition: EcalConstants.h:46
static constexpr double Samp_Period
Definition: EcalConstants.h:22
static constexpr const float * gains
Definition: EcalConstants.h:24
static constexpr double Samp_Period
Definition: EcalConstants.h:41
static constexpr unsigned int kEBChannels
Definition: EcalConstants.h:30
constexpr float gains[NGAINS]
Definition: EcalConstants.h:11
static constexpr unsigned int NBITS
Definition: EcalConstants.h:28
constexpr unsigned int NGAINS
Definition: EcalConstants.h:10
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:44
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:42
static constexpr unsigned int kGainIdMask
Definition: EcalConstants.h:49
constexpr float gains[NGAINS]
Definition: EcalConstants.h:17
static constexpr unsigned int gainId10
Definition: EcalConstants.h:26
static constexpr unsigned int kAdcMask
Definition: EcalConstants.h:48
#define HOST_DEVICE_CONSTANT
static constexpr unsigned int MAXADC
Definition: EcalConstants.h:29
static constexpr unsigned int gainId1
Definition: EcalConstants.h:25