Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-14 00:04:32

0001 //Namespaces for Phase1 and Phase2
0002 #ifndef DataFormats_EcalDigi_EcalConstants_h
0003 #define DataFormats_EcalDigi_EcalConstants_h
0004 
0005 #include "FWCore/Utilities/interface/HostDeviceConstant.h"
0006 
0007 // The HOST_DEVICE_CONSTANTs can not reside in the classes directly, which is
0008 // why they are defined in a namespace and constant pointers to them are used in the classes
0009 namespace ecalph2 {
0010   constexpr unsigned int NGAINS = 2;                     // Number of CATIA gains
0011   HOST_DEVICE_CONSTANT float gains[NGAINS] = {10., 1.};  // CATIA gain values
0012 }  // namespace ecalph2
0013 
0014 namespace ecalph1 {
0015   constexpr unsigned int NGAINS = 4;                             // Number of MGPA gains including a zero gain that
0016                                                                  // could be encoded in the gain id mask
0017   HOST_DEVICE_CONSTANT float gains[NGAINS] = {0., 12., 6., 1.};  // MGPA gain values including a zero gain
0018 }  // namespace ecalph1
0019 
0020 class ecalPh2 {
0021 public:
0022   static constexpr double Samp_Period = 6.25;               // ADC sampling period in ns
0023   static constexpr unsigned int NGAINS = ecalph2::NGAINS;   // Number of CATIA gains
0024   static constexpr const float *gains = ecalph2::gains;     // CATIA gain values
0025   static constexpr unsigned int gainId1 = 1;                // Position of gain 1 in gains array
0026   static constexpr unsigned int gainId10 = 0;               // Position of gain 10 in gains array
0027   static constexpr unsigned int sampleSize = 16;            // Number of samples per event
0028   static constexpr unsigned int NBITS = 12;                 // Number of available bits
0029   static constexpr unsigned int MAXADC = (1 << NBITS) - 1;  // 2^NBITS - 1,  ADC max range
0030   static constexpr unsigned int kEBChannels = 61200;        // Number of channels in the barrel
0031   static constexpr double maxEneEB = 2000.;                 // Max attainable energy in the barrel in GeV
0032                                                             // ~(MAXADC * 10(gain) * 0.05 GeV(LSB at gain 10))
0033   static constexpr unsigned int kNOffsets = 2000;           // Number of time offsets generated for APD pulse shape
0034                                                             // simulation and reused for every kNOffsets^th channel
0035   static constexpr unsigned int kAdcMask = 0xFFF;           // ADC sample mask for unpacking
0036   static constexpr unsigned int kGainIdMask = 0x1;          // Gain id mask for unpacking
0037 };
0038 
0039 class ecalPh1 {
0040 public:
0041   static constexpr double Samp_Period = 25.;               // ADC sampling period in ns
0042   static constexpr unsigned int NGAINS = ecalph1::NGAINS;  // Number of MGPA gains including a zero gain
0043   static constexpr const float *gains = ecalph1::gains;    // MGPA gain values including a zero gain
0044   static constexpr unsigned int sampleSize = 10;           // Number of samples per event
0045   static constexpr unsigned int NBITS = 12;                // Number of available bits
0046   static constexpr unsigned int kNOffsets = 2000;          // Number of time offsets generated for APD pulse shape
0047                                                            // simulation and reused for every kNOffsets^th channel
0048   static constexpr unsigned int kAdcMask = 0xFFF;          // ADC sample mask for unpacking
0049   static constexpr unsigned int kGainIdMask = 0x3;         // Gain id mask for unpacking
0050 };
0051 #endif