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 // constants used to encode difference between corrected cc time and noncorrected cc time
8 // into a uInt8 value to be stored in the 8 bits set aside for the jitter error ( previously unused )
9 namespace ecalcctiming {
10  inline constexpr const float clockToNS = 25.0; // Convert clock units to ns
11  inline constexpr const float nonCorrectedSlope = 1.2; // estimates nonCorreted time from corrected time
12  inline constexpr const float encodingOffest = 0.32; // offsets difference in time using clock units
13  inline constexpr const float encodingValue = 398.4375; // encodes time difference into 0 - 255 int range
14 } // namespace ecalcctiming
15 
16 // The HOST_DEVICE_CONSTANTs can not reside in the classes directly, which is
17 // why they are defined in a namespace and constant pointers to them are used in the classes
18 namespace ecalph2 {
19  constexpr unsigned int NGAINS = 2; // Number of CATIA gains
20  HOST_DEVICE_CONSTANT float gains[NGAINS] = {10., 1.}; // CATIA gain values
21 } // namespace ecalph2
22 
23 namespace ecalph1 {
24  constexpr unsigned int NGAINS = 4; // Number of MGPA gains including a zero gain that
25  // could be encoded in the gain id mask
26  HOST_DEVICE_CONSTANT float gains[NGAINS] = {0., 12., 6., 1.}; // MGPA gain values including a zero gain
27 } // namespace ecalph1
28 
29 class ecalPh2 {
30 public:
31  static constexpr double Samp_Period = 6.25; // ADC sampling period in ns
32  static constexpr unsigned int NGAINS = ecalph2::NGAINS; // Number of CATIA gains
33  static constexpr const float *gains = ecalph2::gains; // CATIA gain values
34  static constexpr unsigned int gainId1 = 1; // Position of gain 1 in gains array
35  static constexpr unsigned int gainId10 = 0; // Position of gain 10 in gains array
36  static constexpr unsigned int sampleSize = 16; // Number of samples per event
37  static constexpr unsigned int NBITS = 12; // Number of available bits
38  static constexpr unsigned int MAXADC = (1 << NBITS) - 1; // 2^NBITS - 1, ADC max range
39  static constexpr unsigned int kEBChannels = 61200; // Number of channels in the barrel
40  static constexpr double maxEneEB = 2000.; // Max attainable energy in the barrel in GeV
41  // ~(MAXADC * 10(gain) * 0.05 GeV(LSB at gain 10))
42  static constexpr unsigned int kNOffsets = 2000; // Number of time offsets generated for APD pulse shape
43  // simulation and reused for every kNOffsets^th channel
44  static constexpr unsigned int kAdcMask = 0xFFF; // ADC sample mask for unpacking
45  static constexpr unsigned int kGainIdMask = 0x1; // Gain id mask for unpacking
46 };
47 
48 class ecalPh1 {
49 public:
50  static constexpr double Samp_Period = 25.; // ADC sampling period in ns
51  static constexpr unsigned int NGAINS = ecalph1::NGAINS; // Number of MGPA gains including a zero gain
52  static constexpr const float *gains = ecalph1::gains; // MGPA gain values including a zero gain
53  static constexpr unsigned int sampleSize = 10; // Number of samples per event
54  static constexpr unsigned int NBITS = 12; // Number of available bits
55  static constexpr unsigned int kNOffsets = 2000; // Number of time offsets generated for APD pulse shape
56  // simulation and reused for every kNOffsets^th channel
57  static constexpr unsigned int kAdcMask = 0xFFF; // ADC sample mask for unpacking
58  static constexpr unsigned int kGainIdMask = 0x3; // Gain id mask for unpacking
59 };
60 #endif
static constexpr const float * gains
Definition: EcalConstants.h:52
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:32
constexpr const float encodingValue
Definition: EcalConstants.h:13
static constexpr unsigned int kGainIdMask
Definition: EcalConstants.h:45
constexpr const float nonCorrectedSlope
Definition: EcalConstants.h:11
constexpr const float clockToNS
Definition: EcalConstants.h:10
static constexpr unsigned int NBITS
Definition: EcalConstants.h:54
static constexpr unsigned int kNOffsets
Definition: EcalConstants.h:42
constexpr unsigned int NGAINS
Definition: EcalConstants.h:24
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:36
static constexpr unsigned int kAdcMask
Definition: EcalConstants.h:44
static constexpr double maxEneEB
Definition: EcalConstants.h:40
static constexpr unsigned int kNOffsets
Definition: EcalConstants.h:55
static constexpr double Samp_Period
Definition: EcalConstants.h:31
static constexpr const float * gains
Definition: EcalConstants.h:33
constexpr const float encodingOffest
Definition: EcalConstants.h:12
static constexpr double Samp_Period
Definition: EcalConstants.h:50
static constexpr unsigned int kEBChannels
Definition: EcalConstants.h:39
constexpr float gains[NGAINS]
Definition: EcalConstants.h:20
static constexpr unsigned int NBITS
Definition: EcalConstants.h:37
constexpr unsigned int NGAINS
Definition: EcalConstants.h:19
static constexpr unsigned int sampleSize
Definition: EcalConstants.h:53
static constexpr unsigned int NGAINS
Definition: EcalConstants.h:51
static constexpr unsigned int kGainIdMask
Definition: EcalConstants.h:58
constexpr float gains[NGAINS]
Definition: EcalConstants.h:26
static constexpr unsigned int gainId10
Definition: EcalConstants.h:35
static constexpr unsigned int kAdcMask
Definition: EcalConstants.h:57
#define HOST_DEVICE_CONSTANT
static constexpr unsigned int MAXADC
Definition: EcalConstants.h:38
static constexpr unsigned int gainId1
Definition: EcalConstants.h:34